Computer Network ---> 7-transport layer (2)

7. UDP User Datagram Protocol

7.1 UDP main features

  • It is suitable for multimedia communication requirements means: broadcast screen
  • TCP only 1 to 1

7.2 UDP header

UDP header following format

  • Two-byte header length identifies the total length of the header portion plus data portion
  • And testing: calculating a "pseudo header" + "header" + "data" is calculated to be tested and
  • Pseudo-header: the header is to round up together plus 20 bytes of data, to facilitate operation and testing. Description: In this test the transport layer and requires that some portion of the network layer header information to be calculated. No. 17 represents the pseudo-header of the protocol
  • UDP checksum calculation is as follows

8. TCP Transmission Control Protocol

8.1 Overview

  • TCP is a connection-oriented transport protocol (computers A and B before the data transmission, to make sure the network is communicating, and can transmit data, to be performed three times during the handshake communication AB)
  • Each TCP connection can have only two endpoints, each TCP connection can only point to point (one to one).
  • TCP provides full-duplex communications (must be full duplex, 500M file download B from A, where, using TCP, even if the A to B has data transfer, but also from time to time B to A a feedback (A already told receive, or let A fast pass, pass a little slower, etc.), so that A knows that the file has been received correctly B)
  • Byte stream oriented (each small grid in the figure represents a binary byte [8], a letter on the computer keyboard or a special symbol representing a byte, a character byte is equal to one)
    in FIG sending application file when a part of the transfer part, each part to be transmitted in a cache, the cache buffer is used in the TCP protocol (referred to herein as TCP buffer), the same receiving end computer also has a TCP buffer. (1) The sender's application put into cache data blocks: the number of bytes per data block contains selected is random, such as: 1-5 @ 6-8 @ 9 to 10 and the like. (2) According to the TCP protocol buffer transfer byte which: adding the head address of the data blocks constituting the packet and other information, transmitted over the Internet, each database representing the selected random number is its own, such as 1 to 3 / / 4 to 5 and the like. (3) to the buffer of the receiving end, the packet header will be removed, the byte stream in order to assemble. (4) from the receiving end application buffer read the bytes, each read a data block (data block contains bytes are random)

TCP address the following three questions

  • TCP提供可靠交付的服务
  • TCP提供流量控制
  • TCP提供拥塞控制(当网络中的很多计算机都在使用某一条链路进行通信的时候,网络堵塞,导致该链路上的路由器处理不过来到达的数据包,导致数据包丢失,TCP协议必须有一种机制来避免网络拥塞)

8.2 TCP的连接

TCP协议是点到点的通信,每一条TCP连接有两个端点,TCP连接的端点不是主机、不是主机的ip地址、不是应用进行、也不是传输层的协议端口,而是“套字节”。对应用程序而言从一个点到另一个点是通过TCP+端口号来表示的。端口号拼接到IP地址即构成了套字节

Guess you like

Origin www.cnblogs.com/deer-cen/p/12324860.html