SlideShare a Scribd company logo
1 of 20
Download to read offline
I
WiMAX Implementation in NS3
Master Program
(Advanced Wireless Telecommunication)
By Student:
Mustafa Khaleel
II
Contents
1. Introduction ............................................................................................................................ 1
1.1. Study case ....................................................................................................................... 1
2. Network simulator 3 (NS-3).................................................................................................... 2
2.1. The basic model .............................................................................................................. 3
2.2. Ns-3 Packets.................................................................................................................... 6
2.3. Simulation Basics ............................................................................................................ 6
3. Simulation and Results ........................................................................................................... 7
Annex ............................................................................................................................................ 14
References..................................................................................................................................... 17
Figure 1 NS-2 and NS-3 ................................................................................................................... 2
Figure 2 the waf build system ........................................................................................................ 3
Figure 3 a special waf shell............................................................................................................. 3
Figure 4 the basic model................................................................................................................. 3
Figure 5 the class Application......................................................................................................... 4
Figure 6 NetDevices ........................................................................................................................ 5
Figure 7 Udpheader example ......................................................................................................... 6
Figure 8 header files ....................................................................................................................... 7
Figure 9 scheduler and log comopent........................................................................................... 7
Figure 10 Nodes .............................................................................................................................. 8
Figure 11 netDevice ........................................................................................................................ 8
Figure 12 configuration of PHY layer of Subscribers ..................................................................... 8
Figure 13 configuration of PHY layer of BaseStation..................................................................... 9
Figure 14 IP addresses..................................................................................................................... 9
Figure 15 the mobility model ......................................................................................................... 9
Figure 16 server and client-1........................................................................................................ 10
Figure 17 server and client-2......................................................................................................... 10
Figure 18 IpcsClassifierRecord user-1........................................................................................... 10
Figure 19 IpcsClassifierRecord user-2........................................................................................... 11
Figure 20 Running simulator ........................................................................................................ 11
Figure 21 simulation output......................................................................................................... 12
Figure 22 the position of nodes.................................................................................................... 12
Figure 23 Nodes in NetAnim......................................................................................................... 13
Figure 24 the transmission in time............................................................................................... 13
III
1
1. Introduction
Network simulator 3 (ns-3) is a discrete-event network simulator, targeted
primarily for research and educational use. ns-3 is free software, licensed
under the GNU GPLv2 license, and is publicly available for research,
development, and use.
The goal of the ns-3 project is to develop a preferred, open simulation
environment for networking research: it should be aligned with the
simulation needs of modern networking research and should encourage
community contribution, peer review, and validation of the software.
1.1.Study case
We use two nodes and base station in Wi-max with ns3 program v. 3.24
and simulate the traffic by changing the modulations schemes and we
will demonstrate the results packets, the delay and the packet flow
between the transmitter and receiver with animation environment
images that explain the transmission time between the nodes and the
base station, all these results will be shown in ns3 program and followed
steps.
2
2. Network simulator 3 (NS-3)
NS-3 is discrete-event network simulator, its open source (GNU GPLv2) and
it’s written in written entirely in C++ (with Python bindings).
NS-3 alignment with real systems (sockets, device, driver interface) also its
alignment with input/output standards (papa traces, ns-2 mobility scripts),
and its modular and documented core.
The figure below show the comparison between NS-2 and NS-3 from
Models view,
Figure 1 NS-2 and NS-3
3
NS-3 using the waf build system, and its Python-based framework for
configuring, compiling and installing applications.
Figure 2 the waf build system
Can run programs through a special waf shell;
Figure 3 a special waf shell
2.1.The basic model
In figure below show the basic model of ns-3
Figure 4 the basic model
Node is like a computer to which you will add functionality. One add things
like applications, protocol stacks and peripheral cards with their associated
drivers to enable the computer to do useful work. We use the same basic
model in ns-3 and it’s represented in C++ by the class Node.
4
Application
A user would typically run an application that acquires and uses the
resources controlled by the system software to accomplish some goal. It’s
represented in C++ by the class Application.
An Application may specialized versions of the application model
Application called UdpEchoClientApplication and
UdpEchoServerApplication, OnOffApplication, PacketSink, for example
client/server application set used to generate and echo simulated network
packets
Figure 5 the class Application
Channel
In the real world, one can connect a computer to a network. Often the
media over which data flows in these networks are called channels.
And it is represented in C++ by the class Channel. The Channel class
provides methods for managing communication subnetwork objects and
connecting nodes to them.
A Channel may specialized versions of the Channel model called
CsmaChannel, PointToPointChannel and WifiChannel. The CsmaChannel,
for example, models a version of a communication subnetwork that
implements a carrier sense multiple access communication medium. This
gives us Ethernet-like functionality.
5
Net Device
A net device is “installed” in a Node in order to enable the Node to
communicate with other Nodes in the simulation via Channels. Just as in a
real computer, a Node may be connected to more than one Channel via
multiple NetDevices.and NetDevices are strongly bound to Channels of a
matching type.
Figure 6 NetDevices
And there several specialized versions of the NetDevice called
CsmaNetDevice, PointToPointNetDevice, and WifiNetDevice, for example
the CsmaNetDevice is designed to work with a CsmaChannel; the
PointToPointNetDevice is designed to work with a PointToPointChannel
and a WifiNetNevice is designed to work with a WifiChannel.
Topology Helpers
Since connecting NetDevices to Nodes, NetDevices to Channels, assigning
IP addresses, etc., are such common tasks in ns-3, we call topology helpers
to make this as easy as possible, for example, it may take many distinct ns-3
core operations to create a NetDevice, add a MAC address, install that net
device on a Node, configure the node’s protocol stack, and then connect
the NetDevice to a Channel.
6
2.2.Ns-3 Packets
Each network packet contains a byte buffer, a list of tags,metadata and
buffer: bit-by-bit (serialized) representation of headers and trailers, the
tags: set of arbitrary, user-provided data structures (e.g., per-packet cross-
layer messages, or flow identifiers), finally the metadata: describes types of
headers and trailers that have been serialized.
To add a new header, subclass from Header, and write your Serialize() and
Deserialize() methods as we see in figure below, the Udpheader example
Figure 7 Udpheader example
2.3.Simulation Basics
Simulation time moves discretely from event to event as in C++ functions
schedule events to occur at specific simulation times, in ns3 we call Run()
function:
Simulation::Run() gets it all started
And the simulation will stop at specific time or when events end.
7
3. Simulation and Results
In our simulation scenario, the wireless network will composed three
nodes:
1. One base Station
2. Two subscriber stations
And subscriber station-1 sends packets to the station subscribe-2.
First we import the necessary header files defines the namespace to use.
Figure 8 header files
We create an object scheduler we will use later,
Figure 9 scheduler and log comopent
The ns-3 logging facility can be used to monitor or debug the progress of
simulation programs.
8
Figure 12 configuration of PHY layer of Subscribers
Now we create the network nodes.
- 1 base station.
- Two subscribers stations.
Figure 10 Nodes
We will create the WiMAX devices (netDevice). And also we define the type
of device for the Subscribe Stations and the Base Station.
Figure 11 netDevice
Adding extra features to the devices of Subscribers and define the
configuration of the physical layer like modulation order.
9
Figure 15 the mobility model
Adding extra features in the base station apparatus using the
Class BaseStationNetDevice.
Figure 13 configuration of PHY layer of BaseStation
We define the Internet Stack in order to implementation of TCP/IPv4- and
IPv6-related components. After that we Specify IP addresses
Installing the IP addresses of nodes.
Figure 14 IP addresses
We set positions nodes in our network. By define model the mobility
“ConstantPositionMobility” Model. Our nodes are firm on their positions
and will not move in space.
10
We set the subscriber station 0 to server and subscriber station 1 as a
client.
Figure 16 server and client-1
Figure 17 server and client-2
We define IpcsClassifierRecord of each user , and An IP packet classifier is
used to map incoming packets to appropriate connections based on a set of
criteria. The classifier maintains a list of mapping rules which associate an
IP to one of the service flows.
Figure 18 IpcsClassifierRecord user-1
11
IpcsClassifierRecord of user-2
Figure 19 IpcsClassifierRecord user-2
Finally we start we the simulator with following code
Figure 20 Running simulator
12
Results:
First we run the simulation with. /waf system and the output is,
Next we run the simulation under NetAnim environment,
We using there commands for NetAnim and we define the position of
nodes in x-axis and y-axis,
Figure 22 the position of nodes
Figure 21 simulation output
13
Finally we have the following,
Figure 23 Nodes in NetAnim
The yellow represent the Base Station and red represent Subscribers.
In following table represent the transmission between nodes with time,
Figure 24 the transmission in time
14
Annex
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/applications-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wimax-module.h"
#include "ns3/internet-module.h"
#include "ns3/global-route-manager.h"
#include "ns3/ipcs-classifier-record.h"
#include "ns3/service-flow.h"
#include <iostream>
#include "ns3/netanim-module.h"
#include "ns3/net-device-container.h"
#include "ns3/netanim-module.h"
using namespace ns3;
int main (int argc, char *argv[]){
WimaxHelper::SchedulerType scheduler =WimaxHelper::SCHED_TYPE_SIMPLE;
LogComponentEnable ("UdpClient", LOG_LEVEL_INFO);
LogComponentEnable ("UdpServer", LOG_LEVEL_INFO);
NodeContainer ssNodes;
NodeContainer bsNodes;
ssNodes.Create (2);
bsNodes.Create (1);
WimaxHelper wimax;
15
NetDeviceContainer ssDevs;
NetDeviceContainer bsDevs;
ssDevs = wimax.Install(ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION,
WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler);
bsDevs = wimax.Install(bsNodes,
WimaxHelper::DEVICE_TYPE_BASE_STATION,WimaxHelper::SIMPLE_PHY_TYPE_OFDM,
scheduler);
Ptr<SubscriberStationNetDevice> ss[2];
for (int i = 0; i < 2; i++) {
ss[i] = ssDevs.Get (i)->
GetObject<SubscriberStationNetDevice> ();
ss[i]->SetModulationType
(WimaxPhy::MODULATION_TYPE_QAM64_34);
}
Ptr<BaseStationNetDevice> bs;
bs = bsDevs.Get (0)->
GetObject<BaseStationNetDevice> ();
InternetStackHelper stack;
stack.Install (bsNodes);
stack.Install (ssNodes);
Ipv4AddressHelper address;
address.SetBase ("10.1.7.0", "255.255.255.0");
Ipv4InterfaceContainer SSinterfaces = address.Assign (ssDevs);
Ipv4InterfaceContainer BSinterface = address.Assign (bsDevs);
Ptr<ListPositionAllocator>
positionAlloc = CreateObject
<ListPositionAllocator> ();
positionAlloc->Add (Vector(15, 25, 0));
16
positionAlloc->Add (Vector(25, 15, 0));
positionAlloc->Add (Vector(5, 15, 0));
MobilityHelper bs_mobility;
bs_mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
bs_mobility.SetPositionAllocator(positionAlloc);
bs_mobility.Install(bsNodes);
UdpServerHelper udpServer;
ApplicationContainer serverApps;
UdpClientHelper udpClient;
ApplicationContainer clientApps;
udpServer = UdpServerHelper (22000);
serverApps = udpServer.Install (ssNodes.Get (0));
serverApps.Start (Seconds (4.0));
serverApps.Stop (Seconds (10.0));
udpClient=UdpClientHelper(SSinterfaces.GetAddress (0),22000);
udpClient.SetAttribute ("MaxPackets", UintegerValue (15000));
udpClient.SetAttribute ("Interval", TimeValue (Seconds (0.1)));
udpClient.SetAttribute ("PacketSize", UintegerValue (512));
clientApps = udpClient.Install (ssNodes.Get (1));
clientApps.Start (Seconds (5.0));
clientApps.Stop (Seconds (9.5));
Simulator::Stop (Seconds (15.0));
IpcsClassifierRecord DlClassifierUgs (Ipv4Address ("0.0.0.0"),
Ipv4Mask ("0.0.0.0"), SSinterfaces.GetAddress (0), Ipv4Mask ("255.255.255.255"), 0, 65000,
22000, 22000, 17, 1);
ServiceFlow DlServiceFlowUgs = wimax.CreateServiceFlow
(ServiceFlow::SF_DIRECTION_DOWN,ServiceFlow::SF_TYPE_RTPS, DlClassifierUgs);
ss[0]->AddServiceFlow (DlServiceFlowUgs);
IpcsClassifierRecord UlClassifierUgs (SSinterfaces.GetAddress(1), Ipv4Mask ("255.255.255.255"),
Ipv4Address ("0.0.0.0"),
17
Ipv4Mask ("0.0.0.0"), 0, 65000, 22000, 22000, 17, 1);
ServiceFlow UlServiceFlowUgs = wimax.CreateServiceFlow(ServiceFlow::SF_DIRECTION_UP,
ServiceFlow::SF_TYPE_RTPS,UlClassifierUgs);
ss[1]->AddServiceFlow (UlServiceFlowUgs);
AnimationInterface anim("animationWiMAX.xml");
anim.SetConstantPosition (ssNodes.Get(0),1.0,3.0);
anim.SetConstantPosition (ssNodes.Get(1),4.0,6.0);
anim.SetConstantPosition (bsNodes.Get(0),7.0,8.0);
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
References
1. nsnam.org
2. ns-3 tutorial, Presenter: Tom Henderson,University of Washington,Simutools
Conference,March, 2008.
3.Youtube.com , Hitesh Choudhary channel.
4. ns-3 tutorial,GENI Eng. Conf., Nov. 2010
5. An IEEE 802.16 WiMAX Module for the NS-3 Simulator.

More Related Content

Viewers also liked

introduction to wimax
introduction to wimaxintroduction to wimax
introduction to wimaxKranthi Reddy
 
Preface FOR DTMF BASED HOME APPLIANCES
Preface FOR DTMF BASED HOME APPLIANCESPreface FOR DTMF BASED HOME APPLIANCES
Preface FOR DTMF BASED HOME APPLIANCESRohit Roy
 
Mixed approach for scheduling process in wimax for high qos
Mixed approach for scheduling process in wimax for high qosMixed approach for scheduling process in wimax for high qos
Mixed approach for scheduling process in wimax for high qoseSAT Journals
 
Building Complex Topology using NS3
Building Complex Topology using NS3Building Complex Topology using NS3
Building Complex Topology using NS3Rahul Hada
 
Radio over Fiber Technology for WiMAX Systems
 Radio over Fiber Technology for WiMAX Systems Radio over Fiber Technology for WiMAX Systems
Radio over Fiber Technology for WiMAX Systems Sajid Marwat
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3Rahul Hada
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifiSalah Amean
 
A tutorial on CloudSim
A tutorial on CloudSimA tutorial on CloudSim
A tutorial on CloudSimHabibur Rahman
 
Wireless LAN security
Wireless LAN securityWireless LAN security
Wireless LAN securityRajan Kumar
 

Viewers also liked (11)

introduction to wimax
introduction to wimaxintroduction to wimax
introduction to wimax
 
Preface FOR DTMF BASED HOME APPLIANCES
Preface FOR DTMF BASED HOME APPLIANCESPreface FOR DTMF BASED HOME APPLIANCES
Preface FOR DTMF BASED HOME APPLIANCES
 
Mixed approach for scheduling process in wimax for high qos
Mixed approach for scheduling process in wimax for high qosMixed approach for scheduling process in wimax for high qos
Mixed approach for scheduling process in wimax for high qos
 
Building Complex Topology using NS3
Building Complex Topology using NS3Building Complex Topology using NS3
Building Complex Topology using NS3
 
Radio over Fiber Technology for WiMAX Systems
 Radio over Fiber Technology for WiMAX Systems Radio over Fiber Technology for WiMAX Systems
Radio over Fiber Technology for WiMAX Systems
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3
 
Wi fi in arabic
Wi fi in arabicWi fi in arabic
Wi fi in arabic
 
Ns3 implementation wifi
Ns3 implementation wifiNs3 implementation wifi
Ns3 implementation wifi
 
A tutorial on CloudSim
A tutorial on CloudSimA tutorial on CloudSim
A tutorial on CloudSim
 
WiMAX
WiMAXWiMAX
WiMAX
 
Wireless LAN security
Wireless LAN securityWireless LAN security
Wireless LAN security
 

Similar to WiMAX implementation in ns3

Paper9250 implementation of an i pv6 stack for ns-3
Paper9250 implementation of an i pv6 stack for ns-3Paper9250 implementation of an i pv6 stack for ns-3
Paper9250 implementation of an i pv6 stack for ns-3Suhail Ahmed Chandio
 
Plenzogan technology
Plenzogan technologyPlenzogan technology
Plenzogan technologyplenzogan
 
DCCN 2016 - Tutorial 1 - Communication with LAN/WLAN
DCCN 2016 - Tutorial 1 - Communication with LAN/WLANDCCN 2016 - Tutorial 1 - Communication with LAN/WLAN
DCCN 2016 - Tutorial 1 - Communication with LAN/WLANrudndccn
 
Digital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdf
Digital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdfDigital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdf
Digital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdfMathavan N
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxPratik Joshi
 
Final Report(Routing_Misbehavior)
Final Report(Routing_Misbehavior)Final Report(Routing_Misbehavior)
Final Report(Routing_Misbehavior)Ambreen Zafar
 
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystemDCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystemrudndccn
 
ECET 375 Effective Communication/tutorialrank.com
 ECET 375 Effective Communication/tutorialrank.com ECET 375 Effective Communication/tutorialrank.com
ECET 375 Effective Communication/tutorialrank.comjonhson203
 
ECET 375 Invent Yourself/newtonhelp.com
ECET 375 Invent Yourself/newtonhelp.comECET 375 Invent Yourself/newtonhelp.com
ECET 375 Invent Yourself/newtonhelp.comlechenau125
 
Performance comparision 1307.4129
Performance comparision 1307.4129Performance comparision 1307.4129
Performance comparision 1307.4129Pratik Joshi
 

Similar to WiMAX implementation in ns3 (20)

Paper9250 implementation of an i pv6 stack for ns-3
Paper9250 implementation of an i pv6 stack for ns-3Paper9250 implementation of an i pv6 stack for ns-3
Paper9250 implementation of an i pv6 stack for ns-3
 
June 28 Presentation
June 28 PresentationJune 28 Presentation
June 28 Presentation
 
UDP Report
UDP ReportUDP Report
UDP Report
 
Plenzogan technology
Plenzogan technologyPlenzogan technology
Plenzogan technology
 
DCCN 2016 - Tutorial 1 - Communication with LAN/WLAN
DCCN 2016 - Tutorial 1 - Communication with LAN/WLANDCCN 2016 - Tutorial 1 - Communication with LAN/WLAN
DCCN 2016 - Tutorial 1 - Communication with LAN/WLAN
 
cscn1819.pdf
cscn1819.pdfcscn1819.pdf
cscn1819.pdf
 
opnet lab report
opnet lab reportopnet lab report
opnet lab report
 
Introduction to ns3
Introduction to ns3Introduction to ns3
Introduction to ns3
 
Digital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdf
Digital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdfDigital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdf
Digital_Notes___UNIT_5___EC8702___AD_HOC_AND__WIRELESS_SENSOR__NETWORKS.pdf.pdf
 
Network simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linuxNetwork simulator 2 a simulation tool for linux
Network simulator 2 a simulation tool for linux
 
NP-lab-manual (1).pdf
NP-lab-manual (1).pdfNP-lab-manual (1).pdf
NP-lab-manual (1).pdf
 
NP-lab-manual.pdf
NP-lab-manual.pdfNP-lab-manual.pdf
NP-lab-manual.pdf
 
Final Report(Routing_Misbehavior)
Final Report(Routing_Misbehavior)Final Report(Routing_Misbehavior)
Final Report(Routing_Misbehavior)
 
Virtual lab - Routing in Mobile Adhoc Networks
Virtual lab - Routing in Mobile Adhoc NetworksVirtual lab - Routing in Mobile Adhoc Networks
Virtual lab - Routing in Mobile Adhoc Networks
 
NP-lab-manual.docx
NP-lab-manual.docxNP-lab-manual.docx
NP-lab-manual.docx
 
D3.2b_v1.0_final
D3.2b_v1.0_finalD3.2b_v1.0_final
D3.2b_v1.0_final
 
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystemDCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
DCCN 2016 - Tutorial 2 - 4G for SmartGrid ecosystem
 
ECET 375 Effective Communication/tutorialrank.com
 ECET 375 Effective Communication/tutorialrank.com ECET 375 Effective Communication/tutorialrank.com
ECET 375 Effective Communication/tutorialrank.com
 
ECET 375 Invent Yourself/newtonhelp.com
ECET 375 Invent Yourself/newtonhelp.comECET 375 Invent Yourself/newtonhelp.com
ECET 375 Invent Yourself/newtonhelp.com
 
Performance comparision 1307.4129
Performance comparision 1307.4129Performance comparision 1307.4129
Performance comparision 1307.4129
 

More from Mustafa Khaleel

More from Mustafa Khaleel (7)

LTE-U
LTE-ULTE-U
LTE-U
 
Massive mimo
Massive mimoMassive mimo
Massive mimo
 
IPsec vpn topology over GRE tunnels
IPsec vpn topology over GRE tunnelsIPsec vpn topology over GRE tunnels
IPsec vpn topology over GRE tunnels
 
Turbocode
TurbocodeTurbocode
Turbocode
 
Mm wave
Mm waveMm wave
Mm wave
 
Adaptive filters
Adaptive filtersAdaptive filters
Adaptive filters
 
Ultra wideband technology (UWB)
Ultra wideband technology (UWB)Ultra wideband technology (UWB)
Ultra wideband technology (UWB)
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 

WiMAX implementation in ns3

  • 1. I WiMAX Implementation in NS3 Master Program (Advanced Wireless Telecommunication) By Student: Mustafa Khaleel
  • 2. II Contents 1. Introduction ............................................................................................................................ 1 1.1. Study case ....................................................................................................................... 1 2. Network simulator 3 (NS-3).................................................................................................... 2 2.1. The basic model .............................................................................................................. 3 2.2. Ns-3 Packets.................................................................................................................... 6 2.3. Simulation Basics ............................................................................................................ 6 3. Simulation and Results ........................................................................................................... 7 Annex ............................................................................................................................................ 14 References..................................................................................................................................... 17 Figure 1 NS-2 and NS-3 ................................................................................................................... 2 Figure 2 the waf build system ........................................................................................................ 3 Figure 3 a special waf shell............................................................................................................. 3 Figure 4 the basic model................................................................................................................. 3 Figure 5 the class Application......................................................................................................... 4 Figure 6 NetDevices ........................................................................................................................ 5 Figure 7 Udpheader example ......................................................................................................... 6 Figure 8 header files ....................................................................................................................... 7 Figure 9 scheduler and log comopent........................................................................................... 7 Figure 10 Nodes .............................................................................................................................. 8 Figure 11 netDevice ........................................................................................................................ 8 Figure 12 configuration of PHY layer of Subscribers ..................................................................... 8 Figure 13 configuration of PHY layer of BaseStation..................................................................... 9 Figure 14 IP addresses..................................................................................................................... 9 Figure 15 the mobility model ......................................................................................................... 9 Figure 16 server and client-1........................................................................................................ 10 Figure 17 server and client-2......................................................................................................... 10 Figure 18 IpcsClassifierRecord user-1........................................................................................... 10 Figure 19 IpcsClassifierRecord user-2........................................................................................... 11 Figure 20 Running simulator ........................................................................................................ 11 Figure 21 simulation output......................................................................................................... 12 Figure 22 the position of nodes.................................................................................................... 12 Figure 23 Nodes in NetAnim......................................................................................................... 13 Figure 24 the transmission in time............................................................................................... 13
  • 3. III
  • 4. 1 1. Introduction Network simulator 3 (ns-3) is a discrete-event network simulator, targeted primarily for research and educational use. ns-3 is free software, licensed under the GNU GPLv2 license, and is publicly available for research, development, and use. The goal of the ns-3 project is to develop a preferred, open simulation environment for networking research: it should be aligned with the simulation needs of modern networking research and should encourage community contribution, peer review, and validation of the software. 1.1.Study case We use two nodes and base station in Wi-max with ns3 program v. 3.24 and simulate the traffic by changing the modulations schemes and we will demonstrate the results packets, the delay and the packet flow between the transmitter and receiver with animation environment images that explain the transmission time between the nodes and the base station, all these results will be shown in ns3 program and followed steps.
  • 5. 2 2. Network simulator 3 (NS-3) NS-3 is discrete-event network simulator, its open source (GNU GPLv2) and it’s written in written entirely in C++ (with Python bindings). NS-3 alignment with real systems (sockets, device, driver interface) also its alignment with input/output standards (papa traces, ns-2 mobility scripts), and its modular and documented core. The figure below show the comparison between NS-2 and NS-3 from Models view, Figure 1 NS-2 and NS-3
  • 6. 3 NS-3 using the waf build system, and its Python-based framework for configuring, compiling and installing applications. Figure 2 the waf build system Can run programs through a special waf shell; Figure 3 a special waf shell 2.1.The basic model In figure below show the basic model of ns-3 Figure 4 the basic model Node is like a computer to which you will add functionality. One add things like applications, protocol stacks and peripheral cards with their associated drivers to enable the computer to do useful work. We use the same basic model in ns-3 and it’s represented in C++ by the class Node.
  • 7. 4 Application A user would typically run an application that acquires and uses the resources controlled by the system software to accomplish some goal. It’s represented in C++ by the class Application. An Application may specialized versions of the application model Application called UdpEchoClientApplication and UdpEchoServerApplication, OnOffApplication, PacketSink, for example client/server application set used to generate and echo simulated network packets Figure 5 the class Application Channel In the real world, one can connect a computer to a network. Often the media over which data flows in these networks are called channels. And it is represented in C++ by the class Channel. The Channel class provides methods for managing communication subnetwork objects and connecting nodes to them. A Channel may specialized versions of the Channel model called CsmaChannel, PointToPointChannel and WifiChannel. The CsmaChannel, for example, models a version of a communication subnetwork that implements a carrier sense multiple access communication medium. This gives us Ethernet-like functionality.
  • 8. 5 Net Device A net device is “installed” in a Node in order to enable the Node to communicate with other Nodes in the simulation via Channels. Just as in a real computer, a Node may be connected to more than one Channel via multiple NetDevices.and NetDevices are strongly bound to Channels of a matching type. Figure 6 NetDevices And there several specialized versions of the NetDevice called CsmaNetDevice, PointToPointNetDevice, and WifiNetDevice, for example the CsmaNetDevice is designed to work with a CsmaChannel; the PointToPointNetDevice is designed to work with a PointToPointChannel and a WifiNetNevice is designed to work with a WifiChannel. Topology Helpers Since connecting NetDevices to Nodes, NetDevices to Channels, assigning IP addresses, etc., are such common tasks in ns-3, we call topology helpers to make this as easy as possible, for example, it may take many distinct ns-3 core operations to create a NetDevice, add a MAC address, install that net device on a Node, configure the node’s protocol stack, and then connect the NetDevice to a Channel.
  • 9. 6 2.2.Ns-3 Packets Each network packet contains a byte buffer, a list of tags,metadata and buffer: bit-by-bit (serialized) representation of headers and trailers, the tags: set of arbitrary, user-provided data structures (e.g., per-packet cross- layer messages, or flow identifiers), finally the metadata: describes types of headers and trailers that have been serialized. To add a new header, subclass from Header, and write your Serialize() and Deserialize() methods as we see in figure below, the Udpheader example Figure 7 Udpheader example 2.3.Simulation Basics Simulation time moves discretely from event to event as in C++ functions schedule events to occur at specific simulation times, in ns3 we call Run() function: Simulation::Run() gets it all started And the simulation will stop at specific time or when events end.
  • 10. 7 3. Simulation and Results In our simulation scenario, the wireless network will composed three nodes: 1. One base Station 2. Two subscriber stations And subscriber station-1 sends packets to the station subscribe-2. First we import the necessary header files defines the namespace to use. Figure 8 header files We create an object scheduler we will use later, Figure 9 scheduler and log comopent The ns-3 logging facility can be used to monitor or debug the progress of simulation programs.
  • 11. 8 Figure 12 configuration of PHY layer of Subscribers Now we create the network nodes. - 1 base station. - Two subscribers stations. Figure 10 Nodes We will create the WiMAX devices (netDevice). And also we define the type of device for the Subscribe Stations and the Base Station. Figure 11 netDevice Adding extra features to the devices of Subscribers and define the configuration of the physical layer like modulation order.
  • 12. 9 Figure 15 the mobility model Adding extra features in the base station apparatus using the Class BaseStationNetDevice. Figure 13 configuration of PHY layer of BaseStation We define the Internet Stack in order to implementation of TCP/IPv4- and IPv6-related components. After that we Specify IP addresses Installing the IP addresses of nodes. Figure 14 IP addresses We set positions nodes in our network. By define model the mobility “ConstantPositionMobility” Model. Our nodes are firm on their positions and will not move in space.
  • 13. 10 We set the subscriber station 0 to server and subscriber station 1 as a client. Figure 16 server and client-1 Figure 17 server and client-2 We define IpcsClassifierRecord of each user , and An IP packet classifier is used to map incoming packets to appropriate connections based on a set of criteria. The classifier maintains a list of mapping rules which associate an IP to one of the service flows. Figure 18 IpcsClassifierRecord user-1
  • 14. 11 IpcsClassifierRecord of user-2 Figure 19 IpcsClassifierRecord user-2 Finally we start we the simulator with following code Figure 20 Running simulator
  • 15. 12 Results: First we run the simulation with. /waf system and the output is, Next we run the simulation under NetAnim environment, We using there commands for NetAnim and we define the position of nodes in x-axis and y-axis, Figure 22 the position of nodes Figure 21 simulation output
  • 16. 13 Finally we have the following, Figure 23 Nodes in NetAnim The yellow represent the Base Station and red represent Subscribers. In following table represent the transmission between nodes with time, Figure 24 the transmission in time
  • 17. 14 Annex #include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/applications-module.h" #include "ns3/mobility-module.h" #include "ns3/config-store-module.h" #include "ns3/wimax-module.h" #include "ns3/internet-module.h" #include "ns3/global-route-manager.h" #include "ns3/ipcs-classifier-record.h" #include "ns3/service-flow.h" #include <iostream> #include "ns3/netanim-module.h" #include "ns3/net-device-container.h" #include "ns3/netanim-module.h" using namespace ns3; int main (int argc, char *argv[]){ WimaxHelper::SchedulerType scheduler =WimaxHelper::SCHED_TYPE_SIMPLE; LogComponentEnable ("UdpClient", LOG_LEVEL_INFO); LogComponentEnable ("UdpServer", LOG_LEVEL_INFO); NodeContainer ssNodes; NodeContainer bsNodes; ssNodes.Create (2); bsNodes.Create (1); WimaxHelper wimax;
  • 18. 15 NetDeviceContainer ssDevs; NetDeviceContainer bsDevs; ssDevs = wimax.Install(ssNodes, WimaxHelper::DEVICE_TYPE_SUBSCRIBER_STATION, WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler); bsDevs = wimax.Install(bsNodes, WimaxHelper::DEVICE_TYPE_BASE_STATION,WimaxHelper::SIMPLE_PHY_TYPE_OFDM, scheduler); Ptr<SubscriberStationNetDevice> ss[2]; for (int i = 0; i < 2; i++) { ss[i] = ssDevs.Get (i)-> GetObject<SubscriberStationNetDevice> (); ss[i]->SetModulationType (WimaxPhy::MODULATION_TYPE_QAM64_34); } Ptr<BaseStationNetDevice> bs; bs = bsDevs.Get (0)-> GetObject<BaseStationNetDevice> (); InternetStackHelper stack; stack.Install (bsNodes); stack.Install (ssNodes); Ipv4AddressHelper address; address.SetBase ("10.1.7.0", "255.255.255.0"); Ipv4InterfaceContainer SSinterfaces = address.Assign (ssDevs); Ipv4InterfaceContainer BSinterface = address.Assign (bsDevs); Ptr<ListPositionAllocator> positionAlloc = CreateObject <ListPositionAllocator> (); positionAlloc->Add (Vector(15, 25, 0));
  • 19. 16 positionAlloc->Add (Vector(25, 15, 0)); positionAlloc->Add (Vector(5, 15, 0)); MobilityHelper bs_mobility; bs_mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel"); bs_mobility.SetPositionAllocator(positionAlloc); bs_mobility.Install(bsNodes); UdpServerHelper udpServer; ApplicationContainer serverApps; UdpClientHelper udpClient; ApplicationContainer clientApps; udpServer = UdpServerHelper (22000); serverApps = udpServer.Install (ssNodes.Get (0)); serverApps.Start (Seconds (4.0)); serverApps.Stop (Seconds (10.0)); udpClient=UdpClientHelper(SSinterfaces.GetAddress (0),22000); udpClient.SetAttribute ("MaxPackets", UintegerValue (15000)); udpClient.SetAttribute ("Interval", TimeValue (Seconds (0.1))); udpClient.SetAttribute ("PacketSize", UintegerValue (512)); clientApps = udpClient.Install (ssNodes.Get (1)); clientApps.Start (Seconds (5.0)); clientApps.Stop (Seconds (9.5)); Simulator::Stop (Seconds (15.0)); IpcsClassifierRecord DlClassifierUgs (Ipv4Address ("0.0.0.0"), Ipv4Mask ("0.0.0.0"), SSinterfaces.GetAddress (0), Ipv4Mask ("255.255.255.255"), 0, 65000, 22000, 22000, 17, 1); ServiceFlow DlServiceFlowUgs = wimax.CreateServiceFlow (ServiceFlow::SF_DIRECTION_DOWN,ServiceFlow::SF_TYPE_RTPS, DlClassifierUgs); ss[0]->AddServiceFlow (DlServiceFlowUgs); IpcsClassifierRecord UlClassifierUgs (SSinterfaces.GetAddress(1), Ipv4Mask ("255.255.255.255"), Ipv4Address ("0.0.0.0"),
  • 20. 17 Ipv4Mask ("0.0.0.0"), 0, 65000, 22000, 22000, 17, 1); ServiceFlow UlServiceFlowUgs = wimax.CreateServiceFlow(ServiceFlow::SF_DIRECTION_UP, ServiceFlow::SF_TYPE_RTPS,UlClassifierUgs); ss[1]->AddServiceFlow (UlServiceFlowUgs); AnimationInterface anim("animationWiMAX.xml"); anim.SetConstantPosition (ssNodes.Get(0),1.0,3.0); anim.SetConstantPosition (ssNodes.Get(1),4.0,6.0); anim.SetConstantPosition (bsNodes.Get(0),7.0,8.0); Simulator::Run (); Simulator::Destroy (); return 0; } References 1. nsnam.org 2. ns-3 tutorial, Presenter: Tom Henderson,University of Washington,Simutools Conference,March, 2008. 3.Youtube.com , Hitesh Choudhary channel. 4. ns-3 tutorial,GENI Eng. Conf., Nov. 2010 5. An IEEE 802.16 WiMAX Module for the NS-3 Simulator.