How to Start FSR Protocol Projects Using NS3

To start an FSR (Fisheye State Routing) protocol project in NS3 has several steps to replicate or execute this link-state-based proactive routing protocol, which reduces overhead with the help of fisheye technique. This method sustains higher routing accuracy for neighbouring nodes whereas offering minimum amount of common updates for distant nodes.

Below is a general method to get started the FSR Protocol Projects using NS3:

Steps to Start FSR Protocol Projects in NS3

  1. Understand FSR Protocol
  • Key Features of FSR:
    • Fisheye Technique: It minimizes routing overhead by sustaining in-depth state data for nearby neighbors and less detailed data for distant nodes.
    • Proactive Protocol: This protocol endlessly sustains the routing tables to every network node.
    • Scalability: It is created for large and dynamic networks like MANETs.
  • Advantages:
    • This protocol effective for dynamic environments.
    • Low control packet overhead.
  • Use Cases:
    • It is used for large-scale mobile ad-hoc networks (MANETs).
    • Dynamic wireless networks.
  1. Set Up NS3
  • Install NS3:
    • Go to nsnam.org to download and install NS3.
  • Verify Installation:

./waf –run scratch/test-example

  • Modules to Enable:
    • internet: It offers the IPv4 stack and routing capabilities.
    • wifi: These module supports for wireless interaction.
    • mobility: For node mobility and dynamic topologies.
    • manet-routing: Discretionary, if we want to base FSR on existing routing instances.
  1. Plan Your FSR Protocol Project
  • Project Objectives:
    • We need to execute the FSR within NS3 and then estimate their performance.
    • Equate FSR including other proactive protocols such as OLSR.
    • We enhance the FSR for certain use cases like mobility or large-scale networks.
  • Metrics to Measure:
    • We access the performance indicators like packet delivery ratio, end-to-end delay, routing overhead, and scalability.
  • Simulation Topology:
    • We can use simulation topology such as dynamic or grid-based wireless networks.
  1. Write a Basic Wireless Network Simulation
  • Replicate a wireless network based on the starting point to utilize NS3 environment.
  • Example: Wireless Network Setup

#include “ns3/core-module.h”

#include “ns3/network-module.h”

#include “ns3/internet-module.h”

#include “ns3/wifi-module.h”

#include “ns3/mobility-module.h”

#include “ns3/applications-module.h”

using namespace ns3;

int main(int argc, char *argv[]) {

uint32_t nNodes = 10; // Number of nodes

double simulationTime = 20.0;

// Create nodes

NodeContainer nodes;

nodes.Create(nNodes);

// Configure Wi-Fi

WifiHelper wifi;

wifi.SetStandard(WIFI_PHY_STANDARD_80211b);

YansWifiPhyHelper phy = YansWifiPhyHelper::Default();

YansWifiChannelHelper channel = YansWifiChannelHelper::Default();

phy.SetChannel(channel.Create());

WifiMacHelper mac;

mac.SetType(“ns3::AdhocWifiMac”);

NetDeviceContainer devices = wifi.Install(phy, mac, nodes);

// Mobility model

MobilityHelper mobility;

mobility.SetPositionAllocator(“ns3::RandomRectanglePositionAllocator”,

“X”, StringValue(“ns3::UniformRandomVariable[Min=0|Max=100]”),

“Y”, StringValue(“ns3::UniformRandomVariable[Min=0|Max=100]”));

mobility.SetMobilityModel(“ns3::RandomWaypointMobilityModel”,

“Speed”, StringValue(“ns3::UniformRandomVariable[Min=1.0|Max=3.0]”),

“Pause”, StringValue(“ns3::ConstantRandomVariable[Constant=0.0]”));

mobility.Install(nodes);

// Install Internet stack

InternetStackHelper stack;

stack.Install(nodes);

// Assign IP addresses

Ipv4AddressHelper ipv4;

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

ipv4.Assign(devices);

// Application: UDP Echo

uint16_t port = 9;

UdpEchoServerHelper echoServer(port);

ApplicationContainer serverApps = echoServer.Install(nodes.Get(nNodes – 1));

serverApps.Start(Seconds(1.0));

serverApps.Stop(Seconds(simulationTime));

UdpEchoClientHelper echoClient(Ipv4Address(“10.1.1.10”), port);

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

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

echoClient.SetAttribute(“PacketSize”, UintegerValue(1024));

ApplicationContainer clientApps = echoClient.Install(nodes.Get(0));

clientApps.Start(Seconds(2.0));

clientApps.Stop(Seconds(simulationTime));

// Enable pcap tracing

phy.EnablePcapAll(“fsr-protocol”);

Simulator::Run();

Simulator::Destroy();

return 0;

}

  1. Implement FSR Protocol
  • Core Steps to Implement FSR:
    1. Neighbor Discovery:
      • We want to swap hello packets sustaining a list of dynamic neighbors.
    2. Fisheye State Updates:
      • Nodes sustain the exact routing data for neighbouring nodes and for distant nodes, less frequent updates.
    3. Routing Table Maintenance:
      • Modernize the routing table occasionally according to the neighbor states and fisheye data.
    4. Packet Forwarding:
      • We effectively send packets using the routing table.
  • Extend NS3 Routing:
    • Prolong the Ipv4RoutingProtocol class.
    • Make ineffective techniques such as:
      • RouteInput(): To manage incoming packets.
      • RouteOutput(): We discover the next hop for outgoing packets.
      • NotifyInterfaceUp() and NotifyInterfaceDown().
  1. Test and Debug
  • Enable Logging:

export NS_LOG=Ipv4RoutingProtocol=level_all

./waf –run scratch/fsr-protocol

  • Inspect Routing Behavior:
    • Print routing tables:

Ptr<Ipv4> ipv4 = nodes.Get(0)->GetObject<Ipv4>();

ipv4->GetRoutingProtocol()->Print(std::cout);

  • Analyze Packets:
    • Examine FSR control packets within Wireshark to utilize PCAP files.
  1. Evaluate Performance
  • Metrics to Evaluate:
    • Now, we measure the performance parameters such as packet delivery ratio, routing overhead, end-to-end delay, scalability with node count.
  • FlowMonitor Integration:

FlowMonitorHelper flowMonitor;

Ptr<FlowMonitor> monitor = flowMonitor.InstallAll();

  1. Advanced Features
  • Mobility and Scalability:
    • We can experiment the FSR in high mobility or large-scale scenarios.
  • Optimization:
    • To enhance the FSR by modifying the fisheye updates frequency.
  • Comparison:
    • Then, equate the performance of FSR including other routing protocols such as OLSR or AODV.

Here, we effectively accomplished the exhaustive approach to start and execute the FSR Protocol projects using fisheye technique in NS3 simulation tool. Also, we will provide advanced methods and information relevant to this topic.

For best project results you can entrust our experts we will guide you on all phases of your FSR Protocol Projects Using NS3 tool. Get tailored assistance from phdprojects.org