To implement the Inter Planetary Networking in OMNeT++ requires a network that helps to communicate among the nodes which is placed on various planets, moons or spacecraft. This kind of network should be responsible for long propagation delays, intermittent connectivity, and high error rates, which are typical in space communications. Follow the below steps to implement IPN in OMNeT++:
Step-by-Step Implementation:
Make sure to install OMNeT++ and the INET Framework.
Determine the network topology which has nodes on various planets and spacecraft by generating a new NED file.
Example: Inter Planetary Network Topology (InterPlanetaryNetwork.ned)
package interplanetarynetwork;
import inet.node.inet.StandardHost;
import inet.node.inet.Router;
network InterPlanetaryNetwork
{
parameters:
@display(“bgb=800,400”);
submodules:
earthNode: StandardHost {
@display(“p=100,200”);
}
marsNode: StandardHost {
@display(“p=300,200”);
}
satelliteNode: Router {
@display(“p=200,100”);
}
connections:
earthNode.ethg++ <–> Eth10M <–> satelliteNode.ethg++;
marsNode.ethg++ <–> Eth10M <–> satelliteNode.ethg++;
}
Generate an OMNeT++ initialization file to configure the parameters of the simulation.
Example: Configuration File (omnetpp.ini)
network = interplanetarynetwork.InterPlanetaryNetwork
sim-time-limit = 5000s
# Visualization
*.visualizer.canvasVisualizer.displayBackground = true
*.visualizer.canvasVisualizer.displayGrid = true
# Earth Node Configuration
*.earthNode.numApps = 1
*.earthNode.app[0].typename = “InterPlanetaryApp”
*.earthNode.app[0].destAddresses = “marsNode”
*.earthNode.app[0].destPort = 5000
*.earthNode.app[0].messageLength = 1024B
*.earthNode.app[0].sendInterval = 60s
# Mars Node Configuration
*.marsNode.numApps = 1
*.marsNode.app[0].typename = “InterPlanetaryApp”
*.marsNode.app[0].destAddresses = “earthNode”
*.marsNode.app[0].destPort = 5000
*.marsNode.app[0].messageLength = 1024B
*.marsNode.app[0].sendInterval = 60s
# Satellite Node Configuration
*.satelliteNode.numApps = 1
*.satelliteNode.app[0].typename = “SatelliteApp”
*.satelliteNode.app[0].localPort = 5000
# UDP Configuration
*.earthNode.hasUdp = true
*.marsNode.hasUdp = true
*.satelliteNode.hasUdp = true
# IP Address Configuration
*.earthNode.ipv4.config = xmldoc(“earthNode.xml”)
*.marsNode.ipv4.config = xmldoc(“marsNode.xml”)
*.satelliteNode.ipv4.config = xmldoc(“satelliteNode.xml”)
# Propagation Delay and Error Rates
*.earthNode.ethg*.macPropagationDelay = 500s
*.marsNode.ethg*.macPropagationDelay = 500s
*.satelliteNode.ethg*.macPropagationDelay = 500s
*.earthNode.ethg*.macFrameErrorRate = 0.1
*.marsNode.ethg*.macFrameErrorRate = 0.1
*.satelliteNode.ethg*.macFrameErrorRate = 0.1
Create XML files to state the IP address configuration for every node.
Example: IP Configuration File for earthNode (earthNode.xml)
<config>
<interface>
<name>eth0</name>
<address>10.0.0.1</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for marsNode (marsNode.xml)
<config>
<interface>
<name>eth0</name>
<address>10.0.0.2</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
Example: IP Configuration File for satelliteNode (satelliteNode.xml)
<config>
<interface>
<name>eth0</name>
<address>10.0.0.254</address>
<netmask>255.255.255.0</netmask>
</interface>
</config>
To simulate inter planetary communications, we have to execute the logic for data transmission and reception, accounting for delays and errors.
Example: Inter Planetary Application (Pseudo-Code)
#include <omnetpp.h>
#include <cstdlib>
#include <cstdio>
using namespace omnetpp;
class InterPlanetaryApp : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
private:
void sendData();
void handleReceivedData(cMessage *msg);
};
Define_Module(InterPlanetaryApp);
void InterPlanetaryApp::initialize() {
// Initialization code
scheduleAt(simTime() + uniform(0, 60), new cMessage(“sendData”));
}
void InterPlanetaryApp::handleMessage(cMessage *msg) {
if (strcmp(msg->getName(), “sendData”) == 0) {
sendData();
scheduleAt(simTime() + 60, msg);
} else {
handleReceivedData(msg);
}
}
void InterPlanetaryApp::sendData() {
// Logic to send data to the destination node
cMessage *msg = new cMessage(“data”);
send(msg, “out”);
}
void InterPlanetaryApp::handleReceivedData(cMessage *msg) {
// Logic to handle received data
delete msg; // Example: simply delete the message after processing
}
Example: Satellite Application (Pseudo-Code)
#include <omnetpp.h>
using namespace omnetpp;
class SatelliteApp : public cSimpleModule
{
protected:
virtual void initialize() override;
virtual void handleMessage(cMessage *msg) override;
private:
void processData(cMessage *msg);
};
Define_Module(SatelliteApp);
void SatelliteApp::initialize() {
// Initialization code
}
void SatelliteApp::handleMessage(cMessage *msg) {
// Process data from earthNode or marsNode
processData(msg);
}
void SatelliteApp::processData(cMessage *msg) {
// Logic to process data from earthNode or marsNode
cMessage *forwardMsg = new cMessage(“forwardData”);
send(forwardMsg, “out”);
delete msg; // Example: simply delete the message after processing
}
Finally, we showcased the valuable information on how to implement the inter planetary networking in this script by installing both the OMNeT++ and INET framework and how to set it up. You can also get extra details of this topic from us.