How to Simulate VLAN Trunking Protocol Projects Using OMNeT++

To simulate a VLAN Trunking Protocol (VTP) project using OMNeT++ and the INET framework, we will be employed with the simulation of Virtual Local Area Network (VLAN) concepts, in which VTP is a protocol utilized to handle VLANs through switches in a network. While VTP is a management protocol for VLANs in Cisco devices, INET doesn’t directly support VTP by default; however we can replicate VLANs and model an setting similar to how VTP performs.

Here’s a step-by-step guide to simulate a VLAN Trunking Protocol (VTP) environment in OMNeT++:

Steps to Simulate VLAN Trunking Protocol Projects in OMNeT++

  1. Install OMNeT++ and INET Framework
  • Download and install OMNeT++.
  • Clone or download the INET framework from INET GitHub repository.
  • The INET framework supports VLANs as part of its Ethernet protocol suite that is the key component for configuring VLAN environments in OMNeT++.
  1. Understand VLAN and VTP Concepts
  • VLAN: A VLAN is a logically isolate network inside a physical network that enables network administrators to group hosts into diverse broadcast domains.
  • VTP (VLAN Trunking Protocol): VTP is a Cisco proprietary protocol utilized to handle VLANs through multiple switches. It enable for the creation, deletion, and propagation of VLAN configurations between switches. While INET doesn’t have direct VTP support, we will replicate VLAN propagation and management by physically set up VLANs and using trunk links.
  1. Set up a VLAN Network in INET
  • We will generate a network topology with multiple switches and hosts. The hosts will be associated to diverse VLANs, and trunk links will be utilized among switches to replicate VTP behaviour (in a simplified form).

Example NED files for a VLAN Network with Trunk Links:

network VLANTrunkNetwork {

submodules:

switch[2]: EthernetSwitch {

@display(“p=” + (index * 200) + “,200”);

}

host[4]: StandardHost {

@display(“p=” + (index % 2 * 200) + “,” + (100 + index / 2 * 100));

}

connections allowunconnected:

host[0].ethg++ <–> Eth10G <–> switch[0].ethg++;

host[1].ethg++ <–> Eth10G <–> switch[0].ethg++;

host[2].ethg++ <–> Eth10G <–> switch[1].ethg++;

host[3].ethg++ <–> Eth10G <–> switch[1].ethg++;

// Trunk link between the switches

switch[0].ethg++ <–> Eth10G <–> switch[1].ethg++;

}

Explanation:

  • Switches: Two switches are associated through a trunk link (i.e., a link that carries traffic for multiple VLANs).
  • Hosts: Four hosts are linked to the switches. The hosts will be allocated to diverse VLANs.
  1. Configure VLANs in omnetpp.ini
  • OMNeT++ and INET enable you to set up VLANs by using 802.1Q VLAN tagging. In the omnetpp.ini file, we will describe VLANs for each host, beside with the trunk links among the switches to carry multiple VLAN traffic.

Example omnetpp.ini configuration:

network = VLANTrunkNetwork

sim-time-limit = 100s

# Enable VLAN tagging on the Ethernet interfaces of the hosts

**.host[0].eth[0].vlanTagEnabled = true

**.host[0].eth[0].vlanId = 10  # VLAN 10

**.host[1].eth[0].vlanTagEnabled = true

**.host[1].eth[0].vlanId = 20  # VLAN 20

**.host[2].eth[0].vlanTagEnabled = true

**.host[2].eth[0].vlanId = 10  # VLAN 10

**.host[3].eth[0].vlanTagEnabled = true

**.host[3].eth[0].vlanId = 20  # VLAN 20

# Trunk links between the switches

**.switch[0].eth[*].vlanTagEnabled = true

**.switch[1].eth[*].vlanTagEnabled = true

# Define VLAN membership for the trunk link (carry traffic for VLAN 10 and VLAN 20)

**.switch[0].eth[2].allowedVlanIds = “10 20”  # Trunk link between switches

**.switch[1].eth[2].allowedVlanIds = “10 20”

# Configure switch ports (each switch port can be an access or trunk port)

**.switch[0].eth[0].allowedVlanIds = “10”  # Host 0 (VLAN 10)

**.switch[0].eth[1].allowedVlanIds = “20”  # Host 1 (VLAN 20)

**.switch[1].eth[0].allowedVlanIds = “10”  # Host 2 (VLAN 10)

**.switch[1].eth[1].allowedVlanIds = “20”  # Host 3 (VLAN 20)

Explanation:

  • VLAN Tagging: Each host is allocated a VLAN ID (vlanId = 10 or vlanId = 20). VLAN tagging is permit on both the hosts and the switches.
  • Trunk Links: The trunk links among the switches carry traffic for both VLAN 10 and VLAN 20. This replicates VTP behaviour, in which VLAN information is distributed among switches.
  1. Traffic Generation between VLANs
  • Now, we can describe traffic patterns to replicate communication in and between VLANs. For example, host[0] (on VLAN 10) can interact with host[2] (also on VLAN 10), however it should not interact with host[1] (on VLAN 20).

Example of traffic configuration:

# Traffic generation: host[0] sends UDP traffic to host[2] (both in VLAN 10)

**.host[0].numApps = 1

**.host[0].app[0].typename = “UdpBasicApp”

**.host[0].app[0].destAddresses = “host[2]”

**.host[0].app[0].sendInterval = 1s

**.host[0].app[0].messageLength = 512B

# Traffic generation: host[1] sends UDP traffic to host[3] (both in VLAN 20)

**.host[1].numApps = 1

**.host[1].app[0].typename = “UdpBasicApp”

**.host[1].app[0].destAddresses = “host[3]”

**.host[1].app[0].sendInterval = 1s

**.host[1].app[0].messageLength = 512B

# Configure the receiving applications (UDP Sink) on destination hosts

**.host[2].numApps = 1

**.host[2].app[0].typename = “UdpSink”

**.host[3].numApps = 1

**.host[3].app[0].typename = “UdpSink”

Explanation:

  • UDP Traffic: Traffic is created from host [0] to host [2] (VLAN 10) and from host [1] to host [3] (VLAN 20). The traffic will only be transmitted within their respective VLANs, replicates VLAN seperation.
  1. Run the Simulation
  • Execute the simulation in the OMNeT++ IDE. Track on how VLAN traffic is managed, and validates that traffic in a VLAN (such as VLAN 10) does not impact hosts on another VLAN (e.g., VLAN 20).
  • Validate that the trunk link appropriately propagates VLAN information among switches, similar to how VTP would propagate VLANs in a real-world network.
  1. Monitor and Analyse Results
  • OMNeT++ enables you to track network performance and VLAN traffic via its built-in tools.
  • We can utilize scalar and vector recording to collect parameter on network traffic, such as:
    • Packet delivery ratio: Make sure that packets sent among hosts in the same VLAN are delivered successfully.
    • End-to-end delay: Evaluate the latency experienced by packets traveling via the VLANs and trunk links.
    • VLAN propagation: Monitor how VLAN traffic is tagged and propagated among switches via trunk links.
  1. Extend or Customize VLAN Configuration (Optional)
  • We can further expand the simulation by:
    • Adding More VLANs: Replicate a larger network with more VLANs and hosts, and set up trunk links to carry additional VLAN traffic.
    • Simulating VLAN Propagation via VTP: We can physically replicate VTP-such as behaviour by enthusiastically adding VLANs to trunk links in the period of the simulation.
    • Introducing VLAN Misconfigurations: Validate how the network act as when VLANs are misconfigured or trunk links fail.
    • VLAN Security: Apply the scenarios in which the inappropriate VLAN access or attacks such as VLAN hopping are endeavoured.

By using the OMNeT++ tool, we illustrate the basic approach with sample coding for VLAN Trunking Protocol that were simulated, enhanced and visualized. Further details will be provided later.

For simulating VLAN Trunking Protocol projects with the OMNeT++ tool, consider reaching out to the experts at phdprime.com. We are committed to providing you with top-notch simulation guidance. Trust us for the best support on VLAN Trunking Protocol

Opening Time

9:00am

Lunch Time

12:30pm

Break Time

4:00pm

Closing Time

6:30pm

  • award1
  • award2