• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.gitignoreD11-Mar-202458 32

MakefileD11-Mar-20241.7 KiB7974

READMED11-Mar-20242.3 KiB5946

bridge_igmp.shD11-Mar-202414.7 KiB562400

bridge_mld.shD11-Mar-202416 KiB559407

bridge_port_isolation.shD11-Mar-20242.3 KiB152112

bridge_sticky_fdb.shD11-Mar-20241.1 KiB7052

bridge_vlan_aware.shD11-Mar-20242.5 KiB152103

bridge_vlan_unaware.shD11-Mar-20241.2 KiB10574

configD11-Mar-2024397 1918

custom_multipath_hash.shD11-Mar-20249.6 KiB365237

devlink_lib.shD11-Mar-202412.8 KiB593445

dual_vxlan_bridge.shD11-Mar-202411.2 KiB367222

ethtool.shD11-Mar-20246.6 KiB300212

ethtool_extended_state.shD11-Mar-20241.9 KiB10371

ethtool_lib.shD11-Mar-20242.7 KiB12192

fib_offload_lib.shD11-Mar-202424.6 KiB874600

forwarding.config.sampleD11-Mar-20241.1 KiB4420

gre_custom_multipath_hash.shD11-Mar-202412.3 KiB457287

gre_inner_v4_multipath.shD11-Mar-20247.5 KiB306182

gre_inner_v6_multipath.shD11-Mar-20247.7 KiB307183

gre_multipath.shD11-Mar-20246.3 KiB258157

gre_multipath_nh.shD11-Mar-20249.1 KiB357230

gre_multipath_nh_res.shD11-Mar-20249.3 KiB362235

ip6_forward_instats_vrf.shD11-Mar-20243 KiB173128

ip6gre_custom_multipath_hash.shD11-Mar-202412.6 KiB459289

ip6gre_inner_v4_multipath.shD11-Mar-20247.8 KiB305182

ip6gre_inner_v6_multipath.shD11-Mar-20247.9 KiB306183

ipip_flat_gre.shD11-Mar-2024838 6443

ipip_flat_gre_key.shD11-Mar-2024860 6443

ipip_flat_gre_keys.shD11-Mar-2024886 6443

ipip_hier_gre.shD11-Mar-2024887 6443

ipip_hier_gre_key.shD11-Mar-2024910 6443

ipip_hier_gre_keys.shD11-Mar-2024938 6443

ipip_lib.shD11-Mar-20248.4 KiB350158

lib.shD11-Mar-202427.5 KiB1,4741,141

loopback.shD11-Mar-20241.6 KiB10369

mirror_gre.shD11-Mar-20243.3 KiB161113

mirror_gre_bound.shD11-Mar-20245.8 KiB227130

mirror_gre_bridge_1d.shD11-Mar-20244.2 KiB13368

mirror_gre_bridge_1d_vlan.shD11-Mar-20242.7 KiB13390

mirror_gre_bridge_1q.shD11-Mar-20244 KiB12766

mirror_gre_bridge_1q_lag.shD11-Mar-20247.3 KiB293191

mirror_gre_changes.shD11-Mar-20245.7 KiB273193

mirror_gre_flower.shD11-Mar-20242.8 KiB13894

mirror_gre_lag_lacp.shD11-Mar-20247.3 KiB286183

mirror_gre_lib.shD11-Mar-20242.5 KiB13198

mirror_gre_neigh.shD11-Mar-20242.3 KiB11679

mirror_gre_nh.shD11-Mar-20242.9 KiB13285

mirror_gre_topo_lib.shD11-Mar-20243.4 KiB9545

mirror_gre_vlan.shD11-Mar-20241.7 KiB9363

mirror_gre_vlan_bridge_1q.shD11-Mar-20248.9 KiB348225

mirror_lib.shD11-Mar-20242.9 KiB149118

mirror_topo_lib.shD11-Mar-20242.7 KiB10259

mirror_vlan.shD11-Mar-20242.2 KiB13293

pedit_dsfield.shD11-Mar-20246.6 KiB312234

pedit_l4port.shD11-Mar-20244.5 KiB201144

q_in_vni.shD11-Mar-202410.7 KiB348213

router.shD11-Mar-20246.2 KiB323228

router_bridge.shD11-Mar-20241.8 KiB11483

router_bridge_vlan.shD11-Mar-20242.1 KiB13397

router_broadcast.shD11-Mar-20245 KiB238179

router_mpath_nh.shD11-Mar-20249.6 KiB426309

router_mpath_nh_res.shD11-Mar-202410 KiB401294

router_multicast.shD11-Mar-202411.3 KiB417270

router_multipath.shD11-Mar-20248.3 KiB343248

router_nh.shD11-Mar-20242.6 KiB161112

router_vid_1.shD11-Mar-20242.1 KiB13695

sch_ets.shD11-Mar-2024781 4834

sch_ets_core.shD11-Mar-20247.3 KiB301187

sch_ets_tests.shD11-Mar-20243.9 KiB224175

sch_red.shD11-Mar-202411.1 KiB493342

sch_tbf_core.shD11-Mar-20245 KiB234142

sch_tbf_ets.shD11-Mar-2024118 73

sch_tbf_etsprio.shD11-Mar-2024711 4026

sch_tbf_prio.shD11-Mar-2024118 73

sch_tbf_root.shD11-Mar-2024422 3423

skbedit_priority.shD11-Mar-20243.8 KiB171114

tc_actions.shD11-Mar-20244.6 KiB224162

tc_chains.shD11-Mar-20244.8 KiB206148

tc_common.shD11-Mar-2024524 2717

tc_flower.shD11-Mar-202421.2 KiB718492

tc_flower_router.shD11-Mar-20243 KiB173123

tc_mpls_l2vpn.shD11-Mar-20245 KiB193111

tc_police.shD11-Mar-202410.4 KiB390256

tc_shblocks.shD11-Mar-20242.7 KiB153108

tc_vlan_modify.shD11-Mar-20243.2 KiB165116

vxlan_asymmetric.shD11-Mar-202417.6 KiB578354

vxlan_bridge_1d.shD11-Mar-202420.4 KiB798552

vxlan_bridge_1d_port_8472.shD11-Mar-2024172 115

vxlan_bridge_1q.shD11-Mar-202423.5 KiB861556

vxlan_bridge_1q_port_8472.shD11-Mar-2024172 115

vxlan_symmetric.shD11-Mar-202418.1 KiB562346

README

1Motivation
2==========
3
4One of the nice things about network namespaces is that they allow one
5to easily create and test complex environments.
6
7Unfortunately, these namespaces can not be used with actual switching
8ASICs, as their ports can not be migrated to other network namespaces
9(NETIF_F_NETNS_LOCAL) and most of them probably do not support the
10L1-separation provided by namespaces.
11
12However, a similar kind of flexibility can be achieved by using VRFs and
13by looping the switch ports together. For example:
14
15                             br0
16                              +
17               vrf-h1         |           vrf-h2
18                 +        +---+----+        +
19                 |        |        |        |
20    192.0.2.1/24 +        +        +        + 192.0.2.2/24
21               swp1     swp2     swp3     swp4
22                 +        +        +        +
23                 |        |        |        |
24                 +--------+        +--------+
25
26The VRFs act as lightweight namespaces representing hosts connected to
27the switch.
28
29This approach for testing switch ASICs has several advantages over the
30traditional method that requires multiple physical machines, to name a
31few:
32
331. Only the device under test (DUT) is being tested without noise from
34other system.
35
362. Ability to easily provision complex topologies. Testing bridging
37between 4-ports LAGs or 8-way ECMP requires many physical links that are
38not always available. With the VRF-based approach one merely needs to
39loopback more ports.
40
41These tests are written with switch ASICs in mind, but they can be run
42on any Linux box using veth pairs to emulate physical loopbacks.
43
44Guidelines for Writing Tests
45============================
46
47o Where possible, reuse an existing topology for different tests instead
48  of recreating the same topology.
49o Tests that use anything but the most trivial topologies should include
50  an ASCII art showing the topology.
51o Where possible, IPv6 and IPv4 addresses shall conform to RFC 3849 and
52  RFC 5737, respectively.
53o Where possible, tests shall be written so that they can be reused by
54  multiple topologies and added to lib.sh.
55o Checks shall be added to lib.sh for any external dependencies.
56o Code shall be checked using ShellCheck [1] prior to submission.
57
581. https://www.shellcheck.net/
59