How to Develop STAR Protocol Projects Using NS3

To develop the STAR (Source Tree Adaptive Routing) Protocol involves the several steps in NS3. This procedure will show how to implement the start protocols in ns3 tool.

Steps to Develop STAR Protocol Projects Using NS3

What is the STAR Protocol?

STAR (Source Tree Adaptive Routing) is proactive link-state routing protocol used to wireless ad-hoc networks. We modify the traditional link-state protocols such as OSPF, STAR decrease the overhead through communicate only for needed the network topology updates.

Key Features of STAR in NS3:

  • Reduced Control Overhead → Only communicates the bring up-to-date for necessary.
  • Proactive Routing → handle the latest routing tables.
  • Energy Efficiency → Replicate for large-scale wireless networks.
  1. Install NS3 and Required Modules

We assure the NS3 is installed:

sudo apt update

sudo apt install -y git build-essential python3 cmake

git clone

cd ns-3

./ns3 configure –enable-examples –enable-tests

./ns3 build

Essential for NS3 Modules in STAR Protocol:

  • Internet Module → Designed for IP-based routing.
  • WiFi Module → Wireless communication.
  • Mobility Module → Mobile nodes are replicating the mobility modules.
  • Routing Module → Employ for STAR-based routing.
  • Applications Module → We replicate the congestion.
  1. Define the STAR Protocol in NS3

Since NS3 cannot have natively encouraged for STAR, we require to:

  • Change the existing proactive routing protocol for sample OLSR.
  • We apply the execution for STAR-inspired in link-state on update method.

Example: Modifying OLSR to Implement STAR

#include “ns3/olsr-helper.h”

class StarRoutingHelper : public OlsrHelper {

public:

StarRoutingHelper() {

SetAttribute(“HelloInterval”, TimeValue(Seconds(5))); // STAR has a longer update interval

SetAttribute(“TcInterval”, TimeValue(Seconds(10))); // Reduced topology control messages

}

};

This modification:

  • Decrease the control communication overhead such as STAR.
  • We increase the link-state in keep informed on mechanism.
  1. Create a Wireless Ad-Hoc Network for STAR

For replicate a 10-node in wireless network in which nodes are communicated for using STAR.

Example: Setting Up a Wireless Network

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

using namespace ns3;

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

NodeContainer nodes;

nodes.Create(10); // 10 Wireless Nodes

WifiHelper wifi;

wifi.SetStandard(WIFI_PHY_STANDARD_80211g);

WifiMacHelper mac;

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

YansWifiPhyHelper phy = YansWifiPhyHelper::Default();

YansWifiChannelHelper channel = YansWifiChannelHelper::Default();

phy.SetChannel(channel.Create());

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

MobilityHelper mobility;

mobility.SetPositionAllocator(“ns3::GridPositionAllocator”,

“MinX”, DoubleValue(0.0),

“MinY”, DoubleValue(0.0),

“DeltaX”, DoubleValue(10.0),

“DeltaY”, DoubleValue(10.0),

“GridWidth”, UintegerValue(5),

“LayoutType”, StringValue(“RowFirst”));

mobility.SetMobilityModel(“ns3::RandomWalk2dMobilityModel”,

“Bounds”, RectangleValue(Rectangle(-50, 50, -50, 50)));

mobility.Install(nodes);

InternetStackHelper internet;

StarRoutingHelper starRouting;

internet.SetRoutingHelper(starRouting);

internet.Install(nodes);

Ipv4AddressHelper address;

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

address.Assign(devices);

Simulator::Stop(Seconds(20));

Simulator::Run();

Simulator::Destroy();

return 0;

}

This setup:

  • For generate the 10-node in wireless ad-hoc network.
  • We utilized the STAR-based on proactive routing.
  • Execute an arbitrary movement of nodes.
  1. Simulating Data Transmission in STAR

We validate the STAR routing; for build UDP congestion among their two nodes.

Example: Sending UDP Traffic over STAR

#include “ns3/udp-client-server-helper.h”

uint16_t port = 5000;

UdpServerHelper server(port);

ApplicationContainer serverApp = server.Install(nodes.Get(9));

serverApp.Start(Seconds(1.0));

serverApp.Stop(Seconds(15.0));

UdpClientHelper client(Ipv4Address(“10.1.1.9”), port);

client.SetAttribute(“MaxPackets”, UintegerValue(50));

client.SetAttribute(“Interval”, TimeValue(Seconds(0.5)));

client.SetAttribute(“PacketSize”, UintegerValue(512));

ApplicationContainer clientApp = client.Install(nodes.Get(0));

clientApp.Start(Seconds(2.0));

clientApp.Stop(Seconds(15.0));

We replicate the data transmission:

  • A UDP client at Node 0 forwarding the packets to Node 9.
  • Routing congestion is dynamically using the STAR.
  1. Implement QoS and Energy-Efficient STAR Routing

STAR is improved for low control overhead and energy effectiveness.

Example: Adding QoS to STAR Routing

#include “ns3/traffic-control-helper.h”

 

TrafficControlHelper tc;

tc.SetRootQueueDisc(“ns3::FqCoDelQueueDisc”);

tc.Install(devices);

This increases the star protocol:

  • Fair packet programing (QoS optimization).
  • Effective for bandwidth usage.
  1. Performance Analysis (Throughput, Delay, Packet Loss)

We utilized the Flow Monitor to calculate a STAR routing effectiveness.

Example: Monitoring STAR Routing Performance

#include “ns3/flow-monitor-helper.h”

 

Ptr<FlowMonitor> monitor;

FlowMonitorHelper flowHelper;

monitor = flowHelper.InstallAll();

Simulator::Run();

monitor->SerializeToXmlFile(“star-flow.xml”, true, true);

Simulator::Destroy();

Outputs: star-flow.xml for packet delivery & delay analysis.

Advanced STAR Protocol Research Topics

  1. Energy-Aware STAR Routing → Enhance the node power usage.
    2. AI-Based STAR Routing → We utilized the machine learning to find the optimal routes.
    3. STAR Security Enhancements → Execute for encode and intrusion detection.
    4. Multi-Channel STAR RoutingAdaptive routing based on network environments.
    5. QoS-Aware STAR Protocol → Apply the priority-based on routing for VoIP, Video Streaming.

Summary: Developing STAR Routing Protocol in NS3

Step 1: Install and download the NS3 and necessary components

Step 2: We create a wireless ad-hoc network (MANET) topology

Step 3: STAR-inspired executed the proactive routing

Step 4: UDP replicate the packet transmission over STAR

Step 5: Enhance the QoS and energy effectiveness in STAR

Step 6: We estimated the performance of parameter metrics such as Throughput, Delay, Packet Loss, etc.

At this time, we clearly demonstrate how to set up a basic star topology and implement a simple protocol for communication between the nodes and the central hub. We design to provide the additional information on how to implement the start topology in other simulation settings.