当 MAC 层队列已满时,现实世界中会发生什么?降低?
最近我正在用模拟器做一个网络实验。我发现当MAC层的队列已满,并且上层(例如IP)仍然向其转发数据包时,该实现选择丢弃这些数据包。
我想知道的是,在现实世界的实现中,就像Linux内核中的协议栈一样,如果MAC层的队列(接口的缓冲区?)已满,并且有更多的数据包来自套接字,它是否会选择丢弃它们或者分配更多内存?为什么?
谢谢。
Recently I'm doing a network experiment with a simulator. I found when the queue of MAC layer is full, and upper layers (e.g. IP) still forwards packets down to it, this implementation chooses to drop those packets.
What I'm wondering is, in real world implementation, like protocol stack in Linux kernel, if the queue of MAC layer (the buffer of interfaces?) is full, and there are more packets coming from socket, dose it choose to drop them or allocate more memory? and why?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正确的做法应该是流走。这会将 IP 堆栈推回到套接字层。
send
或sendto
API 将阻塞或失败,从而建立流量控制(套接字的发送速度不应快于 MAC 层的发送速度)。唯一应该丢弃数据包的时间是在解复用点。这是一种情况,有两个分支要发送,但其中一个分支被阻止。在这里,您必须丢弃数据包,因为一个分支可能不会阻止流量沿着一个分支流动,因为另一分支被阻止。但是,如果只有一个发送分支,您总是会流出。
The correct approach should be to flow off. This will push back IP the stack to the socket layer. The
send
orsendto
APIs will either block or fail and thus flow control is established (a socket should not be able to send faster than the MAC layer can send).The only time packets should even be dropped is at a de-multiplexing point. This is the case where there are two branches to send to and one of them is blocked. Here you have to drop packets because one may not stop traffic flowing down the one branch because the other branch is blocked.But where there is only one send branch you always flow off.