SlideShare a Scribd company logo
1 of 15
Download to read offline
Building Topology
[Part-01]
Point-To -Point Topology
<Reading Code>
Node-1 Node-2
Flow Chart
Create Node
Attach NetDeive
&
Channel
[NODES]
Install
Protocol Stack
[NODES]
Assign
Ip Address
[NETDEVICE]
Install
Application
[NODES]
Node
● Use to create NODE
– To create NODE Object we use Node class with
TEMPLATE function CreateObject<> &
Reference Counting Smart Pointer Ptr<>
Ptr<Node> n= CreateObject<Node>();
● Use of Helper Class
– To create Group of NODE we use NodeContainer
NodeContainer nc;
nc.Create(3);
Channel & NetDevice
● It is a logical path over which information flows
– To create Channel we use following classes:-
● WifiChannel
● CsmaChannel
● PointToPointChannel
● Etc...
– To create NetDevice we use following classes:-
● WifiNetDevice
● CsmaNetDevice
● PointToPointNetDevice
● Etc...
Channel & NetDevice
● Use of Helper Classes
– We can use Helper Classes:-
● WifiHelper
● CsmaHelper
● PointToPointHelper
● Now ATTACH NetDevice & Channel
– NetDeviceContainer device
– device=pointTopoint.Install(NodeContainer);
● At this point we are done with :-
– NODE
– NetDevice
– Channel
Coupling of NetDevice
with Channel
NetDevice-0 NetDevice-1Point-to-point
Channel
Node-0 Node-1
Internet Stack & Ipv4Address
● Now its time to install Protocol Stack
– Helper Class
● InternetStackHelper i
● Now INSTALL protocol stack on Nodes
– i.install(NodeContainer);
● Ipv4Address
– Now associate the devices on our node with IP addresses
● Ipv4AddressHelper iaddr;
● Iaddr.SetBase(“10.1.1.0”,”255.255.255.0”);
– Now assign this IP address to Nodes using Ipv4Interface object
● Ipv4InterfaceContainer iinter = iaddr.Assign(device)
NetDevice-0 NetDevice-1Point-to-point
Channel
Node-0 Node-1
Internet Stack Internet Stack10.1.1.1/24 10.1.1.2/24
Application
● Application abstract class
– UdpEchoServerApplication – server
application
– UdpEchoClientApplication -client application
● We use Helper classes
– UdpEchoServerHelper
– UdpEchoClientHelper
Server Application
UdpEchoServerHelper server(9);
– Set up a UDP echo server application on one of the node
– Require the port number as a parameter to the constructor
ApplicationContainer serApp;
serApp.Install(nodes.Get(1));
servApp.Start(Seconds(1.0));
servApp.Stop(Seconds(10.0));
– Install server application on Node-1
NetDevice-0 NetDevice-1Point-to-point
Channel
Node-0 Node-1
Internet Stack Internet Stack10.1.1.1/24 10.1.1.2/24
Server App
NetDevice-0 NetDevice-1Point-to-point
Channel
Node-0 Node-1
Internet Stack Internet Stack10.1.1.1/24
Server App
Client Application
UdpEchoClientHelper client(i.GetAddress(1),9);
● Pass parameter (to helper) to set the Remote Address and
Remote port for for client to connect.
ApplicationContainer clientApp
=client.Install(nodes.Get(0));
clientApp.Start(Seconds(2.0));
clientApp.Stop(Seconds(9.0));
NetDevice-0 NetDevice-1Point-to-point
Channel
Node-0 Node-1
Internet Stack Internet Stack10.1.1.1/24
Server AppClient App
10.1.1.2/24
Start Simulation
Simulation::Run();
Simulation::Destroy();
return 0;
NetDevice-0 NetDevice-1Point-to-point
Channel
Node-0 Node-1
Internet Stack Internet Stack
Server AppClient App
Running Example
● Copy program from example to scratch
folder
● And run using following commands
● ./waf --run /scratch/first
Simple Modification in
Topology CODE
● Change following values:-
● NetDevice
– DataRate
– Delay
● UDP packet
– MaxPacket
– Interval
– Packet Size
● What is the use of Helper Classes ?
● Why we use Container class ?
● Effect of Packet Size on Rx time @Server ?
To be Continued...

More Related Content

What's hot

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
 

What's hot (20)

X.25 and frame relay
X.25 and frame relayX.25 and frame relay
X.25 and frame relay
 
Ch 20 UNICAST ROUTING SECTION 2
Ch 20   UNICAST ROUTING  SECTION  2Ch 20   UNICAST ROUTING  SECTION  2
Ch 20 UNICAST ROUTING SECTION 2
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
 
AODV routing protocol
AODV routing protocolAODV routing protocol
AODV routing protocol
 
ospf routing protocol
ospf routing protocolospf routing protocol
ospf routing protocol
 
Classification of routing protocols
Classification of routing protocolsClassification of routing protocols
Classification of routing protocols
 
6LoWPAN.pptx
6LoWPAN.pptx6LoWPAN.pptx
6LoWPAN.pptx
 
Application Layer
Application Layer Application Layer
Application Layer
 
~Ns2~
~Ns2~~Ns2~
~Ns2~
 
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
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Introduction to OpenFlow
Introduction to OpenFlowIntroduction to OpenFlow
Introduction to OpenFlow
 
Tcp/ip model
Tcp/ip  modelTcp/ip  model
Tcp/ip model
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Routing
RoutingRouting
Routing
 
TCP-IP Reference Model
TCP-IP Reference ModelTCP-IP Reference Model
TCP-IP Reference Model
 
Distance Vector Routing Protocols
Distance Vector Routing ProtocolsDistance Vector Routing Protocols
Distance Vector Routing Protocols
 
Distance Vector Multicast Routing Protocol (DVMRP) : Presentation
Distance Vector Multicast Routing Protocol (DVMRP) : PresentationDistance Vector Multicast Routing Protocol (DVMRP) : Presentation
Distance Vector Multicast Routing Protocol (DVMRP) : Presentation
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
MPLS VPN
MPLS VPNMPLS VPN
MPLS VPN
 

Viewers also liked

Socket Programming using Java
Socket Programming using JavaSocket Programming using Java
Socket Programming using Java
Rahul Hada
 
Support formobility
Support formobilitySupport formobility
Support formobility
Rahul Hada
 
Mobile transportlayer
Mobile transportlayerMobile transportlayer
Mobile transportlayer
Rahul Hada
 

Viewers also liked (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
 
Software Engineering Introduction
Software Engineering IntroductionSoftware Engineering Introduction
Software Engineering Introduction
 
Inheritance
InheritanceInheritance
Inheritance
 
Introduction to Virtualization
Introduction to VirtualizationIntroduction to Virtualization
Introduction to Virtualization
 
ns-3: History and Future
ns-3: History and Futurens-3: History and Future
ns-3: History and Future
 
Network Simulation NS3
Network Simulation NS3Network Simulation NS3
Network Simulation NS3
 
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
 
Support formobility
Support formobilitySupport formobility
Support formobility
 
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
 
NS3 Tech Talk
NS3 Tech TalkNS3 Tech Talk
NS3 Tech Talk
 
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
 
Script login form php
Script login form phpScript login form php
Script login form php
 

Similar to Building Topology in NS3

Meetup Docker@Nuxeo - Build a Cloud Platform with Docker
Meetup Docker@Nuxeo - Build a Cloud Platform with DockerMeetup Docker@Nuxeo - Build a Cloud Platform with Docker
Meetup Docker@Nuxeo - Build a Cloud Platform with Docker
Nuxeo
 
Day in a life of a node.js developer
Day in a life of a node.js developerDay in a life of a node.js developer
Day in a life of a node.js developer
Edureka!
 

Similar to Building Topology in NS3 (20)

Omnet++
Omnet++Omnet++
Omnet++
 
Andes open cl for RISC-V
Andes open cl for RISC-VAndes open cl for RISC-V
Andes open cl for RISC-V
 
NodeJS : Communication and Round Robin Way
NodeJS : Communication and Round Robin WayNodeJS : Communication and Round Robin Way
NodeJS : Communication and Round Robin Way
 
Meetup Docker@Nuxeo - Build a Cloud Platform with Docker
Meetup Docker@Nuxeo - Build a Cloud Platform with DockerMeetup Docker@Nuxeo - Build a Cloud Platform with Docker
Meetup Docker@Nuxeo - Build a Cloud Platform with Docker
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
nuxt-en.pdf
nuxt-en.pdfnuxt-en.pdf
nuxt-en.pdf
 
How to Install and Use Kubernetes by Weaveworks
How to Install and Use Kubernetes by Weaveworks How to Install and Use Kubernetes by Weaveworks
How to Install and Use Kubernetes by Weaveworks
 
How to install and use Kubernetes
How to install and use KubernetesHow to install and use Kubernetes
How to install and use Kubernetes
 
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell ScruggsOrchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
Orchestration Tool Roundup - Arthur Berezin & Trammell Scruggs
 
Day in a life of a node.js developer
Day in a life of a node.js developerDay in a life of a node.js developer
Day in a life of a node.js developer
 
Day In A Life Of A Node.js Developer
Day In A Life Of A Node.js DeveloperDay In A Life Of A Node.js Developer
Day In A Life Of A Node.js Developer
 
IoT Node-Red Presentation
IoT  Node-Red PresentationIoT  Node-Red Presentation
IoT Node-Red Presentation
 
Ns tutorial
Ns tutorialNs tutorial
Ns tutorial
 
Introduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.comIntroduce about Nodejs - duyetdev.com
Introduce about Nodejs - duyetdev.com
 
Introduction to the Qt Quick Scene Graph
Introduction to the Qt Quick Scene GraphIntroduction to the Qt Quick Scene Graph
Introduction to the Qt Quick Scene Graph
 
High-speed Database Throughput Using Apache Arrow Flight SQL
High-speed Database Throughput Using Apache Arrow Flight SQLHigh-speed Database Throughput Using Apache Arrow Flight SQL
High-speed Database Throughput Using Apache Arrow Flight SQL
 
Introduction to ns3
Introduction to ns3Introduction to ns3
Introduction to ns3
 
Node.js primer for ITE students
Node.js primer for ITE studentsNode.js primer for ITE students
Node.js primer for ITE students
 
Ns 2 Network Simulator An Introduction
Ns 2 Network Simulator An IntroductionNs 2 Network Simulator An Introduction
Ns 2 Network Simulator An Introduction
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
 

Recently uploaded

Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Recently uploaded (20)

School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
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
 
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
 
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
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
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...
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
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
 
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
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 

Building Topology in NS3

  • 2. Point-To -Point Topology <Reading Code> Node-1 Node-2
  • 3. Flow Chart Create Node Attach NetDeive & Channel [NODES] Install Protocol Stack [NODES] Assign Ip Address [NETDEVICE] Install Application [NODES]
  • 4. Node ● Use to create NODE – To create NODE Object we use Node class with TEMPLATE function CreateObject<> & Reference Counting Smart Pointer Ptr<> Ptr<Node> n= CreateObject<Node>(); ● Use of Helper Class – To create Group of NODE we use NodeContainer NodeContainer nc; nc.Create(3);
  • 5. Channel & NetDevice ● It is a logical path over which information flows – To create Channel we use following classes:- ● WifiChannel ● CsmaChannel ● PointToPointChannel ● Etc... – To create NetDevice we use following classes:- ● WifiNetDevice ● CsmaNetDevice ● PointToPointNetDevice ● Etc...
  • 6. Channel & NetDevice ● Use of Helper Classes – We can use Helper Classes:- ● WifiHelper ● CsmaHelper ● PointToPointHelper ● Now ATTACH NetDevice & Channel – NetDeviceContainer device – device=pointTopoint.Install(NodeContainer); ● At this point we are done with :- – NODE – NetDevice – Channel Coupling of NetDevice with Channel NetDevice-0 NetDevice-1Point-to-point Channel Node-0 Node-1
  • 7. Internet Stack & Ipv4Address ● Now its time to install Protocol Stack – Helper Class ● InternetStackHelper i ● Now INSTALL protocol stack on Nodes – i.install(NodeContainer); ● Ipv4Address – Now associate the devices on our node with IP addresses ● Ipv4AddressHelper iaddr; ● Iaddr.SetBase(“10.1.1.0”,”255.255.255.0”); – Now assign this IP address to Nodes using Ipv4Interface object ● Ipv4InterfaceContainer iinter = iaddr.Assign(device) NetDevice-0 NetDevice-1Point-to-point Channel Node-0 Node-1 Internet Stack Internet Stack10.1.1.1/24 10.1.1.2/24
  • 8. Application ● Application abstract class – UdpEchoServerApplication – server application – UdpEchoClientApplication -client application ● We use Helper classes – UdpEchoServerHelper – UdpEchoClientHelper
  • 9. Server Application UdpEchoServerHelper server(9); – Set up a UDP echo server application on one of the node – Require the port number as a parameter to the constructor ApplicationContainer serApp; serApp.Install(nodes.Get(1)); servApp.Start(Seconds(1.0)); servApp.Stop(Seconds(10.0)); – Install server application on Node-1 NetDevice-0 NetDevice-1Point-to-point Channel Node-0 Node-1 Internet Stack Internet Stack10.1.1.1/24 10.1.1.2/24 Server App NetDevice-0 NetDevice-1Point-to-point Channel Node-0 Node-1 Internet Stack Internet Stack10.1.1.1/24 Server App
  • 10. Client Application UdpEchoClientHelper client(i.GetAddress(1),9); ● Pass parameter (to helper) to set the Remote Address and Remote port for for client to connect. ApplicationContainer clientApp =client.Install(nodes.Get(0)); clientApp.Start(Seconds(2.0)); clientApp.Stop(Seconds(9.0)); NetDevice-0 NetDevice-1Point-to-point Channel Node-0 Node-1 Internet Stack Internet Stack10.1.1.1/24 Server AppClient App 10.1.1.2/24
  • 11. Start Simulation Simulation::Run(); Simulation::Destroy(); return 0; NetDevice-0 NetDevice-1Point-to-point Channel Node-0 Node-1 Internet Stack Internet Stack Server AppClient App
  • 12. Running Example ● Copy program from example to scratch folder ● And run using following commands ● ./waf --run /scratch/first
  • 13. Simple Modification in Topology CODE ● Change following values:- ● NetDevice – DataRate – Delay ● UDP packet – MaxPacket – Interval – Packet Size
  • 14. ● What is the use of Helper Classes ? ● Why we use Container class ? ● Effect of Packet Size on Rx time @Server ?