TCP / IP protocol Figure --TCP / IP basis

Specific meaning 1. TCP / IP's

From the literal sense, one might think that TCP / IP refers to two protocols TCP and IP. Real lives sometimes really refers to both protocols. However, in many cases, it is only the use of the group collectively protocol must be used when IP communication. Specifically, IP, or ICMP, TCP or UDP, TELNET or FTP, and HTTP belong to TCP / IP protocol. Their relationship with the TCP or IP of the close, the Internet is an integral part. The term TCP / IP refers to these agreements, therefore, sometimes called TCP / IP protocol for the Internet group.
When the Internet for communication, you need the appropriate network protocol, TCP / IP was originally developed for the use of the Internet protocol suite developed. Therefore, the Internet protocol is TCP / IP, TCP / IP is the Internet protocol.

img

Internet Protocol group

2. Packet

Packet, frame, packet, segment, message
five or more terms are used to express the unit of data, roughly divided as follows:

  • Totipotent package can be said that the term;
  • It represents a unit frame for a data link layer packet;
  • Packet is a unit like layered above UDP and IP network layer packet;
  • TCP segment information of said data stream;
  • It refers to message application protocol data unit.

Each hierarchy, data will be transmitted to attach a header that contains the necessary information in this layer header, destination address and protocol related information, such as transmitted. Typically, the protocol provides information to the packet header, the contents of the data to be transmitted. The lower layer perspective, the packet received from the one considered to be all the data of this layer.

img

Packet header

Packet transmission network consists of two parts: one is to use a protocol header, a layer of the other part is transmitted over the data. Header structure is defined by the specifications of the protocol details. In the header of the packet, it should be clearly marked an agreement on how to read the data. Conversely, to see the head, it will be able to understand the protocol necessary information and data to be processed. The pack header as the face of the agreement.

3. The data processing flow

In the FIG user A sends a message to the user b as an example:

img

Data processing flow

  • ① 应用程序处理
    首先应用程序会进行编码处理,这些编码相当于 OSI 的表示层功能;
    编码转化后,邮件不一定马上被发送出去,这种何时建立通信连接何时发送数据的管理功能,相当于 OSI 的会话层功能。
  • ② TCP 模块的处理
    TCP 根据应用的指示,负责建立连接、发送数据以及断开连接。TCP 提供将应用层发来的数据顺利发送至对端的可靠传输。为了实现这一功能,需要在应用层数据的前端附加一个 TCP 首部。
  • ③ IP 模块的处理
    IP 将 TCP 传过来的 TCP 首部和 TCP 数据合起来当做自己的数据,并在 TCP 首部的前端加上自己的 IP 首部。IP 包生成后,参考路由控制表决定接受此 IP 包的路由或主机。
  • ④ 网络接口(以太网驱动)的处理
    从 IP 传过来的 IP 包对于以太网来说就是数据。给这些数据附加上以太网首部并进行发送处理,生成的以太网数据包将通过物理层传输给接收端。
  • ⑤ 网络接口(以太网驱动)的处理
    主机收到以太网包后,首先从以太网包首部找到 MAC 地址判断是否为发送给自己的包,若不是则丢弃数据。
    如果是发送给自己的包,则从以太网包首部中的类型确定数据类型,再传给相应的模块,如 IP、ARP 等。这里的例子则是 IP 。
  • ⑥ IP processing module
    after receiving the IP data modules do similar processing. Determining whether the packet header from the IP address with its own IP address system matches the protocol type to send data to the header portion of the corresponding module, such as TCP, UDP. The example here is the TCP.
    Further it, for a router, the received address is not its own address is often the end, this time, it needs to control the routing table, then forwards the data after the host or router to be sent to the investigation.
  • ⑦ processing module TCP
    in the TCP module will calculate whether the first checksum, the data is determined to be destroyed. Then check whether the data in accordance with the received sequence number. Finally, check the port number, determine the specific application. After the data is completely received, it will be passed by the application program identified by a port number.
  • Handling ⑧ application
    receiver application will directly receive data sent by the transmission. By analyzing the data, the corresponding content display.

Guess you like

Origin www.cnblogs.com/tutougold/p/11722836.html