TCP & UDP

definition:

TCP (Transmission ControlProtocol Transmission Control Protocol) is a connection-oriented, reliable transport layer protocol based on a stream of bytes defined by the IETF RFC 793. In a simplified OSI model of a computer network, to complete the fourth layer functions specified in the transport layer.
UDP is the User Datagram Protocol short, the Chinese name is the User Datagram Protocol, is the OSI (Open System Interconnection, Open Systems Interconnection) reference model in a non-transport layer protocol connection, providing simple transaction-oriented unreliable information delivery service , IETF RFC 768 is the official specification of the UDP. UDP protocol number in the IP packet is 17.

 

use:

TCP and UDP are the OSI model transport layer protocol. TCP provides reliable communication transmission, UDP is often used to make broadcasting and communication transmission to control the details of the application.

 

TCP and UDP basic differences:
1, based on a connection with no connection.
2, TCP requires more system resources, UDP less.
3, UDP program structure is relatively simple.
4, the flow mode (TCP) and datagram mode (UDP).
5, TCP to ensure the correctness of the data, UDP packet loss may.
6, TCP guarantee data order, UDP does not guarantee.
7, TCP connection-oriented (e.g., dial-up connection is established first call); the UDP is connectionless, i.e. without establishing a connection before sending data.
8, TCP provides reliable service. In other words, the data transfer connection of TCP, error-free, not lost, not repeat, and arrive out of order; UDP best effort, that does not guarantee reliable delivery.
. 9, TCP byte stream and, in fact, the TCP byte stream data as a series of unstructured; is for the UDP packets, UDP no congestion control, and therefore does not cause a congestion transmission source host of the network is the rate of reduction ( useful for real-time applications such as IP telephony, real-time video conferencing, etc.).
10, each TCP connection can only point to point; UDP support one to one, one to many, and many-to-many interactive communication.
11, TCP header of 20 bytes of overhead; small UDP header overhead of only 8 bytes.
12, a logical communication channel is TCP reliable full-duplex channel, UDP is an unreliable channel.

Published 407 original articles · won praise 150 · views 380 000 +

Guess you like

Origin blog.csdn.net/ds1130071727/article/details/102802820