infix icon indicating copy to clipboard operation
infix copied to clipboard

Add support for declaring and matching on edge attributes when mapping topologies

Open wkz opened this issue 1 year ago • 0 comments

Problem Description

In physical test rigs, it is typically not reasonable for the test host to provide the required number of Ethernet connections via dedicated NICs. Instead, an intermediate switch is deployed that will multiplex many ports to a single NIC on the host, by isolating each switch port in its own VLAN.

For most tests this setup is not an issue, but there are cases when the intermediate switch might not manage to act as a transparent multiplexer. Some typical examples:

  1. IEEE Link-Local Multicast: Frames with a destination address in the 01:80:c2:00:00:0x range are not supposed to be forwarded, since they are link-local.
  2. 802.1Q Tagged Frames: Some switches does not support assigning incoming traffic to the port's default PVID if the packet is already tagged.

Proposed Solution

Add a comma-separated list of attributes that an edge provides, to physical topologies:

graph "my-rig" {
        node [shape=record];

        host [
	    label="host | { <d1a> d1a | <d1b> d1b | <d1c> d1c | <d1c> d1d | <d2a> d2a | <d2b> d2b | <d2c> d2c | <d2d> d2d | <d2a> d3a | <d3b> d3b | <d3c> d3c | <d3c> d3d |  <d4a> d4a | <d4b> d4b | <d4c> d4c | <d4c> d4d }",
	    kind="controller",
	];

        dut1 [
	    label="{ <e1> e1 | <e2> e2 | <e3> e3 } | dut1 | { <e4> e4 | <e5> e5 | <e6> e6 | <e7> e7 | <e8> e8}",
	    kind="infix",
	    ];
        dut2 [
	    label="{ <e1> e1 | <e2> e2 | <e3> e3 } | dut2 | { <e4> e4 | <e5> e5 | <e6> e6  | <e7> e7 | <e8> e8}",
	    kind="infix",
	];

	host:d1a -- dut1:e1 [kind=mgmt]
	host:d1b -- dut1:e2 [provides="ieee-mc-transparency,802.1q-transparency"]
	host:d1c -- dut1:e3
	host:d1d -- dut1:e4

	host:d2a -- dut2:e1 [kind=mgmt]
	host:d2b -- dut2:e2 [provides="ieee-mc-transparency,802.1q-transparency"]
	host:d2c -- dut2:e3
	host:d2d -- dut2:e4

	dut1:e5 -- dut2:e5
	dut1:e6 -- dut2:e6
}

In this example the controller has 4 connections to each DUT, where one is dedicated to management (d<N>a), one is a direct connection via a real NIC (d<N>b), and the other two are via an intermediate switch.

A test can then require that an edge provides these attributes via its logical topology. So a test that expects to sniff LLDP frames might say:

graph "lldp-basic" {
        node [shape=record];

	host [
	    label="host | { <tgt> tgt | <data> data }",
	    kind="controller",
	];

        target [
	    label="{ <mgmt> mgmt | <data> data } | target",
	    kind="infix",
	];

	host:tgt -- target:mgmt [kind=mgmt]
	host:data -- target:data [requires="ieee-mc-transparency"]
}

wkz avatar Sep 26 '24 08:09 wkz