计网_ISO模型与SOCKS协议概述
文章目录
ISO模型与SOCKS协议
references
- SOCKS is an Internet protocol that exchanges network packets between a client and server through a proxy server.
- SOCKS5 optionally provides authentication so only authorized users may access a server.
- Practically, a SOCKS server proxies TCP connections to an arbitrary IP address, and provides a means for UDP packets to be forwarded.
- SOCKS performs at Layer 5 of the OSI model (the session layer, an intermediate layer between the presentation layer and the transport layer). A SOCKS server accepts incoming client connection on TCP port 1080, as defined in RFC 1928.[1]
SOCKS代理与HTTP代理的对比
- SOCKS工作在比HTTP代理更低的层次:SOCKS使用握手协议来通知代理软件其客户端试图进行的SOCKS连接,然后尽可能透明地进行操作,而常规代理可能会解释和重写报头(例如,使用另一种底层协议,例如FTP;然而,HTTP代理只是将HTTP请求转发到所需的HTTP服务器)。
- 虽然HTTP代理有不同的使用模式,HTTP CONNECT方法允许转发TCP连接;然而,SOCKS代理还可以转发UDP流量(仅SOCKS5),而HTTP代理不能。
- HTTP代理通常更了解HTTP协议,执行更高层次的过滤(虽然通常只用于GET和POST方法,而不用于CONNECT方法)。
SOCKS
-
Bill希望通过互联网与Jane沟通,但他们的网络之间存在一个防火墙,Bill不能直接与Jane沟通。
-
所以,Bill连接到他的网络上的SOCKS代理,告知它他想要与Jane创建连接;
-
SOCKS代理打开一个能穿过防火墙的连接,并促进Bill和Jane之间的通信。
HTTP
- Bill希望从Jane的Web服务器下载一个网页。Bill不能直接连接到Jane的服务器,因为在他的网络上设置了防火墙。
- 为了与该服务器通信,Bill连接到其网络的HTTP代理。
- 他的网页浏览器与代理通信的方式与他直接连接Jane的服务器的方式相同;
- 也就是说,网页浏览器会发送一个标准的HTTP请求头。
- HTTP代理连接到Jane的服务器,然后将Jane的服务器返回的任何数据传回Bill。
SOCKS5
- The SOCKS5 protocol is defined in RFC 1928. It is an incompatible extension of the SOCKS4 protocol;
- it offers more choices for authentication and adds support for IPv6 and UDP, the latter of which can be used for DNS lookups. The initial handshake consists of the following:
- Client connects and sends a greeting, which includes a list of authentication methods supported.
- Server chooses one of the methods (or sends a failure response if none of them are acceptable).
- Several messages may now pass between the client and the server, depending on the authentication method chosen.
- Client sends a connection request similar to SOCKS4.
- Server responds similar to SOCKS4.
Usage
SOCKS is a de facto standard for circuit-level gateways (level 5 gateways).[6]
The circuit/session level nature of SOCKS make it a versatile tool in forwarding any TCP (or UDP since SOCKS5) traffic, creating an interface for all types of routing tools. It can be used as:
- A circumvention tool, allowing traffic to bypass Internet filtering to access content otherwise blocked, e.g., by governments, workplaces, schools, and country-specific web services.
- Providing similar functionality to a virtual private network, allowing connections to be forwarded1 to a server’s “local” network:
OSI模型
- 1984年,ISO发布了著名的ISO/IEC 7498标准,它定义了网络互联的7层框架,也就是开放式系统互联参考模型。
层次划分
根据建议X.200,OSI将计算机网络体系结构划分为以下七层,标有1~7,第1层在底部。
现“OSI/RM”是英文“Open Systems Interconnection Reference Model”的缩写。
第7层 应用层
应用层(Application Layer)提供为应用软件而设计的接口,以设置与另一应用软件之间的通信。
- 例如:
- HTTP、HTTPS、
- FTP、Telnet、SSH、SMTP、POP3等。
第6层 表示层
表示层(Presentation Layer)把数据转换为能与接收者的系统格式兼容并适合传输的格式。
第5层 会话层
会话层(Session Layer)负责在数据传输中设置和维护计算机网络中两台计算机之间的通信连接。
第4层 传输层
- 传输层(Transport Layer)把传输表头(TH)加至资料以形成分组。
- 传输表头包含了所使用的协议等发送信息。
- 例如:传输控制协议(TCP)等。
第3层 网络层
- 网络层(Network Layer)决定数据的路径选择和转寄,将网络表头(NH)加至数据包,以形成分组。
- 网络表头包含了网络资料。
- 例如:互联网协议(IP)等。
第2层 数据链路层
-
数据链路层(Data Link Layer)负责网络寻址、错误侦测和改错。
-
当表头和表尾被加至数据包时,会形成信息框(Data Frame)。
-
数据链表头(DLH)是包含了物理地址和错误侦测及改错的方法。
-
数据链表尾(DLT)是一串指示数据包末端的字符串。
-
例如:
- 以太网、无线局域网(Wi-Fi)和通用分组无线服务(GPRS)等。
-
分为两个子层:
- 逻辑链路控制(logical link control,LLC)子层和
- 介质访问控制(Media access control,MAC)子层。
第1层 物理层
- 物理层(Physical Layer)在局域网上发送数据帧(Data Frame),它负责管理电脑通信设备和网络媒体之间的互通。
- 包括了针脚、电压、线缆规范、集线器、中继器、网卡、主机接口卡等。
影响
-
OSI是一个定义良好的协议规范集,并有许多可选部分完成类似的任务。
-
它定义了开放系统的层次结构、层次之间的相互关系以及各层所包括的可能的任务,作为一个框架来协调和组织各层所提供的服务。
-
OSI参考模型并没有提供一个可以实现的方法,而是描述了一些概念,用来协调进程间通信标准的制定。
- 即OSI参考模型并不是一个标准,而是一个在制定标准时所使用的概念性框架。
send (a letter or email) on to a further destination. ↩︎
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2021-08-22 foobar2000_为MP3/flac嵌入歌词文件/封面编辑(提供eslyric插件下载)/信息标签编辑