OSI model 与 TCP/IP协议(Internet协议套件的基础)

TCP/IP

The Internet protocol suite is the conceptual model and set of communications protocols used in the Internet and similar computer networks. It is commonly known as TCP/IP because the foundational protocols in the suite are the Transmission Control Protocol (TCP) and the Internet Protocol (IP).

OSI model

The Open Systems Interconnection model (OSI model) is a conceptual model that characterises and standardises the communication functions of a telecommunication or computing system without regard to its underlying internal structure and technology. Its goal is the interoperability of diverse communication systems with standard communication protocols.

Internet protocol suite(Internet协议套件)分为4层:Application(应用层)、Transport(传输层)、Internet(网络层,互连层)、Link(链路层)

在OSI model(开放系统互连模型)中,应用层包含Application、Presentation、Session。传输层包含Transport、网络层包含Network(网络层)、而链路层是Data Link。而OSI model 也添加了一个新的层为Physical。

The term "ping" has essentially two meanings:

  • Send a ICMP Type 8 (echo request) packet to a host in order to receive an echo reply (type 0)
  • Send a packet of some kind to a host in order to receive a response of some kind.

ICMP differs from transport protocols such as TCP and UDP in that it is not typically used to exchange data between systems, nor is it regularly employed by end-user network applications (with the exception of some diagnostic tools like ping and traceroute).

ICMP is Auxiliary protocol for IPv4.

ICMP是IP协议的辅助协议,而IP协议位于Internet层。Ping是作用于Internet层的网络检测工具。Tcping, Udping等魔改网络工具都位于Transport层,因为使用TCP、UDP协议。TCP针对端口明了Host。

TCP

TCP (Transmission Control Protocol)是Transport的协议。

  • SYNchronize sequence numbers
  • ACKnowledgment
  • SYNchronize-ACKnowledgment

建立连接(3次挥手):

SYN: The active open is performed by the client sending a SYN to the server. The client sets the segment's sequence number to a random value A.

SYN-ACK: In response, the server replies with a SYN-ACK. The acknowledgment number is set to one more than the received sequence number i.e. A+1, and the sequence number that the server chooses for the packet is another random number, B.

ACK: Finally, the client sends an ACK back to the server. The sequence number is set to the received acknowledgement value i.e. A+1, and the acknowledgement number is set to one more than the received sequence number i.e. B+1.

断开连接(4次挥手):

It is also possible to terminate the connection by a 3-way handshake, when host A sends a FIN and host B replies with a FIN & ACK (merely combines 2 steps into one) and host A replies with an ACK.这其实也可以为3次。

posted @ 2021-02-02 20:13  千心  阅读(225)  评论(0编辑  收藏  举报