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

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.
主站蜘蛛池模板: 慈利县| 长汀县| 凤城市| 彰化市| 乌拉特后旗| 宁明县| 宜兰县| 阿拉善左旗| 马关县| 顺昌县| 南皮县| 乐东| 岳普湖县| 太和县| 玉林市| 仁化县| 津市市| 湘潭市| 河南省| 合肥市| 高淳县| 独山县| 商水县| 永安市| 龙游县| 磐安县| 镇雄县| 厦门市| 镇坪县| 临海市| 鄂尔多斯市| 南皮县| 临朐县| 泾川县| 济宁市| 青浦区| 随州市| 任丘市| 儋州市| 临泽县| 高阳县|