Comments (2)
- 首先 2 字节应该是 65535,似乎全零不算长度
- UDP 负载的长度,也就是说应用层分组的长度,按照这个题的说法,它只看了 UDP 的长度字段,只需要这个字段所能表示的最大值减去 UDP 首部长度,即 65535-8=65527.
- 不过上面只是理论上 UDP 的长度字段所能表示的,楼上说的那个是在网络层 IP 首部中首部字段和长度字段又进行的限制,简而言之,就是说 IP 格式规定 IP 数据部分的最大值是 65535 - 20 = 65515.再减去 UDP 首部 8 为 65507,这个和 UDP 首部没有关系。
- 实际上如果要看其他层的长度限制的话,链路层也有 MTU 的限制,以太网就要求网络层分组最大是 1500,虽然可以分片解决,除此外还有实际的套接字缓存的大小限制等,不过都不是这个题想要考的。
- 总之,我认为这道题想要的考点应该就是 2 说的。
from computer-networking-a-top-down-approach-notes.
经过查阅资料,找到UDP最大有效负载的理论值:
UDP包Header中的length为2 Byte(字节),用于记录UDP包的总长度:Header+Data。
2个Byte可表示的最大值为: 2^16-1=64K-1=65535,因为length的单位是Byte,所以UDP包的长度最大值为65535Byte。
又因为UDP包Header占8Byte, IP包Header占20Byte, 所以UDP的最大有效负载的理论值为65535-28 = 65507Byte.
答案来源:https://cloud.tencent.com/developer/ask/28347
from computer-networking-a-top-down-approach-notes.
Related Issues (15)
- 关于套接字编程的一个问题 HOT 2
- 感谢分享 HOT 2
- wireshark lab IP 部分 第7题 HOT 2
- 一点建议 HOT 1
- Wireshark实验:HTTP实验五一个输入小错误 HOT 1
- 请问wireshark实验资料在哪里找的? HOT 1
- 4.17, Wireshark Lab2 HOT 2
- 与书相关的Java小程序 HOT 2
- Netmap:一个用于快速数据包I/O的新框架
- Wireshark实验:HTTP
- 官方文档更新了 HOT 1
- Computer networking
- Computer Networking
- I need asset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from computer-networking-a-top-down-approach-notes.