SlideShare a Scribd company logo
1 of 67
Network Simulation with ns-3
Presenter: George Riley
Georgia Institute of Technology
Spring Simulation Conference
April 12, 2010
Overview
 Network Simulation Basics
 Survey of Network Simulation Tools
 Ns-3Details
 “Frameworks” for Ns-3
 Questions
Network Simulation Basics - 1
 Discrete Event Simulation
◦ Events model packet transmission,
receipt, timers, etc.
◦ Future events maintained in sorted Event
List
◦ Processing events results in zero or more
new events
 Packet transmit event generates a future
packet receipt event at next hop
3
Network Simulation Basics - 2
 Create Topology
◦ Nodes, Links, Queues, Routing, etc.
 Create Data Demand on Network
◦ Web Browsers, FTP transfers, Peer-to-
Peer Searching and Downloads, On--Off
Data Sources, etc.
 Run the Simulation
 Analyze Results
4
Network Simulation Basics - 3
5
TCP Client 1
TCP Client 2
TCP Server 1
TCP Server 2
100 Mbps, 5ms
100 Mbps, 5ms
100 Mbps, 5ms
100 Mbps, 5ms
10 Mbps, 20ms
Network “Events”
Simulated Packets
Network “Models”
 Network “Nodes”
◦ End-Systems, Routers, Hubs, NATs
◦ What should a node contain?
 Applications – (How much detail?)
◦ Produce “data demand” on the simulated
network
◦ Bulk TCP Transfer (very common)
◦ TCP/UDP “On-Off” application
◦ Web Browsing
◦ Peer to Peer File Transfers
◦ Video Streaming
◦ VOIP
◦ Chat
Network “Models” Continued
 Protocols
◦ TCP-UDP-IPV4-IPV6
 How much detail? Checksums?
 Socket interface?
 Blocking vs. Non-Blocking
 Finite vs. Infinite buffers
◦ Routing Protocols (Not always
used/needed)
 BGP – OSPF – EIGRP – OLSR – DSR – AODV
◦ Multicast Protocols
 PIM-SM/DM - DVMRP
Network “Models” Continued
 Packets
◦ How much detail?
◦ Real Data or “Dummy”
◦ Abstract or array of bytes?
 Routers and Queuing
◦ Output Queues / Input Queues
◦ Route Lookup Delays
◦ Fast-Path
◦ Routing Table Representation
◦ Queuing methods
 DropTail, Red, Priority
Network “Models” Continued
 Network Interfaces
◦ Wired/Wireless
◦ Layer 2 protocols
 802.3, 802.11
 Links
◦ Ethernet (10/100/1000Mb)
 Physical location of each station?
◦ Point-to-Point
◦ Wireless
 How much detail in PHY layer
 Mobility Models
◦ Random Waypoint – Random Walk – Specific
Waypoint - Swarming
Analyzing Results
 Trace File
◦ Log every packet receipt, transmit, queue,
drop
 Built-in Statistics Gathering
◦ Link Utilization, Queue Occupancy,
Throughput, Loss Rate
 Custom Tracing
◦ User specifies which packets/links/nodes
to trace
 Reduces size of trace file and post-analysis
time
Distributed Simulation
Remote Link Remote Link
Simulator A Simulator B
Network Emulation
Simulation Tools
 Venerable ns-2
◦ Original “design” by Steve McCanne
◦ TCP/C++ Hybrid
◦ Open Source
 Numerous contributions
 Hundreds of models
◦ De-facto Standard in Academic Research
 Georgia Tech Network Simulator
(GTNetS)
◦ Completely C++
◦ Designed for Distributed Simulation
 Scalable to more than 1 Million Network Elements
 BGP++ model of BGP (based on Zebra open
source)
Simulation Tools - Continued
 OPNET
◦ Commercial, closed source tool
◦ De-facto standard in Military and DoD
programs
◦ Full-Featured, nice GUI
◦ Sophisticated Data Analysis features
 Qualnet
◦ Commercial, closed source
◦ Competes primarily with OPNET
 Strengths are in wireless models and protocols
 Scalability
◦ Based on public-domain “GloMoSim” tools
Simulation Tools - Continued
 SSFNet
◦ Both Java and C++ versions
◦ Designed for “parallel” simulation
 Shared Memory multiprocessor
◦ Originally developed at Dartmouth
 Now supported at UIUC
 OMNet++
◦ C++ engine
◦ Very popular in European Community
The NS-3 Team
 Partially funded by US NSF “Community Resource
Initiative (CRI) grant
 Two Co-Principal Investigators
◦ Tom Henderson (Boeing/UW)
◦ George Riley (Georgia Tech)
 Other PI’s
◦ Sally Floyd (ICSI)
◦ Sumit Roy (UW)
 Two full-time staff
◦ Craig Dowell (UW)
◦ Josh Pelkey(GT)
 Numerous Volunteers
◦ Matthew Lacage, INRIA France
◦ Gustavo Carniero, Spain
◦ Joe Kopena, Grad Student, Drexel University
NS-3 Focus Areas
- Core:
 Scalability improvements,
 Modularity,
 class design for realism and abstraction
◦ Integration
 Use of outside software, emulation, and virtualization
◦ Wireless
 Wi-Fi, cellular, small mobile devices
◦ Education
 Animation, educational scripts, integration with
courseware and projects
◦ Maintenance
 Validation, documentation, distribution, project
management
wns-3 March 2010
http
://w
ww.
nsn
am.
org
NS-3 Key Features
 Flexible Event Scheduler
◦ Any member function on any object can be an event handler, with
arbitrary parameter lists
 Trace output in ascii, or Pcap format
◦ Use existing Pcap tools (eg. Wireshark)
 Numerous trace points enabled via callbacks
 Python Bindings for most Public Functions
 Emulation mode
◦ Integration with real networks/packets
◦ Real-Time Scheduler
 Doxygen documentation
 Mercurial Code Repository
 Formal review/check-in procedure
 Quarterly releases
wns-3 March 2010
http
://w
ww.
nsn
am.
org
NS-3 Key Design Decisions
 Use of “smart pointers” to ease memory
management burden on code developers
 Use of “object aggregation”, to allow extension of
object functionality without adding additional virtual
functions to base class.
◦ Similar to Microsoft “Component Object Model”
 Integrated tracing frame work based on type-safe
callbacks
 Simulation event scheduling on arbitrary functions
with arbitrary argument lists
 Packet objects manage sequential array of bytes
with helper functions to add/remove headers and
data
wns-3 March 2010
http
://w
ww.
nsn
am.
org
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Features in Recent Releases
 Four releases (ns-3.4 through ns-3.7)
ns-3.4: Apr 2009:
- Tap Device
- Object names
- new Wifi models
- calendar queue
scheduler
- allinone build
system
ns-3.5: July 2009:
- 802.11e MAC EDCA
- 802.11n A-MSDU
frame aggregation
- 802.11b PHY
- Nakagami loss
- Gamma, Erlang,
Zipf random variables
ns-3.6: Oct 2009:
- Minstrel rate control
- WiFi Athstats and
5/10MHz channels
- IPv6 radvd, ICMP
- 802.11s mesh
- Nix-vector routing
- Flow Monitor
ns-3.7: Jan 2010:
- 802.11p PHY
- AODV
- Waypoint mobility
- NetAnim
- IPv6 Extension and
Option headers
Google Summer of Code
Three student projects
NS-3.8 Release Details
 Estimated release date, April 27
 8 new features merged
1) WiMAX
 Provide an accurate MAC and PHY level
implementation of the 802.16 specification
 Point-to-Multipoint (PMP) mode and
WirelessMAN-OFDM PHY
 Consists of convergence sublayer, MAC
common part sublayer, physical layer
wns-3 March 2010
http
://w
ww.
nsn
am.
org
NS-3.8 Release Details
2) Distributed simulation with MPI
 Allows distributed simulation along point-to-
point links
 Interfaces with MPI to support inter-process
communication
3) 802.11n block ACK
 Implement 802.11n compressed block ACK
mechanism
4) Topology read system
 Reads Inet and Orbis formats
 Generates large point-to-point topologies
easily
wns-3 March 2010
http
://w
ww.
nsn
am.
org
NS-3.8 Release Details
5) Gauss-Markov Mobility Model
 3-D adaptation of the Gauss-Markov
mobility model
 Model contains both memory and variability
6) Steady state random waypoint mobility
model
 Based on random waypoint mobility (RWM)
model
 Initial values are not from uniform
distribution but from stationary distribution
of RWM model
wns-3 March 2010
http
://w
ww.
nsn
am.
org
NS-3.8 Release Details
7) Two ray ground radio propagation model
 Ported from ns-2
8) Matrix propagation loss model
 Uses two-dimensional matrix of pathloss
indexed by source and destination nodes
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Google Summer of Code, 2010
Projects
 Click Modular Router Integration
◦ Software architecture for building flexible and
configurable routers
◦ Widely used in research
◦ Exists in ns-2
 Network Simulation Cradle for IPv4
◦ Last year during GSoC, successfully ported NSC
◦ NSC allows Linux TCP code over ns-3's IPv4
stack
◦ This extends the effort to completely port the
Linux TCP/IPv4 stack
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Google Summer of Code, 2010
Projects
 EMULAB Support and Integration
◦ Attempt to emulate ns-3 and Emulab
◦ Investigate whether Emulab scripting could be
moved to Python/ns-3
◦ Or whether ns-3 simulations need to generate Tcl
for Emulab and attempt to do this integration
 Satellite networks
◦ Investigate the architecture needed to support
ETSI-BSM interfaces
◦ Implement simple satellite return links, like bent-
pipe and basic DVB-RCS
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Google Summer of Code, 2010
Projects
 Cognitive Networks
◦ Implement routing protocols for cognitive
networks
 3GPP Long Term Evolution (LTE)
◦ Focus on the implementation of a subset of the
functionality of LTE
 Underwater acoustic network (UAN)
framework
◦ Extend the currently proposed UAN modules to
support a wider variety of common underwater
networking scenarios
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Google Summer of Code, 2010
Projects
 TCP Validation
◦ Review ns-3 TCP implementations and testing
them for conformance to RFC 5681
◦ Implement a test suite that will ensure that ns-3's
TCP implementation is accurate
 TCP Congestion Avoidance
◦ Implement different congestion control algorithms
◦ Reno, Westwood, Vegas, Cubic, etc.
wns-3 March 2010
http
://w
ww.
nsn
am.
org
NS-3.9 Tentative Information
 Estimated release data, July 27
 Possible New Features
◦ Underwater Acoustic Network Device
◦ Network Address Translation
◦ Spectrum framework
◦ Wireless animation
◦ Distributed wireless simulation
◦ TCP work
wns-3 March 2010
http
://w
ww.
nsn
am.
org
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Growth of NS-3
 Lines of C++ code (wc src/ directory)
◦ ns-3.4: 110,000
◦ ns-3.8: 250,000
 Release downloads:
◦ Jan 2009: 1700
◦ Jan 2010: 10,300
 Authors
◦ ns-3.4: 27
◦ ns-3.8: 55
 New maintainers
◦ Josh Pelkey, Pavel Boyko, Kirill Andreev,
Sebastien Vincent
ns-3 users subscriber count
NS-3 Basics
 Written completely in C++
◦ Heavy use of Templates
◦ C++ Namespace (ns3)
 Simulation programs are C++
executables
 Python bindings for public API’s provided
 NS-3 uses the “waf” build system
◦ Instead of ./configure; make use
◦ ./waf
 Builds a dynamic library
 Both a debug and optimized version
The Basic NS-3 Data Flow
Model
Application
Application
Protocol
stack
Node
NetDevice
NetDevice
Application
Application
Protocol
stack
Node
NetDevice
NetDevice
Sockets-like
API
Channel
Channel
Packet(s)
NS-3 Node Structure
Application
Application
Application
A Node is a husk of a computer to which
applications, stacks, and NICs are
added
NS-3 Node Object
Two key abstractions are maintained:
1) applications use an (asynchronous, for
now) sockets API
2) the boundary between IP and layer 2
mimics the boundary at the device-
independent sub-layer in Linux
i.e., Linux Packet Sockets
NS-3 Net Devices and
Channels
WifiNetDevice
WifiChannel
Net Devices are strongly bound to Channe
of a matching type
NS-3 Packets
 Each NS-3 Packet contains
◦ Byte buffer with packet data
 Protocol Headers
 Optional Data Payload
 Suitable for sending on an actual network as is.
◦ Packet Tags
 Format and Type-free “extra” information about the
packet
 Eg. A Flow Identifier
◦ Packet Meta-Data
 Enables packets to “print themselves”
 Implemented with Smart Pointers and
Copy-on-Write Semantics
NS-3 Smart Pointers
• ns-3 uses reference-counting smart
pointers at its APIs to limit memory leaks
– Or “pass by value” or “pass by reference to
const” where appropriate
• A “smart pointer” behaves like a normal
pointer (syntax) but does not lose memory
when reference count goes to zero
• Use them like built-in pointers:
Ptr<MyClass> p = CreateObject<MyClass> ();
p->method ();
NS-3 Validation
• Can you trust ns-3 simulations?
– Can you trust any simulation?
– Onus is on the researcher to verify results
• ns-3 strategies:
– Open source benefits
– Validation of models on testbeds
– Reuse of code
– Unit tests
– Event driven validation tests
wns-3 March 2010
http
://w
ww.
nsn
am.
org
New NSF award: “Frameworks
for ns-3”
 Four years, awarded on 3 March 2010
 PIs/groups involved:
◦ Univ. of Washington (Tom Henderson)
◦ Georgia Tech. (George Riley)
◦ Bucknell University (Felipe Perrone)
 Scope:
◦ Automation frameworks
◦ Scenario management
◦ Education
◦ Software maintenance
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Frameworks for ns-3
 What do we mean by frameworks?
◦ Extensions to ns-3 outside of the core and models
◦ Helping users with their workflow
Problem
Definition
Modeling Experiment
Definition
Scenario
Generation
ns-3
execution
Optional: Connections to
NICs or to virtual machines (VMs)
Execution manager
Framework to
manage hybrid
ns-3/testbed/VM
experiments
Educational
script library
Output data
management
Iterate as needed
Visualization
Animation
wns-3 March 2010
http
://w
ww.
nsn
am.
org
Future project directions
 Google Summer of Code 2010
 Upcoming ns-3 major merges
◦ ns-3-simu
◦ ns-3 parallel (shared memory)
 Considering a U.S.-based workshop in
late summer
NS-3 Summary
• ns-3 is an emerging simulator to replace ns-2
• Consider ns-3 if you are interested in:
– Open source and collaboration
– More faithful representations of real computers and
the Internet
– Integration with testbeds
– A powerful low-level API
– Python scripting
• ns-3 needs you!
wns-3 March 2010 44
http
://w
ww.
nsn
am.
org
Resources
Web site:
http://www.nsnam.org
Mailing list:
http://mailman.isi.edu/mailman/listinfo/ns-developers
IRC: #ns-3 at freenode.net
Tutorial:
http://www.nsnam.org/docs/tutorial/tutorial.html
Code server:
http://code.nsnam.org
Wiki:
http://www.nsnam.org/wiki/index.php/Main_Page
Questions?
Modeling the PHY Channel
 Experimental Evaluation of Wireless
Assumptions
◦ Kotz et. al, MSWiM 2004
 Link-Level Measurements from an
802.11b Mesh Network
◦ Aguayo et. al, SIGCOMM 2004
 Measurement-Based Physical Layer
Modeling for Wireless Network
Simulations
◦ Reddy et. al, Mascots 2007
46
PHY Layer Models
Free-Space (Friis) Model
 Pr(d) = Received Power
 d = Distance
 Pt = Transmit Power
 Gt = Antenna Gain at Transmitter
 Gr = Antenna Gain at Receiver
 λ = Wavelength
 L = “System Loss” (L >= 1)
47
PHY Layer Models
Two-Ray Ground Reflection Model
 ht = Height of transmitter
 hr = Height of receiver
 dc = Crossover Distance
◦ Use above only if d> dc
48
PHY Layer Models
Shadowing Model
 d0 = “Close-in Distance”
 β = Path loss exponent
 XdB = Log-Normal Random
Variable
49
Kotz – Wireless Assumptions
 The world is flat
 Radio transmission range is circular
 All radios have equal range
 If I can hear you, you can hear me
◦ Symmetry
 If I can hear you at all, I can hear you
perfectly
 Signal strength is a simple function of
distance
50
Kotz – Antenna Angle
51
Kotz – Conditional Rx Probability
52
Kotz – Rx Probability vs.
Distance
53
Kotz – Rx Signal Strength
54
Aguayo - Cambridge Roofnet Map
55
Packet Delivery Map 1
56
Packet Delivery Map 2
57
Packet Delivery Map 3
58
Delivery Fraction
59
Effect of “Foreign Packets”
60
Reddy – Measurement Study
 Single base station, sending constant beacons
 Single laptop receiver, at varying distances from the base
station
 Garmin V GPS on the laptop, reporting position
 Two different wireless chip sets
◦ RaLink
◦ Atheros
 Hack Linux drivers to record retry statistics and received
signal strength indications
 Disable rate adaptation algorithms
 High RTS threshold to disable RTS/CTS exchange
 Constant Tx power of 20dBm
 Operate in IEEE 802.11 Channel 16
61
Reddy – Mobility Pattern
62
Reddy – RSS Measurement
Results
63
Reddy – Results (Antenna
Angle)
64
Reddy – Measurement, Average
RSS
65
PHY Layer Models
Stochastic
 Compute Pr(d) (Sk(t)) with Friis Model
 Choose uniform random variable,
packet error proportional to SNIR(k,t) 66
Questions

More Related Content

What's hot

1 session installation
1 session installation1 session installation
1 session installationRahul Hada
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3Rahul Hada
 
Building Complex Topology using NS3
Building Complex Topology using NS3Building Complex Topology using NS3
Building Complex Topology using NS3Rahul Hada
 
Link Capacity Estimation in SDN-based End-hosts
Link Capacity Estimation in SDN-based End-hostsLink Capacity Estimation in SDN-based End-hosts
Link Capacity Estimation in SDN-based End-hostsFarzaneh Pakzad
 
Notes from 2016 bay area deep learning school
Notes from 2016 bay area deep learning school Notes from 2016 bay area deep learning school
Notes from 2016 bay area deep learning school Niketan Pansare
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2amreshrai02
 
Pyretic - A new programmer friendly language for SDN
Pyretic - A new programmer friendly language for SDNPyretic - A new programmer friendly language for SDN
Pyretic - A new programmer friendly language for SDNnvirters
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 2
Building the Internet of Things with Thingsquare and Contiki - day 2 part 2Building the Internet of Things with Thingsquare and Contiki - day 2 part 2
Building the Internet of Things with Thingsquare and Contiki - day 2 part 2Adam Dunkels
 
Capturando pacotes de rede no kernelspace
Capturando pacotes de rede no kernelspaceCapturando pacotes de rede no kernelspace
Capturando pacotes de rede no kernelspaceCampus Party Brasil
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Adam Dunkels
 
Network emulator
Network emulatorNetwork emulator
Network emulatorjeromy fu
 
Beyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocolsBeyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocolsOlivier Bonaventure
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Adam Dunkels
 
Introduction to OpenNet
Introduction to OpenNetIntroduction to OpenNet
Introduction to OpenNetrascov
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic ControlSUSE Labs Taipei
 
Differences of Deep Learning Frameworks
Differences of Deep Learning FrameworksDifferences of Deep Learning Frameworks
Differences of Deep Learning FrameworksSeiya Tokui
 

What's hot (20)

1 session installation
1 session installation1 session installation
1 session installation
 
NS3 Overview
NS3 OverviewNS3 Overview
NS3 Overview
 
Building Topology in NS3
Building Topology in NS3Building Topology in NS3
Building Topology in NS3
 
NS3 Tech Talk
NS3 Tech TalkNS3 Tech Talk
NS3 Tech Talk
 
Building Complex Topology using NS3
Building Complex Topology using NS3Building Complex Topology using NS3
Building Complex Topology using NS3
 
Link Capacity Estimation in SDN-based End-hosts
Link Capacity Estimation in SDN-based End-hostsLink Capacity Estimation in SDN-based End-hosts
Link Capacity Estimation in SDN-based End-hosts
 
Notes from 2016 bay area deep learning school
Notes from 2016 bay area deep learning school Notes from 2016 bay area deep learning school
Notes from 2016 bay area deep learning school
 
NS3 Simulation Research Guidance
NS3 Simulation Research GuidanceNS3 Simulation Research Guidance
NS3 Simulation Research Guidance
 
Protocol implementation on NS2
Protocol implementation on NS2Protocol implementation on NS2
Protocol implementation on NS2
 
Pyretic - A new programmer friendly language for SDN
Pyretic - A new programmer friendly language for SDNPyretic - A new programmer friendly language for SDN
Pyretic - A new programmer friendly language for SDN
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 2
Building the Internet of Things with Thingsquare and Contiki - day 2 part 2Building the Internet of Things with Thingsquare and Contiki - day 2 part 2
Building the Internet of Things with Thingsquare and Contiki - day 2 part 2
 
Capturando pacotes de rede no kernelspace
Capturando pacotes de rede no kernelspaceCapturando pacotes de rede no kernelspace
Capturando pacotes de rede no kernelspace
 
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
Building the Internet of Things with Thingsquare and Contiki - day 2 part 1
 
Network emulator
Network emulatorNetwork emulator
Network emulator
 
Beyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocolsBeyond TCP: The evolution of Internet transport protocols
Beyond TCP: The evolution of Internet transport protocols
 
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
Advanced Internet of Things firmware engineering with Thingsquare and Contiki...
 
Introduction to OpenNet
Introduction to OpenNetIntroduction to OpenNet
Introduction to OpenNet
 
Ns2
Ns2Ns2
Ns2
 
Linux Linux Traffic Control
Linux Linux Traffic ControlLinux Linux Traffic Control
Linux Linux Traffic Control
 
Differences of Deep Learning Frameworks
Differences of Deep Learning FrameworksDifferences of Deep Learning Frameworks
Differences of Deep Learning Frameworks
 

Similar to Spring sim 2010-riley

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
 
Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3Farzaneh Pakzad
 
Introduction to OSI and QUIC
Introduction to OSI and QUICIntroduction to OSI and QUIC
Introduction to OSI and QUICFarzad Soltani
 
Plenzogan technology
Plenzogan technologyPlenzogan technology
Plenzogan technologyplenzogan
 
Addressing Network Operator Challenges in YANG push Data Mesh Integration
Addressing Network Operator Challenges in YANG push Data Mesh IntegrationAddressing Network Operator Challenges in YANG push Data Mesh Integration
Addressing Network Operator Challenges in YANG push Data Mesh IntegrationThomasGraf42
 
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
 
preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...jeronimored
 
preKnowledge-InternetNetworking.ppt
preKnowledge-InternetNetworking.pptpreKnowledge-InternetNetworking.ppt
preKnowledge-InternetNetworking.pptabdullahalamin69
 
Wayne Quadros-Resume
Wayne Quadros-ResumeWayne Quadros-Resume
Wayne Quadros-ResumeWayne Quadros
 
JesusLopez-VitaeCurricular2016
JesusLopez-VitaeCurricular2016JesusLopez-VitaeCurricular2016
JesusLopez-VitaeCurricular2016Jesus Lopez
 
Introduction to NBL
Introduction to NBLIntroduction to NBL
Introduction to NBLFei Ji Siao
 
Lecture 1 networking &amp; internetworking
Lecture 1 networking &amp; internetworkingLecture 1 networking &amp; internetworking
Lecture 1 networking &amp; internetworkingMd. Mashiur Rahman
 

Similar to Spring sim 2010-riley (20)

June 28 Presentation
June 28 PresentationJune 28 Presentation
June 28 Presentation
 
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
 
Gurpinder_Resume
Gurpinder_ResumeGurpinder_Resume
Gurpinder_Resume
 
Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3Evaluation of mininet WiFi integration via ns-3
Evaluation of mininet WiFi integration via ns-3
 
Introduction to OSI and QUIC
Introduction to OSI and QUICIntroduction to OSI and QUIC
Introduction to OSI and QUIC
 
Plenzogan technology
Plenzogan technologyPlenzogan technology
Plenzogan technology
 
Addressing Network Operator Challenges in YANG push Data Mesh Integration
Addressing Network Operator Challenges in YANG push Data Mesh IntegrationAddressing Network Operator Challenges in YANG push Data Mesh Integration
Addressing Network Operator Challenges in YANG push Data Mesh Integration
 
Ccna day1
Ccna day1Ccna day1
Ccna day1
 
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
 
Ccna day1
Ccna day1Ccna day1
Ccna day1
 
Ccna day1
Ccna day1Ccna day1
Ccna day1
 
C C N A Day1
C C N A  Day1C C N A  Day1
C C N A Day1
 
Ccna introduction
Ccna introductionCcna introduction
Ccna introduction
 
TransPAC3/ACE Measurement & PerfSONAR Update
TransPAC3/ACE Measurement & PerfSONAR UpdateTransPAC3/ACE Measurement & PerfSONAR Update
TransPAC3/ACE Measurement & PerfSONAR Update
 
preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...preKnowledge-InternetNetworking Android's mobile operating system is based on...
preKnowledge-InternetNetworking Android's mobile operating system is based on...
 
preKnowledge-InternetNetworking.ppt
preKnowledge-InternetNetworking.pptpreKnowledge-InternetNetworking.ppt
preKnowledge-InternetNetworking.ppt
 
Wayne Quadros-Resume
Wayne Quadros-ResumeWayne Quadros-Resume
Wayne Quadros-Resume
 
JesusLopez-VitaeCurricular2016
JesusLopez-VitaeCurricular2016JesusLopez-VitaeCurricular2016
JesusLopez-VitaeCurricular2016
 
Introduction to NBL
Introduction to NBLIntroduction to NBL
Introduction to NBL
 
Lecture 1 networking &amp; internetworking
Lecture 1 networking &amp; internetworkingLecture 1 networking &amp; internetworking
Lecture 1 networking &amp; internetworking
 

Spring sim 2010-riley

  • 1. Network Simulation with ns-3 Presenter: George Riley Georgia Institute of Technology Spring Simulation Conference April 12, 2010
  • 2. Overview  Network Simulation Basics  Survey of Network Simulation Tools  Ns-3Details  “Frameworks” for Ns-3  Questions
  • 3. Network Simulation Basics - 1  Discrete Event Simulation ◦ Events model packet transmission, receipt, timers, etc. ◦ Future events maintained in sorted Event List ◦ Processing events results in zero or more new events  Packet transmit event generates a future packet receipt event at next hop 3
  • 4. Network Simulation Basics - 2  Create Topology ◦ Nodes, Links, Queues, Routing, etc.  Create Data Demand on Network ◦ Web Browsers, FTP transfers, Peer-to- Peer Searching and Downloads, On--Off Data Sources, etc.  Run the Simulation  Analyze Results 4
  • 5. Network Simulation Basics - 3 5 TCP Client 1 TCP Client 2 TCP Server 1 TCP Server 2 100 Mbps, 5ms 100 Mbps, 5ms 100 Mbps, 5ms 100 Mbps, 5ms 10 Mbps, 20ms
  • 7. Network “Models”  Network “Nodes” ◦ End-Systems, Routers, Hubs, NATs ◦ What should a node contain?  Applications – (How much detail?) ◦ Produce “data demand” on the simulated network ◦ Bulk TCP Transfer (very common) ◦ TCP/UDP “On-Off” application ◦ Web Browsing ◦ Peer to Peer File Transfers ◦ Video Streaming ◦ VOIP ◦ Chat
  • 8. Network “Models” Continued  Protocols ◦ TCP-UDP-IPV4-IPV6  How much detail? Checksums?  Socket interface?  Blocking vs. Non-Blocking  Finite vs. Infinite buffers ◦ Routing Protocols (Not always used/needed)  BGP – OSPF – EIGRP – OLSR – DSR – AODV ◦ Multicast Protocols  PIM-SM/DM - DVMRP
  • 9. Network “Models” Continued  Packets ◦ How much detail? ◦ Real Data or “Dummy” ◦ Abstract or array of bytes?  Routers and Queuing ◦ Output Queues / Input Queues ◦ Route Lookup Delays ◦ Fast-Path ◦ Routing Table Representation ◦ Queuing methods  DropTail, Red, Priority
  • 10. Network “Models” Continued  Network Interfaces ◦ Wired/Wireless ◦ Layer 2 protocols  802.3, 802.11  Links ◦ Ethernet (10/100/1000Mb)  Physical location of each station? ◦ Point-to-Point ◦ Wireless  How much detail in PHY layer  Mobility Models ◦ Random Waypoint – Random Walk – Specific Waypoint - Swarming
  • 11. Analyzing Results  Trace File ◦ Log every packet receipt, transmit, queue, drop  Built-in Statistics Gathering ◦ Link Utilization, Queue Occupancy, Throughput, Loss Rate  Custom Tracing ◦ User specifies which packets/links/nodes to trace  Reduces size of trace file and post-analysis time
  • 12. Distributed Simulation Remote Link Remote Link Simulator A Simulator B
  • 14. Simulation Tools  Venerable ns-2 ◦ Original “design” by Steve McCanne ◦ TCP/C++ Hybrid ◦ Open Source  Numerous contributions  Hundreds of models ◦ De-facto Standard in Academic Research  Georgia Tech Network Simulator (GTNetS) ◦ Completely C++ ◦ Designed for Distributed Simulation  Scalable to more than 1 Million Network Elements  BGP++ model of BGP (based on Zebra open source)
  • 15. Simulation Tools - Continued  OPNET ◦ Commercial, closed source tool ◦ De-facto standard in Military and DoD programs ◦ Full-Featured, nice GUI ◦ Sophisticated Data Analysis features  Qualnet ◦ Commercial, closed source ◦ Competes primarily with OPNET  Strengths are in wireless models and protocols  Scalability ◦ Based on public-domain “GloMoSim” tools
  • 16. Simulation Tools - Continued  SSFNet ◦ Both Java and C++ versions ◦ Designed for “parallel” simulation  Shared Memory multiprocessor ◦ Originally developed at Dartmouth  Now supported at UIUC  OMNet++ ◦ C++ engine ◦ Very popular in European Community
  • 17. The NS-3 Team  Partially funded by US NSF “Community Resource Initiative (CRI) grant  Two Co-Principal Investigators ◦ Tom Henderson (Boeing/UW) ◦ George Riley (Georgia Tech)  Other PI’s ◦ Sally Floyd (ICSI) ◦ Sumit Roy (UW)  Two full-time staff ◦ Craig Dowell (UW) ◦ Josh Pelkey(GT)  Numerous Volunteers ◦ Matthew Lacage, INRIA France ◦ Gustavo Carniero, Spain ◦ Joe Kopena, Grad Student, Drexel University
  • 18. NS-3 Focus Areas - Core:  Scalability improvements,  Modularity,  class design for realism and abstraction ◦ Integration  Use of outside software, emulation, and virtualization ◦ Wireless  Wi-Fi, cellular, small mobile devices ◦ Education  Animation, educational scripts, integration with courseware and projects ◦ Maintenance  Validation, documentation, distribution, project management wns-3 March 2010 http ://w ww. nsn am. org
  • 19. NS-3 Key Features  Flexible Event Scheduler ◦ Any member function on any object can be an event handler, with arbitrary parameter lists  Trace output in ascii, or Pcap format ◦ Use existing Pcap tools (eg. Wireshark)  Numerous trace points enabled via callbacks  Python Bindings for most Public Functions  Emulation mode ◦ Integration with real networks/packets ◦ Real-Time Scheduler  Doxygen documentation  Mercurial Code Repository  Formal review/check-in procedure  Quarterly releases wns-3 March 2010 http ://w ww. nsn am. org
  • 20. NS-3 Key Design Decisions  Use of “smart pointers” to ease memory management burden on code developers  Use of “object aggregation”, to allow extension of object functionality without adding additional virtual functions to base class. ◦ Similar to Microsoft “Component Object Model”  Integrated tracing frame work based on type-safe callbacks  Simulation event scheduling on arbitrary functions with arbitrary argument lists  Packet objects manage sequential array of bytes with helper functions to add/remove headers and data wns-3 March 2010 http ://w ww. nsn am. org
  • 21. wns-3 March 2010 http ://w ww. nsn am. org Features in Recent Releases  Four releases (ns-3.4 through ns-3.7) ns-3.4: Apr 2009: - Tap Device - Object names - new Wifi models - calendar queue scheduler - allinone build system ns-3.5: July 2009: - 802.11e MAC EDCA - 802.11n A-MSDU frame aggregation - 802.11b PHY - Nakagami loss - Gamma, Erlang, Zipf random variables ns-3.6: Oct 2009: - Minstrel rate control - WiFi Athstats and 5/10MHz channels - IPv6 radvd, ICMP - 802.11s mesh - Nix-vector routing - Flow Monitor ns-3.7: Jan 2010: - 802.11p PHY - AODV - Waypoint mobility - NetAnim - IPv6 Extension and Option headers Google Summer of Code Three student projects
  • 22. NS-3.8 Release Details  Estimated release date, April 27  8 new features merged 1) WiMAX  Provide an accurate MAC and PHY level implementation of the 802.16 specification  Point-to-Multipoint (PMP) mode and WirelessMAN-OFDM PHY  Consists of convergence sublayer, MAC common part sublayer, physical layer wns-3 March 2010 http ://w ww. nsn am. org
  • 23. NS-3.8 Release Details 2) Distributed simulation with MPI  Allows distributed simulation along point-to- point links  Interfaces with MPI to support inter-process communication 3) 802.11n block ACK  Implement 802.11n compressed block ACK mechanism 4) Topology read system  Reads Inet and Orbis formats  Generates large point-to-point topologies easily wns-3 March 2010 http ://w ww. nsn am. org
  • 24. NS-3.8 Release Details 5) Gauss-Markov Mobility Model  3-D adaptation of the Gauss-Markov mobility model  Model contains both memory and variability 6) Steady state random waypoint mobility model  Based on random waypoint mobility (RWM) model  Initial values are not from uniform distribution but from stationary distribution of RWM model wns-3 March 2010 http ://w ww. nsn am. org
  • 25. NS-3.8 Release Details 7) Two ray ground radio propagation model  Ported from ns-2 8) Matrix propagation loss model  Uses two-dimensional matrix of pathloss indexed by source and destination nodes wns-3 March 2010 http ://w ww. nsn am. org
  • 26. Google Summer of Code, 2010 Projects  Click Modular Router Integration ◦ Software architecture for building flexible and configurable routers ◦ Widely used in research ◦ Exists in ns-2  Network Simulation Cradle for IPv4 ◦ Last year during GSoC, successfully ported NSC ◦ NSC allows Linux TCP code over ns-3's IPv4 stack ◦ This extends the effort to completely port the Linux TCP/IPv4 stack wns-3 March 2010 http ://w ww. nsn am. org
  • 27. Google Summer of Code, 2010 Projects  EMULAB Support and Integration ◦ Attempt to emulate ns-3 and Emulab ◦ Investigate whether Emulab scripting could be moved to Python/ns-3 ◦ Or whether ns-3 simulations need to generate Tcl for Emulab and attempt to do this integration  Satellite networks ◦ Investigate the architecture needed to support ETSI-BSM interfaces ◦ Implement simple satellite return links, like bent- pipe and basic DVB-RCS wns-3 March 2010 http ://w ww. nsn am. org
  • 28. Google Summer of Code, 2010 Projects  Cognitive Networks ◦ Implement routing protocols for cognitive networks  3GPP Long Term Evolution (LTE) ◦ Focus on the implementation of a subset of the functionality of LTE  Underwater acoustic network (UAN) framework ◦ Extend the currently proposed UAN modules to support a wider variety of common underwater networking scenarios wns-3 March 2010 http ://w ww. nsn am. org
  • 29. Google Summer of Code, 2010 Projects  TCP Validation ◦ Review ns-3 TCP implementations and testing them for conformance to RFC 5681 ◦ Implement a test suite that will ensure that ns-3's TCP implementation is accurate  TCP Congestion Avoidance ◦ Implement different congestion control algorithms ◦ Reno, Westwood, Vegas, Cubic, etc. wns-3 March 2010 http ://w ww. nsn am. org
  • 30. NS-3.9 Tentative Information  Estimated release data, July 27  Possible New Features ◦ Underwater Acoustic Network Device ◦ Network Address Translation ◦ Spectrum framework ◦ Wireless animation ◦ Distributed wireless simulation ◦ TCP work wns-3 March 2010 http ://w ww. nsn am. org
  • 31. wns-3 March 2010 http ://w ww. nsn am. org Growth of NS-3  Lines of C++ code (wc src/ directory) ◦ ns-3.4: 110,000 ◦ ns-3.8: 250,000  Release downloads: ◦ Jan 2009: 1700 ◦ Jan 2010: 10,300  Authors ◦ ns-3.4: 27 ◦ ns-3.8: 55  New maintainers ◦ Josh Pelkey, Pavel Boyko, Kirill Andreev, Sebastien Vincent ns-3 users subscriber count
  • 32. NS-3 Basics  Written completely in C++ ◦ Heavy use of Templates ◦ C++ Namespace (ns3)  Simulation programs are C++ executables  Python bindings for public API’s provided  NS-3 uses the “waf” build system ◦ Instead of ./configure; make use ◦ ./waf  Builds a dynamic library  Both a debug and optimized version
  • 33. The Basic NS-3 Data Flow Model Application Application Protocol stack Node NetDevice NetDevice Application Application Protocol stack Node NetDevice NetDevice Sockets-like API Channel Channel Packet(s)
  • 34. NS-3 Node Structure Application Application Application A Node is a husk of a computer to which applications, stacks, and NICs are added
  • 35. NS-3 Node Object Two key abstractions are maintained: 1) applications use an (asynchronous, for now) sockets API 2) the boundary between IP and layer 2 mimics the boundary at the device- independent sub-layer in Linux i.e., Linux Packet Sockets
  • 36. NS-3 Net Devices and Channels WifiNetDevice WifiChannel Net Devices are strongly bound to Channe of a matching type
  • 37. NS-3 Packets  Each NS-3 Packet contains ◦ Byte buffer with packet data  Protocol Headers  Optional Data Payload  Suitable for sending on an actual network as is. ◦ Packet Tags  Format and Type-free “extra” information about the packet  Eg. A Flow Identifier ◦ Packet Meta-Data  Enables packets to “print themselves”  Implemented with Smart Pointers and Copy-on-Write Semantics
  • 38. NS-3 Smart Pointers • ns-3 uses reference-counting smart pointers at its APIs to limit memory leaks – Or “pass by value” or “pass by reference to const” where appropriate • A “smart pointer” behaves like a normal pointer (syntax) but does not lose memory when reference count goes to zero • Use them like built-in pointers: Ptr<MyClass> p = CreateObject<MyClass> (); p->method ();
  • 39. NS-3 Validation • Can you trust ns-3 simulations? – Can you trust any simulation? – Onus is on the researcher to verify results • ns-3 strategies: – Open source benefits – Validation of models on testbeds – Reuse of code – Unit tests – Event driven validation tests
  • 40. wns-3 March 2010 http ://w ww. nsn am. org New NSF award: “Frameworks for ns-3”  Four years, awarded on 3 March 2010  PIs/groups involved: ◦ Univ. of Washington (Tom Henderson) ◦ Georgia Tech. (George Riley) ◦ Bucknell University (Felipe Perrone)  Scope: ◦ Automation frameworks ◦ Scenario management ◦ Education ◦ Software maintenance
  • 41. wns-3 March 2010 http ://w ww. nsn am. org Frameworks for ns-3  What do we mean by frameworks? ◦ Extensions to ns-3 outside of the core and models ◦ Helping users with their workflow Problem Definition Modeling Experiment Definition Scenario Generation ns-3 execution Optional: Connections to NICs or to virtual machines (VMs) Execution manager Framework to manage hybrid ns-3/testbed/VM experiments Educational script library Output data management Iterate as needed Visualization Animation
  • 42. wns-3 March 2010 http ://w ww. nsn am. org Future project directions  Google Summer of Code 2010  Upcoming ns-3 major merges ◦ ns-3-simu ◦ ns-3 parallel (shared memory)  Considering a U.S.-based workshop in late summer
  • 43. NS-3 Summary • ns-3 is an emerging simulator to replace ns-2 • Consider ns-3 if you are interested in: – Open source and collaboration – More faithful representations of real computers and the Internet – Integration with testbeds – A powerful low-level API – Python scripting • ns-3 needs you!
  • 44. wns-3 March 2010 44 http ://w ww. nsn am. org Resources Web site: http://www.nsnam.org Mailing list: http://mailman.isi.edu/mailman/listinfo/ns-developers IRC: #ns-3 at freenode.net Tutorial: http://www.nsnam.org/docs/tutorial/tutorial.html Code server: http://code.nsnam.org Wiki: http://www.nsnam.org/wiki/index.php/Main_Page
  • 46. Modeling the PHY Channel  Experimental Evaluation of Wireless Assumptions ◦ Kotz et. al, MSWiM 2004  Link-Level Measurements from an 802.11b Mesh Network ◦ Aguayo et. al, SIGCOMM 2004  Measurement-Based Physical Layer Modeling for Wireless Network Simulations ◦ Reddy et. al, Mascots 2007 46
  • 47. PHY Layer Models Free-Space (Friis) Model  Pr(d) = Received Power  d = Distance  Pt = Transmit Power  Gt = Antenna Gain at Transmitter  Gr = Antenna Gain at Receiver  λ = Wavelength  L = “System Loss” (L >= 1) 47
  • 48. PHY Layer Models Two-Ray Ground Reflection Model  ht = Height of transmitter  hr = Height of receiver  dc = Crossover Distance ◦ Use above only if d> dc 48
  • 49. PHY Layer Models Shadowing Model  d0 = “Close-in Distance”  β = Path loss exponent  XdB = Log-Normal Random Variable 49
  • 50. Kotz – Wireless Assumptions  The world is flat  Radio transmission range is circular  All radios have equal range  If I can hear you, you can hear me ◦ Symmetry  If I can hear you at all, I can hear you perfectly  Signal strength is a simple function of distance 50
  • 51. Kotz – Antenna Angle 51
  • 52. Kotz – Conditional Rx Probability 52
  • 53. Kotz – Rx Probability vs. Distance 53
  • 54. Kotz – Rx Signal Strength 54
  • 55. Aguayo - Cambridge Roofnet Map 55
  • 60. Effect of “Foreign Packets” 60
  • 61. Reddy – Measurement Study  Single base station, sending constant beacons  Single laptop receiver, at varying distances from the base station  Garmin V GPS on the laptop, reporting position  Two different wireless chip sets ◦ RaLink ◦ Atheros  Hack Linux drivers to record retry statistics and received signal strength indications  Disable rate adaptation algorithms  High RTS threshold to disable RTS/CTS exchange  Constant Tx power of 20dBm  Operate in IEEE 802.11 Channel 16 61
  • 62. Reddy – Mobility Pattern 62
  • 63. Reddy – RSS Measurement Results 63
  • 64. Reddy – Results (Antenna Angle) 64
  • 65. Reddy – Measurement, Average RSS 65
  • 66. PHY Layer Models Stochastic  Compute Pr(d) (Sk(t)) with Friis Model  Choose uniform random variable, packet error proportional to SNIR(k,t) 66