To simulate a Mixed Topology in OMNeT++ has needs to integrate diverse network topologies like star, bus, ring, and mesh in the same network. This type of topology is usually found in large-scale, real-world networks in which different parts of the network utilize different topologies to enhance performance, reliability, and scalability.
Here’s how you can simulate a Mixed Topology in OMNeT++ step-by-step:
Steps to Simulate Mixed Topology Projects in OMNeT++
- Understand Mixed Topology
In a mixed topology:
- Star Topology: Nodes are linked to a central node (hub or switch).
- Bus Topology: All nodes distribute a common communication channel.
- Ring Topology: Nodes are associated in a circular fashion, in which each node connects to two others.
- Mesh Topology: Every node is linked to every other node, or to a subset, enabling multiple pathways for data.
- Plan the Mixed Topology
Let’s plan a mixed topology where:
- One part of the network is a star topology.
- Another part of the network is a ring topology.
- A mesh topology associates some nodes in the star and ring sections.
This structure will enable the simulation of different network types in a single network.
- Define the Network Structure in NED (NED File)
The NED file will describe the nodes and the connections that form the mixed topology. In this sample, we will combine star, ring, and mesh topologies.
Sample NED File (MixedTopology.ned)
package mixedtopology;
import inet.node.inet.WirelessHost;
network MixedTopology
{
parameters:
int numStarNodes = default(3); // Number of nodes in the star topology
int numRingNodes = default(3); // Number of nodes in the ring topology
@display(“bgb=800,600”); // Display area size
submodules:
// Define the central node for the star topology
centralHub: WirelessHost {
@display(“p=100,200”);
}
// Define nodes for the star topology
starNode[numStarNodes]: WirelessHost {
@display(“p=200,100; p=300,100; p=400,100”);
}
// Define nodes for the ring topology
ringNode[numRingNodes]: WirelessHost {
@display(“p=300,400; p=400,400; p=500,400”);
}
// Define mesh nodes to interconnect the topologies
meshNode1: WirelessHost {
@display(“p=500,200”);
}
meshNode2: WirelessHost {
@display(“p=600,200”);
}
connections allowunconnected:
// Define the star topology (connect star nodes to the central hub)
starNode[0].out++ –> centralHub.in++;
centralHub.out++ –> starNode[0].in++;
starNode[1].out++ –> centralHub.in++;
centralHub.out++ –> starNode[1].in++;
starNode[2].out++ –> centralHub.in++;
centralHub.out++ –> starNode[2].in++;
// Define the ring topology (connect nodes in a circular manner)
ringNode[0].out++ –> ringNode[1].in++;
ringNode[1].out++ –> ringNode[2].in++;
ringNode[2].out++ –> ringNode[0].in++;
// Define mesh connections between star, ring, and mesh nodes
centralHub.out++ –> meshNode1.in++;
meshNode1.out++ –> centralHub.in++;
meshNode1.out++ –> ringNode[0].in++;
ringNode[0].out++ –> meshNode1.in++;
meshNode2.out++ –> ringNode[2].in++;
ringNode[2].out++ –> meshNode2.in++;
meshNode1.out++ –> meshNode2.in++;
meshNode2.out++ –> meshNode1.in++;
}
- Configure Node Behavior in omnetpp.ini
The omnetpp.ini file configures parameters like the routing protocol, traffic generation, and mobility models. For a mixed topology, we can set up diverse traffic generation and routing behaviours for the star, ring, and mesh sections of the network.
Sample OMNeT++ Configuration (omnetpp.ini)
network = MixedTopology
sim-time-limit = 100s # Run the simulation for 100 seconds
# Use AODV routing protocol (for mesh topology and interconnection)
*.centralHub.hasTcp = false
*.centralHub.hasUdp = true
*.centralHub.hasIpv4 = true
*.centralHub.routingProtocols = “^Aodv”
*.starNode[*].hasTcp = false
*.starNode[*].hasUdp = true
*.starNode[*].hasIpv4 = true
*.starNode[*].routingProtocols = “^Aodv”
*.ringNode[*].hasTcp = false
*.ringNode[*].hasUdp = true
*.ringNode[*].hasIpv4 = true
*.ringNode[*].routingProtocols = “^Aodv”
*.meshNode1.hasTcp = false
*.meshNode1.hasUdp = true
*.meshNode1.hasIpv4 = true
*.meshNode1.routingProtocols = “^Aodv”
*.meshNode2.hasTcp = false
*.meshNode2.hasUdp = true
*.meshNode2.hasIpv4 = true
*.meshNode2.routingProtocols = “^Aodv”
# Wireless communication settings
*.starNode[*].wlan[0].typename = “Ieee80211Nic”
*.starNode[*].wlan[0].mac.useAck = true
*.starNode[*].wlan[0].bitrate = 54Mbps
*.starNode[*].wlan[0].radio.transmitter.communicationRange = 300m
*.ringNode[*].wlan[0].typename = “Ieee80211Nic”
*.ringNode[*].wlan[0].mac.useAck = true
*.ringNode[*].wlan[0].bitrate = 54Mbps
*.ringNode[*].wlan[0].radio.transmitter.communicationRange = 300m
*.meshNode1.wlan[0].typename = “Ieee80211Nic”
*.meshNode1.wlan[0].mac.useAck = true
*.meshNode1.wlan[0].bitrate = 54Mbps
*.meshNode1.wlan[0].radio.transmitter.communicationRange = 300m
*.meshNode2.wlan[0].typename = “Ieee80211Nic”
*.meshNode2.wlan[0].mac.useAck = true
*.meshNode2.wlan[0].bitrate = 54Mbps
*.meshNode2.wlan[0].radio.transmitter.communicationRange = 300m
# Mobility configuration (optional: Nodes can be static or mobile)
*.starNode[*].mobility.typename = “StationaryMobility”
*.ringNode[*].mobility.typename = “StationaryMobility”
*.meshNode1.mobility.typename = “StationaryMobility”
*.meshNode2.mobility.typename = “StationaryMobility”
- Traffic Generation
We can add traffic generation to replicate data being routed among nodes via different topologies (star, ring, and mesh). This can be achieved by set up UDP or TCP applications on certain nodes.
For example, node in the star topology transmits data to a node in the ring topology:
# Application to generate UDP traffic from a star node to a ring node
*.starNode[0].app[0].typename = “UdpBasicApp”
*.starNode[0].app[0].destAddresses = “ringNode[2]”
*.starNode[0].app[0].destPort = 5000
*.starNode[0].app[0].messageLength = 1024B
*.starNode[0].app[0].sendInterval = exponential(1s) # Random traffic intervals
# Application to act as a sink on ringNode
*.ringNode[2].app[0].typename = “UdpSink”
*.ringNode[2].app[0].localPort = 5000
- Visualize and Analyse
When we execute the simulation:
- Mixed Topology Behavior: we will see how the star, ring, and mesh topologies communicate and how traffic flows among them.
- Routing Protocol: The AODV protocol will explore routes among nodes as they attempt to interact via different topologies.
- Performance Metrics: we need to gather the parameters such as throughput, packet loss, delay, and routing efficiency.
- Enhancements to the Simulation
- Node Mobility
We need to replicate node mobility by enabling dynamic mobility models for the nodes. For instance we can make the mesh nodes move in the period of the simulation.
*.meshNode1.mobility.typename = “RandomWaypointMobility”
*.meshNode1.mobility.speed = uniform(1mps, 5mps) # Random speed between 1 and 5 meters per second
*.meshNode2.mobility.typename = “RandomWaypointMobility”
*.meshNode2.mobility.speed = uniform(1mps, 5mps)
- Failure Simulation
We need to replicate node or link failures by disabling nodes or minimizing their communication range in the course of the simulation. This validates the flexibility of the mixed topology.
*.centralHub.wlan[0].radio.transmitter.communicationRange = 0m # Simulate central hub failure
- QoS Metrics
We need to monitor Quality of Service (QoS) parameters such as delay, packet delivery ratio, and jitter, to measure the performance of the network in different conditions (such as high traffic load, node failures, etc.).
Through this procedure, we had successfully delivered the complete procedure to simulate the Mixed Topology projects with the help of OMNeT++ tool. We can also offer additional information regarding this process.
Connect with phdprime.com for the best Mixed Topology Projects simulation using the OMNeT++ tool, tailored to your project requirements. We provide customized comparison analyses to meet your specific needs. Our team offers configuration guidance on various topologies to improve performance, reliability, and scalability for your projects. Additionally, we present you with top project ideas and topics based on your areas of interest.