troglobit / pimd

PIM-SM/SSM multicast routing for UNIX and Linux
http://troglobit.com/projects/pimd/
BSD 3-Clause "New" or "Revised" License
194 stars 86 forks source link

Odd SPT switchover bug in simple 2 router topology #143

Closed zhuguoguo closed 5 years ago

zhuguoguo commented 5 years ago

image

like that, I run the pimd from pimd-master in linux, the interface with 3.3.3.1 is RP

  1. when the pc1 as sender, and the pc2 as receiver the mrt in pim1,pim2 is odd: (eth0: 2.2.2.1, eth2: 3.3.3.1) pim1: (2.2.2.2, 224.1.2.3) Iif: eth0 Oif: pimreg pim1: (2.2.2.2, 224.1.2.3) Iif: pimreg Oif: eth2 at the same time, pim1 send pim register to pim2 for ever, and pim2 also can get pim register, but pc2 can not get the packet.

  2. when the pc1 as receiver, and the pc2 as sender it's all right

Any help would be much appreciated : )

troglobit commented 5 years ago

Sorry, cannot reproduce. The register tunnel is only used until the SPT switchover point.

Are you sure you've set the TTL correct on the sender?

zhuguoguo commented 5 years ago

TTL is 64 on the sender.

zhuguoguo commented 5 years ago

i run the pimd with command './pimd -f ./pimd.conf -n -d all'

  1. the log on the pim1: pimd-master/src>./pimd -f ../pimd.conf -n -d all debug level 0xffffffffffffffff (dvmrp_detail, dvmrp_prunes, dvmrp_pruning, dvmrp_routes, dvmrp_routing, dvmrp_mrt, dvmrp_neighbors, dvmrp_peers, dvmrp_hello, dvmrp_timers, dvmrp, igmp_proto, igmp_timers, igmp_members, groups, membership, igmp, trace, mtrace, traceroute, timeout, callout, packets, pkt, interfaces, vif, kernel, cache, mfc, k_cache, k_mfc, rsrr, pim_detail, pim_hel) 20:21:18.924 pimd version 3.0-beta1 starting ... 20:21:18.925 Got 262144 byte send buffer size in 0 iterations 20:21:18.925 Got 262144 byte recv buffer size in 0 iterations 20:21:18.925 Got 262144 byte send buffer size in 0 iterations 20:21:18.925 Got 262144 byte recv buffer size in 0 iterations 20:21:18.925 Binding IPC socket to /usr/local/var/run/pimd/pimd.sock 20:21:18.925 Ignoring lo, has invalid address 127.0.0.1 and/or netmask 255.0.0.0 20:21:18.925 VIF #0: Installing eth0 (2.2.2.1 on subnet 2.2.2/24) rate 0 20:21:18.925 VIF #1: Installing eth1 (1.1.1.1 on subnet 1.1.1/24) rate 0 20:21:18.925 phyint eth3 (192.168.90.241) disabled, skipping VIF 20:21:18.925 ../pimd.conf:131 - Unknown phyint name or invalid address 'eth2', skipping. 20:21:18.925 ../pimd.conf:132 - Unknown phyint name or invalid address 'eth3', skipping. 20:21:18.925 Local Cand-BSR address 2.2.2.1, priority 5, interval 30 sec 20:21:18.925 Local Cand-RP address 2.2.2.1, priority 20, interval 30 sec 20:21:18.925 spt-threshold packets 0 interval 100 20:21:18.925 Local static RP: 169.254.0.1, group 232.0.0.0/8 20:21:18.925 IGMP query interval : 125 sec 20:21:18.925 IGMP querier timeout : 380 sec 20:21:18.925 VIF #0: now in service, interface eth0 UP 20:21:18.926 query_groups(): Sending IGMP v3 query on eth0 20:21:18.926 Send IGMP Membership Query from 2.2.2.1 to 224.0.0.1 20:21:18.926 SENT 36 bytes IGMP Membership Query from 2.2.2.1 to 224.0.0.1 20:21:18.926 SENT 46 bytes PIM v2 Hello from 2.2.2.1 to 224.0.0.13 20:21:18.926 VIF #1: now in service, interface eth1 UP 20:21:18.926 query_groups(): Sending IGMP v3 query on eth1 20:21:18.926 Send IGMP Membership Query from 1.1.1.1 to 224.0.0.1 20:21:18.926 SENT 36 bytes IGMP Membership Query from 1.1.1.1 to 224.0.0.1 20:21:18.926 SENT 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:21:18.926 VIF #2: now in service, interface register_vif0 UP 20:21:18.926 Received IGMP Membership Query from 2.2.2.1 to 224.0.0.1 20:21:18.926 RECV 46 bytes PIM v2 Hello from 2.2.2.1 to 224.0.0.13 20:21:18.926 Received IGMP Membership Query from 1.1.1.1 to 224.0.0.1 20:21:18.926 RECV 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:21:18.928 Received IGMP v3 Membership Report from 2.2.2.1 to 224.0.0.22 20:21:18.928 accept_membership_report(): IGMP v3 report, 32 bytes, from 2.2.2.1 to 224.0.0.22 with 3 group records. 20:21:18.928 Received IGMP v3 Membership Report from 1.1.1.1 to 224.0.0.22 20:21:18.928 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.1 to 224.0.0.22 with 3 group records. 20:21:19.545 Cache miss, src 2.2.2.2, dst 224.1.2.3, iif 0 20:21:19.545 create group entry, group 224.1.2.3 20:21:23.005 Received IGMP v3 Membership Report from 1.1.1.1 to 224.0.0.22 20:21:23.005 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.1 to 224.0.0.22 with 3 group records. 20:21:23.638 Received IGMP Membership Query from 1.1.1.2 to 224.0.0.1 20:21:23.639 RECV 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:21:23.639 PIM HELLO holdtime from 1.1.1.2 is 105 20:21:23.639 PIM DR PRIORITY from 1.1.1.2 is 1 20:21:23.639 PIM GenID from 1.1.1.2 is 1201029103 20:21:23.639 Received PIM HELLO from new neighbor 1.1.1.2 20:21:23.639 SENT 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:21:23.639 SEND 34 bytes PIM v2 Bootstrap from 1.1.1.1 to 1.1.1.2 ... 20:21:23.639 Sending unicast: len = 34, frag 0, mtu 1500, to 1.1.1.2 20:21:23.639 000: 45 00 00 22 00 04 00 00 :: FF 67 00 00 01 01 01 01 20:21:23.639 010: 01 01 01 02 24 00 14 C2 :: A4 35 1E 05 01 00 02 02 20:21:23.639 020: 02 01 20:21:23.639 SENT 34 bytes PIM v2 Bootstrap from 1.1.1.1 to 1.1.1.2 20:21:23.639 All routers in 1.1.1.1 segment support DR Priority based DR election. 20:21:23.639 Using fallback DR election on 1.1.1.1. 20:21:23.639 We lost DR role on 1.1.1.1 in election. 20:21:23.639 RECV 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:21:23.639 RECV 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:21:23.639 PIM HELLO holdtime from 1.1.1.2 is 105 20:21:23.639 PIM DR PRIORITY from 1.1.1.2 is 1 20:21:23.639 PIM GenID from 1.1.1.2 is 1201029103 20:21:23.639 RECV 34 bytes PIM v2 Bootstrap from 1.1.1.2 to 1.1.1.1 20:21:23.639 Received PIM Bootstrap candidate 3.3.3.1, priority 5 20:21:23.640 Received IGMP v3 Membership Report from 1.1.1.2 to 224.0.0.22 20:21:23.640 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.2 to 224.0.0.22 with 3 group records. 20:21:24.195 Received IGMP v3 Membership Report from 1.1.1.2 to 224.0.0.22 20:21:24.195 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.2 to 224.0.0.22 with 3 group records. 20:21:24.195 SEND 34 bytes PIM v2 Cand. RP Adv. from 2.2.2.1 to 3.3.3.1 ... 20:21:24.195 Sending unicast: len = 34, frag 0, mtu 0, to 3.3.3.1 20:21:24.195 000: 45 00 00 22 00 05 00 00 :: FF 67 00 00 02 02 02 01 20:21:24.195 010: 03 03 03 01 28 00 D2 9D :: 00 14 00 4B 01 00 02 02 20:21:24.195 020: 02 01 20:21:24.195 SENT 34 bytes PIM v2 Cand. RP Adv. from 2.2.2.1 to 3.3.3.1 20:21:24.557 RECV 54 bytes PIM v2 Join/Prune from 1.1.1.2 to 224.0.0.13 20:21:24.557 Received PIM JOIN/PRUNE from 1.1.1.2 on eth1 20:21:24.557 Received PIM JOIN from 1.1.1.2 to group 224.1.2.3 for multicast source 2.2.2.1 on eth1 20:21:27.294 Received IGMP v3 Membership Report from 2.2.2.1 to 224.0.0.22 20:21:27.294 accept_membership_report(): IGMP v3 report, 32 bytes, from 2.2.2.1 to 224.0.0.22 with 3 group records. 20:21:27.615 Received IGMP v3 Membership Report from 1.1.1.1 to 224.0.0.22 20:21:27.615 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.1 to 224.0.0.22 with 3 group records. 20:21:28.039 Received IGMP v3 Membership Report from 1.1.1.2 to 224.0.0.22 20:21:28.040 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.2 to 224.0.0.22 with 3 group records. 20:21:28.047 Received IGMP v3 Membership Report from 1.1.1.1 to 224.0.0.22 20:21:28.047 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.1 to 224.0.0.22 with 3 group records. 20:21:28.158 Received IGMP v3 Membership Report from 2.2.2.1 to 224.0.0.22 20:21:28.158 accept_membership_report(): IGMP v3 report, 32 bytes, from 2.2.2.1 to 224.0.0.22 with 3 group records. 20:21:30.554 Cache miss, src 2.2.2.2, dst 224.1.2.3, iif 0 20:21:30.554 create group entry, group 224.1.2.3 20:21:41.565 Cache miss, src 2.2.2.2, dst 224.1.2.3, iif 0 20:21:41.565 create group entry, group 224.1.2.3 20:21:52.574 Cache miss, src 2.2.2.2, dst 224.1.2.3, iif 0 20:21:52.574 create group entry, group 224.1.2.3 20:21:52.575 SENT 46 bytes PIM v2 Hello from 2.2.2.1 to 224.0.0.13 20:21:52.575 SENT 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:21:52.575 RECV 46 bytes PIM v2 Hello from 2.2.2.1 to 224.0.0.13 20:21:52.575 RECV 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:21:52.576 RECV 56 bytes PIM v2 Bootstrap from 1.1.1.2 to 224.0.0.13 20:21:52.576 Received PIM Bootstrap candidate 3.3.3.1, priority 5 20:21:52.576 NETLINK: ask path to 3.3.3.1 20:21:52.576 NETLINK: vif 1, ifindex=3 20:21:52.576 NETLINK: gateway is 1.1.1.2 20:21:52.576 New RP candidate 2.2.2.1 for group 224.0.0.0/4, priority 20 20:21:52.576 RECV 66 bytes PIM v2 Bootstrap from 1.1.1.2 to 224.0.0.13 20:21:52.576 Received PIM Bootstrap candidate 3.3.3.1, priority 5 20:21:52.576 NETLINK: ask path to 3.3.3.1 20:21:52.576 NETLINK: vif 1, ifindex=3 20:21:52.576 NETLINK: gateway is 1.1.1.2 20:21:52.576 NETLINK: ask path to 3.3.3.1 20:21:52.576 NETLINK: vif 1, ifindex=3 20:21:52.576 NETLINK: gateway is 1.1.1.2 20:21:52.576 For src 3.3.3.1, iif is 1, next hop router is 1.1.1.2 20:21:52.576 New RP candidate 3.3.3.1 for group 224.0.0.0/4, priority 20 20:22:03.585 Cache miss, src 2.2.2.2, dst 224.1.2.3, iif 0 20:22:03.585 create group entry, group 224.1.2.3 20:22:03.585 create source entry, source 2.2.2.2 20:22:03.585 move_kernel_cache: SG 20:22:03.585 move_kernel_cache: SG 20:22:03.585 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from eth0 to register_vif0 20:22:03.585 SEND 34 bytes PIM v2 Cand. RP Adv. from 2.2.2.1 to 3.3.3.1 ... 20:22:03.585 Sending unicast: len = 34, frag 0, mtu 0, to 3.3.3.1 20:22:03.585 000: 45 00 00 22 00 08 00 00 :: FF 67 00 00 02 02 02 01 20:22:03.585 010: 03 03 03 01 28 00 D2 9D :: 00 14 00 4B 01 00 02 02 20:22:03.585 020: 02 01 20:22:03.585 SENT 34 bytes PIM v2 Cand. RP Adv. from 2.2.2.1 to 3.3.3.1 20:22:03.586 NETLINK: ask path to 3.3.3.1 20:22:03.586 NETLINK: vif 1, ifindex=3 20:22:03.586 NETLINK: gateway is 1.1.1.2 20:22:03.586 For src 3.3.3.1, iif is 1, next hop router is 1.1.1.2 20:22:03.586 SEND 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 ... 20:22:03.586 Sending unicast: len = 85, frag 0, mtu 1500, to 3.3.3.1 20:22:03.586 000: 45 00 00 55 00 09 00 00 :: FF 67 00 00 02 02 02 01 20:22:03.586 010: 03 03 03 01 21 00 DE FF :: 00 00 00 00 45 00 00 39 20:22:03.586 020: F0 74 40 00 40 11 64 37 :: 02 02 02 02 E0 01 02 03 20:22:03.586 030: 8E BC 1F 40 00 25 1A F9 :: 48 65 6C 6C 6F 20 6D 75 20:22:03.586 030: 8E BC 1F 40 00 25 1A F9 :: 48 65 6C 6C 6F 20 6D 75 20:22:03.586 SENT 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:22:03.586 RECV 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:22:03.586 PIM HELLO holdtime from 1.1.1.2 is 105 20:22:03.586 PIM DR PRIORITY from 1.1.1.2 is 1 20:22:03.586 PIM GenID from 1.1.1.2 is 1201029103 20:22:04.586 SEND 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 ... 20:22:04.586 Sending unicast: len = 85, frag 0, mtu 1500, to 3.3.3.1 20:22:04.586 000: 45 00 00 55 00 0A 00 00 :: FF 67 00 00 02 02 02 01 20:22:04.586 010: 03 03 03 01 21 00 DE FF :: 00 00 00 00 45 00 00 39 20:22:04.586 020: F3 B7 40 00 40 11 60 F4 :: 02 02 02 02 E0 01 02 03 20:22:04.586 030: 8E BC 1F 40 00 25 1A F8 :: 48 65 6C 6C 6F 20 6D 75 20:22:04.586 030: 8E BC 1F 40 00 25 1A F8 :: 48 65 6C 6C 6F 20 6D 75 20:22:04.586 SENT 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:22:05.587 SEND 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 ... 20:22:05.587 Sending unicast: len = 85, frag 0, mtu 1500, to 3.3.3.1 20:22:05.587 000: 45 00 00 55 00 0B 00 00 :: FF 67 00 00 02 02 02 01 20:22:05.587 010: 03 03 03 01 21 00 DE FF :: 00 00 00 00 45 00 00 39 20:22:05.587 020: F6 66 40 00 40 11 5E 45 :: 02 02 02 02 E0 01 02 03 20:22:05.587 030: 8E BC 1F 40 00 25 1A F7 :: 48 65 6C 6C 6F 20 6D 75 20:22:05.587 030: 8E BC 1F 40 00 25 1A F7 :: 48 65 6C 6C 6F 20 6D 75 20:22:05.587 SENT 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:22:06.587 SEND 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 ...

  2. the log on the pim2: pimd-master/src>./pimd -f ../pimd.conf -n -d all debug level 0xffffffffffffffff (dvmrp_detail, dvmrp_prunes, dvmrp_pruning, dvmrp_routes, dvmrp_routing, dvmrp_mrt, dvmrp_neighbors, dvmrp_peers, dvmrp_hello, dvmrp_timers, dvmrp, igmp_proto, igmp_timers, igmp_members, groups, membership, igmp, trace, mtrace, traceroute, timeout, callout, packets, pkt, interfaces, vif, kernel, cache, mfc, k_cache, k_mfc, rsrr, pim_detail, pim_hel) 20:22:44.909 pimd version 3.0-beta1 starting ... 20:22:44.909 Got 262144 byte send buffer size in 0 iterations 20:22:44.909 Got 262144 byte recv buffer size in 0 iterations 20:22:44.909 Got 262144 byte send buffer size in 0 iterations 20:22:44.909 Got 262144 byte recv buffer size in 0 iterations 20:22:44.909 Binding IPC socket to /usr/local/var/run/pimd/pimd.sock 20:22:44.909 Ignoring lo, has invalid address 127.0.0.1 and/or netmask 255.0.0.0 20:22:44.909 VIF #0: Installing eth1 (1.1.1.2 on subnet 1.1.1/24) rate 0 20:22:44.910 VIF #1: Installing eth2 (3.3.3.1 on subnet 3.3.3/24) rate 0 20:22:44.910 phyint eth3 (192.168.90.242) disabled, skipping VIF 20:22:44.910 ../pimd.conf:131 - Unknown phyint name or invalid address 'eth0', skipping. 20:22:44.910 ../pimd.conf:132 - Unknown phyint name or invalid address 'eth3', skipping. 20:22:44.910 Local Cand-BSR address 3.3.3.1, priority 5, interval 30 sec 20:22:44.910 Local Cand-RP address 3.3.3.1, priority 20, interval 30 sec 20:22:44.910 spt-threshold packets 0 interval 100 20:22:44.910 Local static RP: 169.254.0.1, group 232.0.0.0/8 20:22:44.910 IGMP query interval : 125 sec 20:22:44.910 IGMP querier timeout : 380 sec 20:22:44.910 VIF #0: now in service, interface eth1 UP 20:22:44.910 query_groups(): Sending IGMP v3 query on eth1 20:22:44.910 Send IGMP Membership Query from 1.1.1.2 to 224.0.0.1 20:22:44.910 SENT 36 bytes IGMP Membership Query from 1.1.1.2 to 224.0.0.1 20:22:44.910 SENT 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:22:44.910 VIF #1: now in service, interface eth2 UP 20:22:44.910 query_groups(): Sending IGMP v3 query on eth2 20:22:44.910 Send IGMP Membership Query from 3.3.3.1 to 224.0.0.1 20:22:44.910 SENT 36 bytes IGMP Membership Query from 3.3.3.1 to 224.0.0.1 20:22:44.911 SENT 46 bytes PIM v2 Hello from 3.3.3.1 to 224.0.0.13 20:22:44.911 VIF #2: now in service, interface register_vif0 UP 20:22:44.911 Received IGMP Membership Query from 1.1.1.2 to 224.0.0.1 20:22:44.911 RECV 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:22:44.911 Received IGMP Membership Query from 3.3.3.1 to 224.0.0.1 20:22:44.911 RECV 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:22:44.911 PIM HELLO holdtime from 1.1.1.1 is 105 20:22:44.911 PIM DR PRIORITY from 1.1.1.1 is 1 20:22:44.911 PIM GenID from 1.1.1.1 is 1586616492 20:22:44.911 Received PIM HELLO from new neighbor 1.1.1.1 20:22:44.911 SENT 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:22:44.911 SEND 34 bytes PIM v2 Bootstrap from 1.1.1.2 to 1.1.1.1 ... 20:22:44.911 Sending unicast: len = 34, frag 0, mtu 1500, to 1.1.1.1 20:22:44.911 000: 45 00 00 22 00 04 00 00 :: FF 67 00 00 01 01 01 02 20:22:44.911 010: 01 01 01 01 24 00 10 42 :: A6 B4 1E 05 01 00 03 03 20:22:44.911 020: 03 01 20:22:44.911 SENT 34 bytes PIM v2 Bootstrap from 1.1.1.2 to 1.1.1.1 20:22:44.911 All routers in 1.1.1.2 segment support DR Priority based DR election. 20:22:44.911 Using fallback DR election on 1.1.1.2. 20:22:44.911 RECV 34 bytes PIM v2 Bootstrap from 1.1.1.1 to 1.1.1.2 20:22:44.911 RECV 46 bytes PIM v2 Hello from 3.3.3.1 to 224.0.0.13 20:22:44.911 RECV 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:22:44.912 Received IGMP v3 Membership Report from 1.1.1.2 to 224.0.0.22 20:22:44.912 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.2 to 224.0.0.22 with 3 group records. 20:22:44.912 Received IGMP v3 Membership Report from 3.3.3.1 to 224.0.0.22 20:22:44.912 accept_membership_report(): IGMP v3 report, 32 bytes, from 3.3.3.1 to 224.0.0.22 with 3 group records. 20:22:45.467 Received IGMP v3 Membership Report from 1.1.1.2 to 224.0.0.22 20:22:45.467 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.2 to 224.0.0.22 with 3 group records. 20:22:45.467 RECV 34 bytes PIM v2 Cand. RP Adv. from 2.2.2.1 to 3.3.3.1 20:22:45.468 NETLINK: ask path to 2.2.2.1 20:22:45.468 NETLINK: vif 0, ifindex=3 20:22:45.468 NETLINK: gateway is 1.1.1.1 20:22:45.468 For src 2.2.2.1, iif is 0, next hop router is 1.1.1.1 20:22:45.468 New RP candidate 2.2.2.1 for group 224.0.0.0/4, priority 20 20:22:45.828 Received IGMP v3 Membership Report from 3.3.3.2 to 224.0.0.22 20:22:45.828 accept_membership_report(): IGMP v3 report, 16 bytes, from 3.3.3.2 to 224.0.0.22 with 1 group records. 20:22:45.828 accept_group_report(): igmp_src 3.3.3.2 ssm_src 0.0.0.0 group 224.1.2.3 report_type 34 20:22:45.828 Set delete timer for group: 224.1.2.3 20:22:45.828 ASM group order from 3.3.3.2 (,224.1.2.3) 20:22:45.828 create group entry, group 224.1.2.3 20:22:45.828 Adding vif 1 for group 224.1.2.3 20:22:45.828 Send PIM JOIN/PRUNE from 1.1.1.2 on eth1 20:22:45.828 SENT 54 bytes PIM v2 Join/Prune from 1.1.1.2 to 224.0.0.13 20:22:45.828 RECV 54 bytes PIM v2 Join/Prune from 1.1.1.2 to 224.0.0.13 20:22:46.167 Received IGMP v3 Membership Report from 3.3.3.1 to 224.0.0.22 20:22:46.167 accept_membership_report(): IGMP v3 report, 32 bytes, from 3.3.3.1 to 224.0.0.22 with 3 group records. 20:22:47.527 Received IGMP v3 Membership Report from 3.3.3.1 to 224.0.0.22 20:22:47.527 accept_membership_report(): IGMP v3 report, 32 bytes, from 3.3.3.1 to 224.0.0.22 with 3 group records. 20:22:48.886 Received IGMP v3 Membership Report from 1.1.1.1 to 224.0.0.22 20:22:48.886 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.1 to 224.0.0.22 with 3 group records. 20:22:49.311 Received IGMP v3 Membership Report from 1.1.1.2 to 224.0.0.22 20:22:49.311 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.2 to 224.0.0.22 with 3 group records. 20:22:49.319 Received IGMP v3 Membership Report from 1.1.1.1 to 224.0.0.22 20:22:49.319 accept_membership_report(): IGMP v3 report, 32 bytes, from 1.1.1.1 to 224.0.0.22 with 3 group records. 20:23:13.847 RECV 46 bytes PIM v2 Hello from 1.1.1.1 to 224.0.0.13 20:23:13.847 PIM HELLO holdtime from 1.1.1.1 is 105 20:23:13.847 PIM DR PRIORITY from 1.1.1.1 is 1 20:23:13.847 PIM GenID from 1.1.1.1 is 1586616492 20:23:13.847 SENT 56 bytes PIM v2 Bootstrap from 1.1.1.2 to 224.0.0.13 20:23:13.847 SENT 56 bytes PIM v2 Bootstrap from 3.3.3.1 to 224.0.0.13 20:23:13.847 NETLINK: ask path to 2.2.2.1 20:23:13.847 NETLINK: vif 0, ifindex=3 20:23:13.847 NETLINK: gateway is 1.1.1.1 20:23:13.847 For src 2.2.2.1, iif is 0, next hop router is 1.1.1.1 20:23:13.847 New RP candidate 3.3.3.1 for group 224.0.0.0/4, priority 20 20:23:13.847 RP-set changed; Reducing bootstrap timer. 20:23:13.847 SENT 66 bytes PIM v2 Bootstrap from 1.1.1.2 to 224.0.0.13 20:23:13.848 SENT 66 bytes PIM v2 Bootstrap from 3.3.3.1 to 224.0.0.13 20:23:13.848 RECV 56 bytes PIM v2 Bootstrap from 1.1.1.2 to 224.0.0.13 20:23:13.848 RECV 56 bytes PIM v2 Bootstrap from 3.3.3.1 to 224.0.0.13 20:23:13.848 RECV 66 bytes PIM v2 Bootstrap from 1.1.1.2 to 224.0.0.13 20:23:13.848 RECV 66 bytes PIM v2 Bootstrap from 3.3.3.1 to 224.0.0.13 20:23:24.857 RECV 34 bytes PIM v2 Cand. RP Adv. from 2.2.2.1 to 3.3.3.1 20:23:24.858 SENT 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:23:24.858 SENT 46 bytes PIM v2 Hello from 3.3.3.1 to 224.0.0.13 20:23:24.858 RECV 46 bytes PIM v2 Hello from 1.1.1.2 to 224.0.0.13 20:23:24.858 RECV 46 bytes PIM v2 Hello from 3.3.3.1 to 224.0.0.13 20:23:24.858 RECV 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:23:24.858 Received PIM register: len = 65 from 2.2.2.1 20:23:24.858 find_route:(S,G) entry not found 20:23:24.858 find_route: No (S,G) entry. Return the (,G) entry 20:23:24.858 Received PIM REGISTER: src 2.2.2.1, group 224.1.2.3 20:23:24.858 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from register_vif0 to eth2 20:23:25.858 RECV 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:23:25.858 Received PIM register: len = 65 from 2.2.2.1 20:23:25.858 find_route:(S,G) entry not found 20:23:25.858 find_route: No (S,G) entry. Return the (,G) entry 20:23:25.858 Received PIM REGISTER: src 2.2.2.1, group 224.1.2.3 20:23:25.858 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from register_vif0 to eth2 20:23:25.858 NETLINK: ask path to 2.2.2.1 20:23:25.858 NETLINK: vif 0, ifindex=3 20:23:25.858 NETLINK: gateway is 1.1.1.1 20:23:25.858 For src 2.2.2.1, iif is 0, next hop router is 1.1.1.1 20:23:26.859 RECV 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:23:26.859 Received PIM register: len = 65 from 2.2.2.1 20:23:26.859 find_route:(S,G) entry not found 20:23:26.859 find_route: No (S,G) entry. Return the (,G) entry 20:23:26.859 Received PIM REGISTER: src 2.2.2.1, group 224.1.2.3 20:23:26.859 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from register_vif0 to eth2 20:23:27.860 RECV 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:23:27.860 Received PIM register: len = 65 from 2.2.2.1 20:23:27.860 find_route:(S,G) entry not found 20:23:27.860 find_route: No (S,G) entry. Return the (,G) entry 20:23:27.860 Received PIM REGISTER: src 2.2.2.1, group 224.1.2.3 20:23:27.860 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from register_vif0 to eth2 20:23:28.861 RECV 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:23:28.861 Received PIM register: len = 65 from 2.2.2.1 20:23:28.861 find_route:(S,G) entry not found 20:23:28.861 find_route: No (S,G) entry. Return the (,G) entry 20:23:28.861 Received PIM REGISTER: src 2.2.2.1, group 224.1.2.3 20:23:28.861 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from register_vif0 to eth2 20:23:29.121 Received IGMP Membership Query from 0.0.0.0 to 224.0.0.1 20:23:29.121 Ignoring group membership query from non-adjacent host 0.0.0.0 20:23:29.862 RECV 85 bytes PIM v2 Register from 2.2.2.1 to 3.3.3.1 20:23:29.862 Received PIM register: len = 65 from 2.2.2.1 20:23:29.862 find_route:(S,G) entry not found 20:23:29.862 find_route: No (S,G) entry. Return the (*,G) entry 20:23:29.862 Received PIM REGISTER: src 2.2.2.1, group 224.1.2.3 20:23:29.862 Added kernel MFC entry src 2.2.2.2 grp 224.1.2.3 from register_vif0 to eth2

troglobit commented 5 years ago

Really don't know what to say, the same setup works for me. Do you have any router specific settings in pimd.conf on either router, any iptables or tc rules enabled?

zhuguoguo commented 5 years ago

The router is virtual machine with linux kernel 3.10.62, and I only add 'phyint' in pimd.conf to limit some other interfaces. In addition, pimd-2.3.2 don't have the strange phenomenon.

troglobit commented 5 years ago

Oooh, that's an old kernel! :-/

It's good info that v2.3.2 does not have this problem. However, if you could provide any more information, or help to reproduce the issue, that would be great!

The only thing I can think of is that sometimes virtual machines are connected to a virtual bridge, which may have multicast filtering enabled. In earlier Linux versions that filtering was somewhat broken and needed to be disabled. But since you mention v2.3.2 works without issues, that cannot be the problem here.

zhuguoguo commented 5 years ago

Maybe you noticed that pimd-master can run well when the RP connected to the sender, and it failed when RP is connected to the receiver. I have got pimd logs in different tests. I hope that I can get something helpful after comparing them.

troglobit commented 5 years ago

I swapped sender and receiver in my setup too, but couldn't replicate the problem. Much appreciate you looking into this, would be great to get to the bottom of it!

zhuguoguo commented 5 years ago

Hi, I find that it really can work well when the rp connectd to the sender. I set the static rp in pimd.conf: rp-address 2.2.2.1 224.1.2.3/4.

zhuguoguo commented 5 years ago

The DR connected to the sender sent pim-register to the RP, and RP should reply pim-register stop and switch to spt after get the first packet, right? Because I set spt-threshold packets 0 interval 100 in pimd.conf. Could you tell me the pimreg in the mrt is valid or not? Much appreciate!

troglobit commented 5 years ago

The man page explains spt-threshold the best, first packet but after 100 sec.

The pimreg interface is the register tunnel that is used. What do you mean "is valid or not"?

zhuguoguo commented 5 years ago

pim1: (2.2.2.2, 224.1.2.3) Iif: eth0 Oif: pimreg pim2: (2.2.2.2, 224.1.2.3) Iif: pimreg Oif: eth2 pim1 keep sending pim-register to pim2 when the mrt in linux like above.

Is it not the following? pim1: (2.2.2.2, 224.1.2.3) Iif: eth0 Oif: eth1 pim2: (2.2.2.2, 224.1.2.3) Iif:eth1 Oif: eth2

troglobit commented 5 years ago

The first is correct as long as the spt switchover has not yet taken place; pim1 will send to the RP using pimreg.

The second output is what it looks like after the spt switchover.

Do you mean the SPT switchover never happens for you? Even after 100 sec?

zhuguoguo commented 5 years ago

yes.

troglobit commented 5 years ago

I see, that's not right.

zhuguoguo commented 5 years ago

Something to do in function receive_pim_register? Why it works well for you? :-(

troglobit commented 5 years ago

I have no idea what it could be right now. Trying to reproduce here ...

troglobit commented 5 years ago

Really odd ... works here. I can clearly see how the ip mroute output changes after a little while:

root@R2:/tmp/pycore.41809/R2.conf# ip mroute
(10.0.2.10,225.1.2.3)            Iif: pimreg     Oifs: eth1  State: resolved

[time passes]

root@R2:/tmp/pycore.41809/R2.conf# ip mroute
(10.0.2.10,225.1.2.3)            Iif: eth0       Oifs: eth1  State: resolved
root@R2:/tmp/pycore.41809/R2.conf# 

I'm running the latest master but I don't have a pimd.conf file right now. Maybe it's a bug triggered when pimd reads the .conf file?

troglobit commented 5 years ago

Now I've tested with a pimd.conf file, according to your specifications, everything still works for me. The switchover takes approximately 100 sec. as it should :-/

troglobit commented 5 years ago

I'm starting to think that you may be affected by the timer bug I fixed in 005a08c about two weeks ago. What GIT revision/hash of master are you using?

zhuguoguo commented 5 years ago

I noticed that, and I'm running the newest master. It is too odd! It works well without pimd.conf but not after swapped sender and receiver.

zhuguoguo commented 5 years ago

Maybe you don't know what I mean.

The first: pc1 as sender, pc2 as receiver The second: pc1 as receiver, pc2 as sender

When I start with pimd.conf, the second is good but the first is bad. When I start without pimd.conf, the first is good but the second is bad.

troglobit commented 5 years ago

Hmm, and you've disabled Linux rp_filter, right? On my routers it looks like this:

root@R2:/tmp/pycore.41809/R2.conf# sysctl -ar '\.rp_filter'
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.eth0.rp_filter = 0
net.ipv4.conf.eth1.rp_filter = 0
net.ipv4.conf.lo.rp_filter = 1
net.ipv4.conf.pimreg.rp_filter = 0
root@R2:/tmp/pycore.41809/R2.conf# 

Usually you can modify this by changing the 'all' setting in /etc/sysctl.conf

troglobit commented 5 years ago

(My setup works both with and without any .conf file, regardless of who is the sending node)

zhuguoguo commented 5 years ago

It works well now. I have not understand multicat enough. Thank you for your help!

zhuguoguo commented 5 years ago

Another question: The mrt entry would be cleaned by pimd after stop the sender and receiver?

troglobit commented 5 years ago

Wow really, it works? That's great news! :-) No problem, sorry for my taking so long to understand your problem! :-(

Yup, pimd cleans up after itself. I think as soon as either sender or reciver is stopped the mrt is removed and state is retained in pimd only.

troglobit commented 5 years ago

So maybe we can close this issue report then?

zhuguoguo commented 5 years ago

Sure, much appreciate for your help!

troglobit commented 5 years ago

No problem, good luck! :)