summaryrefslogtreecommitdiff
path: root/pimd/pim_msdp.c
AgeCommit message (Collapse)Author
2016-12-21pimd: reset packet size on tcp connection resetanuradhak
If we were in the middle of a partial read when the tcp connection is reset we were clearing the buffers but not the packet size. This can be problematic when the connection is re-established. There is no easy way to repro and test this without scale (and a timing pattern that is hard to predict). So this change is mostly untested. Ticket: CM-13852 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pimd: Drop local SA reference when the upstream SG is deletedanuradhak
This is done irrespective of the reason for del and is intended as a catchall for cases (unclear which ones) where the RP can drop the SG without KAT expiry. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pimd: restart the ka timer after the sa adv timeranuradhak
To avoid unnecessary ka activity in the network. When the SA advertisment timer fires we build SA TLVs and send them to peers. As a part of this tx we were also restarting the ka timer to avoid unnecessary ka generation in the next 60 seconds. However because the adv timer was restarted after tx (i.e. after ka restart) ka timer would always endup firing just before the adv timer.
2016-12-21pim-msdp: Fix pimd crash on mesh-group delete.anuradhak
The mesh group contents were being accessed after memory was freed. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-msdp: Update the RP address in the SA cache entry on peer ip changeanuradhak
The RP address in the SA is only for informational/display purposes. It is still confusing if we show a stale value. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-msdp: CLI and debug cleanupanuradhak
No functional change. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-anycast-rp: Add limited support for secondary addresses.anuradhak
Anycast requires that the lo interface be associated with multiple addresses. One is the anycast IP address (which is the same on all RPs participating in RP redundancy) and the second is the unique IP address that will be used as the router id by routing protocols. To accomodate that we maintain a list of secondary addresses per-pim iface and allow any of them to be the RP address. This lets the I_am_RP macro succeed on anycast RPs. Note that the support is limited i.e. we don't actually advertise a secondary list to the neighbors. This is assuming the anycast IP will never be used as a router id i.e. will never be an RPF neighbor. Sample output: ============== dell-s6000-04# sh ip pim interface lo Interface : lo State : up Address : 100.1.1.1 (primary) 100.1.1.2 100.1.1.3 100.1.2.1 >>>>>>> SNIP >>>>>>>>>>>>>>> dell-s6000-04# sh ip pim interface lo json { "lo":{ "name":"lo", "state":"up", "address":"100.1.1.1", "index":1, "lanDelayEnabled":true, "secondaryAddressList":[ "100.1.1.2", "100.1.1.3", "100.1.2.1" ], >>>>>>> SNIP >>>>>>>>>>>>>>> dell-s6000-04#sh ip pim rp-info RP address group/prefix-list OIF I am RP 100.1.2.1 224.0.0.0/4 lo yes dell-s6000-04# Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Allow storing of sg in string formatDonald Sharp
Debugs are extremely expensive currently. Let's store 'struct prefix_sg sg' string format in the ifchannel, upstream and msdp_sa structures. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-kat: changed kat handling to match rfc-4601 more closely.anuradhak
1. This is needed to layout the MSDP macros for determining what SAs are originated by a MSDP speaker. 2. We no longer let the kat timer expire on an active flow. Activity counters/lastuse is polled via a wheel for every SG entry. If new activity is detected the keepalive timer is started and SPT bit set. A SRC_STREAM reference is also created for the entry if one doesn't already exist. 3. If KAT actually expires it means the flow is no longer active. At this point we stop advertising the SA to MSDP peers. We also pull the SRC_STREAM reference (deleting the entry if there are no other references). PS: Checking counters on KAT expiry will come in the next change. Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-msdp: part-4: cli cleanupanuradhak
1. Add support for mesh-group based configuration that is easy to apply via automation. The older per-peer configuartion is temporarily hidden and will be cleaned up later. Sample config - ip msdp mesh-group cumulus source 100.1.1.4 ip msdp mesh-group cumulus member 100.1.1.5 ip msdp mesh-group cumulus member 100.1.1.6 2. Added support for detail peer and sa-cache displays. Along with filter keys. 3. Add json output for all the msdp displays. With this commit basic support for anycast-RP with MSDP (in numbered network is complete). Unnumbered support will be added separately. Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Removing impossible codeDonald Sharp
We've already allocated the mp data structure and am using hash_alloc_intern for the hash_get function. This will return the passed in data structure. There is no possibility of mp being NULL. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-msdp: part-3: use SA cache for setting up SPTsanuradhak
1. Added a new MSDP source reference flag for creating (S,G) entries based on the SA-cache. The RFC recommends treating as SA like rxing a (S, G) join (which is a bit different then treating like a traffic stream). 2. SA-SPT is only setup if we are RP for the group and a corresponding (*,G) exists with a non-empty OIL. 3. When an SA is moved we need to let the SPT live if it is active (this change will come in a subsequent CL). Testing done: 1. SA first; SPT setup whenever (*, G) comes around. 2. (*, G) first. As soon as SA is added SPT is setup. 3. (*, G) del with valid SA entries around. Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Remove unnecessary assertsDonald Sharp
When we handle the thread arguments, there is no need to assert. As that if they are wrong, we are going down shortly anyways. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-msdp: part-2: SA cache supportanuradhak
This commit includes - 1. Maintaining SA cache with local and remote entries. 2. Local SA entries - there are two cases where we pick up these - - We are RP and got a source-register from the FHR. - We are RP and FHR and learnt a new directly connected source on a DR interface. 3. Local entries are pushed to peers immediately on addition and periodically. An immediate push is also done when peer session is established. 4. Remote SA entries - from other peers in the mesh group and passed peer-RPF checks. 5. Remote entries are aged out. No other way to del them currently. In the future we may add a knob to flush entries on peer-down. Testing done - Misc topologies with CL routers plus basic interop with another vendor ( we can process their SA updates and they ours). Sample output - root@rp:~# vtysh -c "show ip msdp sa" Source Group RP Uptime 33.1.1.1 239.1.1.2 local 00:02:34 33.1.1.1 239.1.1.3 local 00:02:19 44.1.1.1 239.1.1.4 100.1.3.1 00:01:12 44.1.1.1 239.1.1.5 100.1.3.1 00:00:55 root@rp:~# Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pim-msdp: part-1 - initial protocol infra.anuradhak
This commit includes the following changes - 1. Support for MSDP peer DB (hash and sorted list). 2. Support for the following timers - keepalive, connect-retry, hold. 3. TCP session management (lower-ip is active, higher-ip is passive). 4. MSDP KA packet rx/tx. 5. Limited temporary config (will be replaced with the more automation friendly RP-set). Testing done - Peer bringup/deletion (including interop with another vendor) Sample out - root@dell-s6000-04:~# sudo vtysh -c "show ip msdp peer" Peer Local Mesh-group State Uptime 100.1.1.1 100.1.2.1 default established 00:07:27 100.1.3.1 100.1.2.1 default established 00:31:50 root@dell-s6000-04:~# Coming soon - 1. part-2: SA cache management. 2. part-3: SPT setup using source in SA cache. 3. part-4: CLI cleanup. Ticket: CM-13306 Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add some MSDP infrastructureDonald Sharp
Add some very basic MSDP infrastructure to pim. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>