- Implementing Cisco Networking Solutions
- Harpreet Singh
- 253字
- 2021-07-08 10:02:16
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.
推薦閱讀
- Learning Scala Programming
- 深度學(xué)習(xí)經(jīng)典案例解析:基于MATLAB
- 動手玩轉(zhuǎn)Scratch3.0編程:人工智能科創(chuàng)教育指南
- C語言程序設(shè)計(第2版)
- Python Deep Learning
- 新手學(xué)Visual C# 2008程序設(shè)計
- Vue.js 3.0源碼解析(微課視頻版)
- 網(wǎng)店設(shè)計看這本就夠了
- D3.js 4.x Data Visualization(Third Edition)
- 執(zhí)劍而舞:用代碼創(chuàng)作藝術(shù)
- 搞定J2EE:Struts+Spring+Hibernate整合詳解與典型案例
- Processing創(chuàng)意編程指南
- Android系統(tǒng)下Java編程詳解
- Android Sensor Programming By Example
- 貫通Tomcat開發(fā)