Commit Graph

209 Commits

Author SHA1 Message Date
Sebastien Merle
31f937fb43 lib, zebra: Add SR-TE policy infrastructure to zebra
For the sake of Segment Routing (SR) and Traffic Engineering (TE)
Policies there's a need for additional infrastructure within zebra.
The infrastructure in this PR is supposed to manage such policies
in terms of installing binding SIDs and LSPs. Also it is capable of
managing MPLS labels using the label manager, keeping track of
nexthops (for resolving labels) and notifying interested parties about
changes of a policy/LSP state. Further it enables a route map mechanism
for BGP and SR-TE colors such that learned BGP routes can be mapped
onto SR-TE Policies.

This PR does not introduce any usable features by now, it is just
infrastructure for other upcoming PRs which will introduce 'pathd',
a new SR-TE daemon.

Co-authored-by: Renato Westphal <renato@opensourcerouting.org>
Co-authored-by: GalaxyGorilla <sascha@netdef.org>
Signed-off-by: Sebastien Merle <sebastien@netdef.org>
2020-08-07 11:08:49 +02:00
Anuradha Karuppiah
d0f699b505 lib: MAC-IP flags used by zebra and BGP for SYNC route handling
1. BGP informs zebra if a MAC-IP is a SYNC path and if it active on the
ES peer.
2. Zebra sends paths that are "local-inactive" with the proxy flag to
BGP.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:12 -07:00
Anuradha Karuppiah
ce5160c081 zebra: Ethernet segment management and support for MAC-ECMP
1. Local ethernet segments are configured in zebra by attaching a
local-es-id and sys-mac to a access interface -
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
!
interface hostbond1
 evpn mh es-id 1
 evpn mh es-sys-mac 00:00:00:00:01:11
!
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
This info is then sent to BGP and used for the generation of EAD-per-ES
routes.

2. Access VLANs associated with an (ES) access port are translated into
ES-EVI objects and sent to BGP. This is used by BGP for the
generation of EAD-EVI routes.

3. Remote ESs are imported by BGP and sent to zebra. A list of VTEPs
is maintained per-remote ES in zebra. This list is used for the creation
of the L2-NHG that is used for forwarding traffic.

4. MAC entries with a non-zero ESI destination use the L2-NHG associated
with the ESI for forwarding traffic over the VxLAN overlay.

Please see zebra_evpn_mh.h for the datastruct organization details.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2020-08-05 06:46:12 -07:00
Mark Stapp
474aebd939 lib,sharpd,zebra: initial support for multiple backup nexthops
Initial changes to support a nexthop with multiple backups. Lib
changes to hold a small array in each primary, zapi message
changes to support sending multiple backups, and daemon
changes to show commands to support multiple backups. The config
input for multiple backup indices is not present here.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-07-17 13:12:33 -04:00
Mark Stapp
387831ffc3 lib,zebra,sharpd: modify opaque zapi message to support unicast
Start modifying the OPAQUE zapi message to include optional
unicast destination zapi client info. Add a 'decode' api and
opaque msg struct to encapsulate that optional info.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-10 08:26:27 -04:00
Mark Stapp
d2ddc1416b lib,zebra: rename opaque decode api
Change name of an opaque zapi api to 'decode' to align with the
other zapi message parsing apis. Missed that in the original
opaque commits.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-10 08:16:10 -04:00
Renato Westphal
edfdfe201a
Merge pull request #6506 from volta-networks/ldp_pwstatus_cleanup
ldpd: remove unused 'pwstatus' field from message zapi_pw_status
2020-06-02 21:34:05 -03:00
Karen Schoener
d0e0a52719 ldpd: remove unused 'pwstatus' field from message zapi_pw_status.
Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-06-02 18:10:23 -04:00
Mark Stapp
ff49114095 lib: add OPAQUE zapi message
Add a zapi message type designed to carry opaque data. Add
'send' api, and prototype for client handler function. Also
add registration/unreg messages, so that clients can 'subscribe'
to receive these messages as they're passing through zebra.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-02 08:20:54 -04:00
Renato Westphal
30712725a0
Merge pull request #6480 from volta-networks/feat_pwstatus
ldpd: Relay data plane pseudowire status in LDP notification
2020-06-01 21:00:51 -03:00
Mark Stapp
ae076fc276 lib: add zapi_nexthop2str()
Add a handy 2str api for zapi nexthop debugging.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-01 14:46:32 -04:00
Mark Stapp
34f86754a2 lib: add backup nexthop/nhlfe to zapi label messages
Add backup nexthops/nhlfes to the zapi messages used
to convey LSPs to zebra.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-06-01 14:46:12 -04:00
Karen Schoener
fd563cc7f3 ldpd: Relay data plane pseudowire status in LDP notification
Provide a way for the data plane to indicate pseudowire
status (such as: not forwarding, AC failure).

On a data plane pseudowire install failure, data plane
sets the pseudowire status.
Zebra relays the pseudowire status to LDP.
LDP includes the pseudowire status in the LDP notification
to the LDP peer.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-06-01 13:21:37 -04:00
Renato Westphal
17e38209a5 lib, zebra: add missing extern "C" {} blocks to new header files
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-04-22 23:49:22 -03:00
Mark Stapp
4e0b5b31b7 lib,zebra: add a session id for zapi sessions
Distinguish zapi sessions, for daemons who use more than one,
by adding a session id. The tuple of proto + instance is not
adequate to support clients who use multiple zapi sessions.
Include the id in the client show output if it's present. Add
a bit of info about this to the developer doc.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-04-16 12:07:54 -04:00
Quentin Young
efc7191bbe lib: make all zclient.[ch] stream funcs safe
Use STREAM_GET* variants of stream getters, which all have non-assert
error paths.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-04-13 13:25:25 -04:00
Mark Stapp
0a8881b4b5 lib: support backup nexthops in nexthop-groups and zapi
Add vty support for backup nexthops in nexthop groups. Capture
backup nexthop info in zapi route messages.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-27 09:39:14 -04:00
Mark Stapp
018c648864 lib: add backup nexthops to zapi routes
Add backup nexthop info to zapi route messages.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-27 09:37:02 -04:00
Mark Stapp
e4a1ec7454 zebra,lib: use const in more apis
Use const with some args to ipaddr, zebra vxlan, mpls
lsp, and nexthop apis; add some extra checks to some
nexthop-related apis.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-27 09:37:02 -04:00
Renato Westphal
4e9d40b8a1
Merge pull request #5925 from volta-networks/synchronous_client
zebra: synchronous client queues accumulate messages from zebra
2020-03-26 17:32:37 -03:00
Karen Schoener
17da84a49d zebra: Synchronous client queues accumulate messages from zebra.
Zebra is currently sending messages on interface add/delete/update,
VRF add/delete, and interface address change - regardless of whether
its clients had requested them.  This is problematic for lde and isis,
which only listens to label chunk messages, and only when it is
waiting for one (synchronous client). The effect is the that messages
accumulate on the lde synchronous message queue.

With this change:
  - Zebra does not send unsolicited messages to synchronous clients.
  - Synchronous clients send a ZEBRA_HELLO to zebra.
    The ZEBRA_HELLO contains a new boolean field: sychronous.
  - LDP and PIM have been updated to send a ZEBRA_HELLO for their
    synchronous clients.

Signed-off-by: Karen Schoener <karen@voltanet.io>
2020-03-23 09:17:17 -04:00
Donald Sharp
46f56dadd4 lib: Modify zclient_send_rnh to use const struct prefix
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-22 18:38:56 -04:00
Mark Stapp
4945002d71 *: encode zapi labels message using nexthops
Use the zapi_nexthop struct with the mpls_labels
zapi messages instead of the special-purpose (and
more limited) nexthop struct that was being used.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-02-14 16:16:21 -05:00
Santosh P K
be7bbe529d lib: Adding GR capabilites encode and decode.
For Graceful restart clients have to send GR capabilities
library functions are added to encode capabilities and
also for zebra to decode client capabilities.

Co-authored-by: Santosh P K <sapk@vmware.com>
Co-authored-by: Soman K S <somanks@vmware.com>
Signed-off-by: Santosh P K <sapk@vmware.com>
2020-01-30 10:25:52 -08:00
bisdhdh
eb451ee589 bgpd: Zebra lib for Graceful Restart.
These changes are for Zebra lib in order to supportGraceful Restart
feature. These changes are addedtemporarily, until Zebra Graceful
Restart lib Pr is merged.

Signed-off-by: Biswajit Sadhu <sadhub@vmware.com>
Signed-off-by: Soman K S <somanks@vmware.com>
2020-01-23 09:36:33 +05:30
Quentin Young
24c370dd46 zebra: fix redist memleak on client disconnect
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-15 14:18:40 -05:00
Stephen Worley
9ab0b2a37a lib,zebra: add zapi msg top level error handling
Add error handling for top level failures (not able to
execute command, unable to find vrf for command, etc.)

With this error handling we add a new zapi message type
of ZEBRA_ERROR used when we are unable to properly handle
a zapi command and pass it down into the lower level code.

In the event of this, we reply with a message of type
enum zebra_error_types containing the error type.

The sent packet will look like so:

 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|             Length            |     Marker    |    Version    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             VRF ID                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            Command            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|            ERROR TYPE         |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Also add appropriate hooks for clients to subscribe to for
handling these types of errors.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2020-01-08 12:22:29 -05:00
Donald Sharp
bd054c1aa2 lib, zebra: Allow for encode/decode of nexthop weight in pass down
Add code to encode/decode the nexthop weight when we pass it down
into zebra.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-09 13:37:37 -05:00
Donald Sharp
a44dcdee55
Merge pull request #5332 from mjstapp/remove_zapi_label_flag
*: revise zapi nexthop encoding
2019-12-06 13:19:34 -05:00
Mark Stapp
68a02e06e5 *: revise zapi nexthop encoding
Use a per-nexthop flag to indicate the presence of labels; add
some utility zapi encode/decode apis for nexthops; use the zapi
apis more consistently.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-12-06 10:17:20 -05:00
Stephen Worley
eb5d458b3f lib: Add zapi_rule_notify_owner2str() function
Add a function for converting the zapi_rule_notify_owner enum
type to a string for ease of use.

Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com>
2019-12-03 16:14:34 -05:00
Chirag Shah
0ca1058096 bgpd: evpn pip handle svi ip route
By default announct Self Type-2 routes with
system IP as nexthop and system MAC as
nexthop.

An API to check type-2 is self route via
checking ipv4/ipv6 address from connected interfaces list.

An API to extract RMAC and nexthop for type-2
routes based on advertise-svi-ip knob is enabled.

When advertise-pip is enabled/disabled, trigger type-2
route update. For self type-2 routes to use
anycast or individual (rmac, nexthop) addresses.

Ticket:CM-26190
Reviewed By:
Testing Done:

Enable 'advertise-svi-ip' knob in bgp default instance.
the vrf instance svi ip is advertised with nexthop
as default instance router-id and RMAC as system MAC.

Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
2019-11-22 07:53:32 -08:00
Satheesh Kumar K
46c2687c72 pimd, lib: adding support for MLAG Message processing at PIM
This includes:
1. Defining message formats
2. Stream Decoding after receiving the message at PIM
3. Handling MLAG UP & Down Notifications

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-11-13 20:43: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
6e8e092521 lib, zebra: Fix last write command written
With commit: a9ff90c41b
the vrf_id_t was changed from a uint16_t to a uint32_t

Zebra tracked the last command sent to it's peer via peeking
into the data it was sending to each client ( since we had
lost the idea of what the command was when it was time to track
the data ).

Add a define to track this and add a bit of verbiage
to the code to allow us to notice when we screw with
the header again so that this is just fixed correctly
when it happens again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-15 14:54:35 -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
Jafar Al-Gharaibeh
d563896dad
Merge pull request #4885 from satheeshkarra/pim_mlag
pimd, lib, Zebra: PIM MLAG Support
2019-10-14 01:07:24 -05:00
Satheesh Kumar K
5fdca4ded5 pimd, lib: adding support for MLAG Message processing at PIM
This includes:
1. Defining message formats
2. Stream Decoding after receiving the message at PIM
3. Handling MLAG UP & Down Notifications

Signed-off-by: Satheesh Kumar K <sathk@cumulusnetworks.com>
2019-09-24 01:35:09 -07:00
Donald Sharp
26f8f6fe7f lib: delete interface if you can in upper level protocol
In an upper level protocol, delete the interface on notification
about deletion.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
3c3c325203 *: Convert zapi->interface_delete to ifp callback
Convert the callback of the interface_delete to the new
ifp callback.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
b0b69e59f4 *: Convert interface_down to interface down callback
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ddbf3e6060 *: Convert from ->interface_up to the interface callback
For all the places we have a zclient->interface_up convert
them to use the interface ifp_up callback instead.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04:00
Donald Sharp
ef7bd2a3d5 *: Switch all zclient->interface_add to interface create callback
Switch the zclient->interface_add functionality to have everyone
use the interface create callback in lib/if.c

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-19 13:34:06 -04: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
Renato Westphal
ea6b290bf6 lib, zebra: add new MPLS zapi message with route replace semantics
This new message makes it possible to install/reinstall LSPs with
multiple nexthops using a single ZAPI message.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-10 00:01:10 -03:00
Renato Westphal
b3c49d0e77 lib, zebra: enhance the MPLS zapi messages
* Add ability to specify the nexthop type;
* Add ability to install or not a FTN (in addition to an LSP).

These two additions will be useful to install local SR Prefix-SIDs
configured with the no-PHP option.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06 21:06:11 -03:00
Renato Westphal
e132dea064 zebra: identify MPLS FTNs by route type and instance
Use the route type and instance instead of the route distance
to identify MPLS FTNs. This is a more robust approach since the
routing daemons can modify the distance of their announced routes
via configuration, which can cause inconsistencies.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06 21:06:11 -03:00
Renato Westphal
bad6b0e72e lib: introduce encode/decode functions for the MPLS zapi messages
Do this for the following reasons:
* Improve modularity of the code by separating the decoding of the
  ZAPI messages from their processing;
* Create an API that is easier to use by the client daemons.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2019-09-06 21:06:11 -03:00
Jafar Al-Gharaibeh
5f7faeb041
Merge pull request #4635 from AnuradhaKaruppiah/evpn-pim-replay
pimd, zebra: request for replay of VxLAN SG entries on pimd startup
2019-07-15 15:40:12 -05:00
Emanuele Di Pascale
0e3b6a926a lib, zebra: support label chunk requests for SRGB
For SRGB, we need to support chunk requests starting at a
specific point in the label space, rather than just asking
for any sufficiently large chunk. To this purpose, we extend
the label manager api to request a chunk with a base value;
if the base is set to 0, the label manager will behave as it
currently does, i.e. fetching the first free chunk big enough
to satisfy the request.

update all the existing calls to get chunks from the label
manager so that they use MPLS_LABEL_BASE_ANY as the base
for the requested chunk

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-07-10 15:20:27 +02:00