ns-3 Training 5/08/2017 Computer and Communication Network Lab

Slides:



Advertisements
Similar presentations
INTRODUCTION TO SIMULATION WITH OMNET++ José Daniel García Sánchez ARCOS Group – University Carlos III of Madrid.
Advertisements

1 The ns-2 Network Simulator H Plan: –Discuss discrete-event network simulation –Discuss ns-2 simulator in particular –Demonstration and examples: u Download,
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
Wireless Communication : LAB 3
Application Guide For Mesh AP – MAP-3120
Ns-2 tutorial Karthik Sadasivam Banuprasad Samudrala CSCI 5931 Network Security Instructor : Dr. T. Andrew Yang.
Why to learn OSI reference Model? The answer is too simple that It tells us that how communication takes place between computers on internet but how??
DSR The Dynamic Source Routing Protocol Students: Mirko Gilioli Mohammed El Allali.
- walkthrough of classic hidden terminal problem in WiFi-
LANs and WANs. 2 Chapter Contents Section A: Network Building Blocks Section B: Wired Networks Section C: Wireless Networks Section D: Using LANs Section.
Copyright node This presentation is a subset of the one presented by:
SANS A Simple Ad hoc Network Simulator Nicolas Burri Roger Wattenhofer Yves Weber Aaron Zollinger.
Matnet – Matlab Network Simulator for TinyOS Alec WooTerence Tong July 31 st, 2002.
WSN Simulation Template for OMNeT++
Wireless Sensor Network for Tracking the Traffic in INTERNET Network Routers Supervisor: Mark Shifrin Students: Yuriy Kipnis Nir Bar-Or Networked Software.
Network Simulation Internet Technologies and Applications.
Wireless scheduling analysis (With ns3) By Pradeep Prathik Saisundatr.
1 Chapter Overview Understanding the Windows 2000 Networking Architecture Using Microsoft Management Console.
NdnSIM Tutorial.
Lesson 5 – Looking at the Output MATSim Tutorial, 2011, Shanghai 1.
Guide to MCSE , Second Edition, Enhanced1 Windows XP Network Overview Most versatile Windows operating system Supports local area network (LAN) connections.
Wireless Networking and Systems CSE 590 ns2 tutorial.
LECTURE 9 CT1303 LAN. LAN DEVICES Network: Nodes: Service units: PC Interface processing Modules: it doesn’t generate data, but just it process it and.
Networks LANS,. FastPoll True Questions Answer A for True and B for False A wireless infrastructure network uses a centralized broadcasting device, such.
NetworkProtocols. Objectives Identify characteristics of TCP/IP, IPX/SPX, NetBIOS, and AppleTalk Understand position of network protocols in OSI Model.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
NETWORK SIMULATOR 3 Reporter: Chechieh Lin. O UTLINE Introduction NS3 vs. NS2 NS-3 Modules Key Abstractions A First ns-3 Script.
Ns-3 Training Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/13/2013.
Computer Concepts 2014 Chapter 5 Local Area Networks.
Cisco S2 C4 Router Components. Configure a Router You can configure a router from –from the console terminal (a computer connected to the router –through.
Computer Networks. Introduction Computer Network2 A History Lesson of Networking 1969 – ARPANET, first packet switched network consist of UCLA, Stanford,
QualNet Tutorial Yi Zheng.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
5 SECTION A 1 Network Building Blocks  Network Classifications  LAN Standards  Network Devices  Clients, Servers, and Peers  Physical Topology  Network.
COP 5611 Operating Systems Spring 2010 Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM.
Module 1: Configuring Routing by Using Routing and Remote Access.
Ns-2 Tutorial (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Jianping Wang, 2002 cs757 1.
1 Introduction to NS-2 r Tutorial overview of NS m Create basic NS simulation r Walk-through a simple example m Model specification m Execution and trace.
11 CLUSTERING AND AVAILABILITY Chapter 11. Chapter 11: CLUSTERING AND AVAILABILITY2 OVERVIEW  Describe the clustering capabilities of Microsoft Windows.
Planning and Analyzing Wireless LAN
WLAN.
Chapter 9: Networking with Unix and Linux. Objectives: Describe the origins and history of the UNIX operating system Identify similarities and differences.
Lab #3 MANET routing protocol experiment (AODV) CS492 Fall 2006 Prof. Sue Moon Dooyoung Lee Haewoon Kwak Hyunwoo Chun.
IP-BASED MOBILITY FOR WIRELESS LANS WITH THE NETWORK SIMULATOR NS Frank Christahl, Andreas Huber, Matthias Rosenschon University of Applied Sciences Giessen-Friedberg.
Rehab AlFallaj.  Network:  Nodes: Service units: PC Interface processing Modules: it doesn’t generate data, but just it process it and do specific task.
Introductions of SDN in NS-3
6. The Open Network Lab Overview and getting started
Analysis the performance of vehicles ad hoc network simulation based
Computer Networks.
Simulators for Sensor Networks
Introduction to ns-2: “The” Network Simulator
Real Life Networking Examples
Introduction to ZBOSS Embedded Systems Software Training Center
CT1303 LAN Rehab AlFallaj.
Spyridon (Spyros) Mastorakis University of California, Los Angeles
Lec 5 Layers Computer Networks Al-Mustansiryah University
Session 2. Logging과 Command Line Argument 사용법
Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU
Networking for Home and Small Businesses – Chapter 2
CANalytics TM CAN Interface Software BY.
Network Simulation/Emulation Platform
Karthik Sadasivam Banuprasad Samudrala
ns-3 Waf build system ns-3 Annual Meeting June 2017
Ns-3 Training Session 4: Monday 3:30pm ns-3 Annual Meeting May 2014.
Networking for Home and Small Businesses – Chapter 2
Study of performance of regular TCP in MANETs (using simulator).
Ns-3 Tutorial Xin Li.
EEC4113 Data Communication & Multimedia System Chapter 1: Introduction by Muhazam Mustapha, July 2010.
Ns-3 Training Debugging support ns-3 training, June 2016.
ns-3 training Tom Henderson ns-3 annual meeting 2019
Presentation transcript:

ns-3 Training 5/08/2017 Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/08/2017

Topics Getting Started ns-3 A First ns-3 Script What is ns-3? Installation A First ns-3 Script Two tutorial examples A simple example for this project Complete the remaining parts

Getting Started ns-3 Please read the following documents ns-3 overview http://www.nsnam.org/docs/ns-3-overview.ppt http://www.nsnam.org/docs/ns-3-overview.pdf ns-3 Tutorial http://www.nsnam.org/docs/release/3.25/tutorial/ns-3-tutorial.pdf ns-3 Manual http://www.nsnam.org/docs/release/3.25/manual/ns-3-manual.pdf

What is ns-3? ns-3 is a discrete-event network simulator for Internet systems ns-3 allows researchers to study Internet protocols and large-scale systems in a controlled environment ns-3 is a new simulator (not backwards-compatible with ns-2) ns-3 is a free, open source software project organized around research community development and maintenance the target user community is networking researchers and educators

Extensible Software Core Written in C++ with optional Python interface extensively documented API (doxygen): http://www.nsnam.org/doxygen-release/index.html

Node Basics An ns-3 Node is a husk of a computer to which applications, stacks, and NICs are added

Tracing and Statistics Tracing is a structured form of simulation output Example (from ns-2): Problem: Tracing needs vary widely would like to change tracing output without editing the core would like to support multiple outputs

ns-3 Has A New Tracing Model ns-3 solution: decouple trace sources from trace sinks Benefit: Customizable trace sinks

Downloading ns-3 http://www.nsnam.org/ Latest release: ns-3.27

Problems under Windows Cygwin or MinGW If you do use Cygwin or MinGW and use Logitech products it can cause Cygwin or MinGW DLLs to die in mysterious way Note that NSC is not supported on OSX or Cygwin. Network Simulation Cradle

Building ns-3 (1/5) # ./build.py

Building ns-3 (2/5) # ./waf -d optimized configure ns-3 uses the waf build system

Building ns-3 (3/5) # ./waf -d debug configure

Building ns-3 (4/5) # ./test.py -c core

Building ns-3 (5/5)

Running a Script ./waf --run hello-simulator

Building Your Script # cp examples/tutorial/first.cc scratch/myfirst.cc ./waf

Building Your Script # ./waf --run scratch/myfirst

/ns-allinone-3.10/ns-3.10/examples/tutorial first.cc third.cc A First ns-3 Script /ns-allinone-3.10/ns-3.10/examples/tutorial first.cc third.cc

Boilerplate The first line in the file is an emacs mode line. The ns-3 simulator is licensed using the GNU General Public License.

Module Includes The code proper starts with a number of include statements. ../../build/debug/ns3

Ns3 Namespace The next line in the first.cc script is a namespace declaration. Logging NS_LOG_COMPONENT_DEFINE ("FirstScriptExample"); 是指將 first.cc 檔取名為 "FirstScriptExample" ,並利用 LogComponentEnable(參數一, 參數二),開啟 "參數一" 的 log 功能,再利用參數二設定等級,所以LogComponentEnable("FirstScriptExample", LOG_LEVEL_INFO) 設定了 "FirstScriptExample" 的 log 等級為 LOG_LEVEL_INFO。

Main Functions The next lines of the script you will find are, ns3 提供的 log 訊息分成了以下幾個等級: NS_LOG_ERROR — Log error messages; NS_LOG_WARN — Log warning messages; NS_LOG_DEBUG — Log relatively rare, ad-hoc debugging messages; NS_LOG_INFO — Log informational messages about program progress; NS_LOG_FUNCTION — Log a message describing each function called; NS_LOG_LOGIC – Log messages describing logical flow within a function; NS_LOG_ALL — Log everything. NS_LOG_UNCOND – Log the associated message unconditionally.

Topology Helpers Create the ns-3 Node objects that will represent the computers in the simulation. We are constructing a point to point link

Topology Helpers We will need to have a list of all of the NetDevice objects that are created

Internet Stack Helper Protocol stacks installed on our nodes TCP, UDP, IP, etc. Ipv4AddressHelper make the association between an IP address and a device

Applications Two specializations of the core ns-3 class Application called UdpEchoServerApplication UdpEchoClientApplication UdpEchoServerHelper

Applications UdpEchoClientHelper

Simulator What we need to do at this point is to actually run the simulation. scheduled events in the simulator at 1.0 seconds, 2.0 seconds and two events at 10.0 seconds

Building Your Script Drop your script into the scratch directory Now build your first example script using waf

Building Your Script You can now run the example

Building a Wireless Network Topology Add the Wifi and the mobility modules The network topology illustration follows:

Building a Wireless Network Topology For enabling or disabling logging components and for changing the number of devices created

Building a Wireless Network Topology Part of the Wifi network Configure the PHY and channel helpers Yet Another Network Simulator M. Lacage and T. R. Henderson, “Yet Another Network Simulator,” WNS2 ns-2: The IP Network Simulator, Italy, 2006. http://cutebugs.net/files/wns2-yans.pdf

Building a Wireless Network Topology Create a channel object and associate it to our PHY layer object manager NqosWifiMacHelper object to set MAC parameters rate control algorithm AARF (Adaptive Auto-Rate Fallback ) algorithm

Building a Wireless Network Topology The SSID of the infrastructure network Create the wifi devices of these stations

Building a Wireless Network Topology Configure the AP (access point) node Shares the same set of PHY-level Attributes (and channel) as the stations

Building a Wireless Network Topology Set some Attributes controlling the “position allocator” functionality The number of objects layed out on a line.

Building a Wireless Network Topology Need to tell them how to move RandomWalk2dMobilityModel random direction random speed Rectangle (double _xMin, double _xMax, double _yMin, double _yMax)

Building a Wireless Network Topology Want the access point to remain in a fixed position during the simulation Protocol stacks

Building a Wireless Network Topology assign IP addresses to the device interfaces

Building a Wireless Network Topology Enable internetwork routing Create just enough tracing to cover all three networks

Building a Wireless Network Topology Run the simulation, clean up and then exit the program Output

Read the pcap files

Plot figures

An Example of MANET Reference /ns-allinone-3.10/ns-3.10/examples/wireless/wifi-hidden-terminal.cc

Codes (1/7)

Codes (2/7)

Codes (3/7)

Codes (4/7)

Codes (5/7)

Codes (6/7)

Codes (7/7)

Result

Need to do…… (1/3) Transmission range of a node Node moving speed ns3::RangePropagationLossModel MaxRange Node moving speed ns3::RandomWaypointMobilityModel Speed Pause Node data rate ns3::ConstantRateWifiManager

Need to do…… (2/3) RTS retry limit Buffer size AODV hello periods ns3::UanMacRc RetryRate Buffer size ns3::TcpSocket SndBufSize AODV hello periods ns3::aodv::RoutingProtocol HelloInterval

Need to do…… (3/3) Uniform distribution in a square with 500 meters ns3::RandomRectanglePositionAllocator ns3::UniformVariable

Q & A