I wrote a simple udp server client application with multicast sockets. The server sends packets to three clients every 6 ms. packet size is 1200 bytes. This is 166.66 packets per second. Whenever one of the clients detects a missing packet, it sends a NACK packet to the server via unicast,
First test:
The server and three clients were connected to the TP-Link TL-WDR4300 (dd-wrt) router via ethernet, and everything worked fine.
Second test:
Only the server was connected to the router via Ethernet, while other clients were connected via 2.4 GHz wireless and with a fixed channel. There were two problems with the wireless: The first problem is packet loss, clients receive only 50% of the packets. And losses appear in packets, for example, 400 packets, 200 are lost, etc. The second problem is that when clients send back NACK packets to the server, which I can see on wirehark, but my application cannot receive them. This is strange because the code is the same as when connecting clients via Ethernet. So, any ideas? I would be thankful
Server Code:
while (1) {
FD_ZERO(&readfds);
FD_SET(sd, &readfds);
tv.tv_sec = 0;
tv.tv_usec = 0;
rv = select(sd + 1, &readfds, NULL, NULL, &tv);
while (rv == 1) {
nack_processing(sd);
rv = select(sd + 1, &readfds, NULL, NULL, &tv);
}
}
return 0;
}
:
: 800
: 10
= 100 = 0,076 /
:
~ 10 /
~ 5 /