siteswapjuggler / smartball-firmware

Smartball ESP8266 firmware
GNU General Public License v3.0
2 stars 0 forks source link

[network] multicast lags #1

Open siteswapjuggler opened 5 years ago

siteswapjuggler commented 5 years ago

Some lags may happen using multicast address. Investigation tends to confirm that problem using this protocol on my home personnal router, only one ball connected :

  1. send a color change from max/msp every n ms
  2. check for timing in wireshark
  3. check for timing in the ball

Case 1 : every 20 ms Wireshark sees paquets every 20 ms - OK Balls receive 5 to 7 paquets every 220 ms - NOT OK

Case 2 : every 1000 ms While using multicast I receive paquets by interval beetween 929 and 1250 ms... it sucks. When using unicast address I receive paquets every 1000 ms... perfect.

Multicast and broadcast seems to suffer from low performance as discussed in this thread : https://superuser.com/questions/578729/multicast-lan-ping-twice-as-slow-than-unicast

siteswapjuggler commented 5 years ago

This reflexion works both ways the default multicast adress from balls to the computer could cause the same lag actually.

We also need a way to configure the Output IP via the datagram protocol.

siteswapjuggler commented 5 years ago

I reproduced the lag by experiment on my own home router. The lag behaviour is there with sb.send or sadam.udpSender. The lag is the same with broadcast adress and multicast adress.

using Wireshark filter helps a lot : ip.src == 192.168.1.12 && udp.port == 8000

siteswapjuggler commented 5 years ago

Further search lead me to the dscp option which seems to have influance on the network QoS.

See https://lafibre.info/reso-liain/prioriser-la-tv/ and https://blogotubes.wordpress.com/2016/02/10/wireshark-display-dscp-value-as-a-column-in-a-capture/