PPP 和以太网的开销
PPP 和以太网发送 5000 字节的开销是多少?
点对点协议的帧大小:8字节 MTU:500 字节
以太网帧大小:18 字节 MTU:1500字节
两者都发送5000字节..
我知道这只是一个计算,但我不知道该怎么做。我到处都找不到它。我认为,由于PPP帧需要8个字节,最大传输单元是500,那么它可以一次性发送(500 - 8)字节的信息。它发送 10 帧,从而发送 4920 字节。然后发送最后一帧的最后(80+8)字节。
与以太网类似。每帧 (1500 - 18) 字节。发送 3 帧意味着发送 4446 字节。最后一帧发送(554+18)字节。
这显然没有回答“开销”问题。有人有什么想法吗?
What is the overhead for PPP and Ethernet sending 5000 bytes?
Frame size for Point-to-Point Protocol: 8 bytes
MTU: 500 bytes
Frame size for Ethernet: 18 bytes
MTU: 1500 bytes
Both sending 5000 bytes..
I know this is just a calculation, but I am not sure how to do it. I can't find it anywhere. I would think that since a PPP frame takes 8 bytes and maximum transmission unit is 500 then it can send (500 - 8)bytes of information in one go. It sends 10 frames, resulting in 4920 bytes sent. Then sends the final (80+8)bytes with the last frame.
Similar for Ethernet. (1500 - 18)bytes with each frame. 3 frames sent means 4446 bytes sent. Sending (554+18)bytes in the last frame.
This obviously doesn't answer the "overhead" question. Anyone have any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这实际上取决于您如何定义开销。这个答案将假设开销是除了数据本身之外还需要传输的字节数。
对于以太网,假设 5000 字节有效负载未封装在 IP + TCP/UDP 帧中,则发送的每个数据包将有 18 字节的开销。这意味着 MTU 为 1500 的每次传输将能够容纳 1482 字节。要传输 5000 字节,这意味着必须传输 4 个数据包,这意味着 72 字节 (18 * 4) 的开销。请注意,当您包含诸如包含 TCP 帧的 IP 帧之类的内容时,开销会变得更大。
对于 PPP,正如您已经展示的那样,每帧可以发送 492 字节。 11 个帧意味着 88 字节的开销 (11 * 8) - 同样,不包括有效负载内的任何附加协议帧。
在这两个示例中,构建在这些链路层协议之上的任何协议都会增加开销。例如,使用包含 UDP 数据报的 IPv4 帧发送的以太网数据包将有额外的 28 个字节被标头消耗,而不是数据(假设没有 IP 选项,IPv4 标头中 20 个字节,UDP 标头中 8 个字节)。考虑到原始以太网示例,这意味着每个数据包的数据量变为 1454 字节,幸运的是,这仍然是 4 个数据包(额外的数据溢出到较小的第 4 个数据包),开销为 144 字节。
您可以在此处阅读更多内容(我发现该页面有点难虽然要阅读)。
It really depends on how you define overhead. This answer will assume overhead is the number of bytes that you need to transmit in addition to the data itself.
For Ethernet, assuming the 5000 byte payload is not encapsulated in an IP + TCP/UDP frame, you will have 18 bytes of overhead for every packet sent. That means each transmission with an MTU of 1500 will be able to hold 1482 bytes. To transmit 5000 bytes, this means 4 packets must be transmitted, which means an overhead of 72 bytes (18 * 4). Note that the overhead becomes bigger when you include things like the IP frame which contains a TCP frame.
For PPP, as you've already shown, you can send 492 bytes per frame. Eleven frames means 88 bytes of overhead (11 * 8) - again, not including any additional protocol frames within the payload.
In both these examples any protocols that build on top of these link layer protocols will contribute to overhead. For example, an Ethernet packet sent with an IPv4 frame which contains a UDP datagram will have an additional 28 bytes consumed by headers and not data (20 bytes in an IPv4 header and 8 in a UDP header, assuming no IP options). Considering the original Ethernet example, this means the amount of data per packet becomes 1454 bytes, which luckily still comes to 4 packets (the extra spills over into the smaller 4th packet), with 144 bytes of overhead.
You can read more here (I find that page a little hard to read though).