documentation:examples:multicast_with_pim-sm
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:examples:multicast_with_pim-sm [2019/11/08 10:45] – [Router 3] olivier | documentation: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: | More information on these BSDRP lab scripts available on [[documentation: | ||
| - | Start the lab with 4 routers | + | Start the lab with 4 routers: |
| < | < | ||
| - | tools/ | + | tools/ |
| - | BSD Router Project (http:// | + | BSD Router Project (https:// |
| Setting-up a virtual lab with 4 VM(s): | Setting-up a virtual lab with 4 VM(s): | ||
| - | - Working directory: /root/ | + | - Working directory: /home/ |
| - | - Each VM has 1 core and 512M RAM | + | - Each VM has a total of 1 (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 |
| - | - em1 connected to VM 3 | + | - vtnet1 |
| - | - em2 connected to VM 4 | + | - vtnet2 |
| VM 2 has the following NIC: | VM 2 has the following NIC: | ||
| - | - em0 connected to VM 1 | + | - vtnet0 |
| - | - em1 connected to VM 3 | + | - vtnet1 |
| - | - em2 connected to VM 4 | + | - vtnet2 |
| VM 3 has the following NIC: | VM 3 has the following NIC: | ||
| - | - em0 connected to VM 1 | + | - vtnet0 |
| - | - em1 connected to VM 2 | + | - vtnet1 |
| - | - em2 connected to VM 4 | + | - vtnet2 |
| VM 4 has the following NIC: | VM 4 has the following NIC: | ||
| - | - em0 connected to VM 1 | + | - vtnet0 |
| - | - em1 connected to VM 2 | + | - vtnet1 |
| - | - em2 connected to VM 3 | + | - vtnet2 |
| To connect VM' | To connect VM' | ||
| - | - VM 1 : cu -l / | + | - VM 1 : sudo cu -l / |
| - | - VM 2 : cu -l / | + | - VM 2 : sudo cu -l / |
| - | - VM 3 : cu -l / | + | - VM 3 : sudo cu -l / |
| - | - VM 4 : cu -l / | + | - VM 4 : sudo cu -l / |
| </ | </ | ||
| Line 64: | Line 65: | ||
| | | ||
| | | ||
| - | ifconfig_em0="inet 10.0.12.1/ | + | ifconfig_vtnet0="inet 10.0.12.1/ |
| | | ||
| service hostname restart | service hostname restart | ||
| Line 77: | Line 78: | ||
| < | < | ||
| sysrc hostname=VM2 \ | sysrc hostname=VM2 \ | ||
| - | ifconfig_em0="inet 10.0.12.254/ | + | ifconfig_vtnet0="inet 10.0.12.254/ |
| - | ifconfig_em1="inet 10.0.23.2/ | + | ifconfig_vtnet1="inet 10.0.23.2/ |
| | | ||
| | | ||
| Line 100: | Line 101: | ||
| < | < | ||
| sysrc hostname=VM3 \ | sysrc hostname=VM3 \ | ||
| - | ifconfig_em1="inet 10.0.23.3/ | + | ifconfig_vtnet1="inet 10.0.23.3/ |
| - | ifconfig_em2="inet 10.0.34.254/ | + | ifconfig_vtnet2="inet 10.0.34.254/ |
| | | ||
| | | ||
| Line 122: | Line 123: | ||
| | | ||
| | | ||
| - | ifconfig_em2="inet 10.0.34.4/ | + | ifconfig_vnet2="inet 10.0.34.4/ |
| | | ||
| - | hostname | + | service |
| service netif restart | service netif restart | ||
| service routing restart | service routing restart | ||
| Line 130: | Line 131: | ||
| </ | </ | ||
| + | ===== Checking NIC drivers and Bhyve compatibility with multicast ===== | ||
| + | |||
| + | Before to star with advanced routing setup, just start to test simple multicast between 2 relatives host: Some NIC (vtnet) or some hypervisors network setup aren't compliant with very simple multicast. | ||
| + | |||
| + | On VM1, start a mcast generator (client emitting mcast): | ||
| + | < | ||
| + | [root@VM1]~# | ||
| + | ------------------------------------------------------------ | ||
| + | Client connecting to 239.1.1.1, UDP port 5001 | ||
| + | Sending 1470 byte datagrams, IPG target: 11215.21 us (kalman adjust) | ||
| + | Setting multicast TTL to 32 | ||
| + | UDP buffer size: 9.00 KByte (default) | ||
| + | ------------------------------------------------------------ | ||
| + | [ 3] local 10.0.12.1 port 46636 connected with 239.1.1.1 port 5001 | ||
| + | [ ID] Interval | ||
| + | [ 3] 0.0- 1.0 sec 131 KBytes | ||
| + | [ 3] 1.0- 2.0 sec 128 KBytes | ||
| + | [ 3] 2.0- 3.0 sec 128 KBytes | ||
| + | [ 3] 0.0- 3.5 sec 446 KBytes | ||
| + | [ 3] Sent 311 datagrams | ||
| + | (...) | ||
| + | </ | ||
| + | |||
| + | On the direct connected VM2, start to check if in non-promiscious mode it sees mcast packets comming: | ||
| + | < | ||
| + | [root@VM2]~# | ||
| + | tcpdump: verbose output suppressed, use -v or -vv for full protocol decode | ||
| + | listening on vtnet0, link-type EN10MB (Ethernet), capture size 262144 bytes | ||
| + | 15: | ||
| + | 15: | ||
| + | 2 packets captured | ||
| + | 2 packets received by filter | ||
| + | 0 packets dropped by kernel | ||
| + | </ | ||
| + | |||
| + | => 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 | ||
| + | |||
| + | < | ||
| + | [root@VM2]~# | ||
| + | ------------------------------------------------------------ | ||
| + | Server listening on UDP port 5001 | ||
| + | Binding to local address 239.1.1.1 | ||
| + | Joining multicast group 239.1.1.1 | ||
| + | Receiving 1470 byte datagrams | ||
| + | UDP buffer size: 41.1 KByte (default) | ||
| + | ------------------------------------------------------------ | ||
| + | [ 3] local 239.1.1.1 port 5001 connected with 192.168.100.149 port 35181 | ||
| + | [ ID] Interval | ||
| + | [ 3] 0.0- 1.0 sec 129 KBytes | ||
| + | [ 3] 1.0- 2.0 sec 128 KBytes | ||
| + | [ 3] 2.0- 3.0 sec 128 KBytes | ||
| + | [ 3] 3.0- 4.0 sec 128 KBytes | ||
| + | [ 3] 4.0- 5.0 sec 128 KBytes | ||
| + | [ 3] 5.0- 6.0 sec 129 KBytes | ||
| + | [ 3] 6.0- 7.0 sec 128 KBytes | ||
| + | (...) | ||
| + | </ | ||
| + | => Notice the mcast receiver is correctly receiving at 1Mb/s. | ||
| + | |||
| + | Here is a non working example (here because source interface not given, and it uses the other one): | ||
| + | < | ||
| + | [root@VM2]~# | ||
| + | ------------------------------------------------------------ | ||
| + | Server listening on UDP port 5001 | ||
| + | Binding to local address 239.1.1.1 | ||
| + | Joining multicast group 239.1.1.1 | ||
| + | Receiving 1470 byte datagrams | ||
| + | UDP buffer size: 41.1 KByte (default) | ||
| + | ------------------------------------------------------------ | ||
| + | (...) | ||
| + | </ | ||
| + | |||
| + | => Here it doesn' | ||
| ===== Checking pimd behavior ===== | ===== Checking pimd behavior ===== | ||
| Line 137: | Line 212: | ||
| < | < | ||
| - | [root@VM2]~# pimd -r | + | |
| - | Virtual | + | root@VM2:~ # pimctl show |
| - | Vif Local address | + | |
| - | | + | PIM Interface Table |
| - | 1 10.0.23.2 10.0.23/24 | + | Interface |
| - | 2 10.0.12.2 register_vif0 | + | vtnet0 |
| + | vtnet1 | ||
| + | |||
| + | PIM Neighbor Table | ||
| + | Interface | ||
| + | vtnet1 | ||
| Multicast Routing Table | Multicast Routing Table | ||
| - | Source | + | Source |
| - | --------------------------(*, | + | 10.0.12.1 |
| - | Number of Groups: | + | |
| - | Number of Cache MIRRORs: 0 | + | |
| + | Number of Groups | ||
| + | Number of Cache MIRRORs : 0 | ||
| + | |||
| + | PIM Candidate Rendez-Vous Point Table | ||
| + | Group Address | ||
| + | 232.0.0.0/ | ||
| + | 224.0.0.0/ | ||
| + | |||
| + | Current BSR address: 10.0.23.3 | ||
| + | |||
| + | PIM Rendez-Vous Point Set Table | ||
| + | Group Address | ||
| + | 232.0.0.0/ | ||
| + | 224.0.0.0/ | ||
| </ | </ | ||
| - | => VM2 sees VM3 | + | => VM2 sees VM3 as PIM neighbor |
| < | < | ||
| - | [root@VM3]~# pimd -r | + | root@VM3:~ # pimctl show |
| - | Virtual | + | |
| - | Vif Local address | + | PIM Interface Table |
| - | | + | Interface |
| - | 1 10.0.34.3 | + | vtnet1 |
| - | 2 | + | vtnet2 |
| + | |||
| + | PIM Neighbor Table | ||
| + | Interface | ||
| + | vtnet1 | ||
| Multicast Routing Table | Multicast Routing Table | ||
| - | Source | + | Source |
| - | --------------------------(*, | + | |
| - | Number of Groups: 0 | + | Number of Groups |
| - | Number of Cache MIRRORs: 0 | + | Number of Cache MIRRORs : 0 |
| + | |||
| + | PIM Candidate Rendez-Vous Point Table | ||
| + | Group Address | ||
| + | 232.0.0.0/ | ||
| + | 224.0.0.0/ | ||
| + | |||
| + | Current BSR address: 10.0.23.3 | ||
| + | |||
| + | PIM Rendez-Vous Point Set Table | ||
| + | Group Address | ||
| + | 232.0.0.0/ | ||
| + | 224.0.0.0/ | ||
| </ | </ | ||
| - | => VM3 sees VM2. | + | => VM3 sees VM2 as PIM Designated Router neighbor. |
| ==== Does PIM daemon locally register to PIM mcast group ? ==== | ==== Does PIM daemon locally register to PIM mcast group ? ==== | ||
| Line 175: | Line 285: | ||
| < | < | ||
| [root@VM2]~# | [root@VM2]~# | ||
| - | em0: | + | vtnet0: |
| inet 10.0.12.2 | inet 10.0.12.2 | ||
| igmpv2 | igmpv2 | ||
| Line 198: | Line 308: | ||
| group ff02: | group ff02: | ||
| mcast-macaddr 33: | mcast-macaddr 33: | ||
| - | em1: | + | vtnet1: |
| inet 10.0.23.2 | inet 10.0.23.2 | ||
| igmpv2 | igmpv2 | ||
| Line 302: | Line 412: | ||
| PIM daemon should be updated: | PIM daemon should be updated: | ||
| < | < | ||
| - | [root@VM2]~# | + | [root@VM2]~# |
| - | Virtual Interface Table ====================================================== | + | pimctl: Sending cmd show: No error: |
| - | Vif Local Address | + | |
| - | --- --------------- | + | |
| - | 0 10.0.12.2 | + | |
| - | 1 10.0.23.2 | + | |
| - | 2 10.0.12.2 register_vif0 | + | |
| - | Vif SSM Group Sources | + | PIM Interface Table |
| + | Interface | ||
| + | vtnet0 | ||
| + | vtnet1 | ||
| - | Multicast Routing | + | PIM Neighbor |
| - | ----------------------------------- (S,G) ------------------------------------ | + | Interface |
| - | Source | + | vtnet1 |
| - | --------------- | + | |
| - | 10.0.12.1 | + | |
| - | Joined | + | |
| - | Pruned | + | |
| - | Leaves | + | |
| - | Asserted oifs: ... | + | |
| - | Outgoing oifs: ..o | + | |
| - | Incoming | + | |
| - | TIMERS: | + | Multicast Routing Table |
| - | 180 35 | + | Source |
| - | --------------------------------- (*,*,G) ------------------------------------ | + | 10.0.12.1 |
| - | Number of Groups: 1 | + | |
| - | Number of Cache MIRRORs: 1 | + | Number of Groups |
| - | ------------------------------------------------------------------------------ | + | Number of Cache MIRRORs : 0 |
| + | |||
| + | PIM Candidate Rendez-Vous Point Table | ||
| + | Group Address | ||
| + | 232.0.0.0/ | ||
| + | 224.0.0.0/ | ||
| + | |||
| + | Current BSR address: 10.0.23.3 | ||
| + | |||
| + | PIM Rendez-Vous Point Set Table | ||
| + | Group Address | ||
| + | 232.0.0.0/ | ||
| + | 224.0.0.0/ | ||
| </ | </ | ||
| Line 339: | Line 451: | ||
| IPv4 Virtual Interface Table | IPv4 Virtual Interface Table | ||
| | | ||
| - | 0 | + | 0 |
| - | 1 | + | 1 |
| - | 2 | + | 2 |
| IPv4 Multicast Forwarding Table | IPv4 Multicast Forwarding Table | ||
| | | ||
| - | | + | |
| Line 351: | Line 463: | ||
| IPv6 Multicast Forwarding Table is empty | IPv6 Multicast Forwarding Table is empty | ||
| + | |||
| </ | </ | ||
| - | VM2 had update its mroute table for adding a source for group 239.1.1.1 | + | VM2 had update its mroute table for adding a source for group 239.1.1.1 |
| ==== 3. Start a mcast receiver (IPerf server) on VM4 ==== | ==== 3. Start a mcast receiver (IPerf server) on VM4 ==== | ||
| Line 389: | Line 502: | ||
| < | < | ||
| - | [root@VM3]~# | + | [root@VM3]~# |
| - | Virtual Interface Table ====================================================== | + | pimctl: Sending cmd show: No error: |
| - | Vif Local Address | + | |
| - | --- --------------- | + | |
| - | 0 10.0.23.3 | + | |
| - | 1 10.0.34.3 | + | |
| - | 2 10.0.23.3 register_vif0 | + | |
| - | Vif SSM Group Sources | + | PIM Interface Table |
| + | Interface | ||
| + | vtnet1 | ||
| + | vtnet2 | ||
| - | Multicast Routing | + | PIM Neighbor |
| - | ----------------------------------- (*,G) ------------------------------------ | + | Interface |
| - | Source | + | vtnet1 |
| - | --------------- | + | |
| - | INADDR_ANY | + | |
| - | Joined | + | |
| - | Pruned | + | |
| - | Leaves | + | |
| - | Asserted oifs: ... | + | |
| - | Outgoing oifs: .o. | + | |
| - | Incoming | + | |
| - | TIMERS: | + | Multicast Routing Table |
| - | | + | Source |
| - | ----------------------------------- (S,G) ------------------------------------ | + | ANY |
| - | Source | + | 10.0.12.1 |
| - | --------------- | + | |
| - | 10.0.12.1 | + | Number of Groups |
| - | Joined | + | Number of Cache MIRRORs : 1 |
| - | Pruned | + | |
| - | Leaves | + | PIM Candidate Rendez-Vous Point Table |
| - | Asserted oifs: ... | + | Group Address |
| - | Outgoing oifs: .o. | + | 232.0.0.0/8 169.254.0.1 |
| - | Incoming | + | 224.0.0.0/4 10.0.23.2 |
| + | |||
| + | Current BSR address: 10.0.23.3 | ||
| - | TIMERS: | + | PIM Rendez-Vous Point Set Table |
| - | 195 50 0 | + | Group Address |
| - | --------------------------------- (*,*,G) ------------------------------------ | + | 232.0.0.0/8 |
| - | Number of Groups: 1 | + | 224.0.0.0/4 10.0.23.2 |
| - | Number of Cache MIRRORs: 1 | + | |
| - | ------------------------------------------------------------------------------ | + | |
| </ | </ | ||
| Line 436: | Line 539: | ||
| < | < | ||
| [root@VM3]~# | [root@VM3]~# | ||
| - | |||
| IPv4 Virtual Interface Table | IPv4 Virtual Interface Table | ||
| | | ||
| - | 0 | + | 0 |
| - | 1 | + | 1 |
| - | 2 | + | 2 |
| IPv4 Multicast Forwarding Table | IPv4 Multicast Forwarding Table | ||
| | | ||
| - | | + | |
| Line 451: | Line 553: | ||
| IPv6 Multicast Forwarding Table is empty | IPv6 Multicast Forwarding Table is empty | ||
| - | |||
| </ | </ | ||
| - | VM3 correctly learn that there is a subscriber to group 239.1.1.1 on interface vif1 (toward VM4). | + | VM3 correctly learn that there is a subscriber to group 239.1.1.1 on interface vif1 (toward VM4) and the source is on vif0 (toward VM2). |
documentation/examples/multicast_with_pim-sm.1573206359.txt.gz · Last modified: 2019/11/08 10:45 by olivier
