2

IS there a way I can in user-space get notification about a packet being dropped at Layer-2 in 802.11.

According to my understanding what happens is, when a packet is sent out on the medium, there are Layer-2 ACKs which are received if it is delivered correctly (if not,it does the retransmission and ultimately drops the packet if not delivered after several retries..)

I want to be able to access this notification (in user-space)and change the behavior of packet transmission.

I want to be able to send the packet to another host from the FIB rather than dropping the packet.

I have read about libpcap libraries and netfilter hooks which allows me to capture packet and inject them back on the networking stack..

But I'm not able to find hooks (if any, for the wireless stack) to help me capture the packet notification in Layer-2.

Please correct me if I'm not understanding something correctly. Also, any heads-up or links to read would be great.

Akshay
  • 329
  • 1
  • 7
  • 19
  • Surely the wireless driver knows about the frame loss, maybe mac80211 knows, too. The question is then _How far das this information travel back on the way to the sending application?_ How do you send/inject the frame/packet? (normal IP, raw IP socket, raw packet socket, libpcap, ...) – dasup Mar 03 '14 at 14:52
  • @dasup I guess I would either use any of the different options to inject into it (I also went through libnet, which is used for packet injection..haven't yet tried an example of it..I haven't yet looked into it.. Do you have knowledge of any hooks or api's to receive the frame loss notification ? – Akshay Mar 03 '14 at 18:36

1 Answers1

1

No, you cannot, at least not using the standardised sockets interfaces. 802.11 is a link layer, and the sockets API is strictly link-layer agnostic: unless it's going to work on all link layers, it's not in sockets. There are good reasons for that: the kind of cross-layer interaction that you envision has been tried many times, and it's always turned out more trouble than it's worth.

You didn't give us any details about the application — but the best solution is most probably to change your application-layer protocol to send explicit acknowledgments, and send your data over the fallback route when you fail to receive an ACK.

jch
  • 5,382
  • 22
  • 41