Portal:
Computer network (10)-easy to use UDP
computer network (11 )-have you heard of the TCP three-way handshake
Computer network (12)-three TCP functions
The first eight sections systematically introduced the knowledge of the network layer, including IP datagrams, IP addresses, routing protocols, ARP, ICMP, multicast, IGMP, and so on. Through these protocols, we can make a data packet traverse thousands of mountains and rivers from a host and be transmitted to the destination host in a sea of people. However, the IP protocol is only a protocol that is delivered as much as possible, lacking effective error control, and after finding the host, which processes in the host should be delivered to these datagrams, this is not its functional division. This means that, staying at the network layer, the function of network transmission has not ended successfully. Therefore, a higher-level protocol is needed to implement the functions that these network layers lack. Yes, this is the transport layer.
1. Transport layer protocol
At the transport layer, there are two protocols that need to be learned-TCP and UDP. These two protocols have very different styles, and in reality there are completely different usage scenarios, which complement each other.
TCP has a complex structure, can perform segmented transmission of large data packets, and provides functions such as reliable transmission and flow control. It is often used in applications such as file transmission and mail sending.
UDP is simple in structure, cannot be segmented, and does not provide reliable transmission, flow control and other functions. It is often used for short message transmission, such as QQ.
2. Transport layer function
1) Realize the communication between the processes of the two hosts
2) Provide reliable transmission to establish a connection
3) Flow control
4) Error control
5) Congestion control
Three, port
After the network layer successfully transmits the data packets to the destination host, the transport layer will determine which target processes these data packets should be delivered to. To this end, the transport layer has designed a port number to achieve this.
There are various types of applications at the application layer: FTP, WEB, SMTP, DNS, RDP, etc.
The servers of these applications use TCP or UDP ports to listen to client requests.
The clients of these applications use the IP address to locate the host where the server is located, and the port number to locate the server process.
Common port number : generally 0~1023
FTP:21
TELNET: 23
SMTP: 25
SMTP: 53
HTTP: 80
HTTPS: 443
RDP: 3389
MYSQL: 3306
Registration port number : generally 1024~49151
Client port number : generally 49152~65535