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

..--

.gitignoreD01-Feb-202358 32

MakefileD01-Feb-20232.6 KiB118113

READMED01-Feb-20232.3 KiB5946

bridge_igmp.shD01-Feb-202314.8 KiB568405

bridge_locked_port.shD01-Feb-20233.4 KiB177122

bridge_mdb.shD01-Feb-20231.7 KiB10470

bridge_mdb_port_down.shD01-Feb-20232.2 KiB11980

bridge_mld.shD01-Feb-202316.2 KiB565412

bridge_port_isolation.shD01-Feb-20232.3 KiB152112

bridge_sticky_fdb.shD01-Feb-20231.1 KiB7052

bridge_vlan_aware.shD01-Feb-20232.5 KiB153105

bridge_vlan_mcast.shD01-Feb-202316.7 KiB544440

bridge_vlan_unaware.shD01-Feb-20231.2 KiB10676

configD01-Feb-2023417 2019

custom_multipath_hash.shD01-Feb-20239.8 KiB373245

devlink_lib.shD01-Feb-202312.8 KiB592444

dual_vxlan_bridge.shD01-Feb-202311.2 KiB367222

ethtool.shD01-Feb-20236.6 KiB300212

ethtool_extended_state.shD01-Feb-20232.1 KiB11681

ethtool_lib.shD01-Feb-20232.7 KiB12192

fib_offload_lib.shD01-Feb-202324.6 KiB874600

forwarding.config.sampleD01-Feb-20231.4 KiB5224

gre_custom_multipath_hash.shD01-Feb-202312.5 KiB465295

gre_inner_v4_multipath.shD01-Feb-20237.5 KiB306182

gre_inner_v6_multipath.shD01-Feb-20237.7 KiB307183

gre_multipath.shD01-Feb-20236.3 KiB258157

gre_multipath_nh.shD01-Feb-20239.1 KiB357230

gre_multipath_nh_res.shD01-Feb-20239.3 KiB362235

hw_stats_l3.shD01-Feb-20237 KiB325236

hw_stats_l3_gre.shD01-Feb-20231.7 KiB11076

ip6_forward_instats_vrf.shD01-Feb-20233 KiB173128

ip6gre_custom_multipath_hash.shD01-Feb-202312.7 KiB467297

ip6gre_flat.shD01-Feb-2023876 6646

ip6gre_flat_key.shD01-Feb-2023907 6646

ip6gre_flat_keys.shD01-Feb-2023944 6646

ip6gre_hier.shD01-Feb-2023937 6646

ip6gre_hier_key.shD01-Feb-2023969 6646

ip6gre_hier_keys.shD01-Feb-20231,003 6646

ip6gre_inner_v4_multipath.shD01-Feb-20237.8 KiB305182

ip6gre_inner_v6_multipath.shD01-Feb-20237.9 KiB306183

ip6gre_lib.shD01-Feb-202313.9 KiB439217

ipip_flat_gre.shD01-Feb-2023838 6443

ipip_flat_gre_key.shD01-Feb-2023860 6443

ipip_flat_gre_keys.shD01-Feb-2023886 6443

ipip_hier_gre.shD01-Feb-2023887 6443

ipip_hier_gre_key.shD01-Feb-2023910 6443

ipip_hier_gre_keys.shD01-Feb-2023938 6443

ipip_lib.shD01-Feb-20238.4 KiB350158

lib.shD01-Feb-202332 KiB1,6871,304

local_termination.shD01-Feb-20236.1 KiB300223

loopback.shD01-Feb-20231.6 KiB10369

mirror_gre.shD01-Feb-20233.3 KiB161113

mirror_gre_bound.shD01-Feb-20235.8 KiB227130

mirror_gre_bridge_1d.shD01-Feb-20234.2 KiB13368

mirror_gre_bridge_1d_vlan.shD01-Feb-20232.7 KiB13390

mirror_gre_bridge_1q.shD01-Feb-20234.1 KiB13068

mirror_gre_bridge_1q_lag.shD01-Feb-20237.3 KiB294191

mirror_gre_changes.shD01-Feb-20235.7 KiB273193

mirror_gre_flower.shD01-Feb-20232.8 KiB13894

mirror_gre_lag_lacp.shD01-Feb-20237.3 KiB286183

mirror_gre_lib.shD01-Feb-20232.5 KiB13198

mirror_gre_neigh.shD01-Feb-20232.3 KiB11679

mirror_gre_nh.shD01-Feb-20232.9 KiB13285

mirror_gre_topo_lib.shD01-Feb-20233.4 KiB9545

mirror_gre_vlan.shD01-Feb-20231.7 KiB9363

mirror_gre_vlan_bridge_1q.shD01-Feb-20239 KiB349226

mirror_lib.shD01-Feb-20232.9 KiB150119

mirror_topo_lib.shD01-Feb-20232.7 KiB10259

mirror_vlan.shD01-Feb-20232.3 KiB13293

no_forwarding.shD01-Feb-20235.5 KiB262188

pedit_dsfield.shD01-Feb-20236.6 KiB312234

pedit_ip.shD01-Feb-20234.4 KiB202144

pedit_l4port.shD01-Feb-20234.5 KiB201144

q_in_vni.shD01-Feb-202310.7 KiB348213

q_in_vni_ipv6.shD01-Feb-202310.9 KiB348213

router.shD01-Feb-20237.3 KiB341228

router_bridge.shD01-Feb-20231.8 KiB11483

router_bridge_vlan.shD01-Feb-20232.1 KiB13397

router_broadcast.shD01-Feb-20235 KiB238179

router_mpath_nh.shD01-Feb-20239.6 KiB426309

router_mpath_nh_res.shD01-Feb-202310 KiB401294

router_multicast.shD01-Feb-202314.6 KiB507324

router_multipath.shD01-Feb-20238.3 KiB343248

router_nh.shD01-Feb-20232.6 KiB161112

router_vid_1.shD01-Feb-20233.5 KiB16198

sch_ets.shD01-Feb-2023781 4834

sch_ets_core.shD01-Feb-20237.3 KiB301187

sch_ets_tests.shD01-Feb-20233.9 KiB224175

sch_red.shD01-Feb-202311.1 KiB494342

sch_tbf_core.shD01-Feb-20235 KiB234142

sch_tbf_ets.shD01-Feb-2023118 73

sch_tbf_etsprio.shD01-Feb-20231.3 KiB6847

sch_tbf_prio.shD01-Feb-2023118 73

sch_tbf_root.shD01-Feb-2023422 3423

skbedit_priority.shD01-Feb-20233.8 KiB171114

tc_actions.shD01-Feb-20236.2 KiB269197

tc_chains.shD01-Feb-20234.8 KiB206148

tc_common.shD01-Feb-2023721 3725

tc_flower.shD01-Feb-202321.2 KiB718492

tc_flower_router.shD01-Feb-20233 KiB173123

tc_mpls_l2vpn.shD01-Feb-20235 KiB193111

tc_police.shD01-Feb-202311.8 KiB442292

tc_shblocks.shD01-Feb-20232.7 KiB153108

tc_vlan_modify.shD01-Feb-20233.2 KiB165116

tsn_lib.shD01-Feb-20235.5 KiB250190

vxlan_asymmetric.shD01-Feb-202317.6 KiB578354

vxlan_asymmetric_ipv6.shD01-Feb-202316 KiB505312

vxlan_bridge_1d.shD01-Feb-202320.4 KiB798552

vxlan_bridge_1d_ipv6.shD01-Feb-202321.3 KiB805569

vxlan_bridge_1d_port_8472.shD01-Feb-2023172 115

vxlan_bridge_1d_port_8472_ipv6.shD01-Feb-2023188 126

vxlan_bridge_1q.shD01-Feb-202322.9 KiB841540

vxlan_bridge_1q_ipv6.shD01-Feb-202324.3 KiB838547

vxlan_bridge_1q_port_8472.shD01-Feb-2023172 115

vxlan_bridge_1q_port_8472_ipv6.shD01-Feb-2023188 126

vxlan_symmetric.shD01-Feb-202318.1 KiB562346

vxlan_symmetric_ipv6.shD01-Feb-202318.3 KiB564348

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