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

2 instances of pimd - wrong second gateway to RP #75

Open Kzibi opened 8 years ago

Kzibi commented 8 years ago

pimd -v 2.3.1

Same RP for both subnets - 10.200.200.20 First run in default table,second run in it's own table. Debug:

Virtual Interface Table ====
Vif  Local Address    Subnet              Thresh  Flags      Neighbors

---

  0  192.168.80.1     192.168.80/30            1  DISABLED
  1  81.210.7.6       81.210.7.4/30            1  DISABLED
  2  10.201.230.2     10.201.230/30            1  DISABLED
  3  10.204.32.1      10.204.32/23             1  DISABLED
  4  10.200.51.26     10.200.51.24/30          1  DR PIM     10.200.51.25  
  5  10.205.110.1     10.205.110/23            1  DR NO-NBR
  6  10.200.51.26     register_vif0            1 

 Vif  SSM Group        Sources             

NETLINK: ask path to 10.200.200.20
NETLINK: vif 2, ifindex=58
NETLINK: gateway is 10.201.230.1
For src 10.200.200.20, iif is 2, next hop router is 10.201.230.1: NOT A PIM ROUTER

10.201.230.1 - wrong; it's from 1st instance/net should be 10.200.51.25 unicast routing is fine,

troglobit commented 8 years ago

Thank you for the report. Maybe @idismmxiv or @markusve can better answer this one?

Kzibi commented 8 years ago

hmm ... @idismmxiv or @markusve - 1 month no activities ;( I will try run both pim daemons in not default routing table and see what happens

troglobit commented 8 years ago

@Kzibi that could actually very well help! I'm unfortunately not up to speed on how Linux's CONFIG_IP_MROUTE_MULTIPLE_TABLES works, but I can imagine that both instances must run in their own table, and none of them in the default table.

Would be awesome to hear back from you if that works, then I can update the docs and we can clarify this issue for future improvement, i.e. add detection of more pimd instances and warn the user.

idismmxiv commented 8 years ago

I might be wrong, but this is how I see the case. To be able to run multiple pimd instances, you need to have multiple multicast routing tables. One for each instance. But currently pimd does not support multiple unicast routing tables. I have used multiple pimd instances with multiple multicast routing tables, but newer trying to share single IP (like RP address in this case) in both instances.

I suppose there is a room for improvement in netlink.c to handle unicast route queries based on multiple routing tables. Or to use LInux namespaces, but I haven't tried that.

Kzibi commented 8 years ago

So ;) .. I try ... no success

but newer trying to share single IP (like RP address in this case) in both instances.

this is the clue I think, that pimd (netlink) should use only if's from conf file and do some test like ex.: ip route li table xx | grep RP OR ip route get RP oif from_config ( it need's output interface name not address in config file).