To implement Edge Computing in OMNeT++ contains setting up a imitation where edge devices, edge servers, and cloud servers work collected to development data and offer services. The INET Framework in OMNeT++ affords the needed tools to model and simulate such a network. The following is a step-by-step guide:
Step-by-Step Guide
To make a certain OMNeT++ and the INET Framework installed. To download it from the particular websites and track the installation instructions.
To form a new NED file to express the network topology, counting edge devices, edge servers, and cloud servers.
Example: Edge Computing Network Topology (EdgeNetwork.ned)
package edge;
import inet.node.inet.StandardHost;
import inet.node.inet.Router;
network EdgeNetwork
{
parameters:
@display(“bgb=800,400”);
submodules:
edgeDevice1: StandardHost {
@display(“p=100,300”);
}
edgeDevice2: StandardHost {
@display(“p=300,300”);
}
edgeServer: StandardHost {
@display(“p=500,300”);
}
cloudServer: StandardHost {
@display(“p=700,300”);
}
router1: Router {
@display(“p=200,200”);
}
router2: Router {
@display(“p=400,200”);
}
router3: Router {
@display(“p=600,200”);
}
connections:
edgeDevice1.ethg++ <–> Eth10M <–> router1.ethg++;
edgeDevice2.ethg++ <–> Eth10M <–> router1.ethg++;
router1.ethg++ <–> Eth10M <–> router2.ethg++;
router2.ethg++ <–> Eth10M <–> edgeServer.ethg++;
router2.ethg++ <–> Eth10M <–> router3.ethg++;
router3.ethg++ <–> Eth10M <–> cloudServer.ethg++;
}
In this example:
To make an OMNeT++ initialization file to configure the parameters of the simulation.
Example: Configuration File (omnetpp.ini)
[General]
network = edge.EdgeNetwork
sim-time-limit = 100s
# Visualization
*.visualizer.canvasVisualizer.displayBackground = true
*.visualizer.canvasVisualizer.displayGrid = true
# Host Configuration
*.edgeDevice*.numApps = 1
*.edgeDevice*.app[0].typename = “TcpBasicClientApp”
*.edgeDevice*.app[0].localPort = -1
*.edgeDevice*.app[0].connectAddress = “edgeServer”
*.edgeDevice*.app[0].connectPort = 80
*.edgeDevice*.app[0].sendBytes = 1000
*.edgeDevice*.app[0].tOpen = 1s
*.edgeDevice*.app[0].tSend = 2s
*.edgeDevice*.app[0].tClose = 10s
*.edgeServer.numApps = 1
*.edgeServer.app[0].typename = “TcpBasicServerApp”
*.edgeServer.app[0].localPort = 80
*.cloudServer.numApps = 1
*.cloudServer.app[0].typename = “TcpBasicServerApp”
*.cloudServer.app[0].localPort = 80
# TCP Configuration
*.edgeDevice*.hasTcp = true
*.edgeServer.hasTcp = true
*.cloudServer.hasTcp = true
# IP Address Configuration
*.edgeDevice1.ipv4.config = xmldoc(“edgeDevice1.xml”)
*.edgeDevice2.ipv4.config = xmldoc(“edgeDevice2.xml”)
*.edgeServer.ipv4.config = xmldoc(“edgeServer.xml”)
*.cloudServer.ipv4.config = xmldoc(“cloudServer.xml”)
*.router1.ipv4.config = xmldoc(“router1.xml”)
*.router2.ipv4.config = xmldoc(“router2.xml”)
*.router3.ipv4.config = xmldoc(“router3.xml”)
To generate XML files to express the IP address configuration for separately host and the routers.
Example: IP Configuration File for edgeDevice1 (edgeDevice1.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.1.1</address>
<netmask>255.255.255.0</netmask>
</interface>
<routing>
<route>
<destination>0.0.0.0</destination>
<netmask>0.0.0.0</netmask>
<gateway>192.168.1.254</gateway>
</route>
</routing>
</config>
Example: IP Configuration File for edgeDevice2 (edgeDevice2.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.1.2</address>
<netmask>255.255.255.0</netmask>
</interface>
<routing>
<route>
<destination>0.0.0.0</destination>
<netmask>0.0.0.0</netmask>
<gateway>192.168.1.254</gateway>
</route>
</routing>
</config>
Example: IP Configuration File for edgeServer (edgeServer.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.2.1</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for cloudServer (cloudServer.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.3.1</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for router1 (router1.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.1.254</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for router2 (router2.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.2.254</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for router3 (router3.xml)
<config>
<interface>
<name>eth0</name>
<address>192.168.3.254</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
To put on edge computing, basic to implement reason for data processing and task discharging among edge devices, edge servers, and the cloud server.
Example: Simple Edge Computing Logic (Pseudo-Code)
class EdgeComputingApp : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
private:
void processLocally(cMessage *msg);
void offloadToEdgeServer(cMessage *msg);
void offloadToCloudServer(cMessage *msg);
};
void EdgeComputingApp::initialize() {
// Initialization code
}
void EdgeComputingApp::handleMessage(cMessage *msg) {
// Decide where to process the message
if (canProcessLocally(msg)) {
processLocally(msg);
} else if (canOffloadToEdgeServer(msg)) {
offloadToEdgeServer(msg);
} else {
offloadToCloudServer(msg);
}
}
void EdgeComputingApp::processLocally(cMessage *msg) {
// Logic to process data locally on the edge device
}
void EdgeComputingApp::offloadToEdgeServer(cMessage *msg) {
// Logic to offload data to the edge server
}
void EdgeComputingApp::offloadToCloudServer(cMessage *msg) {
// Logic to offload data to the cloud server
}
In this script, we discussed about the procedure to implementation of edge computing in OMNeT++ and create new OMNeT++ projects, to create IP address conformation files, and more samples. We pleasure to offer more information about to implement the Edge Computing in OMNeT++.
We provide simulation results and comparative analysis for your projects, ensuring you achieve the best outcomes with our support. Additionally, we offer guidance on implementing Edge Computing in OMNeT++ programming.