2.1 Ethernet Links 2.3 Link Object Timing
Ethernet Networking Technology Guide  /  2 Network Simulation  / 

2.2 Ethernet VLAN Switch

The ethernet_switch described in the previous section complains if it receives frames tagged with VLAN information. For VLAN the eth-links provides an IEEE 802.1Q VLAN aware switch: ethernet_vlan_switch.

This section assumes you know what VLAN is. It only shows how to configure and use the ethernet_vlan_switch.

The VLAN switch has the same functionality as the basic Ethernet switch, but the interface is different to handle the added complexity of VLAN. You need to add VLAN groups to the switch before you can connect Ethernet devices to it. Each VLAN group has its own set of connectors.

The VLAN switch is created in the same way as the other Ethernet link components:

simics> load-module eth-links
simics> create-ethernet-vlan-switch evs
Created non-instantiated 'ethernet_vlan_switch' component 'evs'

Once the link has been created you need to add VLAN groups to it:

simics> evs.add-vlan 1

Each VLAN group adds two kinds of connectors: vlan_X_devY and vlan_X_trunk_devY, where X is the VLAN group id and Y is the an identifier for the connector. When a connector of one kind is used the switch automatically creates a new empty connector of the same kind with a new identifier.

Use the vlan_X_devY connectors to connect devices which do not expect or add VLAN tags. For example, to connect the first network port of the QSP-x86 machine created by the firststeps-multi.simics script:

simics> connect board0.mb.sb.eth_slot evs.vlan_1_dev0

Frames sent from the switch on these connections will not have any VLAN tags and the switch will generate a warning if it receives a tagged frame on such a connection.

Each VLAN group also has trunk connectors. On these connections the switch will parse frames sent to the switch to find which VLAN group they should be sent to and the switch will ensure that outgoing frames are tagged with the correct VLAN group.

To avoid having to keep track of the connector identifiers you can use get-free-connector to get an available non-trunk connector for a VLAN group:

simics> evs.get-free-connector 1
"evs.vlan_1_dev1"
simics> connect board1.mb.sb.eth_slot (evs.get-free-connector 1)
simics> evs.get-free-connector 1
"evs.vlan_1_dev2"

and get-free-trunk-connector to get an available trunk connector for a VLAN group:

simics> evs.get-free-trunk-connector 1
"evs.vlan_1_trunk_dev0"
2.1 Ethernet Links 2.3 Link Object Timing