简体   繁体   English

802.11n上的UDP单播-L2肯定ACK对Linux套接字发送缓冲区的影响

[英]UDP unicast over 802.11n - effect of L2 positive ACK on Linux socket send buffer

Can anone explain how it works when an application sends UDP unicast datagrams over an 802.11 WiFi network? 谁能解释当应用程序通过802.11 WiFi网络发送UDP单播数据报时其工作原理吗? Assume non-blocking UDP socket. 假定非阻塞UDP套接字。 For concreteness, assume 802.11n or 802.11ac and a reasonably new Linux kernel (Android Lollipop or Debian stable). 具体而言,假设使用802.11n或802.11ac以及相当新的Linux内核(Android Lollipop或Debian稳定版)。 Specifically, if the sender NIC does not receive any positive ACK of send MPDUs, will the send() call return -1 and socket send queue in kernel be shown as non-empty with netstat? 具体来说,如果发送方NIC没有收到任何发送MPDU的肯定应答,netstat中的send()调用是否返回-1,并且内核中的套接字发送队列显示为非空? And the NIC will re-send same MPDUs repeatedly? NIC是否会重复发送相同的MPDU?

If this is not the right place to ask, please point to a good reference or another StackExchange site maybe. 如果这不是合适的地方,请指向一个很好的参考资料,或者指向另一个StackExchange网站。

In my understanding. 以我的理解。 Wifi(layer 2) would NOT care about UDP/TCP protocol, for wifi hardware, it is just a frame, Wifi(第2层)不关心UDP / TCP协议,对于wifi硬件,它只是一个框架,

the cast will act like this..... 演员会像这样.....

frame sending -> no ack -> retry again -> no ack -> retry -> no ack -> retry ... 帧发送->不确认->重试->不确认->重试->不确认->重试...

after a few retry, wifi hardware will drop this frame and send next frame in NIC buffer. 重试几次后,wifi硬件将丢弃此帧并在NIC缓冲区中发送下一帧。 wifi driver should NOT always keep this frame, because frame drop or lost is frequently case in wifi. wifi驱动程序不应该始终保持此帧,因为在wifi中经常发生帧丢失或丢失的情况。

then we talk about UDP network protocol now, because it's anon-blocking UDP socket, UDP would not care any error, it just continue sending and sending and sending.... 那么我们现在就来谈谈UDP网络协议,因为它是一个非阻塞的UDP套接字,UDP不会关心任何错误,它只会继续发送并继续发送和发送。

Android phone has a feature -- "miracast", it also use UDP as a video streaming protocol and use wifi to transfer data. Android手机具有“ miracast”功能,它还使用UDP作为视频流协议并使用wifi传输数据。 maybe you can check how does this function work. 也许您可以检查此功能的工作方式。

Layer-2 (Wi-Fi, in this case) knows nothing about the layer-3 protocol (IP, IPX, etc.) used, much less the layer-4 protocol (TCP, UDP, SPX, etc.) used: Wi-Fi doesn't know about IP, which doesn't know about UDP. 第2层(在这种情况下为Wi-Fi)对所使用的第3层协议(IP,IPX等)一无所知,而对使用的第4层协议(TCP,UDP,SPX等)则一无所知: -Fi不知道IP,也不知道UDP。 The whole point of the network layers is that they are independent of each other. 网络层的全部要点是它们彼此独立。 Wi-Fi can carry any layer-3 protocol, which, in turn, can carry any layer-4 protocol, which can carry any upper layer protocols. Wi-Fi可以承载任何第3层协议,而该协议又可以承载任何第4层协议,而该协议可以承载任何上层协议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM