To develop the WAN Protocols Projects for used in the NS-3.The Wide Area Network (WAN) protocols to allow the communication above large geographical distances, connecting the several LANs and MANs. In NS-3, we can replicate the WAN protocols such as MPLS, BGP, OSPF, SD-WAN, and ATM to examine the performance for below the various network environments.
Steps to Develop WAN Protocols Projects in NS-3
Step 1: Install NS-3
We have enabled the tool in NS-3 installed and download for your system:
# Install dependencies
sudo apt update
sudo apt install -y build-essential cmake git python3
# Clone NS-3 repository
git clone https://gitlab.com/nsnam/ns-3-dev.git ns-3
cd ns-3
# Build NS-3
./ns3 configure –enable-examples –enable-tests
./ns3 build
Step 2: Choose a WAN Protocol to Simulate
For below the general WAN protocols we can execute the protocols:
- Multiprotocol Label Switching (MPLS) – Improve the packet sending through using labels.
- Border Gateway Protocol (BGP) – Handle the routing among their autonomous systems.
- Open Shortest Path First (OSPF) – An intra-domain routing protocol.
- Software-Defined WAN (SD-WAN) – It used the software control for enhance the WAN routing.
- Asynchronous Transfer Mode (ATM) – The connection-oriented protocol for WAN.
Step 3: Setup a WAN Topology in NS-3
Example: WAN Network with Multiple Routers
Generate a script (wan-simulation.cc) to replicate the WAN topology.
#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;
NS_LOG_COMPONENT_DEFINE(“WANSimulation”);
int main(int argc, char *argv[]) {
CommandLine cmd;
cmd.Parse(argc, argv);
NodeContainer nodes;
nodes.Create(5); // Five nodes representing WAN routers
InternetStackHelper internet;
internet.Install(nodes);
PointToPointHelper p2p;
p2p.SetDeviceAttribute(“DataRate”, StringValue(“10Mbps”));
p2p.SetChannelAttribute(“Delay”, StringValue(“20ms”));
NetDeviceContainer devices;
for (uint32_t i = 0; i < nodes.GetN() – 1; ++i) {
devices.Add(p2p.Install(nodes.Get(i), nodes.Get(i + 1)));
}
Ipv4AddressHelper ipv4;
ipv4.SetBase(“192.168.1.0”, “255.255.255.0”);
ipv4.Assign(devices);
UdpEchoServerHelper echoServer(9);
ApplicationContainer serverApps = echoServer.Install(nodes.Get(4));
serverApps.Start(Seconds(1.0));
serverApps.Stop(Seconds(10.0));
UdpEchoClientHelper echoClient(Ipv4Address(“192.168.1.4”), 9);
echoClient.SetAttribute(“MaxPackets”, UintegerValue(1));
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(10.0));
Ipv4GlobalRoutingHelper::PopulateRoutingTables();
Simulator::Run();
Simulator::Destroy();
return 0;
}
Step 4: Implement Specific WAN Protocols
- Implement MPLS in WAN
- Alter the packet sending to use the labels in place of IP routing.
- We allocate the labels to packets and replicate a label switching.
- For improve the mpls-header.h and mpls-router.cc.
- Implement BGP Routing in NS-3
- Describe the BGP communication (OPEN, UPDATE, KEEPALIVE, NOTIFICATION).
- For replicate the routing for bring up-to-date among several WAN routers.
- Execute the event-based on BGP decision process.
- Implement OSPF-based WAN Routing
- We estimate the OSPF link-state routing by measure the minimum path.
- Utilized the graph-based procedures to calculate the minimum path.
- Adapt the routing tables are dynamically in NS-3.
- Implement SD-WAN with NS-3
- For build the several paths by changed the QoS parameters.
- Choose the better path dynamically used to software-defined routing.
- Execute the controller-based on design to enhance the WAN congestion.
Step 5: Compile and Run the Simulation
Compile the script:
./ns3 build
Implement the replication process for this method:
./ns3 run scratch/wan-simulation
Step 6: Performance Analysis
We used the tool NS-3 trace files and metrics to estimate the WAN performance:
- Latency: For calculate the end-to-end delay.
- Throughput: Estimate the data transmission rate.
- Packet Loss: Examine the network congestion.
- Routing Efficiency: Associate the BGP vs OSPF path selection.
Next Steps
Would you like support by:
- Apply the execution for detailed WAN protocols for instance MPLS, BGP?
- Improve the QoS parameters for SD-WAN?
- Encompass the WAN replications by real-world congestion?
In this demonstration, we completely know how to implement the basic setup simulation and to know how to execute the Wide Area Network in ns3 simulator tool. If you have any query regarding this process we also help to clarify it.