To develop the Interior Gateway Protocol (IGP) for we can configure a network environment in which routers utilize protocols in NS3. Here’s how to simulate IGP protocols in ns3:
What is an Interior Gateway Protocol (IGP)?
Interior Gateway Protocols (IGPs) are used in autonomous system (AS) to route packets efficiently. The record generally used for IGPs include:
- OSPF (Open Shortest Path First) → Link-state protocol which choose the shortest path using Dijkstra’s procedures.
- IS-IS (Intermediate System to Intermediate System) → Equal to OSPF nevertheless used for large-scale networks.
- RIP (Routing Information Protocol) → Distance-vector protocol used the hop count in a metric.
- EIGRP (Enhanced Interior Gateway Routing Protocol) → Cisco proprietary protocol which balances speed and reliability.
Why Develop IGP Projects in NS3?
- Replicate the network convergence time in IGPs.
- Estimate for QoS-based on IGP routing.
- It investigates the IGP behavior for below the network failures.
- Execute the AI-based on dynamic routing for IGPs.
Steps to Develop an IGP Project in NS3
- Install and download the NS3 tool in your system and necessary elements.
We assure the NS3 is installed:
sudo apt update
sudo apt install -y git build-essential python3 cmake
git clone https://gitlab.com/nsnam/ns-3-dev.git ns-3
cd ns-3
./ns3 configure –enable-examples –enable-tests
./ns3 build
We need the NS3 components for this project:
- Internet Module → the IPv4/IPv6 for manage the IGPs.
- Point-to-Point Module → Replicate a wired networks.
- Routing Module → Execute the OSPF, RIP, or EIGRP.
- Traffic Control Module → QoS-based on IGP path selection.
- Create an Interior Gateway Protocol (IGP) Network
It is simple IGP network contains of:
- The several routers in AS
- Data communicate for end hosts
- IGP routing setting such as OSPF, RIP, etc.
Example: Simulating an IGP Network with 4 Routers
#include “ns3/core-module.h”
#include “ns3/network-module.h”
#include “ns3/internet-module.h”
#include “ns3/point-to-point-module.h”
#include “ns3/applications-module.h”
using namespace ns3;
int main(int argc, char *argv[]) {
NodeContainer routers, hosts;
routers.Create(4); // 4 IGP Routers
hosts.Create(2); // 2 End Hosts
PointToPointHelper p2p;
p2p.SetDeviceAttribute(“DataRate”, StringValue(“1Gbps”));
p2p.SetChannelAttribute(“Delay”, StringValue(“2ms”));
NetDeviceContainer devices1 = p2p.Install(hosts.Get(0), routers.Get(0)); // Host to Router1
NetDeviceContainer devices2 = p2p.Install(routers.Get(0), routers.Get(1)); // Router1 to Router2
NetDeviceContainer devices3 = p2p.Install(routers.Get(1), routers.Get(2)); // Router2 to Router3
NetDeviceContainer devices4 = p2p.Install(routers.Get(2), routers.Get(3)); // Router3 to Router4
NetDeviceContainer devices5 = p2p.Install(routers.Get(3), hosts.Get(1)); // Router4 to Host
InternetStackHelper internet;
internet.Install(routers);
internet.Install(hosts);
Ipv4AddressHelper address;
address.SetBase(“10.1.1.0”, “255.255.255.0”);
address.Assign(devices1);
address.SetBase(“10.1.2.0”, “255.255.255.0”);
address.Assign(devices2);
address.SetBase(“10.1.3.0”, “255.255.255.0”);
address.Assign(devices3);
address.SetBase(“10.1.4.0”, “255.255.255.0”);
address.Assign(devices4);
address.SetBase(“10.1.5.0”, “255.255.255.0”);
address.Assign(devices5);
Simulator::Stop(Seconds(10));
Simulator::Run();
Simulator::Destroy();
return 0;
}
✅ This setup:
- 4 Routers forming an IGP network.
- 1 Gbps connection by 2 ms delay.
- 2 End hosts for validate the data transmission.
- Implement IGP Routing
Example: Increase the OSPF as the IGP
#include “ns3/olsr-helper.h”
OlsrHelper ospf;
Ipv4ListRoutingHelper list;
list.Add(ospf, 10);
InternetStackHelper internet;
internet.SetRoutingHelper(list);
internet.Install(routers);
✅ This allow the IGP Routing:
- OSPF-based on the shortest path routing.
- Bring up-to-date for dynamic the link-state connection.
Example: Adding RIP as the IGP
#include “ns3/rip-helper.h”
RipHelper rip;
Ipv4ListRoutingHelper list;
list.Add(rip, 10);
InternetStackHelper internet;
internet.SetRoutingHelper(list);
internet.Install(routers);
✅ This configures:
- RIP-based on routing by hop count as metric.
- Automatic route discovery.
- Simulating High-Speed Data Transmission
For validate the IGP routing, we create the UDP congestion.
Example: Sending UDP Traffic Over IGP
#include “ns3/udp-client-server-helper.h”
uint16_t port = 9000;
UdpServerHelper server(port);
ApplicationContainer serverApp = server.Install(hosts.Get(1));
serverApp.Start(Seconds(1.0));
serverApp.Stop(Seconds(10.0));
UdpClientHelper client(Ipv4Address(“10.1.5.2”), port);
client.SetAttribute(“MaxPackets”, UintegerValue(100));
client.SetAttribute(“Interval”, TimeValue(Seconds(0.01))); // High-speed interval
client.SetAttribute(“PacketSize”, UintegerValue(1024));
ApplicationContainer clientApp = client.Install(hosts.Get(0));
clientApp.Start(Seconds(2.0));
clientApp.Stop(Seconds(10.0));
✅ This simulates:
- The high-speed of UDP in client-server communication over IGP.
- Performance Optimization (QoS, Traffic Control)
We increase the IGP routing effectiveness, we use Traffic Control.
Example: Applying QoS for IGP
#include “ns3/traffic-control-helper.h”
TrafficControlHelper tc;
tc.SetRootQueueDisc(“ns3::FqCoDelQueueDisc”); // Fair Queueing
tc.Install(devices2);
tc.Install(devices3);
tc.Install(devices4);
✅ This ensures:
- Prioritization of low-latency congestion.
- Enhanced the QoS for real-time applications.
- Performance Analysis (Throughput, Delay, Packet Loss)
We use to amount of IGP performance in Flow Monitor.
Example: Monitoring IGP Network Performance
#include “ns3/flow-monitor-helper.h”
Ptr<FlowMonitor> monitor;
FlowMonitorHelper flowHelper;
monitor = flowHelper.InstallAll();
Simulator::Run();
monitor->SerializeToXmlFile(“igp-flow.xml”, true, true);
Simulator::Destroy();
✅ Outputs: igp-flow.xml for Throughput, Delay, Packet Loss analysis.
Advanced IGP Research Topics
- AI-Based IGP Routing Optimization → Machine learning for OSPF or RIP route selection.
2. IGP for Software-Defined Networking (SDN) → It used the SDN controllers for link-state routing.
3. IGP Security Enhancements → Avoid the OSPF/RIP-based on cyber-attacks.
4. IGP Performance in 5G & IoT Networks → Enhance the IGP for low-latency applications.
5. Hybrid IGP & BGP Networks → incorporate the IGP by inter-domain routing.
As shown above, we provided the detailed complete procedures to simulate the Interior Gateway Protocol project which were implemented and analyse the outcomes using the tool of ns3. Additional information with certain details on this Interior Gateway Protocol will be provided in another manual.