To implement the IEEE 802.1Q (VLAN Tagging) in OMNeT++ we requires an INET framework that helps VLAN tagging. Follow us to get more simulation results for you projects from omnet-manual.com. Below are the steps to set up and simulate a VLAN-tagged network using OMNeT++ and INET.
Step-by-Step Implementation:
Make sure to install both the OMNeT++ and the INET Framework on your computer as per your operating system.
State network topology that has VLAN tagging by creating a new NED file.
Example: VLAN Network Topology (VLANNetwork.ned)
package vlan;
import inet.node.inet.StandardHost;
import inet.node.ethernet.EthernetSwitch;
import inet.node.ethernet.EthernetHost;
network VLANNetwork
{
parameters:
@display(“bgb=600,400”);
submodules:
host1: EthernetHost {
@display(“p=100,300”);
}
host2: EthernetHost {
@display(“p=300,300”);
}
host3: EthernetHost {
@display(“p=500,300”);
}
switch1: EthernetSwitch {
@display(“p=200,200”);
}
switch2: EthernetSwitch {
@display(“p=400,200”);
}
connections:
host1.ethg++ <–> Eth10M <–> switch1.ethg++;
host2.ethg++ <–> Eth10M <–> switch1.ethg++;
switch1.ethg++ <–> Eth10M <–> switch2.ethg++;
host3.ethg++ <–> Eth10M <–> switch2.ethg++;
}
In this sample:
Alter the .ini file to configure VLAN tagging.
Example: Configuration File (omnetpp.ini)
network = vlan.VLANNetwork
sim-time-limit = 100s
# Visualization
*.visualizer.canvasVisualizer.displayBackground = true
*.visualizer.canvasVisualizer.displayGrid = true
# VLAN Configuration
*.switch1.vlanTagging = true
*.switch1.vlanTable = xmldoc(“vlan1.xml”)
*.switch2.vlanTagging = true
*.switch2.vlanTable = xmldoc(“vlan2.xml”)
# Host Configuration
*.host*.numEthInterfaces = 1
# Ethernet Switch Configuration
*.switch*.numPorts = 3
Create XML files to define the VLAN configuration for all switch.
Example: VLAN Configuration File for switch1 (vlan1.xml)
<vlanTable>
<vlan>
<id>10</id>
<ports>0,1</ports>
</vlan>
<vlan>
<id>20</id>
<ports>2</ports>
</vlan>
</vlanTable>
Example: VLAN Configuration File for switch2 (vlan2.xml)
<vlanTable>
<vlan>
<id>10</id>
<ports>0</ports>
</vlan>
<vlan>
<id>20</id>
<ports>1,2</ports>
</vlan>
</vlanTable>
According to this demonstration, you can completely understand the details on how to set up the basic simulation network and how to execute the IEEE 802.1Q (VLAN Tagging) in OMNeT++. We will also offer to help you anything which is related to this topic.