NetworkMulticastNotes - henk52/knowledgesharing GitHub Wiki

Network multicast notes

Virtual bridge

  1. brctl addbr br1
  2. brctl addif br0 veth0

mrouted

Testing mrouted

  1. sudo ./mrouted --foreground --loglevel=info
  2. ./mcjoin -s
  3. ./mcjoin
  4. sudo mroutectl show igmp groups
  5. '^C' the client to get how packages where received

It seem like running mcjoin server and client on the same machine without mrouted works.

See alpine notes to see how to build mcjoin on alpine

Mrouted

  1. sudo -i
  2. echo 96 > /proc/sys/net/ipv4/igmp_max_memberships

Docker and multicasting

Test 1 - std docker0 bridge

  • Test 1
    • container1 on docker0
    • container2 on docker0 : yes
    • host client: no
    • wireshark of docker0 : yes

Test 2 - Linux std bridge

From: https://github.com/moby/moby/blob/d3ff00948fe28e40cd876159b92a3026c15d1f2c/docs/sources/articles/networking.md

  1. sudo brctl addbr bridge0
  2. sudo ip addr add 192.168.5.1/24 dev bridge0
  3. sudo ip link set dev bridge0 up
  4. ip addr show bridge0
  5. docker run -it --net=none multicast sh
  6. docker ps
  7. ./fix_network.sh ecstatic_diffie
  • Test 2
    • container1 on bridge0
    • container1 on bridge0 : not run
    • host client: no
    • wireshark of bridge0 : yes
    • mrouted can see container2 join: yes

test 3 - peer connection between two bridges

requires test2 set-up as well

  1. sudo brctl addbr bridge1
  2. sudo ip addr add 192.168.55.1/24 dev bridge1
  3. sudo ip link set dev bridge1 up
  4. ip addr show bridge1
  5. docker run -it --net=none multicast sh
  6. docker ps
  7. ./fix_network.sh ecstatic_diffie
  • Test 3
    • container1 on bridge5
    • container2 on bridge55 : no
    • host client: no
    • wireshark of bridge5 : yes
    • wireshark of bridge55 : no
    • ping container1 to container2: yes

Test 4 - peer-link the bridges

Start test 3

  1. sudo ip link add X5 type veth peer name X55
  2. sudo brctl addif bridge5 X5
  3. sudo ip link set X5 up
  4. sudo brctl addif bridge55 X55
  5. sudo ip link set X55 up

Ohter

Troubleshooting

Troubleshooting mrouted

mrouted warning - Cannot join group 224.0.0.4 on interface 10.1.1.254: No buffer space available

Fix: sudo sysctl -w net.ipv4.igmp_max_memberships=60

See: https://community.ui.com/questions/No-buffer-space-available/2a427f15-2ed3-41f1-aae6-825a9f16c7f3?page=1

sudo mrouted -f
mrouted: 06:50:32.883 warning - Cannot join group 224.0.0.4 on interface 10.1.1.254: No buffer space available
mrouted: 06:50:32.883 warning - Cannot join group 224.0.0.2 on interface 10.1.2.254: No buffer space available
mrouted: 06:50:32.883 warning - Cannot join group 224.0.0.4 on interface 10.1.3.254: No buffer space available
mrouted: 06:50:32.883 warning - Cannot join group 224.0.0.2 on interface 10.1.4.254: No buffer space available

mrouted: 06:56:38.500 warning - too many vifs, ignoring catapultb1.26

See: https://github.com/troglobit/pimd/issues/39

sudo mrouted -r

/usr/src/linux-headers-4.15.0-99/include/uapi/linux/mroute.h:#define MAXVIFS

mrouted repo: ./src/config.c

        /*
         * If there is room in the uvifs array, install this interface.
         */
        if (numvifs == MAXVIFS) {
            logit(LOG_WARNING, 0, "too many vifs, ignoring %s", ifa->ifa_name);
            continue;
        }

mrouted.conf: Invalid interface name br1 near line 1

mrouted warning - ignoring vnic0, same subnet as docker0

mrouted: 08:53:40.989 warning - ignoring vnic0, same subnet as docker0
mrouted: 08:53:40.989 warning - ignoring vnic1, same subnet as docker0
mrouted: 08:53:40.989 warning - mrouted.conf:2: phyint vnic1 not available, continuing ...
mrouted: 08:53:40.989 Cannot forward: only one enabled vif
no phyint
phyint vnic1 enable
phyint enp0s31f6 enable