Skip to content

Commit

Permalink
Merge pull request sonic-net#3 from abhishekd0/master
Browse files Browse the repository at this point in the history
11/2: Pull changes from master
  • Loading branch information
abhishekd-brcm authored Nov 2, 2020
2 parents eb26d6c + 638a36a commit 84fe4b6
Show file tree
Hide file tree
Showing 5 changed files with 818 additions and 59 deletions.
71 changes: 57 additions & 14 deletions L2/PortChannel/Portchannel_Enhancements.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
### Portchannel Enhancements in SONiC

# High Level Design Document
#### Rev 0.1
#### Rev 0.2

# Table of Contents
* [List of Tables](#list-of-tables)
Expand Down Expand Up @@ -62,6 +62,7 @@
| Rev | Date | Author | Change Description |
|:---:|:-----------:|:------------------:|-----------------------------------|
| 0.1 | 04/22/2020 | Madhukar K | Initial version |
| 0.2 | 07/25/2020 | Madhukar K | Adding portchannel level commands |

# About this Manual
This document provides details on Port Channel enhancements in SONiC.
Expand All @@ -84,7 +85,7 @@ This document describes the high level design of Port Channel enhancements in SO
- Upon enabling PortChannel graceful shutdown mode, all the portchannels in the system should be operationally down and stop traffic transmission and reception.

### 1.1.2 Configuration and Management Requirements
Provide configuration to enable/disable Port Channel graceful shutdown mode with the KLISH and click CLI.
Provide configuration to enable/disable Port Channel graceful shutdown mode globally and at portchannel level with the KLISH and click CLI.

### 1.1.3 Scalability Requirements
All the supported portchannels in the device should enable/disable graceful shutdown mode upon user trigger.
Expand All @@ -108,13 +109,14 @@ In MCLAG topologies, one of the two MCLAG nodes is put into graceful shutdown mo

## 2.2 Functional Description
In MCLAG topologies, the Port Channel graceful shutdown mode allows users to upgrade the switch software by forwarding the data through the peer MCLAG switch. The goal is to maintain the data connectivity while the software is being upgraded on one of the MCLAG nodes. In order to achieve this, all the portchannels in that MCLAG node are brought down operationally when the device enters the Port Channel graceful shutdown mode.
In the Port Channel graceful shutdown mode
In the Port Channel graceful shutdown mode:

- any newly created portchannel will be operationally down
- existing portchannel memberships(of the ports) can be changed by the user
- existing portchannels can be deleted by the user

The Port Channel graceful shutdown mode cannot be enabled/disabled for individual portchannels; it applies to all the portchannels present in the system.
The Port Channel graceful shutdown mode can be enabled/disabled for individual portchannels; portchannel level configuration is applicable only if Port Channel graceful shutdown is enabled globally.
Note: User should disable the Port Channel graceful shutdown at the portchannel level before enabling globally, if a given portchannel is desired to be operationally up.

# 3 Design

Expand All @@ -126,12 +128,22 @@ On SONiC device, when user wants to upgrade the firmware or resolve any issue on
- since the LACP state machine for all the member ports is stopped, the portchannels that are operationally up become down
- LACPDUs received on the member ports of the portchannels are silently discarded
- If user triggers a config save followed with a reload (config-reload or cold-reboot) - after reload, the device will come up with all the configured portchannels in graceful shutdown mode. The portchannels will be operationally down.
- the portchannels that have portchannel level graceful shutdown disabled are not altered; they continue to be in the same operational status

Upon exiting the Port Channel graceful shutdown mode:
- LACP state machine is started afresh for all the portchannel member ports that are link up
- LACPDUs are transmitted and received on the all the portchannel member ports that are link up
- Portchannels will be operationally up if the LACP convergence succeeds

If the graceful-shutdown is enabled globally:
- If there is no configuration at the portchannel level - all the portchannels in the system are brought DOWN
- If graceful-shutdown is disabled on a given portchannel(say PortChannel5) - all the portchannels except PortChannel5 are brought DOWN
- enable graceful-shutdown on the portchannel which had graceful-shutdown disabled - PortChannel5 is brought DOWN

If the graceful-shutdown is disabled globally:
- If graceful-shutdown is enabled at a portchannel level - this is a NO-OP; the portchannel continues to be UP
- If graceful-shutdown is disabled at a portchannel level - this is a NO-OP; the portchannel continues to be UP

### 3.1.1 Teamd configuration
The user will be able to enable/disable the Port Channel graceful shutdown mode.

Expand All @@ -143,8 +155,12 @@ Team Manager listens to the enable/disable modes of the Port Channel graceful sh
## 3.2 DB Changes
### 3.2.1 CONFIG DB
A new table PORTCHANNEL_GLOBAL is introduced. In the PORTCHANNEL_GLOBAL table:
- the "graceful_shutdown_mode" field is set to "enable" if user enables the Port Channel graceful shutdown mode
- the "graceful_shutdown_mode" field is set to "disable" if user disables the Port Channel graceful shutdown mode
- the "graceful_shutdown_mode" field is set to "enable" if user enables the Port Channel graceful shutdown mode globally
- the "graceful_shutdown_mode" field is set to "disable" if user disables the Port Channel graceful shutdown mode globally

In the PORTCHANNEL table:
- the "graceful_shutdown_mode" field is set to "enable" if user enables the Port Channel graceful shutdown mode at the portchannel level
- the "graceful_shutdown_mode" field is set to "disable" if user disables the Port Channel graceful shutdown mode at the portchannel level

### 3.2.2 APP DB
No new tables are needed.
Expand Down Expand Up @@ -182,31 +198,48 @@ Not applicable.

Click CLI

Enable/disable the Port Channel graceful shutdown mode.
Enable/disable the Port Channel graceful shutdown mode globally:
```
root@sonic:/home/admin# config portchannel graceful-shutdown <enable/disable>
```

Enable/disable the Port Channel graceful shutdown mode for a given portchannel:
```
root@sonic:/home/admin# config portchannel graceful-shutdown <enable/disable> <portchannel-name>
```

KLISH CLI

Enable PortChannel graceful shutdown mode:
Enable PortChannel graceful shutdown mode globally:
```
sonic(config)# portchannel graceful-shutdown
```

Disable PortChannel graceful shutdown mode:
Enable PortChannel graceful shutdown mode for a given portchannel:
```
sonic(config)# interface PortChannel 6
sonic(conf-if-po6)# graceful-shutdown
```

Disable PortChannel graceful shutdown mode globally:
```
sonic(config)# no portchannel graceful-shutdown
```

Disable PortChannel graceful shutdown mode for a given portchannel:
```
sonic(config)# interface PortChannel 6
sonic(conf-if-po6)# no graceful-shutdown
```

### 3.6.4 Show Commands
KLISH CLI

The output of show interface portchannel is modified to display:
1. Portchannel graceful shutdown mode
2. LACP Fallback operational status, if fallback is enabled.

Graceful shutdown is disabled. Fallback config is enabled; it is non-operational.
Graceful shutdown is disabled. Fallback config is enabled; it is non-operational:
```
sonic# show interface PortChannel
PortChannel5 is up, line protocol is down, mode LACP
Expand All @@ -232,7 +265,7 @@ sonic#
```

Graceful shutdown is disabled. Fallback config is enabled; it is operational.
Graceful shutdown is disabled. Fallback config is enabled; it is operational:
```
sonic# show interface PortChannel
PortChannel5 is up, line protocol is up, mode LACP
Expand All @@ -258,7 +291,7 @@ sonic#
```

Graceful shutdown is enabled. Fallback is disabled.
Graceful shutdown is enabled. Fallback is disabled:
```
sonic# show interface PortChannel
PortChannel5 is up, line protocol is down, mode LACP
Expand Down Expand Up @@ -289,18 +322,28 @@ No new debug commands are added.
### 3.6.6 Rest API Support
PATCH

Enable graceful shutdown mode:
Enable graceful shutdown mode globally:
```
/openconfig-aggregate-ext:aggregate/config/graceful-shutdown-mode
```

Enable graceful shutdown mode for a given portchannel:
```
/openconfig-interfaces:interfaces/interface={name}/openconfig-if-aggregate:aggregation/config/openconfig-interfaces-ext:graceful-shutdown-mode
```

GET

Get graceful shutdown mode:
Get global graceful shutdown mode:
```
/openconfig-aggregate-ext:aggregate/config/graceful-shutdown-mode
```

Get graceful shutdown mode for a given portchannel:
```
/openconfig-interfaces:interfaces/interface={name}/openconfig-if-aggregate:aggregation/config/openconfig-interfaces-ext:graceful-shutdown-mode
```

Get LACP fallback operational status:
```
/openconfig-interfaces:interfaces/interface={name}/openconfig-if-aggregate:aggregation/state/openconfig-interfaces-ext:fallback
Expand Down
1 change: 1 addition & 0 deletions L3/IP ECMP loadshare
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

157 changes: 157 additions & 0 deletions release_documents/Command-Reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Table of Contents
* [Configuration Commands](#bgp-error-handling-config-commands)
* [Show Commands](#bgp-error-handling-show-commands)
* [Clear Commands](#bgp-error-handling-clear-commands)
* [BGP VRF Configuration And Show Commands](#bgp-vrf-configuration-and-show-commands)
* [Configuration Commands](#bgp-vrf-config-commands)
* [BGP VRF Route Leak](#bgp-vrf-route-leak)
* [Show Commands](#bgp-vrf-route-leak-show-commands)
* [EVPN Configuration And Show Commands](#evpn-configuration-and-show-commands)
* [Enable EVPN between BGP Neighbors](#enable-evpn-between-bgp-neighbors)
* [EVPN Configuration Commands](#evpn-configuration-commands)
Expand Down Expand Up @@ -2829,6 +2833,159 @@ To retry installation of failed routes from Zebra, a clear command has been prov
root@sonic:~# clear ip route not-installed
```

# BGP VRF Configuration And Show Commands
This section provides high level config and show commands for BGP VRF
configuration and VRF route leak via BGP.

Please refer to "VRF configuration and show commands" section for details on
how to create VRFs in SONiC.

## Configuration Commands

BGP VRF instance for a given VRF can be configured using IS-CLI as shown below.
Autonomous-System (AS) number for the BGP VRF instance is not mandated to same
as of default BGP VRF instance.

Below example configures BGP instance for Vrf-red, configures a neighbor, and
redistributes connected routes into BGP VRF instance.

```
sonic(config)# router bgp 65535 vrf Vrf-red
sonic(config-router-bgp)# router-id 192.168.1.1
sonic(config-router-bgp)# neighbor 10.20.30.40
sonic(config-router-bgp-neighbor)# remote-as external
sonic(config-router-bgp-neighbor)# address-family ipv4 unicast
sonic(config-router-bgp-neighbor-af)# activate

sonic(config-router-bgp)# address-family ipv4 unicast
sonic(config-router-bgp-af)# redistribute connected
```

It is recommended to configure router-id for the BGP VRF instance(s) in order
to avoid router-id reselection when IP addresses are unconfigured in the VRF.

IPv4 unicast, IPv6 unicast, and L2VPN EVPN address-families are
supported in the BGP VRF instances. Details on using L2VPN EVPN
address-family is described in the next BGP EVPN section.

BGP VRF instance can be created without creating default BGP VRF instance.
However, deletion of default BGP VRF instance is restricted if non-default BGP
VRF instance(s) are present. All non-default BGP VRF instances are required to
be deleted before deleting BGP default VRF instance.


## BGP VRF Route Leak
Routes can be leaked from one VRF to another using BGP VRF route leak feature
described in this section.

Use the 'import' command in corresponding address-family of BGP VRF instance to
import routes from the given source VRF. In the example below, BGP Vrf-red
instance is configured to import IPv4 and IPv6 routes from BGP Vrf-blue.
```
sonic(config)# router bgp 20 vrf Vrf-red
sonic(config-router-bgp)# address-family ipv4 unicast
sonic(config-router-bgp-af)# import vrf Vrf-blue

sonic(config-router-bgp)# address-family ipv6 unicast
sonic(config-router-bgp-af)# import vrf Vrf-blue

```

Import of routes from multiple BGP VRF instances is allowed.

Route-map can be applied for the imported leaked routes as shown below.

```
sonic(config)# router bgp 20 vrf Vrf-red
sonic(config-router-bgp)# address-family ipv4 unicast
sonic(config-router-bgp-af)# import vrf route-map my-import-filter
sonic(config-router-bgp-af)# import vrf Vrf-red
sonic(config-router-bgp-af)#
```

Configured import route-map filters routes from all of the configured
import-VRFs. In case specific routes from specific VRF are required to be
filtered, match-vrf clause in the route-map can be used.

Note that above BGP VRF import commands leak the prefixes, including connected
subnets, from one vrf to another. Leaking of connected subnets may incur
sub-optimal forwarding for the inter-vrf traffic through the CPU (slow) path.
It is therefore recommended to always leak the routes which have remote
next-hops instead of leaking the connected subnets.


## Show Commands
In order to show routes from a given VRF instance, 'vrf' option can be
specified to the regular bgp and ip route show commands.

Below commands show BGP routes in the given BGP VRF instance:

```
sonic# show ip bgp vrf Vrf-red
BGP table version is 9, local router ID is 169.100.1.1, vrf id 91
Default local pref 100, local AS 10
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, # not installed in hardware
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 1.1.1.1/32 0.0.0.0@0< 0 32768 ?
*> 1.2.1.1/32 0.0.0.0@0< 0 32768 ?
*> 4.1.1.1/32 fe80::5054:ff:fe8d:7741@0<
*> 8.0.0.0/24 fe80::5054:ff:fe8d:7741@0<
* 10.59.128.0/20 fe80::5054:ff:fe8d:7741@0<
*> 51.52.0.0/31 0.0.0.0@0< 0 32768 ?
*> 155.100.1.0/24 0.0.0.0 0 32768 ?
*> 169.100.1.0/24 0.0.0.0 0 32768 ?
*> 200.2.1.0/24 0.0.0.0@0< 0 32768 ?

Displayed 9 routes and 13 total paths
sonic#

```

```
sonic# show bgp vrf Vrf-red ipv6
BGP table version is 3, local router ID is 169.100.1.1, vrf id 91
Default local pref 100, local AS 10
Status codes: s suppressed, d damped, h history, * valid, > best, = multipath, # not installed in hardware
i internal, r RIB-failure, S Stale, R Removed
Nexthop codes: @NNN nexthop's vrf id, < announce-nh-self
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 1550:100:1::/80 :: 0 32768 ?
*> 1690:100:1::/64 :: 0 32768 ?
*> 2000:200::/64 ::@0< 0 32768 ?

Displayed 3 routes and 3 total paths
sonic#
```


Below command shows routes from the RIB for the specified VRF:
```
sonic# show ip route vrf Vrf-red
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 route, r - rejected route, # - not installed in hardware
VRF Vrf-red:
B>* 1.1.1.1/32 [200/0] is directly connected, Loopback10(vrf default), 01:33:30
B>* 1.2.1.1/32 [200/0] is directly connected, Loopback11(vrf default), 01:33:30
B>* 4.1.1.1/32 [200/0] via fe80::5054:ff:fe8d:7741, Ethernet0(vrf default), 01:33:29
B>* 8.0.0.0/24 [200/0] via fe80::5054:ff:fe8d:7741, Ethernet0(vrf default), 01:33:29
B>* 10.59.128.0/20 [200/0] is directly connected, eth0(vrf default), 01:33:30
B>* 51.52.0.0/31 [200/0] is directly connected, Vlan4090(vrf default), 01:33:30
C>* 155.100.1.0/24 is directly connected, Vlan100, 01:33:52
C>* 169.100.1.0/24 is directly connected, Vlan1000, 01:33:52
B>* 200.2.1.0/24 [200/0] is directly connected, Vlan200(vrf default), 01:33:30
sonic#

```

# EVPN Configuration And Show Commands

The following sections provide the basic configuration needed to use EVPN as the control plane for VXLAN.
Expand Down
Loading

0 comments on commit 84fe4b6

Please sign in to comment.