Commit Graph

435 Commits

Author SHA1 Message Date
Anuradha Karuppiah
5923b7396e pimd: MUTE flag to suppress traffic forwarding on non-DF
If an mroute loses DF election (with the MLAG peer) it has to stop
forwarding traffic on active-active devices such as ipmr-lo used
for vxlan traffic termination. To acheive that this commit
introduces a concept of OIF muting. That way we can let the PIM and
IGMP state machines play out and silence OIFs after the fact.

Relevant outputs:
=================
1. muted OIFs are displayed with the M flag in "pim state" -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@TORC12:~# net show pim state |grep "27.0.0.13"|grep 100
1         27.0.0.13        239.1.1.100      uplink-1          ipmr-lo(   *M)
root@TORC12:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
2. And supressed altogether in the mroute output -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
root@TORC12:~# net show mroute |grep "27.0.0.13"|grep 100
27.0.0.13       239.1.1.100     none   uplink-1         none             0    --:--:--
root@TORC12:~#
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-11-15 09:16:15 -08:00
Satheesh Kumar K
36b5b98fef pimd : Add support for MLAG Register & Un-register
when ever a FRR Client wants to send any data to another node
using MLAG Channel, uses below mechanisam.

1. sends  a MLAG Registration to zebra with interested messages that
   it is intended to receive from peer.
2. In response to this request, Zebra opens communication channel with
   MLAG. and also in Rx. diretion zebra forwards only those messages which
   client shown interest during registration
3. when client is no-longer interested in communicating with MLAG, client
   posts De-register to Zebra
4. if this is the last client which is interested for MLAG Communication,
   zebra closes the channel.

why PIM Needs MLAG Communication
================================
1. In general on LAN Networks elecetd DR will send the Join towards
   Multicast RP in case of a LHR and Register in case of FHR.
2. But in case DR Goes down, traffic will be re-converged only after
   the New DR is elected, but this can take time based on Hold Timer to
   detect the DR down.
3. this can be optimised by using MLAG Mecganisam.
4. and also Traffic can be forwarded more efficiently by knowing the cost
   towards RP using MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13 19:46:52 -08:00
Donald Sharp
3b13a2ccc1 pimd: Duplicate config is not a CMD_WARNING_CONFIG_FAILED
When you enter:
ip pim ssm prefix-list my-custom-ssm-range
ip pim ssm prefix-list my-custom-ssm-range

The second instance would cause a failure to happen which
should not happen w/ duplicate config.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-29 21:37:30 -04:00
Donald Sharp
253283d742 pimd: result was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO
The result variable was already tested against PIM_GROUP_BAD_ADDR_MASK_COMBO
earlier in the function.  No need to do the same thing twice.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-25 07:07:49 -04:00
Quentin Young
6a597223d3 Revert "Merge pull request #4885 from satheeshkarra/pim_mlag"
This reverts commit d563896dad, reversing
changes made to 09ea1a4038.
2019-10-14 17:15:09 +00:00
Satheesh Kumar K
4bf3dda597 pimd : Add support for MLAG Register & Un-register
when ever a FRR Client wants to send any data to another node
using MLAG Channel, uses below mechanisam.

1. sends  a MLAG Registration to zebra with interested messages that
   it is intended to receive from peer.
2. In response to this request, Zebra opens communication channel with
   MLAG. and also in Rx. diretion zebra forwards only those messages which
   client shown interest during registration
3. when client is no-longer interested in communicating with MLAG, client
   posts De-register to Zebra
4. if this is the last client which is interested for MLAG Communication,
   zebra closes the channel.

why PIM Needs MLAG Communication
================================
1. In general on LAN Networks elecetd DR will send the Join towards
   Multicast RP in case of a LHR and Register in case of FHR.
2. But in case DR Goes down, traffic will be re-converged only after
   the New DR is elected, but this can take time based on Hold Timer to
   detect the DR down.
3. this can be optimised by using MLAG Mecganisam.
4. and also Traffic can be forwarded more efficiently by knowing the cost
   towards RP using MLAG

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-09-16 20:11:01 -07:00
Quentin Young
33b58e536f pimd: fix some help strings
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-06 00:15:27 +00:00
Quentin Young
2951a7a4c2 *: s/TRUE/true/, s/FALSE/false/
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-07-01 17:26:05 +00:00
Rafael Zalamena
9b2d87406a
Merge pull request #4525 from donaldsharp/some_cleanups
Some cleanups
2019-06-25 16:06:57 -03:00
David Lamparter
18130847e6
Merge pull request #4520 from rgirada/fix_clear_mroute
pimd: Added cli to generate igmp query.
2019-06-25 14:06:13 +02:00
rgirada
6741a5bb4e pimd: Added cli to generate igmp query.
Fix details :
Added a utility cli to generate a igmp query on an interface.
This won't impact the existing query generation based on the
general query interval.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-06-24 03:15:10 -07:00
Donald Sharp
a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Donald Sharp
a12bb225a6
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
2019-06-22 13:35:45 -04:00
Donald Sharp
11884868d4 pimd: ALLOC functions cannot fail.
There is no need to check for ALLOC function failures
in the code base.  If we cannot get more memory we
assert.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-19 19:07:12 -04:00
David Lamparter
3779776a39 lib/clippy: error out on unsupported bits
clippy can't process #ifdef or similar bits inside of an argument list
(e.g. within the braces of a DEFUN or DEFPY statement.)  Improve error
reporting to catch these cases instead of generating broken C code.

Fixes: #3840
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:22:59 +02:00
Philippe Guibert
f11e98eca3 *: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:54 +02:00
Russ White
51e6f92ec6
Merge pull request #4494 from donaldsharp/no_src_for_you
pimd: The PIM_OIF_FLAG_PROTO_SRC flag was never used
2019-06-11 08:13:04 -04:00
Donald Sharp
11e0acfba5 pimd: The PIM_OIF_FLAG_PROTO_SRC flag was never used
Nor should it be.  So remove from system.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-08 07:30:36 -04:00
Donald Sharp
9a8a7b0ed1 lib, pimd, sharpd: Various output string cleanups
Various compilers in our CI system were complaining about various
auto-conversions.  Let's get these cleaned up a bit more.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-07 09:29:45 -04:00
Russ White
230dec1398
Merge pull request #4452 from donaldsharp/mroute_count
pim: Add `clear ip mroute [vrf NAME] count` command
2019-06-04 09:16:34 -04:00
Donald Sharp
cd333cf968 pimd: Add clear ip mroute [vrf NAME] count command to pim
When debugging a large number of mroutes and data is changing
fast it is sometimes hard to know what has actually changed.
Add a `clear ip mroute count` command that resets the last
data points gathered and allows you to see what has changed
since the last clear.

Output:
donna.cumulusnetworks.com# show ip mroute count

Source          Group           LastUsed Packets Bytes WrongIf
*               224.0.1.60      272      0       0          0
10.50.11.11     239.255.255.250 2        1       203        1
10.50.11.13     239.255.255.250 66       1       203        1
10.50.11.100    239.255.255.250 68       1       203        1
10.50.11.114    239.255.255.250 62       2       406        1
10.50.11.129    239.255.255.250 10       1       199        1
10.50.11.143    239.255.255.250 44       1       203        1
10.50.11.144    239.255.255.250 44       1       203        1
10.50.11.156    239.255.255.250 66       1       203        1
10.50.11.235    239.255.255.250 149      0       0          0
10.50.11.246    239.255.255.250 54       5       965        1
donna.cumulusnetworks.com# clear ip mroute count
donna.cumulusnetworks.com# show ip mroute count

Source          Group           LastUsed Packets Bytes WrongIf
*               224.0.1.60      279      0       0          0
10.50.11.11     239.255.255.250 9        0       0          0
10.50.11.13     239.255.255.250 73       0       0          0
10.50.11.100    239.255.255.250 76       0       0          0
10.50.11.114    239.255.255.250 69       0       0          0
10.50.11.129    239.255.255.250 17       0       0          0
10.50.11.143    239.255.255.250 51       0       0          0
10.50.11.144    239.255.255.250 51       0       0          0
10.50.11.156    239.255.255.250 73       0       0          0
10.50.11.235    239.255.255.250 156      0       0          0
10.50.11.246    239.255.255.250 61       0       0          0
donna.cumulusnetworks.com# show ip mroute count

Source          Group           LastUsed Packets Bytes WrongIf
*               224.0.1.60      300      0       0          0
10.50.11.11     239.255.255.250 30       0       0          0
10.50.11.13     239.255.255.250 94       0       0          0
10.50.11.100    239.255.255.250 96       0       0          0
10.50.11.114    239.255.255.250 90       0       0          0
10.50.11.119    239.255.255.250 7        1       203        1
10.50.11.127    239.255.255.250 3        2       406        1
10.50.11.129    239.255.255.250 38       0       0          0
10.50.11.143    239.255.255.250 72       0       0          0
10.50.11.144    239.255.255.250 72       0       0          0
10.50.11.156    239.255.255.250 94       0       0          0
10.50.11.197    239.255.255.250 2        1       200        1
10.50.11.235    239.255.255.250 177      0       0          0
10.50.11.246    239.255.255.250 82       0       0          0

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 11:16:00 -04:00
Donald Sharp
fbd74c7d94 pimd: Convert strncpy to strlcpy in pim_cmd.c
A couple of places of strncpy snuck in due to my confusion
about if Quentin's earlier change had gotten in.  Just some
code in flux.  This should fix the issue/warnings in our
CI system.
2019-06-03 10:09:22 -04:00
Donald Sharp
ed7e15589d pimd: Remove unused functions
Recent commits rewrote the `clear mroute` command and this caused
these two two functions to no longer be used, remove.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-06-03 08:38:38 -04:00
Donald Sharp
b97480c548
Merge pull request #4274 from rgirada/fix_clear_mroute
pimd: Re-deisgn the "clear ip mroute" command.
2019-06-03 07:39:04 -04:00
Donald Sharp
008def8643
Merge pull request #4369 from patrasar/lmqc_lmqt
pimd: new cli to configure last-member-query-count & last-member-quer…
2019-05-30 21:23:11 -04:00
Sarita Patra
59115451a8 pimd: new cli to configure last-member-query-count & last-member-query-interval
Introduce new cli commands ip igmp last-member-query-count <1-7>
ip igmp last-member-query-interval <1-255> deciseconds.

Display the config in show running config and show ip igmp interface

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-05-29 20:36:16 -07:00
Renato Westphal
0ad79902fc
Merge pull request #4267 from qlyoung/fix-misc-compile-warnings
Fix misc compile warnings, remove strcpy & strcat
2019-05-29 23:55:17 -03:00
Quentin Young
c35b7e6bea pimd: strcpy -> strlcpy
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-29 18:03:26 +00:00
Sarita Patra
468b6f4400 pimd: new cli command show ip mroute summary
Introduced a new command "show ip mroute summary"
to display total number of (*, G) and (S, G) mroutes
created and number of mroutes installed in the kernel.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-05-29 08:44:22 -07:00
rgirada
4a5e6e7416 pimd: Re-deisgn the "clear ip mroute" command.
Made changes to clean up the all upstreams and ifchannels
in FRR apart from cleanup datapath mroutes when this command
issued.

Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2019-05-28 22:39:32 -07:00
Jafar Al-Gharaibeh
bda0241599
Merge pull request #4239 from sarav511/rp
pimd: PIM Bootstrap Message Processing
2019-05-28 10:26:28 -05:00
saravanank
5164ad1e98 pimd: clear pim bsm traffic counters for BSM
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank
415f63501b pimd: Implement show & clear ip pim statistics command
This would show only bsm related statistics for now.
We shall add more statistics to this later.

Sw3# show ip pim statistics
BSM Statistics :
----------------
Number of Received BSMs : 1584
Number of Forwared BSMs : 793
Number of Dropped BSMs  : 1320

Interface : ens192
-------------------
Number of BSMs dropped due to config miss : 0
Number of unicast BSMs dropped : 0
Number of BSMs dropped due to invalid scope zone : 0

Interface : ens224
-------------------
Number of BSMs dropped due to config miss : 0
Number of unicast BSMs dropped : 0
Number of BSMs dropped due to invalid scope zone : 0

Interface : ens256
-------------------
Number of BSMs dropped due to config miss : 0
Number of unicast BSMs dropped : 0
Number of BSMs dropped due to invalid scope zone : 0

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank
321295c1d7 pimd: Implementation of show ip pim bsrp-info.
This command displays the group to rp mappings received from BSR.

Sw3# show ip pim bsrp-info
BSR Address  30.0.0.100
Group Address 225.1.1.1/32
--------------------------
Rp Address      priority        Holdtime        Hash
(ACTIVE)
20.0.0.2        0               150             1533588312
2.2.2.2         0               150             1524600152
9.9.9.10        0               150             1489835248
7.7.2.7         0               150             1230207135
7.2.2.7         0               150             1093826719
7.7.9.7         0               150             897086367
7.8.9.10        0               150             811603184
7.5.2.7         0               150             746158239
9.10.9.10       0               150             658117872
(PENDING)
Pending RP count :0
Partial List is empty.

Group Address 226.1.1.1/32
--------------------------
Rp Address      priority        Holdtime        Hash
(ACTIVE)
9.9.9.9         0               150             326773161
(PENDING)
Pending RP count :0
Partial List is empty.

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank
0d1a4e24c2 pimd: Implement show ip pim bsm-database
This command shows all the fragments of the last received preferred BSM.
This displayed in readable format.

Sw3# sh ip pim bsm-database
Scope Zone: Global
Number of the fragments: 1

BSM Fragment : 1
------------------
BSR-Address     BSR-Priority    Hashmask-len    Fragment-Tag
30.0.0.100      0               0               3289

Group : 225.1.1.1/32
-------------------
Rp Count:9
Fragment Rp Count : 9
RpAddress     HoldTime     Priority
20.0.0.2        150          0
2.2.2.2         150          0
9.9.9.10        150          0
7.7.2.7         150          0
7.2.2.7         150          0
7.7.9.7         150          0
7.8.9.10        150          0
7.5.2.7         150          0
9.10.9.10       150          0

Group : 226.1.1.1/32
-------------------
Rp Count:1
Fragment Rp Count : 1
RpAddress     HoldTime     Priority
9.9.9.9         150          0

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:42:22 -07:00
saravanank
256392ebfd pimd: Implementation of show ip pim bsr command
Command to display current bsr, last received bsm ts, bsr uptime

Sw3# sh ip pim bsr
PIMv2 Bootstrap information
Current preferred BSR address: 30.0.0.100
Priority        Fragment-Tag       State           UpTime
  0               6390            ACCEPT_PREFERRED    91:26:24
Last BSM seen: 00:00:37

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:37:27 -07:00
saravanank
d0e418b42c pimd: rp_new & rp_del split into 2 tier functions & implement rp_change
pim_rp_new split into pim_rp_new_config and pim_rp_new.
pim_rp_new_config is called by CLI.
pim_rp_new will be called by pim_rp_new_config and bsm rp config.

pim_rp_del is split into pim_rp_del_config and pim_rp_del
pim_rp_del_config is called by CLI.
pim_rp_del is called by pim_rp_del_config and bsm rp config

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 21:35:45 -07:00
saravanank
16c926c85d pimd: interface commands to enable/disable bsm processing
(intf)ip pim bsm - to enable bsm processing on the interface
(intf)no ip pim bsm - to disable bsm processing on the interface
(intf)ip pim unicast-bsm - to enable ucast bsm processing on the interface
(intf)no ip pim unicast-bsm - to disable ucast bsm processing on the interface

Note: bsm processing and ucast bsm processing is enabled by default on a
pim interface. The CLI is implemented as a security feature as recommended by
RFC 5059

Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 20:23:15 -07:00
saravanank
4616b2e981 pimd: cli changes to show BSM statistics in show ip pim int traffic
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 20:23:15 -07:00
saravanank
09524ccfb0 pimd: implement debug pim bsm command
Signed-off-by: Saravanan K <saravanank@vmware.com>
2019-05-14 20:23:15 -07:00
Donald Sharp
859ea2dea0 pimd: Stop crash in show of single interface
There exists a possiblity that we have upstream data but
at this point in time the rpf failed because there is no
path.  As such the rpf interface will be NULL and we
should not necessarily trust it.  Prevent a crash

Ticket: CM-24857
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-05-02 10:37:04 -04:00
Donald Sharp
e134b399bd pimd: Add missing flags to json output
the json code has not been updated since a variety of new flags have
been added to the code base.  Add those flags in so we can tell
what is going on sometimes.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-23 22:01:44 -04:00
Donald Sharp
c23c1d3957 pimd: Add ability to select on S or G for show ip mroute
Add the ability to select on a S or G for a `show ip mroute`
command.

show ip mroute 225.1.1.111
show ip mroute 4.5.6.7 225.1.1.111

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-22 19:51:20 -04:00
Jafar Al-Gharaibeh
c6f637132f
Merge pull request #4025 from AnuradhaKaruppiah/pim-evpn
pim-evpn: Forwarding overlay BUM traffic via multicast VxLAN tunnels in the underlay
2019-04-22 11:44:52 -05:00
Anuradha Karuppiah
7c85225cf5 pimd: hidden command to set MLAG parameters
The MLAG component on the switch is expected to provide some
properties (such as peerlink-rif) to bootstrap the anycast-VTEP
functionality. The final interface for this is being defined as
a part of the pim-mlag functionality.

This commit provides a hidden command to test the anycast-VTEP
functionality independent of the MLAG component.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:23 -07:00
Anuradha Karuppiah
f1e2901a0f pimd: display commands for the pim-vxlan-sg database and worklist
Sample output:
root@TORS1:~# vtysh -c "show ip pim vxlan-groups"
Codes: I -> installed
Source          Group           Input           Output          Flags
27.0.0.7        239.1.1.101     lo                              I
*               239.1.1.100     -               ipmr-lo         I
*               239.1.1.101     -               ipmr-lo         I
27.0.0.7        239.1.1.100     lo                              I
root@TORS1:~#

root@TORS1:~# vtysh -c "show ip pim vxlan-work"
Codes: I -> installed
Source          Group           Input           Flags
27.0.0.7        239.1.1.100     lo                              I
PS: note the worklist dump is a hidden command

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:23 -07:00
Anuradha Karuppiah
4d913fa62e pimd: cli changes for pim-debug-vxlan
Sample:
root@TORC12:~# vtysh -c "show run" |grep "debug pim vxlan"
debug pim vxlan
root@TORC12:~# vtysh -c "show debug" |grep "pim vxlan"
debug pim vxlan
root@TORC12:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:23 -07:00
Anuradha Karuppiah
b1891fa084 pimd: API for enabling pim on the vxlan term device ipmr-lo
ipmr-lo is a dummy netdev with no additional addressing requirements -
root@TORS1:~# ip -d link show ipmr-lo
28: ipmr-lo: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 12:5a:ae:74:51:a2 brd ff:ff:ff:ff:ff:ff promiscuity 0
    dummy addrgenmode eui64
root@TORS1:~#

This device is used by pim-vxlan to signify multicast-vxlan-tunnel
termination.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:21 -07:00
Anuradha Karuppiah
ee31c9fd1a pimd: add new OIF type in prep for vxlan support
In an anycast VTEP setup the peerlink-rif (ISL) is added as a OIF to the
tunnel origination mroute. A new OIF protocol, VxLAN, has been added to
allow that functionalty.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:21 -07:00
Donald Sharp
6de45bcc61 pimd: Add ability to select join S,G for 'show ip pim join`
Add a bit of code to allow us to look at specified S,G for
the upstream available to us.

If one item is listed we assume Group, if both we assume Source
then Group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-18 16:36:10 -04:00
Donald Sharp
dff5cedb56 pimd: Add ability to select upstream on S,G for show ip pim upstream
Add a bit of code to allow us to look at specified S,G for
the upstreams available to us.

If one item is listed we assume Group, if both we assume Source then
Group.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-18 16:36:10 -04:00
Russ White
0697abef9d
Merge pull request #4096 from donaldsharp/pim_nht_cleanup
Pim nht cleanup
2019-04-16 10:27:35 -04:00
Mark Stapp
35a1272051 pimd: use debug pim static
Replace cli 'debug static' with 'debug pim static', to make
the 'debug static' node available for staticd (eventually).

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-11 11:46:40 -04:00
Donald Sharp
43763b11d0 pimd: Tracking of RPF is *separate* from the lookup
Start the separation of tracking a Destination from the act
of looking it up.  The cojoining of these two concepts led
to a bunch of code that had to think about both problems leading
to weird situations and code paths.  Simplify the code by making
pim_ecmp_nexthop_search a static function and we only ever
call pim_ecmp_nexthop_lookup when we need to do a RPF().

pim_ecmp_nexthop_lookup will now attempt to find a stored pnc
and if it finds one it will report on the answer from it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-05 11:12:59 -04:00
Lou Berger
e9890df15d
Merge pull request #4073 from donaldsharp/undebug_me_or_not
some cleanup across multiple daemons
2019-04-04 10:08:34 -04:00
Jafar Al-Gharaibeh
dbf2f94c2c
Merge pull request #4060 from donaldsharp/pim_cherrybomb
Pim cherrybomb
2019-04-03 23:02:32 -05:00
Donald Sharp
fb09579ef7 bgpd, pimd: Remove undebug commands
The undebug XXX commands were deprecated over a year ago now,
time to nuke from on high.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-03 16:17:26 -04:00
Donald Sharp
ade155e146 pimd: pim_nexthop_lookup should return true/false
The current reverse logic led to this code construct
if (!pim_nexthop_lookup(...)) {
	//Do something successfull
}

This is backwards and will cause logic errors when people
use this code.  Fix to use true/false for success/failure.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-02 08:20:36 -04:00
Sarita Patra
e7cd85bda7 pimd: Introduce mroute_creation in channel oil data structure
Issue: (*,G) mroute uptime is not updated in mroute table,
after deleting and adding the RP

Root cause: When RP gets deleted or becomes not reachable, then
we un-install the entry from the kernel, but still maintains the
entry in the stack. When  RP gets re-configured or becomes reachable,
"show ip mroute" shows the uptime, when the channel_oil gets created.

Fix: Introduce a new time mroute_creation in the channel_oil, gets
updated when mroute gets installed in the kernel.

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-03-31 23:38:28 -07:00
Donald Sharp
ff415346e6 pimd: Interfaces can be upto 16 characters
The interface column in pim was limited to 8 or 9 columns
all over the place in pim, fix the code up to allow interface
length to be up to 16 columns.

Ticket: CM-23083
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-26 21:01:00 -04:00
Donald Sharp
a6170d839a
Merge pull request #3863 from patrasar/RP_addition_deletion_changes
Rp addition deletion changes
2019-03-20 18:31:01 -04:00
Donald Sharp
f116689efb pimd: Display drpriority as a unsigned int
There existed output code that used %d for a uint32_t
switch to a %u.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-15 11:32:41 -04:00
David Lamparter
6e727402bd
Merge pull request #3907 from donaldsharp/pim_election
pimd: Ensure DR election happens when both sides change prio
2019-03-11 19:41:10 +01:00
Donald Sharp
3de708125e pimd: Ensure DR election happens when both sides change prio
Suppose we have 2 routers A and B.  Both Router A and B have
the same priority of 1000.  Router A is the elected DR.
Now suppose B lowers his priority to 1.  He still looses the
DR election and we are not sending a hello with the new priority.
Immediately after this A's priority is also lowered to 1, it
looses the election and sends the hello.  B receives this hello
and elects A as the DR( since it has the better ip address)
At this point A believes B is the DR, and B believes A is the
DR until such time that the normal hello from B is sent to A,
which if timed correctly can be a significant amount of time).

This code just causes a hello to be sent if the priority is
changed.  Now both sides will be able to converge quickly

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-03-05 10:29:35 -05:00
Quentin Young
0a22ddfbb1 *: remove null check before XFREE
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-02-25 23:00:46 +00:00
Tim Bray
e3b78da875 *: Rename backet to bucket
Presume typo from original author

Signed-off-by: Tim Bray <tim@kooky.org>
2019-02-25 16:22:36 +00:00
Sarita Patra
d8bed89dca pimd: Handling dummy upstream in "show ip pim upstream"
When FRR receives IGMP/PIM (*, G) join and RP is not configured or
not reachable, then we are creating a dummy upstream with incoming
interface as NULL.
Added some null checks for the incoming interface, while displaying
the pim upstream information in the cli command "show ip pim upstream".

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-24 09:38:03 -08:00
Donald Sharp
70fd22bd03 pimd: Add 'test pim keepalive-reset A.B.C.D A.B.C.D' command
Add a test command to pim that allows you to reset the keepalive timer
for an upstream to it's max value.  This is to allow purposeful testing
of cleanup code in pim, by forcing the keeaplive timer to expire later.

robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:10 00:00:52  00:00:25  00:02:54       1
robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:11 00:00:51  00:00:24  00:02:53       1
robot# test pim keep 192.168.201.136 225.1.0.0
Setting (192.168.201.136,225.1.0.0) to current keep alive time: 210
robot# show ip pim upstream
Iif       Source          Group           State       Uptime   JoinTimer RSTimer   KATimer   RefCnt
enp3s0    192.168.201.136 225.1.0.0       NotJ,RegP   00:00:27 00:00:35  00:00:08  00:03:27       1
robot#

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-02-20 19:26:05 -05:00
Sarita Patra
6b44b40141 pimd: reject inconsistent address/mask "ip pim rp command"
Issue: Configure "ip pim rp x.x.x.x 225.0.0.0/4".
Show running config shows "ip pim rp x.x.x.x 224.0.0.0/4"
This is mis-leading.

Root-cause: Internally 225.0.0.0/4 is getting converted to
224.0.0.0/4 group mask, since the prefix length is 4.

Fix: Restrict the user to configure inconsistent group address
mask by throughing a cli error "Inconsistent address and mask".

Signed-off-by: Sarita Patra <saritap@vmware.com>
2019-02-08 01:35:21 -08:00
Donald Sharp
414d885aac pimd: Add hidden 'ip pim active-active` command
Add a command to track if an interface should be in active-active
mode or not.  This command is hidden at this time because it
is not finished fully.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31 09:28:39 -05:00
Donald Sharp
afec9bba1e pimd: Allow pim to display what it believes the mlag role is.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:40 -05:00
Donald Sharp
75373ccac4 pimd: Move packet_process variable to pim_router
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp
2925dff513 pimd: Move register_suppress_time into struct pim router
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp
da03883e1e pimd: Convert rpf_cache_refresh_delay_msec into pim_router struct
Move the rpf_cache_refresh_delay_msec into the pim_router since
it should own the data.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp
5b45753eff pimd: Convert qpim_t_periodic into the struct pim_router structure
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-04 12:23:39 -05:00
Donald Sharp
a0bf54c7de pimd: Add some extra information to a show command
The tracking of who have drpriority on an interface
in pim was not displayed anywhere.  Add to the show
command for future reference.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-21 10:17:48 -04:00
Donald Sharp
85a13586ed pimd: use bool instead of int to pass true/false
In pim_if_new use bool instead of an int to pass
true/false values for what we should create the
pim interface type for.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-17 14:09:06 -04:00
Donald Sharp
59752d4ea5 pimd: Actually create vif's in non-integrated config
The startup of a non-integrated config was not properly
allowing for startup to create the vif when we have
not learned about the interface we are trying to configure
at this point in time.  Actually notice when we are
trying to create a pimreg device or not to properly
notice when to attempt to create the vif or not.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-17 13:58:59 -04:00
Sarita Patra
eccdcfe2b6 pimd: fix indentation warnings
Signed-off-by: Sarita Patra <saritap@vmware.com>
2018-09-11 22:00:15 -07:00
root
2f5e937c49 pimd: create a new command "ip pim" configuring pim sm
A new command "ip pim" is created to configure pim sm on an
interface, which replaces the existing commands "ip pim sm"
and "ip pim ssm" and make "ip pim sm" and "ip pim ssm" as
hidden commands. The command "ip multicast-routing" is removed
since it is already enabled on FRR by default.

Signed-off-by: Sarita Patra saritap@vmware.com
2018-09-10 22:22:14 -07:00
Don Slice
088f109866 bgpd, ospfd, pimd, zebra: Convert more use_json locations to bool
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-09-04 17:39:04 +00:00
Don Slice
9f049418bc bgpd/ospfd: make bgp and ospf json response a bit more consistent
Problem reported that some bgp and ospf json commands did not return
any json output at all if the bgp/ospf instance did not exist.
Additionally, some bgp and ospf json commands did not return any json
output if the instance existed but no neighbors were defined.  This
fix makes these commands more consistent in returning empty braces for
json output and issue a message if not using json output.  Additionally,
made the flag "use_json" a bool to make it consistent since previously,
it had been defined as an int, char, u_char, and bool at various places.

Ticket: CM-21040
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-08-30 12:40:18 +00:00
David Lamparter
a2dc7057e0 *: fix gcc-8 format-overflow warnings
e.g.
pimd/pim_oil.c: In function ‘pim_channel_oil_dump’:
pimd/pim_oil.c:51:19: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 10 [-Werror=format-overflow=]

Build on gcc-8.2.0 is warning-free after this patch.

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-08-21 21:05:09 +02:00
Donald Sharp
7cd502014e pimd: Trust backet->data
The backet->data cannot be NULL, no need to check for it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-15 17:53:09 -04:00
Donald Sharp
d6853655b5
Merge branch 'master' into bfd-final 2018-08-14 08:16:10 -04:00
Donald Sharp
0ce1ca805d *: ALLOC calls cannot fail
There is no need to check for failure of a ALLOC call
as that any failure to do so will result in a assert
happening.  So we can safely remove all of this code.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-08-11 17:14:58 +02:00
Rafael Zalamena
64dc4b2d7a bgpd/ospf(6)d/pimd: hide BFD commands with timers
Don't show BFD commands with timers since it might confuse users
("show running-config" won't display timers in client daemons anymore),
but keep accepting this command from previous configurations.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2018-08-08 18:25:08 -03:00
Donald Sharp
b938537bdb pimd: Remove duplicate parameter to functions
Both pim_ecmp_nexthop_lookup and pim_ecmp_fib_lookup_if_vif_index
pass the address in 2 times.  Make function calls consistent
and just pass in the src once.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-07 10:15:02 -04:00
Donald Sharp
ab9ac14351 pimd: When doing nexthop-lookups don't allocate perm memory
When doing nexthop lookups do not permanently allocate
memory in zebra and pim to track the nexthop specified
on the cli.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-07 09:02:07 -04:00
Donald Sharp
db20e34f09 pimd: Use generated interface name
When we have a generated interface name, use it instead of the actual
pointer.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-07-03 21:31:11 -04:00
paco
a2b6e694b1
bgpd isisd ldpd lib ospfd pimd: redundancy (infer)
Signed-off-by: F. Aragon <paco@voltanet.io>
2018-06-20 22:25:28 +02:00
Donald Sharp
4795fff748 pimd: Fix ecmp_enable and ecmp_rebalance_enable
These commands were being accepted in all vrf's and
affecting all vrf's behavior globally, since they were
global variables.

Modify the code to make these two commands work
on a per-vrf basis.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-06-07 10:23:32 -04:00
Mladen Sablic
21313cbfda pimd: show ip igmp statistics command
Command showing IGMP Rx statistics, useful for analyzing IGMP
activity on interfaces.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-05-04 17:05:19 +02:00
Quentin Young
ef7eec745d
bgpd, pim: remove undebug
This 'undebug' syntax is only used in 5 commands and serves no apparent
purpose.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-04-02 16:03:11 -04:00
Lou Berger
97610b589f
Merge pull request #1921 from donaldsharp/pim_stuff
Pim stuff
2018-03-30 12:03:33 -04:00
Quentin Young
d7c0a89a3a
*: use C99 standard fixed-width integer types
The following types are nonstandard:
- u_char
- u_short
- u_int
- u_long
- u_int8_t
- u_int16_t
- u_int32_t

Replace them with the C99 standard types:
- uint8_t
- unsigned short
- unsigned int
- unsigned long
- uint8_t
- uint16_t
- uint32_t

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-03-27 15:13:34 -04:00
Donald Sharp
bfc9201928 pimd: Move some data tracking variables per VRF
There were a few more global variables that needed to be per
vrf.  So move them over.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 21:34:55 -04:00
Donald Sharp
da11e32521 pimd: Make the rpf scan per vrf.
We know the vrf that we are in when we need to initiate a
rescan of the rpf cache.  So pass it in and use that information.
This should help the rescan at scale with several vrf's cutting
out a lot of unnecessary work.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-03-17 21:13:09 -04:00
Mladen Sablic
f83f396624 pimd: mtrace only IGMP sockets
Feature of mtrace only IGMP sockets on pim sm and pim
ssm interfaces. Modifed IGMP socket creation and show
igmp interface command output.

Signed-off-by: Mladen Sablic <mladen.sablic@gmail.com>
2018-03-08 09:40:48 +01:00
Lou Berger
3a6351a3d9 pimd: another change to keep indent.py happy
Signed-off-by: Lou Berger <lberger@labn.net>
2018-03-06 14:09:19 -05:00