Skip to content

Commit

Permalink
Merge pull request #1 from vvbrcm/master-1
Browse files Browse the repository at this point in the history
Update SONiC_VRRP_HLD.md
  • Loading branch information
dks19 committed Aug 25, 2023
2 parents 33c2c86 + bed3582 commit b13dd68
Show file tree
Hide file tree
Showing 2 changed files with 451 additions and 109 deletions.
142 changes: 33 additions & 109 deletions doc/SONiC_VRRP_HLD.md
Expand Up @@ -68,11 +68,11 @@ Following requirements are addressed by the design presented in this document:

1. Support VRRP v2 (IPv4)

2. Support VRRP v3 (IPv6)
2. Support VRRP v3 (IPv4 & IPv6)

3. Support multiple VRRP instances (groups) per interface

4. Support VRRP on VLAN, PortChannel and Ethernet interfaces
4. Support VRRP on VLAN, PortChannel, Ethernet and sub-interfaces

5. Support Uplink interface tracking

Expand All @@ -90,13 +90,14 @@ Following requirements are addressed by the design presented in this document:

## 2.2 Configuration and Management Requirements

This feature will support configuration and display CLIs to control and monitor VRRP parameters
This feature will support configuration and display CLIs to control and monitor VRRP parameters.
Open-config yang and sonic yang support is added for configurating and monitoring VRRP paramters.

1. Support configuration of VRRP instances per interface
2. Support configuration of VIP, priority, hello interval and pre-emption for VRRP instance
3. Support configuration of uplink interface track
4. Allow users to configure track interface weight to provide flexible policy of Master to Backup switchover
5. Support display of various VRRP parameters as well as states using CLIs.
4. Allow users to configure track interface weight to provide flexibility in Master to Backup switchover
5. Support display of various VRRP parameters as well as states.



Expand All @@ -114,6 +115,8 @@ This feature will support configuration and display CLIs to control and monitor

VRRP module is warm reboot compliant but the sessions state will not be maintained during warm-reboot. That is, VRRP docker will be restarted as part of warm-reboot. Master instances on restarting router will go Down, and Backup instance on the restart neighbor routers will transition to Master. The behavior of VRRP will be like Cold reboot.

To aid faster convergence, all Master routers will quickly relinquish its mastership by advertising 0 priority keepalives and the Backup router upon receiving 0 priority keepalive will instantaneously become Master.



# 3 Feature Description
Expand Down Expand Up @@ -195,6 +198,8 @@ Following virtual MAC address is used by the protocol (as per RFC 5798)

IPv4 case: **00-00-5e-00-01-{vrid}**

IPv6 case: **00-00-5e-00-02-{vrid}**

where, vrid is user configured 1-byte virtual router identifier. VRID has interface scope; that is, VRID has to be unique among the VRRP instances on an interface. However, same VRID can be used for two or more virtual router instances across different interfaces.

### 3.2.4 VRRP Advertisement Frame
Expand Down Expand Up @@ -283,7 +288,6 @@ vrid = 1*3DIGIT ; VRRP Instance Identifier
vip = ip_address ; Virtual IP address. This is a list of IP addresses
priority = vrrp_priority ; Priority of VRRP instance
adv_interval = 1*3DIGITS ; Advertisement interval for VRRP. Default = 1sec
state = vrrp_state ; String denoting the state of VRRP instance
version = vrrp_version ; VRRP version. Value will always be 2 for this release
pre_empt = "true"/"false" ; VRRP pre-emption is enabled? Default is True
track_interface = track_interface ; List of interfaces tracked by a VRRP instance
Expand All @@ -308,19 +312,17 @@ Example:-
1) "vrid"
2) "1"
3) "vip"
4) "4.1.1.100,"
4) "4.1.1.100"
5) "priority"
6) "80"
7) "adv_interval"
8) "1"
9) "state"
10) ""
11) "version"
12) "2"
13) "pre_empt"
14) "True"
15) "track_interface"
16) "Ethernet7|weight|10,PortChannel001|weight|10,"
9) "version"
10) "2"
11) "pre_empt"
12) "True"
13) "track_interface"
14) "Ethernet7|weight|10,PortChannel001|weight|10"



Expand All @@ -330,19 +332,17 @@ admin@sonic:~$ redis-cli -n 4 HGETALL "VRRP|Vlan1|1"
1) "vrid"
2) "1"
3) "vip"
4) "4.1.1.100,4.1.1.200,4.1.1.50,4.1.1.150,"
4) "4.1.1.100,4.1.1.200,4.1.1.50,4.1.1.150"
5) "priority"
6) "80"
7) "adv_interval"
8) "1"
9) "state"
10) ""
11) "version"
12) "2"
13) "pre_empt"
14) "True"
15) "track_interface"
16) "Ethernet7|weight|10,PortChannel001|weight|10,"
9) "version"
10) "2"
11) "pre_empt"
12) "True"
13) "track_interface"
14) "Ethernet7|weight|10,PortChannel001|weight|10"

### 4.2.2 APP_DB Changes

Expand All @@ -362,19 +362,21 @@ Schema:
key = VRRP_TABLE:interface_name:vip:type
interface_name ; interface name as a string. Vlan, Ethernet or PortChannel
vip ; virtual IP address in a.b.c.d/32 format
type ; IP address type string. only IPv4 supported currently
vip ; virtual IP address in a.b.c.d/32 or a::b/128 format
type ; IPv4 or IPv6 address type string.
; field = value
vmac = virtual_mac_address ; Virtual MAC address associated with VRRP instance
```

Example:-

**Key**: VRRP_TABLE:Vlan1000:[40.10.8.101/32:ipv4]

**Key**: VRRP_TABLE:Vlan1000|40.10.8.101/32
**Value**: "vmac":"00:00:5e:00:01:08"

**Key**: VRRP_TABLE:Vlan1001|40::1/128
**Value**: "vmac":"00:00:5e:00:02:08"

## 4.3 Modules Design and Flows

Below diagram depicts interactions of submodules for VRRP support.
Expand Down Expand Up @@ -450,89 +452,11 @@ Accept packet though source IP in IP Header matches owned IP on this interface.



## 5 CLI

SONIC Click based configuration and monitoring CLIs have been introduced in SONIC for VRRP

## 5 Configuration and display

### 5.1 Configuration Commands
VRRP supports configuration and display of information as per sonic-vrrp.yang.
The yang file is uploaded as well.

```
configure interface vrrp add <interface_name> <vrid>
This command adds/enables a VRRP instance on an interface.
- interface_name - name of interface (Ethernet or Vlan or PortChannel) over which VRRP is to be enabled.
- vrid - VRRP instance identifier.
configure interface vrrp remove <interface_name> <vrid>
This command removes a VRRP instance from an interface.
configure interface vrrp vip add <interface_name> <vrid> <virtual_ip_address>
This command adds a virtual IP address for a VRRP instance on an interface. User is allowed to create multiuple VIPs for a VRRP instance. VIP must fall in the interface's subnet.
- interface_name - name of interface (Ethernet or Vlan or PortChannel) over which VIP is being added
- vrid - VRRP instance identifier.
- virtual_ip_address - VIP address in dotted decimal IPv4 address
configure interface vrrp vip remove <interface_name> <vrid> <virtual_ip_address>
This command deletes a already configured VIP from a VRRP instance
configure interface vrrp priority <interface_name> <vrid> <priority>
This command configures priority for a VRRP instance
- priority - a number between 1 and 254 with 1 being the lowest and 254 being the highest priority. Default is 100. Priority 255 is reserved for owner VRRP router.
configure interface vrrp adv_interval <interface_name> <vrid> <interval>
This command configures VRRP periodic advertisement interval for a VRRP instance
- interval - a number between 1 and 255. Unit is in seconds. Default is 1sec.
configure interface vrrp pre_empt enable <interface_name> <vrid>
This command enables pre-emption of a Master when a higher priority VRRP router arrives
- enable - Enable pre-emption. Default is enabled.
configure interface vrrp pre_empt disable <interface_name> <vrid>
This command disables pre-emeption of a Master when a higher priority VRRP router arrives
- disable - Disable pre-emption. Default is enabled.
configure interface vrrp track_interface add <interface_name> <vrid> <track_interface> <weight>
This command adds a track interface to a VRRP Instance. A maximum of 8 track interfaces can be added to a VRRP instance.
- track_interface - Interface to track. Interface can be Ethernet, Vlan or PortChannel
- weight - weight or importance assigned to the track_interface. When track interface goes down, the priority of VRRP instance will be reduced by weight
configure interface vrrp track_interface remove <interface_name> <vrid> <track_interface>
This command removes an already configured track interface from a VRRP Instance.
```

### 5.2 Show Commands

```
show vrrp
- lists all the VRRP instances including their current state
Sample output:-
admin@sonic:~$ show vrrp
Interface_Name VRID State VIP Cfg_Prio Curr_Prio
Vlan1 1 Backup 4.1.1.100 100 120
Vlan2 2 Master 4.1.2.100 100 100
Vlan3 3 Backup 4.1.3.100 100 100
Vlan4 4 Backup 4.1.4.100 100 100
Vlan5 5 Master 4.1.5.100 100 100
show vrrp <interface_name> <vrid>
- This command displays data about a VRRP instance in detail
Sample output:-
admin@sonic:~$ show vrrp Vlan1 1
Vlan1, VRID 1
Version is 2
State is Backup
Virtual IP address:
4.1.1.100
Virtual MAC address is 0000.5e00.0101
Track interface:
Intfname State Priority
Ethernet7 Up 10
PortChannel001 Up 10
Configured Priority is 100, Current Priority is 120
Advertisement interval is 1 sec
Preemption is enabled
```


## 6 Serviceability and Debug
Expand Down

0 comments on commit b13dd68

Please sign in to comment.