Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch Port Modes and VLAN CLI Enhancement #912

Merged
merged 70 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
ab74bb2
Add files via upload
ham-xa Dec 14, 2021
56dfc14
Update L2 dot1q HLD
ham-xa Sep 30, 2022
f1ae3a6
Changes in Title and Updates in HLD
ham-xa Oct 24, 2022
91d1d02
Update L2 dot1q HLD.markdown
ham-xa Oct 26, 2022
818f47a
Delete doc/L2_802.1q_Tunneling_Support_HLD/media directory
ham-xa Oct 26, 2022
add7788
Restructure directories and modify .md file
ridahanif96 Oct 26, 2022
1268428
Update Switchport Mode and VLAN CLI Enhancement.md
ridahanif96 Oct 28, 2022
30d25cf
Added Support for PortChannel on Switchport Mode
ridahanif96 Dec 15, 2022
cbb9ac5
Delete SwitchPortModes.png
ridahanif96 Dec 15, 2022
1a23c89
Add files via upload
ridahanif96 Dec 15, 2022
0704341
Slight Modifications
ridahanif96 Dec 16, 2022
4bc8db6
Updated Slight Modifications for YANG Model
ridahanif96 Feb 3, 2023
639c70a
Modifications as per suggestions
ridahanif96 Feb 6, 2023
5cb27f5
Update Switchport Mode and VLAN CLI Enhancement.md
ridahanif96 Feb 6, 2023
f5e79e7
Some Fixes
ridahanif96 Feb 7, 2023
e40754d
Add files via upload
ridahanif96 Feb 7, 2023
71cd865
Config-Db & Db-Migrator Enhancement along with Some Modifications in HLD
ridahanif96 Mar 6, 2023
084c665
Delete SwitchPortMode-PortPortChannel.png
ham-xa Mar 7, 2023
22342c2
Delete AddMember_trunk.png
ham-xa Mar 7, 2023
8f15f2f
Delete MultipleVlans.png
ham-xa Mar 7, 2023
cd6449a
Delete DeleteVlanMember.png
ham-xa Mar 7, 2023
06c9944
Delete DeleteVlan.png
ham-xa Mar 7, 2023
db548e0
Add files via upload
ham-xa Mar 7, 2023
29847df
Slight Updates
ridahanif96 Mar 7, 2023
ad4596c
Re-format Use case statement
ridahanif96 Mar 10, 2023
e92a38f
Images
ridahanif96 May 4, 2023
bf5990e
Detailed Examples for Switchport Modes
ridahanif96 May 5, 2023
20560cd
Detailed Examples for Switchport Modes
ridahanif96 May 5, 2023
1c6dc80
Delete Vlan-Range-Multiple.png
ridahanif96 May 5, 2023
f160a31
Delete Access-mode.png
ridahanif96 May 5, 2023
f3f9a3a
Delete New-Int-Stat.png
ridahanif96 May 5, 2023
f8be3c7
Delete Show-Int-Stat-old.png
ridahanif96 May 5, 2023
45ce3cb
Delete PortChannel-access.png
ridahanif96 May 5, 2023
2c17310
Delete PortChannel-trunk.png
ridahanif96 May 5, 2023
b01f9e0
Delete trunk.png
ridahanif96 May 5, 2023
586c33c
Delete Switch-Access-Route.png
ridahanif96 May 5, 2023
063284d
Delete Switch-Trunk-Access.png
ridahanif96 May 5, 2023
f59187d
Delete Switch-Trunk-Routed.png
ridahanif96 May 5, 2023
afcfaf5
Delete Vlan-MultipleAdd.png
ridahanif96 May 5, 2023
d4d5796
Delete Vlan-Comma Separted.png
ridahanif96 May 5, 2023
85dd22e
Delete Vlan-Add-Error.png
ridahanif96 May 5, 2023
940fc85
Delete Vlan-Add-Middle.png
ridahanif96 May 5, 2023
ec7aa68
Delete Vlan-Trucate-1.png
ridahanif96 May 5, 2023
e5d7329
Delete Vlan-Truncate-2.png
ridahanif96 May 5, 2023
d85d84f
Delete Access-Routed-Eth0.png
ridahanif96 May 7, 2023
420236b
Delete Access-Trunk-Eth0.png
ridahanif96 May 7, 2023
3a01728
Delete Vlan-add-Acces-Eth0.png
ridahanif96 May 7, 2023
e4efa7e
Delete Vlan-Truncate-3.png
ridahanif96 May 7, 2023
6bba6e6
Delete IP-Add-Routed-Error.png
ridahanif96 May 7, 2023
5991d00
Delete IP-Add-Trunk-Eth4.png
ridahanif96 May 7, 2023
9f4409c
Delete Multiple-Untag-Eth0.png
ridahanif96 May 7, 2023
5821261
Delete PortChannel-Mem-Add.png
ridahanif96 May 7, 2023
daba494
Delete Remove-IP-Eth4.png
ridahanif96 May 7, 2023
29d3b31
Delete Show-Switch-Stat-Eth0.png
ridahanif96 May 7, 2023
ae0c6d6
Delete Switch-ROuted-Eth0.png
ridahanif96 May 7, 2023
60d952c
Delete Tagged-Mem-Eth4.png
ridahanif96 May 7, 2023
873f410
Delete Switch-Trunk-Routed-Error.png
ridahanif96 May 7, 2023
ee1e145
Delete Tag-Eth0-Error.png
ridahanif96 May 7, 2023
3f33c32
Delete Vlan-Member-Except-Eth28.png
ridahanif96 May 7, 2023
93655ac
Delete Vlan-Member-Eth20-Range.png
ridahanif96 May 7, 2023
ba83bc9
Delete Vlan-Member-Eth24.png
ridahanif96 May 7, 2023
fc6fcca
Delete Vlan-Member-All.png
ridahanif96 May 7, 2023
bc027a8
Delete Vlan-Brief.png
ridahanif96 May 7, 2023
f847651
Delete Vlan-Brief-Show.png
ridahanif96 May 7, 2023
854f2c0
Delete Vlan-Add-Range.png
ridahanif96 May 7, 2023
c011021
Update Switchport Mode and VLAN CLI Enhancement.md
ridahanif96 May 7, 2023
66ae8ab
Check for db-migrator
ridahanif96 Jun 13, 2023
f768368
modified example statement
ridahanif96 Jun 13, 2023
79d161d
Modified HLD to spell out routed case
ridahanif96 Jun 14, 2023
3a1420f
Merge branch 'master' into 802.1q_HLD
ridahanif96 Jun 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,390 @@
# Switch Port Modes and Vlan CLI Enhancement


## Revision History

[© xFlow Research Inc](https://xflowresearch.com/)

| Revision No| Description | Author | Contributors |Date |
| :-------------: |:-------------:| :-----:|:----------:|:-----:|
|0.1| IEEE 802.1Q Tunneling Support| [Muhammad Hamza Iqbal](https://github.com/ham-xa)| [Hafiz Mati ur Rehman](https://github.com/Mati86) & [Arsalan Ahmad](https://github.com/ahmadarsalan/)| 14 Dec 2021|
|0.2| Architectural Changes & CLI Commands addition| [Muhammad Hamza Iqbal](https://github.com/ham-xa)| [Hafiz Mati ur Rehman](https://github.com/Mati86) , [Rida Hanif](https://github.com/ridahanif96) , [Umar Asad](https://github.com/MuhammadUmarAsad) & [Arsalan Ahmad](https://github.com/ahmadarsalan/)| 30 Sep 2022|
|0.3| Revision in Title,Switchport modes and CLI enhancements| [Muhammad Hamza Iqbal](https://github.com/ham-xa)| [Hafiz Mati ur Rehman](https://github.com/Mati86) , [Rida Hanif](https://github.com/ridahanif96) , [Umar Asad](https://github.com/MuhammadUmarAsad) & [Arsalan Ahmad](https://github.com/ahmadarsalan/)| 24 Oct 2022|

## Table of Contents

- Scope
- Definitions/Abbreviations
- Overview
- Introduction
- Topology Design
- Architecture Design
- High-level Design
- Switchport Mode
- Add Multiple Vlan(s)
- Delete Multiple Vlan(s)
- Add Multiple Vlan(s) on Trunk Ports
- Delete Multiple Vlan(s) on Trunk Ports
- CLI & YANG Model Configuration Commands & Usage
- CLI Configuration Commands
- YANG Model Configurations
- Example/Usage of Commands
- SAI API
- Warm Boot and Fastboot Design Impact
- Restrictions/Limitations
- Testing Requirements/Design
- Unit Test cases
- Future Work

## Scope

This high-level design document describes the implementation of switchport modes and CLI enhancements in SONiC.

## Definitions/Abbreviations

| **Sr No** | **Term** | **Definition** |
| :------------- |:-------------| :-----|
| 1 | VLAN_ID | Unique identifier for each VLAN |
| 2 | Dot1q | IEEE 802.1Q Protocol |
| 3 | Trunk | The port is untagged member to one VLAN and tagged member to one or more VLANs |
| 4 | Access | The port is untagged member to only one VLAN|
| 5 | Routed | The port is in L3 interface mode |
| 6 | Hybrid| The port is multiple untagged and multiple tagged vlan members to more VLANs |


## Overview

This HLD will provide implementation details of switch port modes access and trunk on a Port or on a PortChannel. In this HLD vlan configuration commands are also improved for efficient configuration and management of VLANs.

## Introduction

Switch ports are Layer 2-only interfaces associated with a physical port. A switch port can have three modes: access port, a trunk port, or a hybrid port. We can manually configure a port as an access port, trunk port or hybrid port depending on requirement . Switch ports are used for managing the physical interface and associated Layer 2 protocols and do not handle routing.

### Access Mode

In access mode a port possesses the following properties
* Receives untagged/tagged traffic for a particular Vlan
* Forwards untagged/tagged traffic for a particular Vlan

### Trunk Mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • What is the use case adding new switch port mode?
  • List down a use case scenario for existing switch modes (access, trunk and routed port)
  • what is the default switch port mode?
  • what is transition graph from one switch port mode to other?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated HLD as per the suggestions/concerns.


In trunk mode a port possesses the following properties
* Receives untagged traffic for a single Vlan
* Forwards untagged traffic for a single Vlan
* Receives tagged traffic for one or more Vlan(s)
* Forwards tagged traffic for one or more Vlan(s)

### Hybrid Mode

In hybrid mode a port possesses the following properties
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this planned to be added as a CLI option? I don't see it in example below

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hybrid mode is the future scope of this HLD. This HLD has two switchport modes (access, trunk).
For hybrid mode, we have a separate HLD which is in the roadmap of 202305 and we will present it later in one of the future community reviews.

* Receives multiple tagged & untagged traffic for one or more Vlan(s)
* Forwards multiple tagged & untagged traffic for one or more Vlan(s)

### Sample Topology

![Topology](https://user-images.githubusercontent.com/61490193/208155234-3a04ca08-5ca3-42b3-b679-c1efcacddff2.png)


__*Figure 1: Sample Topology*__

The figure shows that 3 different VLANs are configured with 6 other hosts. The switch ports connected to hosts would be configured as access ports. The ports that connect switches together would be configured as trunk ports.

## Architecture Design

The overall SONiC architecture will remain the same and no new sub-modules will be introduced. Changes are made only in the CLI container and Config_DB.

![Architecture](https://user-images.githubusercontent.com/61490193/208155328-5d26e5f3-7483-4b85-8942-56ccb790db1b.png)




## High-level Design

In this section we will explain sequence diagrams for the implemented features.

### Switch Port Mode

![SwitchPortMode-PortPortChannel](https://user-images.githubusercontent.com/61490193/207826139-3ff0c41a-69af-4018-bf19-c083e1307bf7.png)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sequence diagram doesn't clearly show the separation between the processing done in the CLI vs that done in the clicommon. For example, the same "if" checks are done in both the components.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added state transition diagram for Switchport modes in HLD for more clarity. Thanks


__*Figure 2: Sequence Diagram Switch Port mode*__


**1.** Check the existing_port_mode.

**2.** Check if existing_port_mode!=routed then set port mode as access and update config_db.

**3.** Check if type==access and existing_mode==trunk then show an error message to remove tagged members first and update config_db. Moreover, switching between modes also works here.

**4.** Check if type==trunk && existing_mode==trunk then update port mode.

**5.** if mode==access or trunk && want to assign IP it will show error to switch mode to routed first for IP assignment.


**5.** Check if type== routed then show an error message to remove tagged && untagged vlan members first from port and then set_mode entry as “routed” .

**6.** Update PORT table.


__*NOTE: This works same for Adding Switchport Mode on a PortChannel*__


### Add Multiple VLANs

![MultipleVlans](https://user-images.githubusercontent.com/61490193/208155973-801f99e5-bc79-4e4d-9db4-be13decf6637.png)


__*Figure 3: Sequence Diagram for adding Multiple VLANs*__

**1.** The SONiC CLI will call the multiple vlan list parser which will parse multiple vlan(s) in a list and return.

**2.** Check if the VLAN is in the range (2-4094) and whether the vid already exists or not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this HLD introducing vlan range? if it is do you see any performance challenges programming bulk vlans/range to ASIC? Please include a test case to validate bulk vlans?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have introduced the vlan range. No performance challenges will be faced using this. Please, see HLD for test cases. Thanks


**3.** Check if vlan id exist

**4.** After checking if it’s in the range, CLI will call for the VLAN_id function.

**5.** Finally, CLI will add the VLAN from the list in the VLAN table.

__*NOTE: This works same for Adding Multiple VLANs on a PortChannel*__


### Delete Multiple VLANs

![DeleteVlan](https://user-images.githubusercontent.com/61490193/208156042-88b5ba0a-4ad4-4cc9-b919-6cf0c1dec281.png)

__*Figure 4: Sequence Diagram for deleting Multiple VLANs*__

**1.** The SONiC CLI will call the multiple vlan list parser which will parse multiple vlan(s) in a list and return.

**2.** Check if the VLAN is in the range .

**3.** Read the existing vlan table and delete vlans(s).


__*NOTE: This works same for Deleting Multiple VLANs from a PortChannel*__


### Add Multiple VLAN member on Trunk Port

![AddMember_trunk](https://user-images.githubusercontent.com/61490193/208156160-cefe6ca7-4092-436e-a209-6da8fc238756.png)


__*Figure 5: Sequence Diagram for Adding VLAN member on Trunk Port*__


**1.** The SONiC CLI will Call vlan_member_input_parser to add multiple vlan member(s).

**2.** Check for vlan_range and return.

**3.** Check port mode for adding vlan members on a port from the PORT table and return.

**4.** Add member vlan(s) in multiple commas or range list, all flag & except flag can be used as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if part of the requested VLAN is already part of this Trunk port? do you ignore them or do you flag that as an error and reject the request?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By using multiple VLAN command, CLI will add the VLANs to the port in ascending order and explicitly print on the CLI the VLANs which have been added to the PORT and when it reaches the VLAN which already exists it will give an error. Please refer to the examples section, we have included example of this behavior as well.


**5.** Add the vlan member(s) in the vlan member table.


__*NOTE: This works same for Adding Multiple VLANs members on a PortChannel*__


### Delete Multiple VLAN member on Trunk Port

![DeleteVlanMember](https://user-images.githubusercontent.com/61490193/208156383-f1ba0a89-f7c4-444c-850b-aa96eb95dc08.png)


__*Figure 6: Sequence Diagram for deleting VLAN member on Trunk Port*__

**1.** The SONiC CLI will call the vlan_member_input_parser parser which will parse multiple vlan(s) in a list and return.

**2.** Check if the members exist in the range .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if the requested vlan to be deleted is not part of the port's vlan membership? Do you reject the request?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will give an error saying the VLAN doesn't exist as a member of PORT and the command will abort.


**3.** Read the existing vlan table and delete vlans(s).


__*NOTE: This works same for Delete Multiple VLANs members from a PortChannel*__

## CLI & YANG Model Configuration Commands & Usage

## CLI Configuration Commands

**1.** config switchport mode <routed|access|trunk> <member_portname>/<member_portchannel>
Copy link
Contributor

@gechiang gechiang Mar 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't a port without switchport mode is meant to be "routed"? switchport mode is a L2 concept where only layer 2 ports should have switchport mode configured. L3 port in industry typically do not have switchport mode configured. and I have not seen any vendors use "switch port routed" for L3 interfaces...
So by default if there are no VLAN configured for a given interface, then switchport mode should not be required... only when a VLAN needs to be configured, then switchport mode is required... and it should be either access/trunk for those cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider, if a port is in access/trunk mode and no vlan member is configured then this situation is called "blackhole". So, a port can be in access/trunk mode without having any member.
We have given switchport mode routed here because if a user is coming back from access/trunk then he needs to specifically configure the port back to routed. This mode is actually equivalent of the negation command like "no switchport mode access" available in Cisco. As we do not have this command in SONiC so, we need routed mode to exit from access/trunk mode.


**2.** config vlan add/del -m <comma separated list, range> <vlan_ids>

**3.** config vlan member add/del -m <all,except, comma separated list, range> <vlan_ids> <member_portname>/<member_portchannel>

## Examples/Usage of Commands

The following examples will provide the usage for these new commands that have been added for providing switchport modes and VLAN CLI enhancements.

**1.** Switchport mode command:

```
admin@sonic:~$ sudo config switchport mode access Ethernet0

Usage: This command will add Ethernet0 as access port

```
```
admin@sonic:~$ sudo config switchport mode trunk Ethernet4

Usage: This command will add Ethernet4 as trunk port
```

```
admin@sonic:~$ sudo config switchport mode access PortChannel1001

Usage: This command will add PortChannel1001 as access

```

```
admin@sonic:~$ sudo config switchport mode trunk PortChannel1002

Usage: This command will add PortChannel1002 as trunk

```
```
admin@sonic:~$ sudo config switchport mode routed Ethernet4

Usage: This command will add Ethernet4 as routed port. This is for switching from access or trunk mode to routed mode.

```

```
admin@sonic:~$ sudo config switchport mode routed PortChannel1001

Usage: This command will add PortChannel1001 as routed port. This is for switching from access or trunk mode to routed mode.

```

**2.** Add multiple Vlan(s) using a single command:

```
admin@sonic:~$ sudo config vlan add -m 100,200,300

Usage: This command will add multiple comma separated vlan in a list
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you show the errors being shown for each error conditions would be helpful.

Copy link
Collaborator

@ridahanif96 ridahanif96 Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to the HLD examples section for error conditions. If you want more error conditions please mention those as well.


Example : The command will create the VLAN "Vlan 100, Vlan 200, Vlan 300" if these do not already exist.

```

**3.** Add range of Vlan(s) using a single command:

```
admin@sonic:~$ sudo config vlan add -m 100-103

Usage: This command will add range of vlan in a list

Example : The command will create the VLAN "Vlan 100, Vlan 101, Vlan 102, Vlan 103" if these do not already exist.

***This works with deleting multiple VLANs in the same way***
```


**4.** Add all Vlan(s) as Vlan Member(s) using a single command:

```
admin@sonic:~$ sudo config vlan member add all Ethernet0

Usage: This command will add all existing vlan(s) as vlan member(s)

Example : Suppose Vlan 100, Vlan 101, Vlan 102 are already existing Vlans. This command will add Ethernet0 as a member of Vlan 100, Vlan 101, Vlan 102.

***This command only work for trunk ports***

```

```
admin@sonic:~$ sudo config vlan member add all PortChannel1001

Usage: This command will add all existing vlan(s) as vlan member(s) on PortChannel1001

Example : Suppose Vlan 100, Vlan 101, Vlan 102 are already existing Vlans. This command will add PortChannel1001 as a member of Vlan 100, Vlan 101, Vlan 102.

***This command only work for trunk ports***

```

**5.** Add multiple Vlan Member(s) except one specific using a single range command:

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we print lot of message e.g
VLAN10 has been added
VLAN11 has been added
.....................

If possible, please print only the failures.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure we will update it.


```
admin@sonic:~$ sudo config vlan member add -m -e 12-17 Ethernet0

Usage: This command will add all existing vlan(s) execpt as vlan member(s)

Example: Suppose if Vlan10, Vlan11, Vlan12, Vlan13, Vlan14, Vlan15, Vlan16, Vlan17, Vlan18, Vlan19, Vlan20 are existing Vlans. This command will add Ethernet0 as member of Vlan10, Vlan11, Vlan18, Vlan19, Vlan20

***This command only work for trunk ports***

```

```
admin@sonic:~$ sudo config vlan member add -m -e 12-17 PortChannel1002

Usage: This command will add all existing vlan(s) execpt as vlan member(s)

Example: Suppose if Vlan10, Vlan11, Vlan12, Vlan13, Vlan14, Vlan15, Vlan16, Vlan17, Vlan18, Vlan19, Vlan20 are existing Vlans. This command will add PortChannel1002 as member of Vlan10, Vlan11, Vlan18, Vlan19, Vlan20

***This command only work for trunk ports***

```

## YANG Model Configuration

For Mode attribute, a new type is defined in YANG Model for adding support of "mode" in PORT_TABLE & PORTCHANNEL_TABLE.

### YANG New type for PORT_TABLE & PORTCHANNEL_TABLE

typedef switchport_mode {
type string {
pattern "routed|access|trunk";
}
description
"SwitchPort Modes for Port & PortChannel";
}

### YANG Leaf for PORT_TABLE & PORTCHANNEL_TABLE

leaf mode {
description "SwitchPort Modes possible values are routed|access|trunk. Default val is routed. ";
type stypes:switchport_mode;
default "routed";
}

### Warm Boot and Fastboot Design Impact

The existing warm boot/fast boot feature is not affected due to this design.

## SAI API

No SAI API change or addition is needed for this HLD. We will be using the existing SAI API.

## Restrictions/Limitations

This HLD did not consider hybrid switch port mode. We will be adding a separate HLD for hybrid mode.

### Testing Requirements/Design

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also mention a new show command that will display the siwtchport mode of the interface. You should not be changing the output format of the existing "show interface status" output as it will break many existing applications, parsers, and testcases. So it is best to disclose what is the new show command that you will be implementing here as well.

Also, I was looking for a section in this doc to clearly spell out all the possible transitions foe the switchport mode and what are allowed and not allowed. Also, things as if there are any default Access VLANs or Trunk untagged (Native) VLAN when an interface is configured to switchport mode trunk. It would be better to have a section dedicated to spell out all these for completeness and easy of review so that there are nothing unspecified and became ambiguous...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will add a new command for switchport modes and will not change existing "show int status" output format.
Also we will add more specific examples for Transition of port mode to avoid ambiguity.

#### Unit Test cases

Unit testing will be done at two levels CLI level and Functional Level

CLI Level Tests
* Verify CLI to set the mode of an interface or a PortChannel to access or trunk
* Verify CLI to add a comma separated list of vlan(s)
* Verify CLI to add all vlan(s) except given vlan to member port or portchannel
* Verify CLI to delete list of vlan(s)
* Verify CLI to delete all vlans except given comma separated list of vlan(s)

Functional Level Tests
* Verify that port modes are set .
* Verify that multiple vlan(s) or range of vlan(s) can be added.
* Verify that multiple vlan member(s) can be added on a trunk port or on trunk portchannel.
* Verify intra-vlan communication between hosts on a single switch
* Verify intra-vlan communication between hosts on two different switches
* Repeat above step for different vlans

### Future Work
The scope of this HLD is limited to Switchport Mode “Access” and “Trunk”. In future, support for “Hybrid” will also be provided.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.