SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Building Topology
[Part-2]
Topology
STA-1
STA-2
STA-3
AP
CSMA
P2P
WIFI
P1 P2
C1 C2 C3 C4
CLIENT
SERVER
UdpEchoServerHelper
UdpEchoCientHelper
RoadMap
● Writing Code
● Detail Understanding
– Logging
– Tracing
– Attributes
Flow Chart
Point To Point
CSMA
WIFI Station
WIFI AP
NODE
Container
Point To Point
CSMA
WIFI Station
WIFI AP
NetDe`vice
Container
Point To Point
CSMA
WIFI Station
WIFI AP
SetAttributes
NetDevice
Point To Point
CSMA
Attach
NetDevice to
PHY
&CHANNEL
WIFI Station
WIFI AP
Configure
PHY & MAC
WIFI Station
WIFI AP
Attach
NetDevice to
PHY
&CHANNEL
Point To Point
CSMA
WIFI Station
WIFI AP
Install
ProtocolStack
Point To Point
CSMA
WIFI Station
WIFI AP
Assign IP
Address
Install Application
Topology Description
● Channels & Net Device
– Wireless
– Point to Point
– CSMA
● Node Container
– Access Point Node
– Station Nodes
– Point to Point Nodes
– CSMA Nodes
● Node P1 & P2 having two Net Device of different types
Classes
● NodeContainer
● PointToPointHelper
● CsmaHelper
● YansWifiChannelHelper
●
YansWifiPhyHelper
● WifiHelper
● NetDeviceContainer
● MobilityHelper
● InternetStackHelper
● Ipv4AddressHelper
●
Ipv4InterfaceContainer
● UdpEchoServerHelper
● UdpEchoClientHelper
● ApplicationContainer
`
Include
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/internet-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/applications-module.h"
#include "ns3/ipv4-global-routing-helper.h"
NODE
● We are having four different types of nodes.
● Create Four Different NodeContainer
– Point to Point
– Station Nodes
– Access Point
– CSMA NodeContainer n1,n2;
n1.Create(3);
[...]
N2.Create(1);
n2.Add(n1.Get(0));
void Create(uint32_t n);
Add()- used to add node in a node container
Create() - used to create node/s
NetDevice and Channel
● Three different NetDevice and Channel:-
– PointToPointHelper – NetDevice & Channel
– CsmaHelper – NetDevice & Channel
– YansWifiChannelHelper – Channel
– YansWifiPhyHelper – PHY
– WifiHelper – NetDevice
We use Install()method to attach NetDevice with Node
It will return an object to NetDeviceContainer
Configure WIFI NetDevice
`
NetDevice
PHY
MAC<attach>
YansWifiPhyHelper
NqosWifiMacHelper
YansWifiChannelHelper
WifiHelper
Node
Configure WIFI NetDevice
● WifiChannel & WifiPhy abstract class
– YansWifiChannel
● We use Helper [YansWifiChannelHelper]
● Set Channel related attributes
– [channel switch delay, energy of received signal,etc]
– YansWifiPhy
● We use Helper [YansWifiPhyHelper]
● Set PHY Layer related attributes
– [propogation delay] Set CHANNEL to PHY
void SetChannel(Ptr<YansWifiChannel>)-
Class YansWifiPhy
Configure MAC
● WifiMac abstract class
– List of MAC Types
● AdhocWifiMac – Infrastructure less network
● ApWifiMac – Access point Node MAC
● StaWifiMac – Station Node MAC
● Etc.
– We use Helper Class
● NqosWifiMacHelper or WifiMacHelper
– Set the appropiate MAC from the list and Set Attributes
● void SetType(T,A,V....);
● T- Type of MAC
● A- Name of Attribute
● V –Value of Attribute
Mobility
● It is used to track and maintain the
– Current Cartesian position
– Speed of an object
– Placement of Node
– Setup Mobility Model
Mobility
[Cartesian Position]
Source:http://en.wikipedia.org/wiki/Cartesian_coordinate_system
Mobility
● Assign Mobility to WIFI Nodes
– List of Mobility Model
● ConstantAccelerationMobilityModel
● ConstantPositionMobilityModel
● ConstantVelocityMobilityModel
● RandomDirection2dMobilityModel
● RandomWalk2dMobilityModel
● Etc
– List of Allocator Model (placement of Node)
● RandomDiscPositionAllocator
● RandomRectanglePositionAllocator
● GridPositionAllocator
● Etc.
Mobility Model
● RandomWalk2dMobilityModel
– 2D random walk mobility model
– Each instance moves with a speed and direction
choosen at random
– Nodes moves in Boundaries specified by Rectangle
– Rectangle(double xMin,double xMax,double yMin,double yMax)
x-axis
y-axis
xMin xMax
yMin
yMax
Allocator Model
● GridPositionAllocator
– Allocate position on a rectangular 2D grid
– List of Attributes
● MinX
● MinY
● DeltaX
● DeltaY
● GridWidth
● LayoutType
– ROW_FIRST
– COLUMN_FIRST
1 2 3
4
(MinX,MinY) DeltaX
DeltaY GridWidth
x-axis
y-axis
Mobility
● We use Helper Class
– MobilityHelper
● SetMobilityModel()-Set Mobility Model
● SetPositionAllocator() - Set Position Allocator
– Install the mobility on Nodes
– Mobility Model [Access Point & CSMA Nodes]
● ConstantPositionMobilityModel
Internet Stack & Ipv4Address
● Now its time to install Protocol Stack
– InternetStackHelper
● Install()
● Assign IP address to the NetDevice
– Ipv4InterfaceContainer
● Assign()
Application
STA-1
STA-2
STA-3
AP
CSMA
P2P
WIFI
P1 P2
C1 C2 C3 C4
CLIENT
SERVER
UdpEchoServerHelper
UdpEchoCientHelper
Animation
● AnimationInterface
– Set Methods for Nodes
● Description – SetNodeDescription(NodeContainer,”AP”)
● Color – SetNodeColor(NodeContainer , R,G,B)
● Position – SetConstantPosition(Node,X,Y)
● Etc.
– Add Background Image
● SetBackgroundImage(..,..,..,);
vodi EnablePacketMetadata(boolean value)
Start Simulation
Simulation::Run();
Simulation::Destroy();
return 0;
● Modify the Mobility Pattern using
– RandomWalk2dMobilityModel
● Distance- Change current direction and
speed after moving for this distance.
● Speed – speed of node
● Bounds – Area
To be Continued...

Contenu connexe

Tendances

Lecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networksLecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networks
Chandra Meena
 

Tendances (20)

Ns3
Ns3Ns3
Ns3
 
Ccna4
Ccna4Ccna4
Ccna4
 
~Ns2~
~Ns2~~Ns2~
~Ns2~
 
OSPF v3
OSPF v3OSPF v3
OSPF v3
 
IPv6 Transition & Deployment, including IPv6-only in cellular and broadband
IPv6 Transition & Deployment, including IPv6-only in cellular and broadbandIPv6 Transition & Deployment, including IPv6-only in cellular and broadband
IPv6 Transition & Deployment, including IPv6-only in cellular and broadband
 
Fundamental of Quality of Service(QoS)
Fundamental of Quality of Service(QoS) Fundamental of Quality of Service(QoS)
Fundamental of Quality of Service(QoS)
 
Introduction_Reseau.ppt
Introduction_Reseau.pptIntroduction_Reseau.ppt
Introduction_Reseau.ppt
 
MPLS
MPLSMPLS
MPLS
 
Remote Procedure Call in Distributed System
Remote Procedure Call in Distributed SystemRemote Procedure Call in Distributed System
Remote Procedure Call in Distributed System
 
Routing Presentation
Routing PresentationRouting Presentation
Routing Presentation
 
Mac adhoc
Mac adhocMac adhoc
Mac adhoc
 
Lecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networksLecture 23 27. quality of services in ad hoc wireless networks
Lecture 23 27. quality of services in ad hoc wireless networks
 
Tcp/ip model
Tcp/ip  modelTcp/ip  model
Tcp/ip model
 
MPLS VPN
MPLS VPNMPLS VPN
MPLS VPN
 
Introduction to OpenFlow
Introduction to OpenFlowIntroduction to OpenFlow
Introduction to OpenFlow
 
Notions de base sur le routage
Notions de base sur le routageNotions de base sur le routage
Notions de base sur le routage
 
Distance Vector Routing Protocols
Distance Vector Routing ProtocolsDistance Vector Routing Protocols
Distance Vector Routing Protocols
 
Formation1 sockets
Formation1 socketsFormation1 sockets
Formation1 sockets
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
Ingénieur de conception télécommunications et réseaux
Ingénieur de conception télécommunications et réseaux Ingénieur de conception télécommunications et réseaux
Ingénieur de conception télécommunications et réseaux
 

En vedette

Support formobility
Support formobilitySupport formobility
Support formobility
Rahul Hada
 
Socket Programming using Java
Socket Programming using JavaSocket Programming using Java
Socket Programming using Java
Rahul Hada
 
Mobile transportlayer
Mobile transportlayerMobile transportlayer
Mobile transportlayer
Rahul Hada
 
Spring sim 2010-riley
Spring sim 2010-rileySpring sim 2010-riley
Spring sim 2010-riley
Sopna Sumāto
 

En vedette (20)

Socio-technical System
Socio-technical SystemSocio-technical System
Socio-technical System
 
Fundamental of Shell Programming
Fundamental of Shell ProgrammingFundamental of Shell Programming
Fundamental of Shell Programming
 
Inheritance
InheritanceInheritance
Inheritance
 
Introduction to Virtualization
Introduction to VirtualizationIntroduction to Virtualization
Introduction to Virtualization
 
Support formobility
Support formobilitySupport formobility
Support formobility
 
Software Engineering Introduction
Software Engineering IntroductionSoftware Engineering Introduction
Software Engineering Introduction
 
Introduction of Cloud Computing
Introduction of Cloud ComputingIntroduction of Cloud Computing
Introduction of Cloud Computing
 
Socket Programming using Java
Socket Programming using JavaSocket Programming using Java
Socket Programming using Java
 
Risk
RiskRisk
Risk
 
Risk
RiskRisk
Risk
 
Mobile transportlayer
Mobile transportlayerMobile transportlayer
Mobile transportlayer
 
Quality planning
Quality planningQuality planning
Quality planning
 
WLAN - IEEE 802.11
WLAN - IEEE 802.11WLAN - IEEE 802.11
WLAN - IEEE 802.11
 
Mobile Network Layer
Mobile Network LayerMobile Network Layer
Mobile Network Layer
 
Spring sim 2010-riley
Spring sim 2010-rileySpring sim 2010-riley
Spring sim 2010-riley
 
WiMAX implementation in ns3
WiMAX implementation in ns3WiMAX implementation in ns3
WiMAX implementation in ns3
 
Jammers&amp;anti jammers
Jammers&amp;anti jammersJammers&amp;anti jammers
Jammers&amp;anti jammers
 
Cryptanalysis of image encryption using traditional encryption tecnhniques
Cryptanalysis of image encryption using traditional encryption tecnhniquesCryptanalysis of image encryption using traditional encryption tecnhniques
Cryptanalysis of image encryption using traditional encryption tecnhniques
 
ICT role in Yemen
ICT role in Yemen ICT role in Yemen
ICT role in Yemen
 
ns-3: History and Future
ns-3: History and Futurens-3: History and Future
ns-3: History and Future
 

Similaire à Building Complex Topology using NS3

Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccna
robertoxe
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
Thomas Graf
 

Similaire à Building Complex Topology using NS3 (20)

Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccna
 
Camara Application Programming Interface (API) Overview.pdf
Camara Application Programming Interface (API) Overview.pdfCamara Application Programming Interface (API) Overview.pdf
Camara Application Programming Interface (API) Overview.pdf
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
 
Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccna
 
Chapter14ccna
Chapter14ccnaChapter14ccna
Chapter14ccna
 
Presentation on ccna
Presentation on ccnaPresentation on ccna
Presentation on ccna
 
Intelligent Network Services through Active Flow Manipulation
Intelligent Network Services through Active Flow ManipulationIntelligent Network Services through Active Flow Manipulation
Intelligent Network Services through Active Flow Manipulation
 
Enabling Active Flow Manipulation (AFM) in Silicon-based Network Forwarding E...
Enabling Active Flow Manipulation (AFM) in Silicon-based Network Forwarding E...Enabling Active Flow Manipulation (AFM) in Silicon-based Network Forwarding E...
Enabling Active Flow Manipulation (AFM) in Silicon-based Network Forwarding E...
 
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol SupportCloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
Cloud Foundry Summit 2015: Cloud Foundry and IoT Protocol Support
 
FIWARE Tech Summit - lwM2M IoT Agent in Depth
FIWARE Tech Summit - lwM2M IoT Agent in DepthFIWARE Tech Summit - lwM2M IoT Agent in Depth
FIWARE Tech Summit - lwM2M IoT Agent in Depth
 
SDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center NetworkingSDN & NFV Introduction - Open Source Data Center Networking
SDN & NFV Introduction - Open Source Data Center Networking
 
Network Virtualization & Software-defined Networking
Network Virtualization & Software-defined NetworkingNetwork Virtualization & Software-defined Networking
Network Virtualization & Software-defined Networking
 
Contrail Enabler for agile cloud services
Contrail Enabler for agile cloud servicesContrail Enabler for agile cloud services
Contrail Enabler for agile cloud services
 
Distributed routing
Distributed routingDistributed routing
Distributed routing
 
CCNA Training
CCNA TrainingCCNA Training
CCNA Training
 
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
WebTram: una WebApp GWT per l'editing di dati cartografici e topologici di un...
 
CisCon 2018 - Overlay Management Protocol e IPsec
CisCon 2018 - Overlay Management Protocol e IPsecCisCon 2018 - Overlay Management Protocol e IPsec
CisCon 2018 - Overlay Management Protocol e IPsec
 
Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015Network and Service Virtualization tutorial at ONUG Spring 2015
Network and Service Virtualization tutorial at ONUG Spring 2015
 
SD-WAN Catalyst a brief Presentation of solution
SD-WAN Catalyst a brief  Presentation of solutionSD-WAN Catalyst a brief  Presentation of solution
SD-WAN Catalyst a brief Presentation of solution
 
OpenNebula Networking - Rubén S. Montero
OpenNebula Networking - Rubén S. MonteroOpenNebula Networking - Rubén S. Montero
OpenNebula Networking - Rubén S. Montero
 

Dernier

scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
HenryBriggs2
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Dernier (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Air Compressor reciprocating single stage
Air Compressor reciprocating single stageAir Compressor reciprocating single stage
Air Compressor reciprocating single stage
 

Building Complex Topology using NS3

  • 2. Topology STA-1 STA-2 STA-3 AP CSMA P2P WIFI P1 P2 C1 C2 C3 C4 CLIENT SERVER UdpEchoServerHelper UdpEchoCientHelper
  • 3. RoadMap ● Writing Code ● Detail Understanding – Logging – Tracing – Attributes
  • 4. Flow Chart Point To Point CSMA WIFI Station WIFI AP NODE Container Point To Point CSMA WIFI Station WIFI AP NetDe`vice Container Point To Point CSMA WIFI Station WIFI AP SetAttributes NetDevice Point To Point CSMA Attach NetDevice to PHY &CHANNEL WIFI Station WIFI AP Configure PHY & MAC WIFI Station WIFI AP Attach NetDevice to PHY &CHANNEL Point To Point CSMA WIFI Station WIFI AP Install ProtocolStack Point To Point CSMA WIFI Station WIFI AP Assign IP Address Install Application
  • 5. Topology Description ● Channels & Net Device – Wireless – Point to Point – CSMA ● Node Container – Access Point Node – Station Nodes – Point to Point Nodes – CSMA Nodes ● Node P1 & P2 having two Net Device of different types
  • 6. Classes ● NodeContainer ● PointToPointHelper ● CsmaHelper ● YansWifiChannelHelper ● YansWifiPhyHelper ● WifiHelper ● NetDeviceContainer ● MobilityHelper ● InternetStackHelper ● Ipv4AddressHelper ● Ipv4InterfaceContainer ● UdpEchoServerHelper ● UdpEchoClientHelper ● ApplicationContainer ` Include #include "ns3/core-module.h" #include "ns3/network-module.h" #include "ns3/csma-module.h" #include "ns3/internet-module.h" #include "ns3/point-to-point-module.h" #include "ns3/applications-module.h" #include "ns3/ipv4-global-routing-helper.h"
  • 7. NODE ● We are having four different types of nodes. ● Create Four Different NodeContainer – Point to Point – Station Nodes – Access Point – CSMA NodeContainer n1,n2; n1.Create(3); [...] N2.Create(1); n2.Add(n1.Get(0)); void Create(uint32_t n); Add()- used to add node in a node container Create() - used to create node/s
  • 8. NetDevice and Channel ● Three different NetDevice and Channel:- – PointToPointHelper – NetDevice & Channel – CsmaHelper – NetDevice & Channel – YansWifiChannelHelper – Channel – YansWifiPhyHelper – PHY – WifiHelper – NetDevice We use Install()method to attach NetDevice with Node It will return an object to NetDeviceContainer
  • 10. Configure WIFI NetDevice ● WifiChannel & WifiPhy abstract class – YansWifiChannel ● We use Helper [YansWifiChannelHelper] ● Set Channel related attributes – [channel switch delay, energy of received signal,etc] – YansWifiPhy ● We use Helper [YansWifiPhyHelper] ● Set PHY Layer related attributes – [propogation delay] Set CHANNEL to PHY void SetChannel(Ptr<YansWifiChannel>)- Class YansWifiPhy
  • 11. Configure MAC ● WifiMac abstract class – List of MAC Types ● AdhocWifiMac – Infrastructure less network ● ApWifiMac – Access point Node MAC ● StaWifiMac – Station Node MAC ● Etc. – We use Helper Class ● NqosWifiMacHelper or WifiMacHelper – Set the appropiate MAC from the list and Set Attributes ● void SetType(T,A,V....); ● T- Type of MAC ● A- Name of Attribute ● V –Value of Attribute
  • 12. Mobility ● It is used to track and maintain the – Current Cartesian position – Speed of an object – Placement of Node – Setup Mobility Model
  • 14. Mobility ● Assign Mobility to WIFI Nodes – List of Mobility Model ● ConstantAccelerationMobilityModel ● ConstantPositionMobilityModel ● ConstantVelocityMobilityModel ● RandomDirection2dMobilityModel ● RandomWalk2dMobilityModel ● Etc – List of Allocator Model (placement of Node) ● RandomDiscPositionAllocator ● RandomRectanglePositionAllocator ● GridPositionAllocator ● Etc.
  • 15. Mobility Model ● RandomWalk2dMobilityModel – 2D random walk mobility model – Each instance moves with a speed and direction choosen at random – Nodes moves in Boundaries specified by Rectangle – Rectangle(double xMin,double xMax,double yMin,double yMax) x-axis y-axis xMin xMax yMin yMax
  • 16. Allocator Model ● GridPositionAllocator – Allocate position on a rectangular 2D grid – List of Attributes ● MinX ● MinY ● DeltaX ● DeltaY ● GridWidth ● LayoutType – ROW_FIRST – COLUMN_FIRST 1 2 3 4 (MinX,MinY) DeltaX DeltaY GridWidth x-axis y-axis
  • 17. Mobility ● We use Helper Class – MobilityHelper ● SetMobilityModel()-Set Mobility Model ● SetPositionAllocator() - Set Position Allocator – Install the mobility on Nodes – Mobility Model [Access Point & CSMA Nodes] ● ConstantPositionMobilityModel
  • 18. Internet Stack & Ipv4Address ● Now its time to install Protocol Stack – InternetStackHelper ● Install() ● Assign IP address to the NetDevice – Ipv4InterfaceContainer ● Assign()
  • 19. Application STA-1 STA-2 STA-3 AP CSMA P2P WIFI P1 P2 C1 C2 C3 C4 CLIENT SERVER UdpEchoServerHelper UdpEchoCientHelper
  • 20. Animation ● AnimationInterface – Set Methods for Nodes ● Description – SetNodeDescription(NodeContainer,”AP”) ● Color – SetNodeColor(NodeContainer , R,G,B) ● Position – SetConstantPosition(Node,X,Y) ● Etc. – Add Background Image ● SetBackgroundImage(..,..,..,); vodi EnablePacketMetadata(boolean value)
  • 22. ● Modify the Mobility Pattern using – RandomWalk2dMobilityModel ● Distance- Change current direction and speed after moving for this distance. ● Speed – speed of node ● Bounds – Area