Commit Graph

24361 Commits

Author SHA1 Message Date
Donald Sharp
fc1391a840
Merge pull request #8617 from opensourcerouting/pim-bsm-cleanup
lib, pimd: move bsm code to typesafe lists
2021-05-04 07:05:24 -04:00
Abhinay Ramesh
4ab467017e bgpd: Support tcp-mss for bgp neighbors
Problem Statement:
=================
In scale setup BGP sessions start flapping.

RCA:
====
In virtualized environment there are multiple places where
MTU need to be set. If there are some places were MTU is not set
properly then there is chances that BGP packets get fragmented,
in scale setup this will lead to BGP session flap.

Fix:
====
A new tcp option is provided as part of this implementation,
which can be configured per neighbor and helps to set the TCP
max segment size. User need to derive the path MTU between the BGP
neighbors and set that value as part of tcp-mss setting.

1. CLI Configuration:
	[no] neighbor <A.B.C.D|X:X::X:X|WORD> tcp-mss (1-65535)

2. Running config
    frr# show running-config
    router bgp 100
     neighbor 198.51.100.2 tcp-mss 150       => new entry
     neighbor 2001:DB8::2 tcp-mss 400        => new entry

3. Show command
    frr# show bgp neighbors 198.51.100.2
    BGP neighbor is 198.51.100.2, remote AS 100, local AS 100, internal link
    Hostname: frr
      Configured tcp-mss is 150, synced tcp-mss is 138     => new display

4. Show command json output

    frr# show bgp neighbors 2001:DB8::2 json
    {
      "2001:DB8::2":{
        "remoteAs":100,
        "bgpTimerKeepAliveIntervalMsecs":60000,
        "bgpTcpMssConfigured":400,                               => new entry
        "bgpTcpMssSynced":388,                                  => new entry

Risk:
=====
Low - This is a config driven feature and it sets the max segment
size for the TCP session between BGP peers.

Tests Executed:
===============
Have done manual testing with three router topology.
1. Executed basic config and un config scenarios
2. Verified if the config is updated in running config
   during config and no config operation
3. Verified the show command output in both CLI format and
   JSON format.
4. Verified if TCP SYN messages carry the max segment size
   in their initial packets.
5. Verified the behaviour during clear bgp session.
6. done packet capture to see if the new segment size
   takes effect.

Signed-off-by: Abhinay Ramesh <rabhinay@vmware.com>
2021-05-04 06:21:24 +00:00
Donatas Abraitis
98d742c6f7
Merge pull request #8606 from donaldsharp/peer_cleanups
Peer cleanups
2021-05-04 08:47:26 +03:00
Donald Sharp
645a1f1d5f bgpd: Prevent test against uninited data
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-03 21:03:31 -04:00
Donald Sharp
9f54dfd8b7
Merge pull request #8613 from opensourcerouting/build-fix-pb-assert
build: fix assert() use in .pb-c.c files
2021-05-03 20:46:58 -04:00
Donald Sharp
c3d0d6e8a1 zebra: Allow redistribution for routes selected
Current code has an inconsistent behavior with redistribute routes.
Suppose you have a kernel route that is being read w/ a distance
of 255:

eva# show ip route kernel
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.161.1, enp39s0, 00:06:39
K>* 4.4.4.4/32 [255/8192] via 192.168.161.1, enp39s0, 00:01:26
eva#

If you have redistribution already turned on for kernel routes
you will be notified of the 4.4.4.4/32 route.  If you turn
on kernel route redistribution watching after the 4.4.4.4/32 route
has been read by zebra you will never learn of it.

There is no need to look for infinite distance in the redistribution
code.  Either we are selected or not.  In other words non kernel routes
with an 255 distance are never installed so the checks were pointless.

So let's just remove the distance checking and tell interested parties
about the 255 kernel route if it exists.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-03 19:53:12 -04:00
Renato Westphal
e34248cf3f
Merge pull request #8577 from volta-networks/fix_ldp_broken_lsps
ldpd: make allowing broken-lsps to be installed configurable
2021-05-03 20:46:32 -03:00
Donald Sharp
921af54db9 sharpd: add v4 redistribute watching
Add the ability for sharpd to watch v4 redistribution events

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-03 19:38:38 -04:00
Igor Ryzhov
c0ec883b45
Merge pull request #8603 from Fredi-raspall/pr_tilfa_link_fallback
Pr tilfa link fallback
2021-05-03 22:51:38 +03:00
David Lamparter
62cd66d90b tests: add scapy to topotests Docker
Not having scapy in the docker image leads to very obtuse failures in
the pim bsm tests (obtuse, as in, it just fails without any hint as to
why...)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:56:55 +02:00
David Lamparter
02fb02de37 lib: kill unused list_filter_out_nodes()
pimd was the only user of this function, and that has gone away now.
So just kill the function.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:56:55 +02:00
David Lamparter
fdab294037 pimd: cleanup & convert bsm_rpinfo to TS list
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:56:51 +02:00
David Lamparter
d4a4525c12 pimd: cleanup & convert bsm_info to TS list
Just some cleanup before I touch this code;  switching to typesafe list
macros & putting the data directly inline.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:55:59 +02:00
David Lamparter
6669282091 pimd: remove unused sz_timer
... yes we may need it later, but if and when that happens we can put it
back there.  No point carrying around unused things.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:55:04 +02:00
David Lamparter
507e0e5d66 lib: add *_swap_all to typesafe containers
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 20:55:04 +02:00
Don Slice
9f92e2352b eigrpd: Test for EIGRP AS number and ensure it's the same
When receiving a packet, ensure that the AS number is the same.

Fixes: 8515
Signed-off-by: Don Slice <dslice@nvidia.com>
2021-05-03 14:26:27 -04:00
David Lamparter
20a4a2e9e6 build: fix assert() use in .pb-c.c files
The .pb-c.c files pick up our assert() override, but that needs config.h
to be included too, and that needs to go at the very top of the file...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-03 18:48:33 +02:00
Rafael Zalamena
ccfd681d98 doc: improve PIM documentation
Remove duplicates and explain MSDP better.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-05-03 13:38:21 -03:00
Rafael Zalamena
8c70c9e290 pimd: show MSDP configuration
Display the MSDP peer configuration in `show running-config` so it can
be saved on configuration write.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-05-03 12:30:40 -03:00
Rafael Zalamena
5a1a392032 pimd: reduce code duplication
Standardize a function to get the current VRF node name.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2021-05-03 12:30:02 -03:00
Fredi Raspall
c2b0cb2cc4 doc: document link-fallback ti-lfa option
Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-05-03 17:27:37 +02:00
Fredi Raspall
ce4eccfa80 isisd: link protection optional fallback in ti-lfa
The current implementation of TI-LFA computes link-protecting
repair paths (even when node protection is enabled) to have repair
paths to all destinations when no node-protecting repair has been
found. This may be desired or not. E.g. the link-protecting paths
may use the protected node and be, therefore, useless if the node
fails. Also, computing link-protecting repairs incurs extra
calculations.

With this patch, when node protection is enabled, link protecting
repair paths are only computed if "link-fallback" is specified in
the configuration, on a per interface and IS-IS level.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-05-03 17:27:37 +02:00
Mark Stapp
f71e1ff6a9
Merge pull request #8545 from opensourcerouting/assert-our-own
*: make our own assert() actually work
2021-05-03 11:17:36 -04:00
Igor Ryzhov
92046e6540
Merge pull request #8605 from donaldsharp/libyang_version
build: Limit libyang version to under 2.0
2021-05-03 16:55:11 +03:00
Mark Stapp
2a27bd976c
Merge pull request #8571 from donaldsharp/ifp_speed
zebra: Allow interface up events to read speed
2021-05-03 09:39:41 -04:00
Donald Sharp
9298056138 zebra: Allow one connected route per network mask on a interface
Currently FRR reads the kernel for interface state and FRR
creates a connected route per address on an interface.  If
you are in a situation where you have multiple addresses
on an interface just create 1 connected route for them:

sharpd@eva:/tmp/topotests$ vtysh -c "show int dummy302"
Interface dummy302 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  vrf: default
  index 3279 metric 0 mtu 1500 speed 0
  flags: <UP,BROADCAST,RUNNING,NOARP>
  Type: Ethernet
  HWaddr: aa:4a:ed:95:9f:18
  inet 10.4.1.1/24
  inet 10.4.1.2/24 secondary
  inet 10.4.1.3/24 secondary
  inet 10.4.1.4/24 secondary
  inet 10.4.1.5/24 secondary
  inet6 fe80::a84a:edff:fe95:9f18/64
  Interface Type Other
  Interface Slave Type None
  protodown: off

sharpd@eva:/tmp/topotests$ vtysh -c "show ip route connected"
Codes: K - kernel route, C - connected, S - static, R - RIP,
       O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

C>* 10.4.1.0/24 is directly connected, dummy302, 00:10:03
C>* 192.168.161.0/24 is directly connected, enp39s0, 00:10:03

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-03 09:17:22 -04:00
lynne
ff5279ba48 ldpd: make allowing broken-lsps to be installed with pop operation configurable
If LDP is miss configured in a setup and the router has LSPs with no remote
label, this code installs the LSP with a pop instruction of the top-level
label so the packet can be forwarded using IP.   This is a best-effort
attempt to deliver labeled IP packets to their final destination instead of
dropping them.    If this config is turned off the code will only install
LSPs that have a valid remote label.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
2021-05-03 09:02:36 -04:00
David Lamparter
adf1bb9f0c
Merge pull request #8566 from rubensfig/isis_metricstyle
doc: isis: document default value for metric-style
2021-05-03 13:30:35 +02:00
David Lamparter
0a1970c356
Merge pull request #8599 from Jafaral/old-doc
doc: remove obsolete Netlink discussion, fix svi cmd doc
2021-05-03 10:45:38 +02:00
David Lamparter
9cd090488c
Merge pull request #8479 from mjstapp/zlog_immediate 2021-05-03 10:40:54 +02:00
David Lamparter
c8b084aab7
Merge pull request #8607 from donaldsharp/better_reasoning
lib: Provide some better error handling for operator
2021-05-03 10:07:43 +02:00
Yash Ranjan
17ab36c6c4 ospf6d: Send Link LSAs when interface priority is changed
As per the ospfv3 conformance test 24.3

SETUP: Configure DIface-0 with priority set to <hprty>.
ANVL: Establish full adjacency with DUT for neighbor Rtr-0-A on DIface-0.
DUT: Exchange all the <OSPF-DD> packets, during adjacency establish- ment.
ANVL: Verify that the received <OSPF-DD> packets contain: • one header of Link-LSA, originated by DUT.
ANVL: Send <OSPF-LSR> packet from neighbor Rtr-0-A to DIface-0 con- taining:
• One Request Tuple for Link-LSA originated by DUT.
ANVL: Listen (for upto 2 * <RxmtInterval> seconds) on DIface-0. DUT: Send <OSPF-LSU> packet.
ANVL: Verify that the received <OSPF-LSU> packet contains:
• •
one Link-LSA, originated by DUT, contains: Rtr Pri field set to <hprty>.
----------
When interface priority is changed Link LSAs should be tranmitted
with the priority set.

When the link priorty chanages, the drbdr algorithm is called, which
can change the state of the interface. But if the state does not
changes then LINK LSAs are not transmitted.

This PR fixes this issue. If the state is changed, then LINK LSAs
will anyways be tranmitted. But in case the state is not changed,
even in that case Link LSAs are tranmitted.

Signed-off-by: Yash Ranjan <ranjany@vmware.com>
2021-05-02 10:19:16 -07:00
David Lamparter
4f1a6d98da lib: fix random C++ compat problem w/ printfrr
These hoops to get warnings for mis-printing `uint64_t` are apparently
breaking some C++ bits...

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
David Lamparter
8dff30f801 tests: fix assert.h header change fallout
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
David Lamparter
64dd77361f lib: rework how we "override" assert()
The previous method, using zassert.h and hoping nothing includes
assert.h (which, on glibc at least, just does "#undef assert" and puts
its own definition in...) was fragile - and actually broke undetected.

Just provide our own assert.h and control overriding by putting it in a
separate directory to add to the include path (or not.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:27:17 +02:00
David Lamparter
9d75e30960 zebra: replace _rnode_zlog with %pZN ext
Since _rnode_zlog was wrapping zlog(), these messages weren't getting an
unique ID assigned through the xref mechanism.  Replace macro with a
small extension that prints (almost) the same thing.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-05-02 16:20:30 +02:00
Donald Sharp
188acbb9a3 lib: Provide some better error handling for operator
When an operator encounters a situation where the number
of FD's open is greater than what we have been configured
to legitimately handle via uname or the `--limit-fds` command
line, abort with a message that they should be able to
debug and figure out what is going on.

Fixes: #8596
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-02 07:41:11 -04:00
Donald Sharp
7a75470fe1 bgpd: Delay setting peer data until after decision to allow open
Delay setting local data about a remote peer until after BGP
has decided to allow an open connection to proceed.

Modifying local peer data structures based upon what is
received from a peer should not be done until after BGP
has decided that the open is allowed to proceed.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-02 07:31:54 -04:00
Donald Sharp
f88221f3b4 bgpd: Cleanup bgp_collision_detect indentation
The bgp_collision_detect function is heavily indented.
Perform some cleanup to make it easier to read.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-02 07:31:45 -04:00
Donald Sharp
c3c6dbf80a bgpd: listener thread pointer is already NULL
FRR in thread.c clears the passed in double pointer when
we pull it off the ready queue and pass it back to
the calling function via thread_fetch().

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-02 07:31:30 -04:00
Donald Sharp
c490437e6f zebra: Allow interface up events to read speed
Initially the reading of the speed of an interface happened
upon interface creation and happened until the speed of a link
settled down to a single value.  The speed of an interface
can also change as that a new optic can be inserted that
changes the speed, in which case FRR would see a interface
down (optic removal) and then a interface up (optic insertion).

In this case FRR would not treat this as an event that changed
the speed.  Let's expand the checking a bit more.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-02 07:30:02 -04:00
Renato Westphal
83187b8285
Merge pull request #8601 from Fredi-raspall/pr_fix_lfa_debug
isisd: fix show LFA debug in show debugging cmd
2021-05-01 21:28:07 -03:00
Renato Westphal
18a27ed2bd
Merge pull request #8602 from Fredi-raspall/pr_fix_lfa_mem_leak
isisd: fix memory leak for non-freed spftrees
2021-05-01 21:27:40 -03:00
Donald Sharp
6b334023f7 build: Limit libyang version to under 2.0
Ensure that master is not built with libyang version 2 or greater
since we'll fail.

Fixes: #8524
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2021-05-01 18:38:26 -04:00
Fredi Raspall
098fc8a9cd isisd: fix show LFA debug in show debugging cmd
When enabling 'debug isis lfa', the option was correctly enabled
but not displayed by 'show debugging' command.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-05-01 16:05:22 +02:00
Fredi Raspall
7c3be15f3e isisd: fix memory leak for non-freed spftrees
When enabling TI-LFA the forward SPF for neighbors adjacent to the
PLR is computed. Later, when computing the PQ spaces, the reverse
SPF trees for those adjacent neighbors affected by the protected
interface are computed.

When node protection is enabled, TI-LFA link protection is run
immediately afterwards to compute repairs in case no
node-protecting backup path exists. In this second run, the
existing code tries to compute the reverse SPF tree for the same
node, without freeing the SPF tree of the prior run.

This patch fixes this by not computing the reverse SPF again, thus
avoiding a memory leak and an unnecessary SPF run.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
2021-05-01 15:52:10 +02:00
Jafar Al-Gharaibeh
a927f5bc6e doc: remove obsolete Netlink discussion, fix svi cmd doc
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2021-04-30 18:10:56 -05:00
Igor Ryzhov
b32454e10c tests: fix bgp-auth topotest
Individual tests must not depend on each other. In particular, a test
can't be sure that the previous test config is applied or cleared.
It is definitely not true when a single test is executed, for example:
`test_bgp_auth.py::test_prefix_peer_remove_passwords`.

This commit makes all tests independent of each other. It also adds a
call to check_all_peers_established at the start of "remove_passwords"
tests to make sure that we not only block new peers with an incorrect
password, but also clean the existing peers.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2021-05-01 01:31:26 +03:00
Quentin Young
1af1ce4ebc
Merge pull request #8576 from pguibert6WIND/macvlan_crash 2021-04-30 15:34:32 +00:00
Rafael Zalamena
058d0236b6
Merge pull request #8588 from idryzhov/a-lot-of-isis-fixes
a lot of isis fixes
2021-04-30 07:58:19 -03:00