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

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.
主站蜘蛛池模板: 应城市| 弋阳县| 舞阳县| 凌云县| 建德市| 镇宁| 白银市| 上犹县| 新田县| 蒙阴县| 郴州市| 崇文区| 新余市| 绥德县| 上饶县| 通城县| 焦作市| 淮北市| 呼图壁县| 陆川县| 会泽县| 明溪县| 长顺县| 成安县| 涟源市| 邢台县| 黎城县| 禹城市| 芜湖市| 灵璧县| 紫金县| 县级市| 神木县| 曲松县| 焦作市| 大宁县| 都兰县| 榆林市| 黔江区| 兰考县| 临洮县|