User Tools

Site Tools


documentation:examples:multicast_with_pim-sm

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
documentation:examples:multicast_with_pim-sm [2019/11/08 15:18] – [Checking NIC drivers and Bhyve compatibility with multicast] olivierdocumentation:examples:multicast_with_pim-sm [2025/10/02 17:52] (current) – [PIM neighbors] olivier
Line 21: Line 21:
 More information on these BSDRP lab scripts available on [[documentation:examples:How to build a BSDRP router lab]]. More information on these BSDRP lab scripts available on [[documentation:examples:How to build a BSDRP router lab]].
  
-Start the lab with 4 routers simulating an e1000 NIC (vtnet interface and they didn't support mcast routing on FreeBSD):+Start the lab with 4 routers:
 <code> <code>
-tools/BSDRP-lab-bhyve.sh -n 4 -e -i BSDRP-1.96-full-amd64-serial.img.xz +tools/BSDRP-lab-bhyve.sh -n 4 -i BSDRP-2.0-full-amd64.img.xz 
-BSD Router Project (http://bsdrp.net) - bhyve full-meshed lab script+BSD Router Project (https://bsdrp.net) - bhyve full-meshed lab script
 Setting-up a virtual lab with 4 VM(s): Setting-up a virtual lab with 4 VM(s):
-- Working directory: /root/BSDRP-VMs +- Working directory: /home/olivier/BSDRP-VMs 
-- Each VM has 1 core and 512M RAM +- Each VM has a total of (1 cores and 1 threads) and 1G RAM 
-- Emulated NIC: e1000+- Emulated NIC: virtio-net 
 +- Boot mode: UEFI
 - Switch mode: bridge + tap - Switch mode: bridge + tap
 - 0 LAN(s) between all VM - 0 LAN(s) between all VM
 - Full mesh Ethernet links between each VM - Full mesh Ethernet links between each VM
 VM 1 has the following NIC: VM 1 has the following NIC:
-em0 connected to VM 2 +vtnet0 connected to VM 2 
-em1 connected to VM 3 +vtnet1 connected to VM 3 
-em2 connected to VM 4+vtnet2 connected to VM 4
 VM 2 has the following NIC: VM 2 has the following NIC:
-em0 connected to VM 1 +vtnet0 connected to VM 1 
-em1 connected to VM 3 +vtnet1 connected to VM 3 
-em2 connected to VM 4+vtnet2 connected to VM 4
 VM 3 has the following NIC: VM 3 has the following NIC:
-em0 connected to VM 1 +vtnet0 connected to VM 1 
-em1 connected to VM 2 +vtnet1 connected to VM 2 
-em2 connected to VM 4+vtnet2 connected to VM 4
 VM 4 has the following NIC: VM 4 has the following NIC:
-em0 connected to VM 1 +vtnet0 connected to VM 1 
-em1 connected to VM 2 +vtnet1 connected to VM 2 
-em2 connected to VM 3+vtnet2 connected to VM 3
 To connect VM'serial console, you can use: To connect VM'serial console, you can use:
-- VM 1 : cu -l /dev/nmdm-BSDRP.1B +- VM 1 : sudo cu -l /dev/nmdm-BSDRP.1B 
-- VM 2 : cu -l /dev/nmdm-BSDRP.2B +- VM 2 : sudo cu -l /dev/nmdm-BSDRP.2B 
-- VM 3 : cu -l /dev/nmdm-BSDRP.3B +- VM 3 : sudo cu -l /dev/nmdm-BSDRP.3B 
-- VM 4 : cu -l /dev/nmdm-BSDRP.4B+- VM 4 : sudo cu -l /dev/nmdm-BSDRP.4B
 </code> </code>
  
Line 64: Line 65:
  gateway_enable=no \  gateway_enable=no \
  ipv6_gateway_enable=no \  ipv6_gateway_enable=no \
- ifconfig_em0="inet 10.0.12.1/24" \+ ifconfig_vtnet0="inet 10.0.12.1/24" \
  defaultrouter=10.0.12.254  defaultrouter=10.0.12.254
 service hostname restart service hostname restart
Line 77: Line 78:
 <code> <code>
 sysrc hostname=VM2 \ sysrc hostname=VM2 \
- ifconfig_em0="inet 10.0.12.254/24"+ ifconfig_vtnet0="inet 10.0.12.254/24"
- ifconfig_em1="inet 10.0.23.2/24" \+ ifconfig_vtnet1="inet 10.0.23.2/24" \
  defaultrouter=10.0.23.3 \  defaultrouter=10.0.23.3 \
  pimd_enable=yes  pimd_enable=yes
Line 100: Line 101:
 <code> <code>
 sysrc hostname=VM3 \ sysrc hostname=VM3 \
- ifconfig_em1="inet 10.0.23.3/24"+ ifconfig_vtnet1="inet 10.0.23.3/24"
- ifconfig_em2="inet 10.0.34.254/24" \+ ifconfig_vtnet2="inet 10.0.34.254/24" \
  defaultrouter=10.0.23.2 \  defaultrouter=10.0.23.2 \
  pimd_enable=yes  pimd_enable=yes
Line 122: Line 123:
  gateway_enable=no \  gateway_enable=no \
  ipv6_gateway_enable=no \  ipv6_gateway_enable=no \
- ifconfig_em2="inet 10.0.34.4/24" \+ ifconfig_vnet2="inet 10.0.34.4/24" \
  defaultrouter=10.0.34.254  defaultrouter=10.0.34.254
 service hostname restart service hostname restart
Line 153: Line 154:
 </code> </code>
  
-On the direct connected VM2, start a mcast listener (server receiving), it should receive multicast flow+On the direct connected VM2, start to check if in non-promiscious mode it sees mcast packets comming: 
 +<code> 
 +[root@VM2]~# tcpdump -pni vtnet0 -c 2 
 +tcpdump: verbose output suppressed, use -v or -vv for full protocol decode 
 +listening on vtnet0, link-type EN10MB (Ethernet), capture size 262144 bytes 
 +15:22:32.517270 IP 10.0.12.1.33482 > 239.1.1.1.5001: UDP, length 1470 
 +15:22:32.528668 IP 10.0.12.1.33482 > 239.1.1.1.5001: UDP, length 1470 
 +2 packets captured 
 +2 packets received by filter 
 +0 packets dropped by kernel 
 +</code> 
 + 
 +=> VM2 is receiving mcast packets from 10.0.12.1 to mcast group 239.1.1.1. 
 +Now on VM2 start a mcast listener (server receiving), it should receive multicast flow
  
 <code> <code>
-[root@VM2]~# iperf -s -u -B 239.1.1.1 -i 1+[root@VM2]~# iperf -s -u -B 239.1.1.1%vtnet0 -i 1
 ------------------------------------------------------------ ------------------------------------------------------------
 Server listening on UDP port 5001 Server listening on UDP port 5001
Line 177: Line 191:
 => Notice the mcast receiver is correctly receiving at 1Mb/s. => Notice the mcast receiver is correctly receiving at 1Mb/s.
  
-Here is a non working example:+Here is a non working example (here because source interface not given, and it uses the other one):
 <code> <code>
 [root@VM2]~# iperf -s -u -B 239.1.1.1 -i 1 [root@VM2]~# iperf -s -u -B 239.1.1.1 -i 1
Line 198: Line 212:
  
 <code> <code>
-[root@VM2]~# pimd -r 
-Virtual Interface Table ====================================================== 
-Vif  Local Address    Subnet              Thresh  Flags      Neighbors 
----  ---------------  ------------------  ------  ---------  ----------------- 
-  0  10.0.12.254      10.0.12/24                DR NO-NBR 
-  1  10.0.23.2        10.0.23/24                PIM        10.0.23.3 
-  2  10.0.12.254      register_vif0            1 
  
- Vif  SSM Group        Sources+root@VM2:~ # pimctl show
  
-Multicast Routing Table ====================================================== +PIM Interface Table 
---------------------------------- (*,*,G) ------------------------------------ +Interface         State     Address            Priority  Hello  Nbr  DR Address      DR Priority 
-Number of Groups: 0 +vtnet0               Up        10.0.12.2                     30    0  10.0.12.2      1 
-Number of Cache MIRRORs: 0 +vtnet1               Up        10.0.23.2                     30    1  10.0.23.3      1 
-------------------------------------------------------------------------------+ 
 +PIM Neighbor Table 
 +Interface         Address            Priority  Mode  Uptime/Expires 
 +vtnet1               10.0.23.3                  DR    0h2m51s/0h1m25s 
 + 
 +Multicast Routing Table 
 +Source            Group            RP Address       Flags 
 +10.0.12.1         239.1.1.1        10.0.23.2        SG 
 + 
 + 
 +Number of Groups        1 
 +Number of Cache MIRRORs : 0 
 + 
 +PIM Candidate Rendez-Vous Point Table 
 +Group Address     RP Address       Prio  Holdtime  Expires 
 +232.0.0.0/      169.254.0.1           Forever  Never 
 +224.0.0.0/      10.0.23.2                 150  0h1m45s 
 + 
 +Current BSR address: 10.0.23.3 
 + 
 +PIM Rendez-Vous Point Set Table 
 +Group Address     RP Address       Prio  Holdtime  Type 
 +232.0.0.0/      169.254.0.1           Forever  Static 
 +224.0.0.0/      10.0.23.2                 105  Dynamic
 </code> </code>
  
Line 218: Line 248:
  
 <code> <code>
-[root@VM3]~# pimd -r +root@VM3:~ # pimctl show
-Virtual Interface Table ====================================================== +
-Vif  Local Address    Subnet              Thresh  Flags      Neighbors +
----  ---------------  ------------------  ------  ---------  ----------------- +
-  0  10.0.23.3        10.0.23/24                DR PIM     10.0.23.2 +
-  1  10.0.34.254      10.0.34/24                DR NO-NBR +
-  2  10.0.23.3        register_vif0            1+
  
- Vif  SSM Group        Sources+PIM Interface Table 
 +Interface         State     Address            Priority  Hello  Nbr  DR Address      DR Priority 
 +vtnet1               Up        10.0.23.3                     30    1  10.0.23.3       1 
 +vtnet2               Up        10.0.34.3                     30    0  10.0.34.3       1
  
-Multicast Routing Table ====================================================== +PIM Neighbor Table 
---------------------------------- (*,*,G) ------------------------------------ +Interface         Address            Priority  Mode  Uptime/Expires 
-Number of Groups: 0 +vtnet1               10.0.23.2                        0h3m55s/0h1m15s 
-Number of Cache MIRRORs: 0 + 
-------------------------------------------------------------------------------+Multicast Routing Table 
 +Source            Group            RP Address       Flags 
 + 
 +Number of Groups        : 0 
 +Number of Cache MIRRORs : 0 
 + 
 +PIM Candidate Rendez-Vous Point Table 
 +Group Address     RP Address       Prio  Holdtime  Expires 
 +232.0.0.0/      169.254.0.1           Forever  Never 
 +224.0.0.0/      10.0.23.2                 150  0h2m25s 
 + 
 +Current BSR address: 10.0.23.3 
 + 
 +PIM Rendez-Vous Point Set Table 
 +Group Address     RP Address       Prio  Holdtime  Type 
 +232.0.0.0/      169.254.0.1           Forever  Static 
 +224.0.0.0/      10.0.23.2                 145  Dynamic
 </code> </code>
  
Line 242: Line 285:
 <code> <code>
 [root@VM2]~# ifmcstat [root@VM2]~# ifmcstat
-em0:+vtnet0:
         inet 10.0.12.2         inet 10.0.12.2
         igmpv2         igmpv2
Line 265: Line 308:
                 group ff02:1::1:ff00:212 refcnt 1                 group ff02:1::1:ff00:212 refcnt 1
                         mcast-macaddr 33:33:ff:00:02:12 refcnt 1                         mcast-macaddr 33:33:ff:00:02:12 refcnt 1
-em1:+vtnet1:
         inet 10.0.23.2         inet 10.0.23.2
         igmpv2         igmpv2
Line 369: Line 412:
 PIM daemon should be updated: PIM daemon should be updated:
 <code> <code>
-[root@VM2]~# pimd -r +[root@VM2]~# pimctl -r 
-Virtual Interface Table ====================================================== +pimctl: Sending cmd show: No error: 0
-Vif  Local Address    Subnet              Thresh  Flags      Neighbors +
----  ---------------  ------------------  ------  ---------  ----------------- +
-  0  10.0.12.254      10.0.12/24                DR NO-NBR +
-  1  10.0.23.2        10.0.23/24                PIM        10.0.23.3 +
-  2  10.0.12.254      register_vif0            1+
  
- Vif  SSM Group        Sources+PIM Interface Table 
 +Interface         State     Address            Priority  Hello  Nbr  DR Address      DR Priority 
 +vtnet0            Up        10.0.12.2                     30    0  10.0.12.2                 1 
 +vtnet1            Up        10.0.23.2                     30    1  10.0.23.3                 1
  
-Multicast Routing Table ====================================================== +PIM Neighbor Table 
------------------------------------ (S,G) ------------------------------------ +Interface         Address            Priority  Mode  Uptime/Expires 
-Source           Group            RP Address       Flags +vtnet1            10.0.23.3                  DR    0h8m36s/0h1m40s
----------------  ---------------  ---------------  --------------------------- +
-10.0.12.1        239.1.1.1        10.0.23.2        SG +
-Joined   oifs: ... +
-Pruned   oifs: ... +
-Leaves   oifs: ... +
-Asserted oifs: ... +
-Outgoing oifs: ... +
-Incoming     : I..+
  
-TIMERS:  Entry    JP    RS  Assert VIFS:  0  1  2 +Multicast Routing Table 
-             0               0        0   0 +Source            Group            RP Address       Flags 
---------------------------------- (*,*,G) ------------------------------------ +10.0.12.1         239.1.1.1        10.0.23.2        SPT SG 
-Number of Groups: 1 + 
-Number of Cache MIRRORs: 0 +Number of Groups        : 1 
-------------------------------------------------------------------------------+Number of Cache MIRRORs : 0 
 + 
 +PIM Candidate Rendez-Vous Point Table 
 +Group Address     RP Address       Prio  Holdtime  Expires 
 +232.0.0.0/      169.254.0.1           Forever  Never 
 +224.0.0.0/      10.0.23.2                 150  0h2m0s 
 + 
 +Current BSR address: 10.0.23.3 
 + 
 +PIM Rendez-Vous Point Set Table 
 +Group Address     RP Address       Prio  Holdtime  Type 
 +232.0.0.0/      169.254.0.1           Forever  Static 
 +224.0.0.0/      10.0.23.2                 120  Dynamic
 </code> </code>
  
Line 406: Line 451:
 IPv4 Virtual Interface Table IPv4 Virtual Interface Table
  Vif   Thresh   Local-Address   Remote-Address    Pkts-In   Pkts-Out  Vif   Thresh   Local-Address   Remote-Address    Pkts-In   Pkts-Out
-  0           10.0.12.254                             0          0 +  0           10.0.12.2                               0          0 
-  1           10.0.23.2                               0          0 +  1           10.0.12.2                           18267          0 
-  2           10.0.12.254                                      0+  2           10.0.23.2                                    18267
  
 IPv4 Multicast Forwarding Table IPv4 Multicast Forwarding Table
Line 421: Line 466:
 </code> </code>
  
-VM2 had update its mroute table for adding a source for group 239.1.1.1 comming from '65535'??.+VM2 had update its mroute table for adding a source for group 239.1.1.1 coming from '65535'??.
  
 ==== 3. Start a mcast receiver (IPerf server) on VM4 ==== ==== 3. Start a mcast receiver (IPerf server) on VM4 ====
Line 457: Line 502:
  
 <code> <code>
-[root@VM3]~# pimd -r                                                                                                                 [9/367] +[root@VM3]~# pimctl -d 
-Virtual Interface Table ====================================================== +pimctl: Sending cmd show: No error: 0
-Vif  Local Address    Subnet              Thresh  Flags      Neighbors +
----  ---------------  ------------------  ------  ---------  ----------------- +
-  0  10.0.23.3        10.0.23/24                DR PIM     10.0.23.2 +
-  1  10.0.34.254      10.0.34/24                DR NO-NBR +
-  2  10.0.23.3        register_vif0            1+
  
- Vif  SSM Group        Sources+PIM Interface Table 
 +Interface         State     Address            Priority  Hello  Nbr  DR Address      DR Priority 
 +vtnet1            Up        10.0.23.3                     30    1  10.0.23.3                 1 
 +vtnet2            Up        10.0.34.3                     30    0  10.0.34.3                 1
  
-Multicast Routing Table ====================================================== +PIM Neighbor Table 
------------------------------------ (*,G) ------------------------------------ +Interface         Address            Priority  Mode  Uptime/Expires 
-Source           Group            RP Address       Flags +vtnet1            10.0.23.2                 1        0h14m40s/0h1m35s
----------------  ---------------  ---------------  --------------------------- +
-INADDR_ANY       239.1.1.1        10.0.23.2        WC RP CACHE +
-Joined   oifs: ... +
-Pruned   oifs: ... +
-Leaves   oifs: .l. +
-Asserted oifs: ... +
-Outgoing oifs: .o. +
-Incoming     : I..+
  
-TIMERS:  Entry    JP    RS  Assert VIFS:  0  1  2 +Multicast Routing Table 
-                50                  0  0  0 +Source            Group            RP Address       Flags 
------------------------------------ (S,G) ------------------------------------ +ANY               239.1.1.1        10.0.23.2        WC RP 
-Source           Group            RP Address       Flags +10.0.12.1         239.1.1.1        10.0.23.2        CACHE SG
----------------  ---------------  ---------------  --------------------------- +
-10.0.12.1        239.1.1.1        10.0.23.2        SG +
-Joined   oifs: ... +
-Pruned   oifs: ... +
-Leaves   oifs: .l. +
-Asserted oifs: ... +
-Outgoing oifs: .o. +
-Incoming     : I..+
  
-TIMERS:  Entry    JP    RS  Assert VIFS:   1  2 +Number of Groups        
-           200    55                   0  0 +Number of Cache MIRRORs : 1 
---------------------------------- (*,*,G) ------------------------------------ + 
-Number of Groups: +PIM Candidate Rendez-Vous Point Table 
-Number of Cache MIRRORs: 1 +Group Address     RP Address       Prio  Holdtime  Expires 
-------------------------------------------------------------------------------+232.0.0.0/      169.254.0.        1   Forever  Never 
 +224.0.0.0/4       10.0.23.2                 150  0h2m25s 
 + 
 +Current BSR address: 10.0.23.3 
 + 
 +PIM Rendez-Vous Point Set Table 
 +Group Address     RP Address       Prio  Holdtime  Type 
 +232.0.0.0/      169.254.0.        1   Forever  Static 
 +224.0.0.0/      10.0.23.2                 145  Dynamic                                                                                                               
 </code> </code>
  
Line 504: Line 539:
 <code> <code>
 [root@VM3]~# netstat -g [root@VM3]~# netstat -g
- 
 IPv4 Virtual Interface Table IPv4 Virtual Interface Table
  Vif   Thresh   Local-Address   Remote-Address    Pkts-In   Pkts-Out  Vif   Thresh   Local-Address   Remote-Address    Pkts-In   Pkts-Out
-  0           10.0.23.3                             157          0 +  0           10.0.23.3                               0          0 
-  1           10.0.34.254                                    157 +  1           10.0.23.3                           30739          
-  2           10.0.23.3                                        0+  2           10.0.34.3                                    29215
  
 IPv4 Multicast Forwarding Table IPv4 Multicast Forwarding Table
  Origin          Group             Packets In-Vif  Out-Vifs:Ttls  Origin          Group             Packets In-Vif  Out-Vifs:Ttls
- 10.0.12.1       239.1.1.1             157    0    1:1+ 10.0.12.1       239.1.1.1           29215       2:1
  
  
documentation/examples/multicast_with_pim-sm.1573222720.txt.gz · Last modified: 2019/11/08 15:18 by olivier

Except where otherwise noted, content on this wiki is licensed under the following license: BSD 2-Clause
Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki