官术网_书友最值得收藏!

User Datagram Protocol (UDP)

UDP is a protocol that provides connectionless service to the application, and sends data to the application layer as received, without worrying about lost parts of the application data stream or some parts being received out of order. A UDP packet is shown in Figure 11:

Figure 11: UDP packet structure

Since UDP provides lesser services compared to TCP, the packet has fewer fields and is much simpler. The UDP datagram can be of any length as can be encapsulated in the IP packets as follows, and has a header that is of fixed 8-byte length. The different fields in the UDP packet are discussed as follows:

  • Source Port/Destination Port: Like TCP, UDP also serves multiple applications and hence has to provide the multiplexing function to cater to multiple applications that might want to use the services of the UDP layer. The source port/destination port fields are 16-bit identifiers that are used to distinguish the upper layer protocols. Some of the common UDP port numbers are shown in the following figure:
Figure 12: Common UDP port numbers
  • Length: This 16-bit field represents the total size of each UDP datagram, including both header and data. The values range from a minimum of 8 bytes (the required header size) to sizes above 65,000 bytes.
  • Checksum: Similar to TCP, this 16-bit field is used for checking the integrity of the received UDP datagram.
  • Data: This is the data that is being carried in the UDP packet and includes the application layer headers.
主站蜘蛛池模板: 襄汾县| 苗栗县| 灵台县| 介休市| 阿坝县| 井冈山市| 南昌市| 砚山县| 北安市| 五华县| 三河市| 永新县| 牟定县| 兴和县| 蒲江县| 凤山市| 从化市| 广河县| 康平县| 清流县| 东乡县| 广昌县| 黑河市| 中超| 夏津县| 巴中市| 甘洛县| 阳江市| 井冈山市| 汪清县| 中超| 祥云县| 洛阳市| 洪洞县| 阳东县| 万盛区| 靖江市| 定西市| 佳木斯市| 久治县| 韶山市|