How to Begin Implement a EIGRP protocol in NS3

To create an Enhanced Interior Gateway Routing Protocol (EIGRP) in ns3 has includes the build a replication for examine the behavior, performance and efficiency in a network. Although ns3 does not natively helps for EIGRP in cisco proprietary protocol, we can replicate the functionality through execute the custom routing logic or using external tools such as Quagga or FRRouting integrated into ns3.

Here’s how to approach the implementation:

Steps to Begin Implement an EIGRP protocol in NS3

  1. Understand EIGRP and Its Features
  • Key Features:
    • Used the hybrid routing approach such as distance vector and link state.
    • Reliable transmission by acknowledgment of routing bring up-to-date.
    • Loop-free routing using the Diffusing Update Algorithm (DUAL).
    • It helps for unequal-cost load balancing.
  • Simulation Goals:
    • It designs the EIGRP-like behavior in a network.
    • Validate the routing convergence, load balancing, or protocol performance.
    • Estimate the performance of parameter metrics such as delay, throughput, and packet delivery ratio.
  1. Set up ns-3 Environment
  1. Install ns-3:

git clone https://gitlab.com/nsnam/ns-3-dev.git

cd ns-3-dev

./build.py

  1. Verify the installation:

./ns3 run hello-simulator

  1. Plan the Network Topology
  • Components:
    • Routers for replicate the EIGRP routing behavior.
    • End nodes are creating the congestion with the network.
  • Topology:
    • Express the several subnets interconnected through routers.
  1. Write the Simulation Script
  2. Include Necessary Headers

#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”

  1. Define Nodes and Links

ns3::NodeContainer routers, hosts;

routers.Create(3);  // Three routers

hosts.Create(2);    // Two end hosts (source and destination)

// Links between routers

ns3::PointToPointHelper p2p;

p2p.SetDeviceAttribute(“DataRate”, ns3::StringValue(“1Gbps”));

p2p.SetChannelAttribute(“Delay”, ns3::StringValue(“2ms”));

ns3::NetDeviceContainer routerLinks;

routerLinks.Add(p2p.Install(routers.Get(0), routers.Get(1)));  // Link R1-R2

routerLinks.Add(p2p.Install(routers.Get(1), routers.Get(2)));  // Link R2-R3

// Links between routers and hosts

routerLinks.Add(p2p.Install(routers.Get(0), hosts.Get(0)));    // Link R1-Host1

routerLinks.Add(p2p.Install(routers.Get(2), hosts.Get(1)));    // Link R3-Host2

  1. Install Internet Stack

ns3::InternetStackHelper internet;

internet.Install(routers);

internet.Install(hosts);

ns3::Ipv4AddressHelper address;

address.SetBase(“10.1.1.0”, “255.255.255.0”);

ns3::Ipv4InterfaceContainer routerInterfaces = address.Assign(routerLinks);

  1. Simulate EIGRP-Like Behavior

Option 1: Custom EIGRP Application

  1. Implement Custom Routing Logic:
    • It replicates the EIGRP behavior by a custom application for estimate the routes, distribute bring up-to-date, and maintain the topology variations.

class EigrpApp : public ns3::Application {

private:

virtual void StartApplication() override {

// Initialize routing table and send updates

std::cout << “EIGRP-like routing updates initialized\n”;

}

virtual void StopApplication() override {

// Clean up resources

std::cout << “EIGRP-like application stopped\n”;

}

};

Ptr<EigrpApp> eigrpApp1 = CreateObject<EigrpApp>();

routers.Get(0)->AddApplication(eigrpApp1);

eigrpApp1->SetStartTime(ns3::Seconds(1.0));

  1. Maintain Routing Tables:
    • Apply the logic for distance vector measure and replicate the DUAL procedure.

Option 2: Integrate External Routing Tools

  1. Install Quagga or FRRouting: Use these external tools for setting and process the EIGRP in a real-world routing context.

sudo apt install quagga

  1. Configure EIGRP in Quagga: Generate zebra.conf and eigrp.conf for routers. Sample setting:

router eigrp 1

network 10.1.1.0/24

network 10.1.2.0/24

  1. Integrate Quagga with ns-3: Use the command TapBridgeHelper to link ns3 nodes by Quagga routers.

ns3::TapBridgeHelper tapBridge;

tapBridge.SetAttribute(“Mode”, ns3::StringValue(“UseLocal”));

tapBridge.Install(routers.Get(0), devices.Get(0));

  1. Generate Traffic

UDP Traffic

// UDP Echo server on Host 2

ns3::UdpEchoServerHelper echoServer(9);

ns3::ApplicationContainer serverApp = echoServer.Install(hosts.Get(1));

serverApp.Start(ns3::Seconds(2.0));

serverApp.Stop(ns3::Seconds(20.0));

// UDP Echo client on Host 1

ns3::UdpEchoClientHelper echoClient(routerInterfaces.GetAddress(1), 9);

echoClient.SetAttribute(“MaxPackets”, ns3::UintegerValue(10));

echoClient.SetAttribute(“Interval”, ns3::TimeValue(ns3::Seconds(1.0)));

echoClient.SetAttribute(“PacketSize”, ns3::UintegerValue(512));

ns3::ApplicationContainer clientApp = echoClient.Install(hosts.Get(0));

clientApp.Start(ns3::Seconds(3.0));

clientApp.Stop(ns3::Seconds(20.0));

  1. Run the Simulation

ns3::Simulator::Run();

ns3::Simulator::Destroy();

  1. Analyze Results

Metrics:

  • Routing Convergence:
    • Period taken has a routing tables for become stable.
  • Packet Delivery Ratio:
    • Rate of packets has successfully delivered to their destination.
  • Routing Overhead:
    • Capacity of control messages modified through router.

Tracing and Visualization:

  • Ensure the tracing for specific study for packet like .pcap:

ns3::AsciiTraceHelper ascii;

p2p.EnableAsciiAll(ascii.CreateFileStream(“eigrp.tr”));

p2p.EnablePcapAll(“eigrp”);

  • Uses the tool Wireshark for examine routing bring up-to-date and congestion.
  1. Iterate and Enhance
  • Advanced Scenarios:
    • It replicates the connection failures and calculates the protocol response time.
    • Enhance the several subnets and routers for difficult topologies.
  • Realistic Traffic:
    • Validate by TCP or multimedia congestion design.
  • Performance Tuning:
    • Research by changed connection such as bandwidths, delays, and traffic loads.

From the demonstration we completely aggregate the data about the installation process and simulation procedure for Enhanced Interior Gateway Routing Protocol that was set up in the tool of ns3. A dedicated manual will be shared to handle further questions about this project.