To develop the Routing Information Protocol (RIP) Projects Using NS3
The Routing Information Protocol (RIP) is distance-vector routing protocol which used a hop count as metric to establish the better path to destination. It brings up-to-date for periodically its routing table through modify the data by neighboring routers.
Key Features of RIP
- For path calculation used the Bellman-Ford procedure.
- Bring up-to-date the routing tables in which 30 seconds.
- Maximum hop count = 15 (avoids the routing loops).
- It helps for the RIPv1 (classful) and RIPv2 (classless).
NS3 has built-in encourage for RIP, making it easy to replicate a RIP-based routing environments.
Step to Develop Routing Information Protocol Projects Using NS3
- Install and Set Up NS-3
Assure the tool NS-3 is install and download for your system:
git clone
cd ns-3-dev
./ns3 configure –enable-examples –enable-tests
./ns3 build
- Define a Network Topology
We build a 4-router topology in which every router process for RIP and modify the routing data.
(A) Generate a Router Node
NodeContainer routers;
routers.Create(4); // Create 4 routers
(B) We link the routers for used a Point-to-Point connections
PointToPointHelper p2p;
p2p.SetDeviceAttribute(“DataRate”, StringValue(“1Gbps”));
p2p.SetChannelAttribute(“Delay”, StringValue(“2ms”));
NetDeviceContainer devicesAB = p2p.Install(routers.Get(0), routers.Get(1));
NetDeviceContainer devicesBC = p2p.Install(routers.Get(1), routers.Get(2));
NetDeviceContainer devicesCD = p2p.Install(routers.Get(2), routers.Get(3));
NetDeviceContainer devicesDA = p2p.Install(routers.Get(3), routers.Get(0));
- Distribute the IP Addresses
InternetStackHelper stack;
stack.Install(routers);
Ipv4AddressHelper address;
address.SetBase(“10.1.1.0”, “255.255.255.0”);
Ipv4InterfaceContainer interfacesAB = address.Assign(devicesAB);
address.SetBase(“10.1.2.0”, “255.255.255.0”);
Ipv4InterfaceContainer interfacesBC = address.Assign(devicesBC);
address.SetBase(“10.1.3.0”, “255.255.255.0”);
Ipv4InterfaceContainer interfacesCD = address.Assign(devicesCD);
address.SetBase(“10.1.4.0”, “255.255.255.0”);
Ipv4InterfaceContainer interfacesDA = address.Assign(devicesDA);
- Assist the RIP Routing
(A) Assist to RIP on Every Router
RipHelper rip;
Ipv4ListRoutingHelper list;
list.Add(rip, 100); // Assign RIP as primary routing protocol
InternetStackHelper stack;
stack.SetRoutingHelper(list);
stack.Install(routers);
(B) Allocate the RIP to Detailed Interfaces
rip.ExcludeInterface(routers.Get(0), 1); // Exclude a specific interface
rip.EnableRouting(routers.Get(0));
rip.EnableRouting(routers.Get(1));
rip.EnableRouting(routers.Get(2));
rip.EnableRouting(routers.Get(3));
- Configure the Traffic Applications
For verify the RIP-based routing, we transmit the packets among Router 1 and Router 4.
UdpEchoServerHelper echoServer(9);
ApplicationContainer serverApps = echoServer.Install(routers.Get(3)); // Router 4 as server
serverApps.Start(Seconds(1.0));
serverApps.Stop(Seconds(10.0));
UdpEchoClientHelper echoClient(Ipv4Address(“10.1.4.2”), 9);
echoClient.SetAttribute(“MaxPackets”, UintegerValue(5));
echoClient.SetAttribute(“Interval”, TimeValue(Seconds(1.0)));
echoClient.SetAttribute(“PacketSize”, UintegerValue(512));
ApplicationContainer clientApps = echoClient.Install(routers.Get(0)); // Router 1 as client
clientApps.Start(Seconds(2.0));
clientApps.Stop(Seconds(10.0));
- Support to Tracing for Debugging
AsciiTraceHelper ascii;
p2p.EnableAsciiAll(ascii.CreateFileStream(“rip-routing.tr”));
p2p.EnablePcapAll(“rip-routing”);
- Implement the replication
Simulator::Run();
Simulator::Destroy();
- Study the performance of parameter outcomes
We permit for envision the tool like NetAnim:
./waf –run rip-routing
netanim
We validate the RIP routing tables, use:
show ip route rip
- Extend with Advanced Features
- RIP with Authentication: We protected for bring up-to-date the routing.
- QoS-Aware RIP: For improve the paths terms on bandwidth.
- Hybrid RIP with OSPF: We apply for execute the mixed routing policies.
In the end, we obviously knew the concepts of the Routing Information Protocol on how it performs in different scenarios use of ns3 simulation tool. If clarification is needed, it will be included in an additional project manual.