I've got C code which works fine for frames with a payload of more than ~800 bytes. I can transmit frames over Ethernet and over WLAN using Atheros/MadWifi fine. The default I used for quite a while was the maximum payload of 1500 bytes and that was working fine. There is no TCP/IP/UDP running, it is just raw ethernet frames.
I'm opening the socket with
socket(PF_PACKET, SOCK_RAW, htons(999));
Then I am waiting for the socket to become available again with:
select(FD_SIZE, NULL, &wfds, NULL, timeval));
and for frames bigger than 818 on WLAN it works fine.
But if I change the payload to say 60 which is the smallest legal size the select function does not slow down the transmission anymore and packets do get lost in the kernel presumably by falling off a buffer. So I am already losing packets in the sender due to buffer overflow I assume. The strange thing is that the same code works for Ethernet even for very small packets.
So I am not convinced that there is something wrong with the code because I can utilise the 10MB Ethernet I got using small packets but something is definitely different in the way the system handles WLAN frames.
Is the another way to tell the packet generation of my program to slow down apart from the select() function? All I'm trying to do is to match the throughput to the WLAN's conditions.
Thanks and regards,
Inbox full of unwanted email? Get leading protection and 1GB storage with All New Yahoo! Mail.