SlideShare a Scribd company logo
2
Most read
3
Most read
5
Most read
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

PPTX
General Data Protection Regulations (GDPR): Do you understand it and are you ...
PPTX
Introduction to GDPR
PDF
Ccnp presentation [Day 1-3] Class
PPTX
Busbar protection LEC 1
PPTX
5G End to-end network slicing Demo
 
PPT
BUSBAR PROTECTION
PPT
Ip ran v1.1
General Data Protection Regulations (GDPR): Do you understand it and are you ...
Introduction to GDPR
Ccnp presentation [Day 1-3] Class
Busbar protection LEC 1
5G End to-end network slicing Demo
 
BUSBAR PROTECTION
Ip ran v1.1

What's hot (20)

PDF
Building Complex Topology using NS3
PDF
NS3 Overview
PDF
Tutorial ns 3-tutorial-slides
PDF
ns-3 Tutorial
PPTX
Presentation Routing algorithm
PDF
1 session installation
PPTX
PDF
Linux systems - Linux Commands and Shell Scripting
PDF
Ns3 implementation wifi
PDF
Wired and Wireless Examples in ns2
PPTX
Transport Layer Services : Multiplexing And Demultiplexing
PDF
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
PPTX
Broadcast NETWORK
PPTX
deadlock handling
PPTX
Ground to ns3 - Basic wireless topology implementation
PPTX
NTP Server - How it works?
PPT
Parallel computing
PPT
TCP congestion control
Building Complex Topology using NS3
NS3 Overview
Tutorial ns 3-tutorial-slides
ns-3 Tutorial
Presentation Routing algorithm
1 session installation
Linux systems - Linux Commands and Shell Scripting
Ns3 implementation wifi
Wired and Wireless Examples in ns2
Transport Layer Services : Multiplexing And Demultiplexing
Deploying CloudStack and Ceph with flexible VXLAN and BGP networking
Broadcast NETWORK
deadlock handling
Ground to ns3 - Basic wireless topology implementation
NTP Server - How it works?
Parallel computing
TCP congestion control
Ad

Viewers also liked (20)

PDF
Socio-technical System
PDF
Fundamental of Shell Programming
PDF
Software Engineering Introduction
PDF
Inheritance
ODP
Introduction to Virtualization
PDF
ns-3: History and Future
PDF
Network Simulation NS3
PDF
Introduction of Cloud Computing
PDF
Socket Programming using Java
PPTX
PDF
Support formobility
PPT
PPT
PDF
Mobile transportlayer
PPT
Quality planning
PDF
WLAN - IEEE 802.11
PDF
Mobile Network Layer
PDF
NS3 Tech Talk
PDF
WiMAX implementation in ns3
PPTX
Jammers&amp;anti jammers
Socio-technical System
Fundamental of Shell Programming
Software Engineering Introduction
Inheritance
Introduction to Virtualization
ns-3: History and Future
Network Simulation NS3
Introduction of Cloud Computing
Socket Programming using Java
Support formobility
Mobile transportlayer
Quality planning
WLAN - IEEE 802.11
Mobile Network Layer
NS3 Tech Talk
WiMAX implementation in ns3
Jammers&amp;anti jammers
Ad

Similar to Building Topology in NS3 (20)

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

Recently uploaded (20)

PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Lecture Notes Electrical Wiring System Components
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PPTX
Sustainable Sites - Green Building Construction
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPT
Project quality management in manufacturing
PPTX
web development for engineering and engineering
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
additive manufacturing of ss316l using mig welding
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
composite construction of structures.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
OOP with Java - Java Introduction (Basics)
Lecture Notes Electrical Wiring System Components
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Sustainable Sites - Green Building Construction
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Project quality management in manufacturing
web development for engineering and engineering
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Lesson 3_Tessellation.pptx finite Mathematics
additive manufacturing of ss316l using mig welding
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
composite construction of structures.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
UNIT 4 Total Quality Management .pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...

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 ?