summaryrefslogtreecommitdiff
path: root/pimd/pim_cmd.c
AgeCommit message (Collapse)Author
2016-12-21pimd: make the json output a bit more machine-friendlyanuradhak
Mixing well-known and variable property names makes the output difficult to parse. so wrapped variable-keyed dicts with well-known property names (such as "oil") in the following outputs - "show ip mroute json" "show ip msdp mesh-group json" Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: Allow us to repair missed inherited_olistsDonald Sharp
There exists situations where we have noted that we need to rescan but have missed the window of opportunity to actually redo the scan so for the moment allow the S,G 30 second scanner notice the missed opportunity and fix it. We'll remove this later. Ticket: CM-13988 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Modify pim_upstream_new behaviorDonald Sharp
Modify pim_usptream_new to auto create the pim channel oil. Why? Because there exists situations where we have upstream state and we are attempting to set the inherited_olist on it and we have not created the channel oil yet. When that happens we end up with mroutes that are being meanies. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add ability to tweak join/prune send timeDonald Sharp
Add the ability to tweak how often we can send the join prune message. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Clarify pim_mroute_[add|del] function debuggingDonald Sharp
When debugging is turned on for 'debug mroute' we are unable to tell when a mroute has been added or deleted from the mrib. Notice when we do it and who called it. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix 'no ip igmp query-max-response-time XX' to workDonald Sharp
Ticket:CM-13786 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix stupidity compile errorsDonald Sharp
I introduced compile errors using gcc, that worked fine with clang. This removes the issue. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Make igmp query max response time take input in dsecDonald Sharp
Make the 'ip igmp query-max-response-time' command take input in deci-seconds and make the 'ip igmp query-max-response-time-dsec' command hidden. Ticket:CM-13786 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-anycast-rp: Change the reason code on use-source config failure.anuradhak
Was failing with a vague error - "Source set failed" Changed to used the error string (used by the rest of the commands) - "Pim not enabled on this interface" Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21pim-msdp: cleanup debug commandsanuradhak
And fixup display spacing. No functional change. 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: Support in BGP unnumbered networks.anuradhak
Anycast rp requires multiple ip addresses on the lo. If PIM is used in an unnumbered BGP network it picks one of the lo addresses as the pim-primary for the swp interfaces. But if the anycast IP is picked up by both sides pim nbr will never converge. So a static "use-source" config is provided to allow the administrator to force the the hello source to the unique IP address. Sample output: ============= dell-s6000-04(config-if)# do show running-config pimd >>>>>> SNIPPED >>>>>>>>>>>>>>>>> interface lo ip pim sm ip pim use-source 100.1.1.5 ! >>>>>> SNIPPED >>>>>>>>>>>>>>>>> dell-s6000-04(config-if)# do show ip pim interface lo Interface : lo State : up Use Source : 100.1.1.5 Address : 100.1.1.5 (primary) 100.1.1.100 >>>>>> SNIPPED >>>>>>>>>>>>>>>>> dell-s6000-04(config-if)# do show ip pim interface lo json { "lo":{ "name":"lo", "state":"up", "address":"100.1.1.5", "index":1, "lanDelayEnabled":true, "useSource":"100.1.1.5", "secondaryAddressList":[ "100.1.1.100" ], >>>>>> SNIPPED >>>>>>>>>>>>>>>>> Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add knob to control # of packets read in at one timeDonald Sharp
Add 'ip pim packets <1-100>' command. Allows you to control the number of packets read in before giving control back to another part of the process. Signed-off-by: Donald Sharp <sharpd@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-21pimd: Add 'ip pim register-suppress-time <5-60000>'Donald Sharp
Add the 'ip pim register-suppress-time ...' command. Remove the 'no ip pim rp keep-al...' command as that the register suppress set that value. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Allow 'no ip pim sm' to not turn off igmpDonald Sharp
When we receive a 'no ip pim sm' for an interface that has both pim and igmp on it, only turn off pim. Ticket: CM-12985 Signed-off-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-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: Fix 'show ip pim join json' outputDonald Sharp
When we have multiple incoming joins for a single group on a interface, we need to allow proper output. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add ability to know if ifchannel is (S,G,rpt)Donald Sharp
Add ability to track (S,G,rpt) ifchannel prunes. Add ability to display this data in json. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: 'show ip pim join json' add by src not grpDonald Sharp
If you add to the json by grp, if you have multiple ifchannels for that group, on the the first one will be displayed. 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-21pimd: Store ifchannel information in a global list too.Donald Sharp
This fix handles two issues: 1) Searching entire vrf_iflist to get per interface pim_ifchannel_list 2) Display of ifchannel information in pim not being ordered correctly. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Modify Debug to be betterDonald Sharp
Make debugs of some pim processes easier to interpret and understand. Signed-off-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: Remove unused/unmaintained test commandsDonald Sharp
The test commands are not being maintained and are not out of date with the rest of the system. There are better ways to test code and in addition these commands if entered by a user could seriously impact their running system. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fix possible crash using 'struct pim_nexthop'Donald Sharp
When passing in a nexthop data structure to nexthop_lookup ensure that it is zero'ed out. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add basic nexthop lookup cached information.Donald Sharp
Cache the last time we looked up the nexthop for this particular address. Store time to usec accuracy. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: always build json for show commandsDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> This cleans up the following so that they always collect the data to display in json structures and then either dumps the json output or traverses it to produce the non-json output. show ip pim local-membership show ip pim interface
2016-12-21pimd: replace grp_str[100] with grp_str[INET_ADDRSTRLEN]Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: add support for IGMPv2Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-7962
2016-12-21pimd: Allow debugs entered in conf t mode to persistDonald Sharp
When entering debug commands under 'conf t' mode allow the debugs to be saved for future fun and adventure. Ticket: CM-13213 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Create channel_oil hash for quicker lookupDonald Sharp
When looking up the channel_oil use a hash to find it. Keep the list around for quick walks of the channel oils. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Add hash lookups for upstreamDonald Sharp
2016-12-21pimd: 'sh ip pim int' showed local IP as the DRDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: use JSON_C_TO_STRING_PRETTY everywhereDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2016-12-21pimd: 'show ip pim state json' use JSON_C_TO_STRING_PRETTYDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-11812
2016-12-21pimd: initial "show ip pim state"Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-11812 superm-redxp-05# show ip pim state Source Group IIF OIL 20.0.13.253 230.10.10.1 br1 swp1 20.0.13.253 230.20.20.1 br1 0.0.0.0 230.40.40.1 swp1 br1 0.0.0.0 230.42.42.1 swp1 br1 0.0.0.0 230.42.43.1 swp1 br1 superm-redxp-05# superm-redxp-05# show ip pim state 20.0.13.253 Source Group IIF OIL 20.0.13.253 230.10.10.1 br1 swp1 20.0.13.253 230.20.20.1 br1 superm-redxp-05# show ip pim state 20.0.13.253 230.10.10.1 Source Group IIF OIL 20.0.13.253 230.10.10.1 br1 swp1 superm-redxp-05# superm-redxp-05# show ip pim state 230.40.40.1 Source Group IIF OIL 0.0.0.0 230.40.40.1 swp1 br1 superm-redxp-05# show ip pim state 230.40.40.1 json { "230.40.40.1":{ "0.0.0.0":{ "swp1":{ "br1":{ "source":"0.0.0.0", "group":"230.40.40.1", "inboundInterface":"swp1", "outboundInterface":"br1" } } } } } superm-redxp-05#
2016-12-21pimd: Added json to 'show ip igmp group'Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> root@superm-redxp-05[quagga-pim]# vtysh -c 'show ip igmp group' Interface Address Group Mode Timer Srcs V Uptime br1 20.0.13.1 230.40.40.1 EXCL 00:03:24 1 3 00:01:28 root@superm-redxp-05[quagga-pim]# root@superm-redxp-05[quagga-pim]# root@superm-redxp-05[quagga-pim]# vtysh -c 'show ip igmp group json' | python -m json.tool { "br1": { "230.40.40.1": { "group": "230.40.40.1", "mode": "EXCLUDE", "source": "20.0.13.1", "sourcesCount": 1, "timer": "00:03:23", "uptime": "00:01:30", "version": 3 }, "address": "20.0.13.1", "flagBroadcast": true, "flagMulticast": true, "index": 96, "lanDelayEnabled": true, "name": "br1", "state": "up" } } root@superm-redxp-05[quagga-pim]#
2016-12-21pimd: Fix 'show ip mroute count'Donald Sharp
Add the lastused data. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: Fixup pim mroute outputDonald Sharp
Cleanup the 'show ip mroute' command to be a bit more minimalistic. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21pimd: "show ip mroute" skips entries without an OIFDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> The entry for 230.10.10.4 was not being displayed root@superm-redxp-05[pimd]# ip mroute show (20.0.13.253, 230.10.10.4) Iif: br1 (20.0.13.253, 230.10.10.1) Iif: br1 Oifs: swp1 root@superm-redxp-05[pimd]# root@superm-redxp-05[pimd]# root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute' Proto: I=IGMP P=PIM S=STATIC O=SOURCE Source Group Proto Input iVifI Output oVifI TTL Uptime 20.0.13.253 230.10.10.1 P br1 1 swp1 2 1 00:01:09 20.0.13.253 230.10.10.4 P br1 1 none 0 0 --:--:-- root@superm-redxp-05[pimd]#
2016-12-21pimd: JSON support for "show ip mroute"Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-12876 root@superm-redxp-05[pimd]# vtysh -c 'show ip mroute json' | pjson { "230.10.10.1": { "20.0.13.253": { "br1": { "swp1": { "group": "230.10.10.1", "iVifI": 1, "inboundInterface": "br1", "oVifI": 2, "outboundInterface": "swp1", "protocolPim": true, "source": "20.0.13.253", "ttl": 1, "upTime": "00:02:37" } } } }, "230.10.10.4": { "20.0.13.253": { "br1": {} } } } root@superm-redxp-05[pimd]#
2016-12-21pimd: json support for "show ip pim" commandsDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-12865
2016-12-21pimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORDDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-11812
2016-12-21pimd: show ip pim int WORD, show ip pim nei WORD, show ip igmp int WORDDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Ticket: CM-11812
2016-12-21pimd: Rework approach for needing nbrsDonald Sharp
Pim sometimes needs the upstream rpf lookup to only take into account if we have a nbr out the selected interface or not. Move the code for this to a better spot so we can make a more intelligent decision here. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21PIM: json support for "show ip pim" commandsDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-12865