title: UDP with mulicast sockets over wireless network
body: <p>I wrote a simple udp server client application with multicast sockets. Server is sending packets to three clients every 6 ms . Packet
  size is 1200 bytes. This is 166,66 packets per second. Whenever one of the client detects a missing packet, it will send a NACK packet to the server via unicast 
  . </p>
  
  <p><strong>First test:</strong>
  Server and three clients were connected to the router TP-Link TL-WDR4300 (dd-wrt) via ethernet and everything worked fine. </p>
  
  <p><strong>Second test:</strong>
  Only server was connected to the router via Ethernet and other clients were connected via wireless 2.4 GHz and with fixed channel. Two problems arrived
  with wireless: <strong>First problem</strong> is packet loss, clients are receiving just 50% of packets. And losses appear in bursts, for example 400 packets are received,
  200 are lost etc. <strong>Second problem</strong> is that when clients are sending back NACK packets to the server which I can see on wireshark but my application can't receive them.
  This is strange because the code is the same as it was when clients were connected via Ethernet. So, any ideas ? I would be thankful </p>
  
  <p>Server code:</p>
  
  <pre><code>while (1) {
  
      FD_ZERO(&amp;readfds);
      FD_SET(sd, &amp;readfds);
  
      tv.tv_sec = 0;
      tv.tv_usec = 0;
  
      rv = select(sd + 1, &amp;readfds, NULL, NULL, &amp;tv);
  
      while (rv == 1) {
  
          nack_processing(sd);
          rv = select(sd + 1, &amp;readfds, NULL, NULL, &amp;tv);
  
  
      }
  }
  return 0;
  
  }
  </code></pre>
  
  <p>I also made updates to decrease traffic:
  Packet size : 800 bytes
  Inter arrival time between packets : 10 ms
  = 100 packets per second = 0.076 MB /s</p>
  
  <p>and I measured traffic at server and client sides:
  Server ~ 10 MB/s
  Clients ~ 5 MB /s</p>
  
  <p>Everything seems fine</p>