TCP/IP Note 3. Transport Layer (1) -- UDP, TCP 1. Transport Layer 1.1 two Protocols: TCP and UDP. (1) TCP: provides a reliable data transmission service. TCP is connection oriented and can communicate only after the link is established. (2) UDP: data is sent directly, and no matter whether the recipient is receiving or not, even if UDP cannot be delivered, no ICMP error message will be generated. 1.2 upper and lower layers (1) TCP, UDP does not know which routers the data goes through in the channel, and (2) network layer (those routers) does not know TCP, whether UDP has established port 1.3 to mark the processes at the application layer. Port is marked with a 16-bit port number. The port number is only local, that is, the port number is only used to mark processes in the application layer of the computer. The same port number of different computers on the Internet is not associated. UDP2.1 Overview (1) UDP only adds a few features on the IP datagram service, that is, the port function and the error detection function (2) advantages: No need to establish a connection before sending data. UDP hosts do not need to maintain a complex connection status table." UDP User Datagram has only eight bytes of header overhead. Network Congestion does not reduce the transmission rate of the source host. This is important for some real-time applications. 1 vs 1, 1 vs 1 +, 1 + vs 1, 1 + vs 1 + 2.2 packet header 3. advantages of TCP3.1 (1) connection-oriented (2) reliability (3) Full Duplex (4) byte stream-oriented 3.2 format serial number: the ID of this document (each byte in the data stream transmitted through the TCP connection is a serial number. The value of the serial number field refers to the serial number of the first byte of the data sent in this section.) Confirmation No.: the serial number of the next packet URG = 1: The emergency pointer field is valid. It tells the system that there is urgent data in this packet segment and should be transmitted as soon as possible (equivalent to high-priority data) ACK = 1: The validation number field is valid PSK = 1: deliver to receiving process RST = 1: critical error as soon as possible, reconnect SYN = 1: link request FIN = 1: link end option field: variable length. TCP only specifies one option, that is, the Maximum length of the message Segment MSS (Maximum Segment Size ). The MSS tells the peer TCP: "The maximum length of the data field of the packet segment that can be received by my cache is MSS bytes ."