e-mail address: omnetmanual@gmail.com

Phone number: +91 9444856435

Tel 7639361621

DEFENDER
  • Phd Omnet++ Projects
    • RESEARCH PROJECTS IN OMNET++
  • Network Simulator Research Papers
    • Omnet++ Thesis
    • Phd Omnet++ Projects
    • MS Omnet++ Projects
    • M.Tech Omnet++ Projects
    • Latest Omnet++ Projects
    • 2016 Omnet++ Projects
    • 2015 Omnet++ Projects
  • OMNET INSTALLATION
    • 4G LTE INSTALLATION
    • CASTALIA INSTALLATION
    • INET FRAMEWORK INSTALLATION
    • INETMANET INSTALLATION
    • JDK INSTALLATION
    • LTE INSTALLATION
    • MIXIM INSTALLATION
    • Os3 INSTALLATION
    • SUMO INSTALLATION
    • VEINS INSTALLATION
  • Latest Omnet++ Projects
    • AODV OMNET++ SOURCE CODE
    • VEINS OMNETPP
    • Network Attacks in OMNeT++
    • NETWORK SECURITY OMNET++ PROJECTS
    • Omnet++ Framework Tutorial
      • Network Simulator Research Papers
      • OMNET++ AD-HOC SIMULATION
      • OmneT++ Bandwidth
      • OMNET++ BLUETOOTH PROJECTS
      • OMNET++ CODE WSN
      • OMNET++ LTE MODULE
      • OMNET++ MESH NETWORK PROJECTS
      • OMNET++ MIXIM MANUAL
  • OMNeT++ Projects
    • OMNeT++ OS3 Manual
    • OMNET++ NETWORK PROJECTS
    • OMNET++ ROUTING EXAMPLES
    • OMNeT++ Routing Protocol Projects
    • OMNET++ SAMPLE PROJECT
    • OMNeT++ SDN PROJECTS
    • OMNET++ SMART GRID
    • OMNeT++ SUMO Tutorial
  • OMNET++ SIMULATION THESIS
    • OMNET++ TUTORIAL FOR WIRELESS SENSOR NETWORK
    • OMNET++ VANET PROJECTS
    • OMNET++ WIRELESS BODY AREA NETWORK PROJECTS
    • OMNET++ WIRELESS NETWORK SIMULATION
      • OMNeT++ Zigbee Module
    • QOS OMNET++
    • OPENFLOW OMNETPP
  • Contact

How to Implement lan protocols in OMNeT++

To implement the LAN (Local Area Network) protocols in OMNeT++ contains to making the modules that simulate the activities of common LAN protocols like Spanning Tree Protocol (STP), Ethernet, and Address Resolution Protocol (ARP). The following steps are to implement this protocols by using the INET framework in OMNeT++.

Step-by-Step Implementations:

Step 1: Set Up OMNeT++ and INET Framework

  1. Install OMNeT++: To download and install the latest version of OMNeT++ from it.
  2. Install INET Framework: From the INET repository to download and install the INET framework.

Step 2: Understand LAN Protocols

Ethernet

It is a broadly used LAN protocol that works at the data link layer like Layer 2 of the OSI model. This is define how data is outlined and conducted over the physical medium.

Spanning Tree Protocol (STP)

STP is a network protocol that confirms a loop-free topology used for Ethernet networks.

Address Resolution Protocol (ARP)

It is used to map IP addresses to MAC addresses, permitting communication in the same LAN.

Step 3: Implement Ethernet

Ample implementation of Ethernet, so leverage the remaining implementation provided by INET framework.

Define the Network in .ned File

Produce a .ned file for the Ethernet LAN.

network EthernetLAN

{

parameters:

@display(“bgb=600,400”);

submodules:

host1: StandardHost {

parameters:

@display(“p=100,200”);

}

host2: StandardHost {

parameters:

@display(“p=300,200”);

}

switch: EthernetSwitch {

parameters:

@display(“p=200,100”);

}

connections:

host1.ethg++ <–> Eth10M <–> switch.ethg++;

host2.ethg++ <–> Eth10M <–> switch.ethg++;

}

Step 4: Implement ARP

ARP is also part of the INET framework. We can configure it in the .ini file.

omnetpp.ini Configuration

[General]

network = EthernetLAN

*.host*.eth[*].mac.typename = “EthernetMac”

*.host*.eth[*].mac.promiscuous = true

*.host*.ipv4.arp.typename = “GlobalArp”

*.host*.ipv4.routingTable.netmaskRoutes = “true”

*.switch*.eth[*].mac.typename = “EthernetMac”

*.switch*.eth[*].mac.promiscuous = true

*.switch*.forwardingTable.typename = “MACRelayUnit”

*.host1.ipv4.config = “host1.config”

*.host2.ipv4.config = “host2.config”

Host Configuration

Create configuration files for the hosts.

host1.config

* default

address 192.168.0.1

netmask 255.255.255.0

host2.config

* default

address 192.168.0.2

netmask 255.255.255.0

Step 5: Implement Spanning Tree Protocol (STP)

STP is not comprised in the default INET framework, so we need to make the own module for STP.

Define the STP Module in .ned File

Create a .ned file for the STP module.

simple STP

{

parameters:

@display(“i=block/router”);

gates:

input fromLowerLayer[];

output toLowerLayer[];

}

Implement the STP Module in C++

Create the corresponding .cc and .h files.

STP.h

#ifndef __STP_H_

#define __STP_H_

#include <omnetpp.h>

#include <vector>

#include <map>

#include “inet/common/INETDefs.h”

#include “inet/linklayer/common/MacAddress.h”

using namespace omnetpp;

using namespace inet;

class STP : public cSimpleModule

{

private:

struct PortInfo {

int portNum;

bool isRootPort;

bool isDesignatedPort;

MacAddress designatedBridge;

int designatedPort;

int pathCost;

};

MacAddress bridgeId;

MacAddress rootId;

int rootPathCost;

int helloTime;

int maxAge;

int forwardDelay;

std::map<int, PortInfo> portTable;

protected:

virtual void initialize() override;

virtual void handleMessage(cMessage *msg) override;

void sendBPDU();

void processBPDU(cMessage *msg);

public:

STP();

virtual ~STP();

};

#endif

STP.cc

#include “STP.h”

Define_Module(STP);

STP::STP()

{

}

STP::~STP()

{

}

void STP::initialize()

{

bridgeId = MacAddress::generateAutoAddress();

rootId = bridgeId;

rootPathCost = 0;

helloTime = 2;

maxAge = 20;

forwardDelay = 15;

for (int i = 0; i < gateSize(“fromLowerLayer”); ++i) {

PortInfo portInfo = {i, false, true, bridgeId, i, 0};

portTable[i] = portInfo;

}

scheduleAt(simTime() + helloTime, new cMessage(“sendBPDU”));

}

void STP::handleMessage(cMessage *msg)

{

if (msg->isSelfMessage()) {

sendBPDU();

scheduleAt(simTime() + helloTime, msg);

} else {

processBPDU(msg);

}

}

void STP::sendBPDU()

{

for (auto& port : portTable) {

cMessage *bpdu = new cMessage(“BPDU”);

bpdu->addPar(“rootId”) = rootId.str().c_str();

bpdu->addPar(“rootPathCost”) = rootPathCost;

bpdu->addPar(“bridgeId”) = bridgeId.str().c_str();

bpdu->addPar(“portNum”) = port.second.portNum;

send(bpdu, “toLowerLayer”, port.second.portNum);

}

}

void STP::processBPDU(cMessage *msg)

{

MacAddress receivedRootId = MacAddress(msg->par(“rootId”).stringValue());

int receivedRootPathCost = msg->par(“rootPathCost”).intValue();

MacAddress receivedBridgeId = MacAddress(msg->par(“bridgeId”).stringValue());

int receivedPortNum = msg->par(“portNum”).intValue();

if (receivedRootId < rootId ||

(receivedRootId == rootId && receivedRootPathCost + 1 < rootPathCost) ||

(receivedRootId == rootId && receivedRootPathCost + 1 == rootPathCost && receivedBridgeId < bridgeId)) {

rootId = receivedRootId;

rootPathCost = receivedRootPathCost + 1;

for (auto& port : portTable) {

port.second.isRootPort = false;

}

portTable[receivedPortNum].isRootPort = true;

portTable[receivedPortNum].designatedBridge = receivedBridgeId;

portTable[receivedPortNum].designatedPort = receivedPortNum;

portTable[receivedPortNum].pathCost = receivedRootPathCost;

} else if (receivedRootId == rootId && receivedRootPathCost + 1 == rootPathCost && receivedBridgeId == bridgeId) {

portTable[receivedPortNum].isDesignatedPort = false;

}

delete msg;

}

Step 6: Integrate STP with Simulation Model

Integrate the STP module into a network simulation model.

Network Configuration .ned File

Extend the earlier EthernetLAN network definition to include STP.

network EthernetLANWithSTP

{

parameters:

@display(“bgb=600,400”);

submodules:

host1: StandardHost {

parameters:

@display(“p=100,200”);

}

host2: StandardHost {

parameters:

@display(“p=300,200”);

}

switch: EthernetSwitch {

parameters:

@display(“p=200,100”);

}

stp: STP {

parameters:

@display(“p=200,50”);

}

connections:

host1.ethg++ <–> Eth10M <–> switch.ethg++;

host2.ethg++ <–> Eth10M <–> switch.ethg++;

switch.ethg++ <–> Eth10M <–> stp.fromLowerLayer++;

}

Step 7: Test and Debug

  1. Run Simulations: Effect simulations to test the actions of the Ethernet, ARP, and STP modules below several network conditions.
  2. Analyze Results: Prove the correctness and performance of the implementation.
  3. Debugging: By using the OMNeT++’s debugging tools to troubleshoot any problems.

Over this page, we are study about Ethernet, implement the STP, and how to execute LAN protocols in OMNeT++ tool using the INET framework. Our team specializes in LAN protocols, including Spanning Tree Protocol (STP), Ethernet, and Address Resolution Protocol (ARP) we have needed resourves to carry out your work. We offer expert implementation of these protocols in OMNeT++, and our developers are here to assist you with innovative topic ideas that are currently trending.

Related Topics

  • Network Intrusion Detection Projects
  • Computer Science Phd Topics
  • Iot Thesis Ideas
  • Cyber Security Thesis Topics
  • Network Security Research Topics

designed by OMNeT++ Projects .