Commit Graph

140 Commits

Author SHA1 Message Date
anuradhak
755210ab1d pimd: display reg-state and join-state info in the pim_upstream output
Changed the state field in the "sh ip pim upstream" output to include
register and join state info as a comma separated value. Register info
is supressed if reg-state=NoInfo.

Sample output:
=============
root@fhr:/home/cumulus# net show pim upstream
Iif       Source          Group           State       Uptime   JoinTimer
RSTimer   KATimer   RefCnt
swp1      33.1.1.1        239.1.1.2       J,RegP      00:00:18 --:--:--
00:00:44  00:03:24       2
root@fhr:/home/cumulus#

root@rp:/home/cumulus# net show pim upstream
Iif       Source          Group           State       Uptime   JoinTimer
RSTimer   KATimer   RefCnt
lo        *               239.1.1.2       J           00:02:08 00:00:52
--:--:--  --:--:--       1
swp1      33.1.1.1        239.1.1.2       J           00:00:16 00:00:11
--:--:--  00:03:26       1
root@rp:/home/cumulus#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-14700
Testing Done: pim-smoke
2017-03-10 10:48:47 -08:00
anuradhak
0c2ebf00a6 pimd: add new/distinct enumeration for pim register state
With the separation of register-state and upstream-join-state we no
longer need an enumeration that covers both states. This commit includes
the following -
1. Defined new enumeration for reg state (this 1:1 with RFC4601).
2. Dropped JOIN_PENDING enum value from upstream join state. RFC4601
only define two values NOT_JOINED and JOINED for this state.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-14700
Testing Done: Verified register setup manually and ran pim-smoke
2017-03-10 10:48:41 -08:00
anuradhak
e0e127b009 pimd: Separate the register and upstream join states on the FHR
On the FHR upstream-join-state is not particularly relevant as we
don't need to send upstream JPs for the SG. So that field was being
overloaded with the register-state. However some of the events that
triggered changes to the JoinDesired macro were accidentally overwriting
the state with join info (instead of treating it as register info)
confusing the register state machine.

To make the PIM RFC macros' implemention simple I have separated out
the register-state. And upstream->state now solely describes the
upstream-join-state independent of the role of the PIM router.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>

Ticket: CM-14700
Testing Done: verified pim-register state-machine with separate and
combined FHR/RP routers. Also ran pim-smoke.
2017-03-10 10:48:38 -08:00
David Lamparter
d7c07bb47a Merge branch 'frr/pull/243' ("Pim jp agg")
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-07 16:42:20 +01:00
Donald Sharp
344cbf76bc pimd: Fix 'show ip pim state' command
The 'show ip pim state' command was not
working quite correctly from when
we moved over to the new vtysh-grammar.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-02 10:57:45 -05:00
Donald Sharp
b8d16be287 pimd: Hide 'ip multicast-routing' command
Automatically turn on pim if the daemon is turned on.
Hide the 'ip multicast-routing' command
Disable the 'no ip multicast-routing' command
Do not display the 'ip multicast-routing' command.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-02 10:33:23 -05:00
Donald Sharp
21419f5932 pimd: Turn on igmp when igmp commands are entered
When you enter these commands, under an interface:

ip igmp version ...
ip igmp query-interval ...
ip igmp query-max-response-time ...
ip igmp query-max-response-time-dsec ...

These commands will now just turn on igmp for the
interface.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-02 10:12:52 -05:00
Donald Sharp
982bff8972 pimd: Join/Prune Aggregation
Add the ability for PIM to send Join/Prunes as an
aggregated message instead of individual messages
for each S,G.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-02 08:13:03 -05:00
David Lamparter
dab8cd005f *: fix ambiguous commands
Some "show [ip] bgp ipv4 encap ..." commands remaining ambiguous.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-02-10 16:57:20 +01:00
Donald Sharp
90d84f92ae pimd: Cleanup dest buffer to small
Cleanup the in_ifname and out_ifname buffers
to be large enough to hold the actual interface
names.

Additionally move the common variables to be defined
once, instead of inside of multiple for loops

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-07 15:08:56 -05:00
Donald Sharp
28d5da5a53 pimd: Fix cmd issues
Fix possible buffer overwrite and uninitialized idx access.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-01 20:40:10 -05:00
Donald Sharp
dc0665f150 pimd: Handle assignment of vif index better
PIM was handling vif creation deletion poorly
for interface down and up events.  Fix this
issue by keeping track of which vif index'es
we have issued and allow the wholes to be
filled in.

Ticket: CM-14556
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30 12:51:20 -05:00
Donald Sharp
781a1745c0 pimd: Fixup tracking of where we got OIF's from.
This commit does these three things:

1) Add code to 'show ip pim state' to show where OIF's got their
decision to include that interface

2) Add code in pim_mroute_[add|del] to display what we think we are
adding to the kernel

3) Add code to properly track where we got the incoming request from and
to appropriately not remove a OIL if we have state still

Ticket: CM-14034
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Reviewed-by: Don Slice <dslice@cumulusnetworks.com>
Reviewed-by: Chirag Shah <chirag@cumulusnetworks.com>
2017-01-30 12:49:38 -05:00
Donald Sharp
8799b66b94 pimd: Start abstraction of zclient data structure for pim_zebra.c
Start the abstraction of the zclient data structure out from a
global variable for the entire program to a global variable
to the pim_zebra.c file.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30 10:04:05 -05:00
Donald Sharp
72e81cf424 pimd: More pim cli fixup
Found some additional issues with the pim
cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-26 09:10:54 -05:00
Donald Sharp
a957a05bb4 pimd: Cleanup some missing help strings.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-25 09:13:46 -05:00
Donald Sharp
c74e219474 pimd: Fix double add of command
We were adding the 'ip msdp ...' command to
the parser 2x.  Some new code added to the
parser apparently catches this for us now.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-25 08:20:06 -05:00
Donald Sharp
83190a40e2 pimd: Cleanup the headers.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-19 10:01:02 -05:00
Donald Sharp
de6d2fa72e pimd: Remove bad merges
Two functions were accidentally left around
as part of the merge operation.  Remove them.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-18 07:47:58 -05:00
Donald Sharp
b58ed1f8a8 Merge remote-tracking branch 'origin/master' into pim_lib_work2 2017-01-17 21:01:56 -05:00
Donald Sharp
3b14d86eed Merge remote-tracking branch 'origin/stable/2.0' 2017-01-06 09:58:21 -05:00
anuradhak
01cb146642 pimd: make the json output a bit more machine-friendly
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-21 20:26:19 -05:00
Donald Sharp
bfdf409644 pimd: Allow us to repair missed inherited_olists
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-21 20:26:19 -05:00
Donald Sharp
07335c8d08 pimd: Modify pim_upstream_new behavior
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-21 20:26:18 -05:00
Donald Sharp
ee1a071806 pimd: Add ability to tweak join/prune send time
Add the ability to tweak how often we can
send the join prune message.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:18 -05:00
Donald Sharp
6a78764e46 pimd: Clarify pim_mroute_[add|del] function debugging
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-21 20:26:18 -05:00
Donald Sharp
f041117e84 pimd: Fix 'no ip igmp query-max-response-time XX' to work
Ticket:CM-13786
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:18 -05:00
Donald Sharp
80df099b48 pimd: Fix stupidity compile errors
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-21 20:26:17 -05:00
Donald Sharp
58344b652e pimd: Make igmp query max response time take input in dsec
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-21 20:26:17 -05:00
anuradhak
7cdb24da72 pim-anycast-rp: Change the reason code on use-source config failure.
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-21 20:26:17 -05:00
anuradhak
886d1e80f6 pim-msdp: cleanup debug commands
And fixup display spacing. No functional change.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21 20:26:17 -05:00
anuradhak
15ad0c71e0 pim-msdp: CLI and debug cleanup
No functional change.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2016-12-21 20:26:16 -05:00
anuradhak
4763cd0ed5 pim-anycast-rp: Support in BGP unnumbered networks.
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-21 20:26:16 -05:00
Donald Sharp
8e4c9ef376 pimd: Add knob to control # of packets read in at one time
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-21 20:26:16 -05:00
anuradhak
7176984f74 pim-anycast-rp: Add limited support for secondary addresses.
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-21 20:26:16 -05:00
Donald Sharp
8bfb8b67ae pimd: Allow storing of sg in string format
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-21 20:26:16 -05:00
anuradhak
1bf1644338 pim-kat: changed kat handling to match rfc-4601 more closely.
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-21 20:26:16 -05:00
Donald Sharp
191f5695df pimd: Add 'ip pim register-suppress-time <5-60000>'
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-21 20:26:16 -05:00
Donald Sharp
c83778f769 pimd: Allow 'no ip pim sm' to not turn off igmp
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-21 20:26:15 -05:00
anuradhak
977d71cc7a pim-msdp: part-4: cli cleanup
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-21 20:26:15 -05:00
anuradhak
7667c5568f pim-msdp: part-3: use SA cache for setting up SPTs
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-21 20:26:15 -05:00
Donald Sharp
5349cf9a09 pimd: Fix 'show ip pim join json' output
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-21 20:26:14 -05:00
Donald Sharp
637a61fa2b pimd: Add ability to know if ifchannel is (S,G,rpt)
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-21 20:26:14 -05:00
Donald Sharp
11757d7b98 pimd: 'show ip pim join json' add by src not grp
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-21 20:26:14 -05:00
anuradhak
3c72d65495 pim-msdp: part-2: SA cache support
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-21 20:26:14 -05:00
Donald Sharp
ea4a71fcf7 pimd: Store ifchannel information in a global list too.
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-21 20:26:14 -05:00
Donald Sharp
5d84a3bc9a pimd: Modify Debug to be better
Make debugs of some pim processes easier
to interpret and understand.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2016-12-21 20:26:13 -05:00
anuradhak
2a333e0f22 pim-msdp: part-1 - initial protocol infra.
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-21 20:26:12 -05:00
Donald Sharp
8b9c900bd1 pimd: Remove unused/unmaintained test commands
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-21 20:26:12 -05:00
Donald Sharp
580d761266 pimd: Fix possible crash using 'struct pim_nexthop'
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-21 20:26:12 -05:00