-
Notifications
You must be signed in to change notification settings - Fork 574
Add VLAN and PortChannel test plan #1480
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
Merged
richardyu-ms
merged 19 commits into
opencomputeproject:master
from
richardyu-ms:add_vlan_pc_test_plan
Jun 19, 2022
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
31b141a
Add VLAN and PortChannel test plan
richardyu-ms 5c5a0e2
Update lag_test_plan.md
zhoudongxu cfdd7f4
Update lag_test_plan.md
zhoudongxu 93a6b66
remove cases not related to T0
richardyu-ms 525e2b3
Update lag_test_plan.md
zhoudongxu 70a1400
Add VLAN and Lag test plan and put topo config in seperated files
1ab24e8
fix typo and more description more clear
richardyu-ms 304888f
fix lag test typo (#29)
zhoudongxu c3706e6
refactor vlan test plan and config
richardyu-ms 12f90e7
refactor lag test plan (#33)
zhoudongxu 9c526f2
refactor pc and vlan test
zhoudongxu 7fd1819
Merge branch 'add_vlan_pc_test_plan' into add_vlan_pc_test_plan
zhoudongxu bc7fcf0
Improve pc and vlan test Doc (#35)
zhoudongxu 7644b2c
reformat and adjust the description of the tests
richardyu-ms 191471c
set hash algorithm (#36)
zhoudongxu d9e53d7
refine lag test (#37)
zhoudongxu d4c2bb9
correct vlan interface test (#38)
zhoudongxu 08c90dc
workaround for the sequence number issue in github and correct typo
richardyu-ms 0c53ec5
adjust the case numbers and vlan id
richardyu-ms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| # Sample T0 Configurations and data <!-- omit in toc --> | ||
| - [Overriew](#overriew) | ||
| - [IP and MAC naming convention](#ip-and-mac-naming-convention) | ||
| - [MAC](#mac) | ||
| - [IP](#ip) | ||
| - [1. L2 Configurations](#1-l2-configurations) | ||
| - [1.1 FDB Configuration](#11-fdb-configuration) | ||
| - [1.2 VLAN configuration](#12-vlan-configuration) | ||
| - [2. L3 configuration](#2-l3-configuration) | ||
| - [2.1 VLAN Interfaces](#21-vlan-interfaces) | ||
| - [2.2 LAG configuration](#22-lag-configuration) | ||
| - [2.2.1 LAG Hash Rule](#221-lag-hash-rule) | ||
| - [2.3 Route Configuration](#23-route-configuration) | ||
| - [2.3.1 VLAN interfaces route entries](#231-vlan-interfaces-route-entries) | ||
| - [2.3.2 LAG Route entry](#232-lag-route-entry) | ||
| - [2.4 Neighbor Configuration](#24-neighbor-configuration) | ||
| - [2.4.1 VLAN Neighbors](#241-vlan-neighbors) | ||
| - [2.4.2 LAG Neighbors](#242-lag-neighbors) | ||
| # Overriew | ||
| This document describes the sample configuration data. | ||
|
|
||
| **Note: This configuration focused on T0 topology.** | ||
|
|
||
| # IP and MAC naming convention | ||
| In this configuration, we mapped the IP and MAC address into different parts of this configuration as below. | ||
|
|
||
| ## MAC | ||
| For MAC addresses, we can use different sections in the MAC addresses to map different title numbers. | ||
| The pattern is | ||
| ``` | ||
| 00:TITLE_L1_NUM:TITLE_L2_NUM:ROLE:EXTRA:SEQ | ||
| ROLE: T1=1, Server=99 | ||
| ``` | ||
|
|
||
| For example: | ||
| For the MAC address in ``1.1 FDB Configuration``. | ||
| `1.1` is the title number. | ||
| ``` | ||
| #Server MAC | ||
| 00:01:01:99:02:01~00:01:01:99:02:32 | ||
| # 99: Server | ||
| # 02: EXTRA (Group ID) | ||
| ``` | ||
|
|
||
|
|
||
| ## IP | ||
| For IP addresses, we will use different prefix for different role | ||
|
|
||
| Format: ROLE.NUM.GROUP_ID.SEQ | ||
|
|
||
| - ROLE_NUM | ||
| T0: 10.0.0.0 | ||
| T1: 10.1.0.0 | ||
| Server: 192.168.0.0 | ||
|
|
||
| For example | ||
| ``` | ||
| # IP in | ||
| # 2.4.1 VLAN Neighbors | ||
| #Group0 (For Vlan10) | ||
| 192.168.1.1~ 192.168.1.8 | ||
| #Group1 (ForVlan20) | ||
| 192.168.2.1~ 192.168.2.8 | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
|
|
||
| # 1. L2 Configurations | ||
|
|
||
| ## 1.1 FDB Configuration | ||
|
|
||
| The MAC Table for VLAN L2 forwarding as below | ||
| |Name|MAC|PORT|VLAN|HostIf| | ||
| |-|-|-|-|-| | ||
| |mac0|01:01:00:99:00:00|Port0||Ethernet0| | ||
| |mac1-8 |00:01:01:99:01:01 - 00:01:01:99:01:08|Port1-8|10|Ethernet4-Ethernet32| | ||
| |mac9-16 |00:01:01:99:02:09 - 00:01:01:99:02:16|Port9-16|20|Ethernet36-Ethernet64| | ||
|
|
||
| ## 1.2 VLAN configuration | ||
|
|
||
| |HostIf|VLAN ID|Ports|Tag mode| | ||
| |-|-|-|-| | ||
| |Ethernet4-32|10|Port1-8|Untag| | ||
| |Ethernet36-72|20|Port9-16|Untag| | ||
|
|
||
|
|
||
| # 2. L3 configuration | ||
|
|
||
| Host interface IP | ||
| |Port|Interface IP| | ||
| |-|-| | ||
| |port0|10.0.0.100| | ||
|
|
||
| ## 2.1 VLAN Interfaces | ||
| |VLAN ID | VLAN Interface IP| | ||
| |-|-| | ||
| |10|192.168.1.100| | ||
| |20|192.168.2.100| | ||
|
|
||
| ## 2.2 LAG configuration | ||
|
|
||
| |HostIf|LAG ID|Ports| | ||
| |-|-|-| | ||
| |Ethernet76-80|lag1|Port17-18| | ||
| |Ethernet84-88|lag2|Port19-20| | ||
|
|
||
| ### 2.2.1 LAG Hash Rule | ||
| - Set hash algorithm as SAI_HASH_ALGORITHM_CRC | ||
| - Set switch hash attribute as below, which means switch computes hash using the five fields and seed(SAI_SWITCH_ATTR_LAG_DEFAULT_HASH_SEED) as the hash configuration. | ||
| ``` | ||
| SAI_NATIVE_HASH_FIELD_SRC_IP | ||
| SAI_NATIVE_HASH_FIELD_DST_IP | ||
| SAI_NATIVE_HASH_FIELD_IP_PROTOCOL | ||
| SAI_NATIVE_HASH_FIELD_L4_DST_PORT | ||
| SAI_NATIVE_HASH_FIELD_L4_SRC_PORT | ||
| ``` | ||
|
|
||
| ## 2.3 Route Configuration | ||
|
|
||
| ### 2.3.1 VLAN interfaces route entries | ||
| |VLAN ID | route IP | Type | | ||
| |-|-| - | | ||
| |10| 192.168.1.100/24 | Direct Connect| | ||
| |20| 192.168.2.100/24 | Direct Connect| | ||
| ### 2.3.2 LAG Route entry | ||
|
|
||
| |LAG ID | route IP | Type | VALUE| | ||
| |-|-| - |-| | ||
| |1| 10.0.1.100/31 | Direct Connect|| | ||
| |2| 10.0.2.100/31 | Direct Connect|| | ||
| |1| 192.168.10.1-192.168.10.100| NH|lag1_nb| | ||
| |2| 192.168.11.1-192.168.11.100| NH|lag2_nb| | ||
|
|
||
| ## 2.4 Neighbor Configuration | ||
| ### 2.4.1 VLAN Neighbors | ||
| |Name|Port|IP|dest_mac| | ||
| |-|-|-|-| | ||
| |vlan10_nb1-nb8|Port1-8 |192.168.1.1 ~ 192.168.1.8 |00:01:01:99:01:01 - 00:01:01:99:01:08| | ||
| |vlan20_nb1-nb8|Port9-16|192.168.2.9 ~ 192.168.2.16 |00:01:01:99:02:09 - 00:01:01:99:02:16| | ||
|
|
||
|
|
||
| ### 2.4.2 LAG Neighbors | ||
|
|
||
| |Name|Port|IP|dest_mac| | ||
| |-|-|-|-| | ||
| |lag1_nb|lag1| 10.1.1.101 | 02:04:02:01:01:01| | ||
| |lag2_nb|lag2| 10.1.2.101 | 02:04:02:01:02:01| | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| # SAI LAG Test plan | ||
| - [SAI LAG Test plan](#sai-lag-test-plan) | ||
| - [Overriew](#overriew) | ||
| - [Test Configuration](#test-configuration) | ||
| - [Test Execution](#test-execution) | ||
| - [Test Data/Packet](#test-datapacket) | ||
| - [Test Group1: L3 PortChannel Load balancing](#test-group1-l3-portchannel-load-balancing) | ||
| - [Case1: test_loadbalance_on_source_port](#case1-test_loadbalance_on_source_port) | ||
| - [Case2: test_loadbalance_on_destinstion_port](#case2-test_loadbalance_on_destinstion_port) | ||
| - [Case3: test_loadbalance_on_source_ip](#case3-test_loadbalance_on_source_ip) | ||
| - [Case4: test_loadbalance_on_destinstion_ip](#case4-test_loadbalance_on_destinstion_ip) | ||
| - [Case5: test_loadbalance_on_protocol](#case5-test_loadbalance_on_protocol) | ||
| - [Test Group2: Disable Egress/Ingress](#test-group2-disable-egressingress) | ||
| - [Case1: test_disable_egress](#case1-test_disable_egress) | ||
| - [Case2: test_disable_ingress](#case2-test_disable_ingress) | ||
| - [Test Group3: Remove/Add LAG member](#test-group3-removeadd-lag-member) | ||
| - [Case1: test_remove_lag_member](#case1-test_remove_lag_member) | ||
| - [Case2: test_add_lag_member](#case2-test_add_lag_member) | ||
| - [Test Group4: Indifference Ingress Port in Hash](#test-group4-indifference-ingress-port-in-hash) | ||
| - [Case1: test_ingress_port_hash_indiff](#case1-test_ingress_port_hash_indiff) | ||
| # Overriew | ||
| The purpose of this test plan is to test the LAG/PortChannel function from SAI. | ||
|
|
||
|
|
||
| # Test Configuration | ||
|
|
||
| For the test configuration, please refer to LAG configuration section of the file | ||
| - [Config_t0](./config_data/config_t0.md) | ||
|
|
||
| **Note. All the tests will be based on the configuration above, if any additional configuration is required, it will be specified in the Test case.** | ||
|
|
||
| # Test Execution | ||
| ## Test Data/Packet | ||
| ```Python | ||
| pkt = simple_udp_packet(eth_dst=ROUTER_MAC, | ||
| eth_src=src_mac, | ||
| ip_dst=dst_ip_addr, | ||
| ip_src=src_ip_addr, | ||
| udp_sport=udp_sport, | ||
| udp_dport=udp_dport, | ||
| ip_id=106, | ||
| ip_ttl=64) | ||
|
|
||
| exp_pkt = simple_udp_packet(eth_dst=dstmac, | ||
| eth_src=ROUTER_MAC, | ||
| ip_dst=dst_ip_addr, | ||
| ip_src=src_ip_addr, | ||
| udp_sport=udp_sport, | ||
| udp_dport=udp_dport, | ||
| ip_id=106, | ||
| ip_ttl=63) | ||
| ``` | ||
|
|
||
| ```Python | ||
| pkt = simple_tcp_packet(eth_dst=ROUTER_MAC, | ||
| eth_src=src_mac, | ||
| ip_dst=dst_ip_addr, | ||
| ip_src=src_ip_addr, | ||
| tcp_sport=tcp_sport, | ||
| tcpp_dport=tcp_dport, | ||
| ip_id=106, | ||
| ip_ttl=64) | ||
|
|
||
| exp_pkt = simple_udp_packet(eth_dst=dstmac, | ||
| eth_src=ROUTER_MAC, | ||
| ip_dst=dst_ip_addr, | ||
| ip_src=src_ip_addr, | ||
| tcp_sport=tcp_sport, | ||
| tcp_dport=tcp_dport, | ||
| ip_id=106, | ||
| ip_ttl=63) | ||
| ``` | ||
| ## Test Group1: L3 PortChannel Load balancing | ||
| These cases will cover five scenarios: src/dst IP, src/dst port, and protocol. considering the mighty hash collision, please make sure the volume of the test data, and we can check the final result is in a range. | ||
|
|
||
|
|
||
| ### Case1: test_loadbalance_on_source_port | ||
| ### Case2: test_loadbalance_on_destinstion_port | ||
| ### Case3: test_loadbalance_on_source_ip | ||
| ### Case4: test_loadbalance_on_destinstion_ip | ||
| ### Case5: test_loadbalance_on_protocol | ||
|
|
||
|
|
||
| ### Testing Objective <!-- omit in toc --> | ||
| For load balancing, expecting the ports in a lag should receive the packet equally. Traffic direction: from server-side to T1 side. | ||
|
|
||
| ### Test steps: <!-- omit in toc --> | ||
| 1. Generate different packets by updating different factors for each case. The factor includes source port(L4), destination port(L4), source IP, and destination IP of the packet. Packets use lag1 neighbor IPs as destination IP, and lag1 MAC (Switch MAC) as destination MAC. | ||
| 2. Send these packets with different protocols on port1(with different cases). | ||
| 3. Check if packets are received on ports of lag1 equally. | ||
|
|
||
| ## Test Group2: Disable Egress/Ingress | ||
|
|
||
|
|
||
| ### Case1: test_disable_egress | ||
| ### Case2: test_disable_ingress | ||
|
|
||
| ### Testing Objective <!-- omit in toc --> | ||
| These cases will cover two scenarios: disable egress and ingress. We can disable ingress or egress on a lag member, then we expect traffic drop on the disabled lag member. | ||
|
|
||
| ### Test steps: <!-- omit in toc --> | ||
| - test_disable_egress | ||
|
|
||
| 1. Generate different packets by updating different factors for each case. The factor includes source port(L4), destination port(L4), source IP, and destination IP of the packet. Packets use lag1 neighbor IPs as destination IP, and lag1 MAC (Switch MAC) as destination MAC. | ||
| 2. Send packet from port1 | ||
| 3. Verify packets appear on different lag1 members(Baseline check). | ||
| 4. Disable egress on lag1 member port18 | ||
| 5. Send packets in step1 from port1 again | ||
| 6. Check if the Packet drop on port18 | ||
|
|
||
| - test_disable_ingress | ||
|
|
||
| 1. Generate packet using port1 neighbor IP as destination IP, VLAN Interface MAC (Switch MAC) as destination MAC. | ||
| 2. Send packet from lag1 port18 | ||
| 3. Verify packets appear on Port1(Baseline check). | ||
| 4. Disable ingress on lag1 member port18 | ||
| 5. Send packet in step1 again from lag1 port18 | ||
| 6. Check if Packet drop on port1 | ||
|
|
||
| ## Test Group3: Remove/Add LAG member | ||
| ### Case1: test_remove_lag_member | ||
| ### Case2: test_add_lag_member | ||
| ### Testing Objective <!-- omit in toc --> | ||
| These cases will cover adding and removing the lag members. We can remove or add a lag member, then expect traffic to drop/appear on the lag member. | ||
|
|
||
| ### Test steps: <!-- omit in toc --> | ||
| - test_remove_lag_member | ||
|
|
||
| 1. Generate different packets by updating different factors for each case. The factor includes source port(L4), destination port(L4), source IP, and destination IP of the packet. Packets use lag1 neighbor IPs as destination IP and lag1 MAC (Switch MAC) as destination MAC. | ||
| 2. Send packet from port1 | ||
| 3. Verify packets appear on lag1 port18(Baseline check). | ||
| 4. Remove port18 from lag1 | ||
| 5. Send packets in step1 from port1 again | ||
| 6. Check if the Packet drop on port18 | ||
|
|
||
| - test_add_lag_member | ||
|
|
||
| 1. Add port21 to lag1 | ||
| 2. Create packets with variations of the src_ip, dest_ip, src_port,dest_port.(dest_ip is lag1 neighbor IP and MAC is lag1 neighbor MAC) | ||
| 3. Send packet from port1 | ||
| 4. Verify packets appear on all the lag1 members, including port21. | ||
|
|
||
|
|
||
| ## Test Group4: Indifference Ingress Port in Hash | ||
| ### Case1: test_ingress_port_hash_indiff | ||
|
|
||
| ### Test Objective <!-- omit in toc --> | ||
| This case will verify the ingress ports should not be as a Hash Factor in Lag loadbalance. | ||
| When forwarding the packet from different ingress ports, if only the ingress port changed, then the loadbalance should not happen among lag members. | ||
|
|
||
| ### Test steps: <!-- omit in toc --> | ||
| 1. Generate packet using one lag1 neighbor IP as destination IP, lag1 MAC (Switch MAC) as destination MAC, and keep all packets from different ports have the same src_ip, dest_ip, src_port(L4),dest_port(L4), and protocol. | ||
| 2. Send packet from Port1 ~ Port16 | ||
| 3. Verify packets only appear on one LAG member port |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.