layer2_configuration - nsg-ethz/mini_internet_project GitHub Wiki
Layer-2 configuration
You can define one or more layer-2 networks inside every AS.
You can do this through three configuration files that describe these layer-2 networks.
These configuration files are applied on one or more ASes, according to the AS_config.txt file.
In the following, we explain each configuration file and give an example.
The default configuration files depicted below build the following L2 network:
[!NOTE] In case you do not want to have a layer-2 network in your mini-Internet, just make the following configuration files empty.
l2_switches.txt
This file lists the switches in the layer-2 networks included in an AS. The following table shows an example of this configuration file.
C1 C2 C3 C4 C5
------------------------------------------
TCW S1 LAUS 11:11:11:11:11:11 1
TCS S2 BELL 22:22:22:22:22:22 2
TCS S3 N/A 33:33:33:33:33:33 3
Below is the description of each column:
- C1: Name of the layer-2 network the switch belongs to. Here, TCW (resp. TCS) means Train Control West (resp. South).
- C2: Name of the layer-2 switch.
- C3: Router to which the layer-2 switch is connected to (or N/A if the switch is not connected to a router).
- C4: The MAC address to use for a switch which will serve as an
ID. - C5: The bridge ID for the switch which is used for the spanning tree computation.
Note that a router can only be connected to one L2 network, but a layer 2 network can be connected to one or more routers.
[!NOTE] When a switch is connected to a router, it must also be indicated in the third column of the
l3_router.txtconfiguration file, which lists the L3 routers. In thel3_router.txtconfiguration file, the name of the L2 network must always be preceded byL2-.
l2_hosts.txt
This file lists the hosts that are in the layer 2 network along with their parameters. The following table shows an example of such a configuration file.
C1 C2 C3 C4 C5 C6 C7 C8
-----------------------------------------------------------------------
A_VAUD miniinterneteth/host:26 TCW S1 10mbit 1ms 50ms 10
C_VAUD miniinterneteth/host:26 TCW S1 10mbit 1ms 50ms 20
A_GOTT miniinterneteth/host:26 TCS S2 10mbit 1ms 50ms 10
C_GOTT miniinterneteth/host:26 TCS S2 10mbit 1ms 50ms 20
A_CENE miniinterneteth/host:26 TCS S3 10mbit 1ms 50ms 10
C_CENE miniinterneteth/host:26 TCS S3 10mbit 1ms 50ms 20
Below is the description of each column:
- C1: Name of the host.
- C2: Docker image to use for this host.
- C3: The name of the L2 network the host belongs to.
- C4: The name of the switch to which the host is connected.
- C5: The throughput of the link between the host and the switch.
- C6: The delay of the link between the host and the switch.
- C7: The maximum time a packet will be buffered before it is dropped.
- C8: The VLAN to which the host belongs to.
l2_links.txt
The last file describes the layer-2 topologies. Each line corresponds to a link between two switches.
The following table shows an example of such a configuration file.
C1 C2 C3 C4 C5 C6 C7
------------------------------------------
TCS S2 TCS S3 10mbit 1ms 50ms
Below is the description of each column:
- C1: Name of the L2 network where the first switch of the link is located.
- C2: The name of the first switch of the link.
- C3: Name of the L2 network where the second switch of the link is located.
- C4: The name of the second switch of the link.
- C5: The throughput of the link between the host and the switch.
- C6: The delay of the link between the host and the switch.
- C7: The maximum time a packet will be buffered before it is dropped.
[!NOTE] The names of the layer-2 networks should be identical for the two switches since it is not possible to connect two switches that are in two different L2 networks.