UDP foundation

UDP main features:

(1) UDP is a connectionless , and transmits data without establishing a connection, reducing overhead and latency before data transmission.
(2) UDP use a best effort delivery , that does not guarantee reliable delivery, so the host does not need to maintain a connection state table.
(3) UDP -oriented packets , UDP application layer cross down packet reservation packet boundaries, adding header after delivery ip layer; for ip layer handed user data packet, removing the header directly after handed over to the application layer .
(4) UDP does not congestion control , congestion of the network and therefore does not invalidate the transmission rate of the source host is reduced.
(5) UDP support one to one, one to many, many-to-many interactive communication.
(6) UDP's header overhead small , only 8 bytes.

UDP header format

User Datagram UDP has two fields: a data field and a header field. Header field (above), is only 8 bytes, the four fields, each field is a length of two bytes. The fields are as follows:
(1) a source port : the source port number. Choice in times of need reply. Need not be full with zeros.
(2) a destination port : the destination port number. It must be used at the end of the delivery of the message.
(3) length : length of the UDP user datagram, which minimum value 8 (only the first portion).
(4) Test and : UDP User Datagram detecting for errors in transmission. Wrong to discard

Note that , when the UDP user datagram header is checked and the calculation is necessary to increase the pseudo-header of each 12-byte UDP user datagram before, neither the pseudo header is not submitted upward downward transmission, the figure shows the pseudo-header field content. UDP checksum is the header and data parts are tested together.

Guess you like

Origin www.cnblogs.com/CubicZ/p/11597775.html