Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU ycshin@mwnl.snu.ac.kr.

Slides:



Advertisements
Similar presentations
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
Advertisements

- walkthrough of classic hidden terminal problem in WiFi-
Copyright node This presentation is a subset of the one presented by:
Virtual Machine and UNIX. What is a VM? VM stands for Virtual Machine. It is a software emulation of hardware. By using a VM, you can have the same hardware.
Introduction to Linux/UNIX. History UNIX beginnings in 1969 (Linus Torvalds is born!) AT & T Bell Laboratories (Ken Thompson & Dennis Richie) Working.
Installing software on personal computer
Linux Operations and Administration
NdnSIM Tutorial.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
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.
Dedan Githae, BecA-ILRI Hub Introduction to Linux / UNIX OS MARI eBioKit Workshop; Nov , 2014.
Ns-3 Training Computer and Communication Network Lab Department of Electrical Engineering National Sun Yat-Sen University 5/13/2013.
Session 2 Wharton Summer Tech Camp Basic Unix. Agenda Cover basic UNIX commands and useful functions.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
Agenda Link of the week Use of Virtual Machine Review week one lab assignment This week’s expected outcomes Review next lab assignments Break Out Problems.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
Lesson 2-Touring Essential Programs. Overview Development of UNIX and Linux. Commands to execute utilities. Communicating instructions to the shell. Navigating.
Introduction to UNIX Road Map: 1. UNIX Structure 2. Components of UNIX 3. Process Structure 4. Shell & Utility Programs 5. Using Files & Directories 6.
Basic Unix Commands CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
RT-LAB Electrical Applications 1 Opal-RT Technologies Use of the “Store Embedded” mode Solution RT-LAB for PC-104.
CCNA1 v3 Module 1 v3 CCNA 1 Module 1 JEOPARDY K. Martin.
Embedded Software Design Week II Linux Intro Linux Kernel.
INTRODUCTION TO SHELL SCRIPTING By Byamukama Frank
Introductions of SDN in NS-3
Linux Workshop Session 2 By Amol and Prem. Overview of Presentation Brief Review Useful tools Remote Access Troubleshooting.
Introduction to Operating Systems Concepts
Precept I : Lab Environment, Unix, Bash, Emacs
6. The Open Network Lab Overview and getting started
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 20, 2016.
Outline Installing Gem5 SPEC2006 for Gem5 Configuring Gem5.
ns-3 Training 5/08/2017 Computer and Communication Network Lab
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
EE516: Embedded Software Project 1
Development Environment
Lab 1: Using NIOS II processor for code execution on FPGA
Virtual Private Networking with OpenVPN
CCNA Routing and Switching Routing and Switching Essentials v6.0
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
C151 Multi-User Operating Systems
Lecture 4: Operating System Structures
Introduction to ZBOSS Embedded Systems Software Training Center
The Linux Operating System
Introduction to SimpleScalar
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 19, 2017.
Chapter 10: Device Discovery, Management, and Maintenance
CCNA Routing and Switching Routing and Switching Essentials v6.0
Lab 1 introduction, debrief
Session 2. Logging과 Command Line Argument 사용법
Networking for Home and Small Businesses – Chapter 2
Chapter 10: Device Discovery, Management, and Maintenance
Computer software.
Chapter 2: System Structures
Unix : Introduction and Commands
Exercise #1: Exploring Open-Source Operating Systems with Virtual Machines J. H. Wang Sep. 21, 2018.
Karthik Sadasivam Banuprasad Samudrala
Chapter 2: The Linux System Part 1
ns-3 Waf build system ns-3 Annual Meeting June 2017
Introduction to Linux/UNIX
Tutorial Unix Command & Makefile CIS 5027
Cordova & Cordova Plugin Installation and Management
Networking for Home and Small Businesses – Chapter 2
Windows Server Administration Fundamentals
Software Setup & Validation
Ns-3 Tutorial Xin Li.
Yung-Hsiang Lu Purdue University
Lecture 09 & 10 Operating Systems Network, Communication, OSI.
ns-3 Direct Code Execution ns-3 Annual Meeting June 2016
Presentation transcript:

Session 1. ns-3 기초 신연철 Multimedia & Wireless Networking Laboratory, SNU ycshin@mwnl.snu.ac.kr

Contents Linux basic commands Introduction to ns-3 Starting ns-3 ns-3 key abstractions

Linux Basic Commands

Linux Basic Commands man [instruction] ls cd <path> Manual of the instruction ex) man ls ls Short listing of directory contents ex) ls -al cd <path> Change directory ex) cd .. (go to the parent directory) cd / (go to the root directory)

Linux Basic Commands mkdir <directory name> Make directory mkdir test_dir1 gedit <filename> Open <filename> with gedit gedit test1.txt cat <filename> Print the file to the screen cat test1.txt

Linux Basic Commands cp <filename1> <filename2> Copy files or directories ex) cp –r test_dir1 test_dir2 cp test1.txt test_dir2/ mv <filename1> <filename2> Move file Change filename mv test_dir1/test1.txt test_dir2/ mv test1.txt test2.txt

Linux Basic Commands rm <filename> Remove files and directories ex) rm test2.txt rm –r test_dir2 rm * grep <pattern> <filename> search for a pattern in a file grep hello test1.txt

Linux Basic Commands find <directory> <expressions> search for files in a directory ex) find . find . –name “*.txt” find with grep find . –name “*.txt” | xargs grep hello find files which contain ‘hello’

Linux Basic Commands tar tar archiving ex) tar cvf test.tar test_dir1 tar xvf test.tar tar xvf ns-allinone-3.21.tar.gz

Linux Basic Commands Redirection > Save results into a file cat test1.txt > test2.txt >> Append results into a file cat test1.txt >> test2.txt 2>&1 stderr  stdout ./waf –-run scratch/myfirst > log.out 2>&1

Introduction to ns-3

ns-3 ns-3 is targeted at networking research.

ns-3 Status Periodic update Supporting platform Latest version is ns-3.22 Supporting platform FreeBSD, Linux, SunOS, Solaris, Windows (Cygwin) Free, open source software project Website http://www.nsnam.org/ Can find the doxygen, reference manual, and tutorial

ns-3 vs. ns-2 Limitations of ns-2 Advantages of ns-3 Complicated architecture C++, Otcl Simplified layers 2, 3, and applications Single network interface for each node Advantages of ns-3 Simple architecture C++ (Can run ns-3 without any knowledge of Python) Bindings in Python Provides realistic implementations ns-3 is not an extension of ns-2

ns-3 DCE What is DCE (Direct Code Execution) Why use DCE Framework provides facilities to execute within ns-3 without modifying source code Existing user-space applications/protocols Kernel-space network protocols Why use DCE If you do not want to maintain multiple implementations of a single protocols, or re-implement existing protocols If you want to debug and test your code within a controlled environment

Waf Build System waf waf key concepts Python-based framework for configuring, compiling, and installing applications Reference http://code.google.com/p/waf waf key concepts configure  ./waf –d [optimized|debug] configure make  ./waf make clean  ./waf clean Running program E.g.) ./waf –run simple-point-to-point

ns-3 Components ns-3 simulator Pre-processing Post-processing Traffic / topology generation Alignment with real systems (sockets, device driver interfaces) Post-processing ns-3 output file (trace file) analysis Throughput, delay, jitter, drop Various tracing system Graph gnuplot

ns-3 all-in-one package Directory Structure Example simulation scripts

Starting ns-3

How to Download ns-3 ns-3 download: http://www.nsnam.org/ns-3-22/download/ [user@com ~]# tar xvf ns-allinone-3.15.tar.bz2 [user@com ~]# cd ns-allinone-3.15 ns-3 download using mercurial: [user@com ~]# hg clone http://code.nsnam.org/ns-3-allinone [user@com ~]# cd ns-3-allinone [user@com ~]# ./download.py -n ns-3.22

How to Install ns-3 Building with build.py Building with waf Test [user@com ~/ns-allinone-3.22]$ ./build.py Building with waf [user@com~/ns-allinone-3.22] $ cd ns-3.22 [user@com~/ns-allinone-3.22/ns-3.22] $ ./waf clean Configuration with build-profile=debug for outputting log messages $ ./waf –-build-profile=debug --enable-examples --enable-tests configure Configuration with build-profile=optimized for maximizing simulation speed $ ./waf –-build-profile=optimized --enable-examples --enable-tests configure Build $ ./waf Specifying output directory for build-profile $ ./waf –-build-profile=debug –-out=build/debug Test $ ./test.py –c core

Running a Script cd ns-allinone-3.22/ns-3.22 ../ns-3.22$ ./waf --run scratch/scratch-simulator Output

Scratch Simulator scratch/scratch-simulator.cc #include "ns3/core-module.h" using namespace ns3; NS_LOG_COMPONENT_DEFINE ("ScratchSimulator"); int main (int argc, char *argv[]) { NS_LOG_UNCOND ("Scratch Simulator"); Simulator::Run (); Simulator::Destroy (); } module inclusion : automatically includes header files in src/core namespace declaration : after that you will not have to type ns3:: definition of logging module name : will be explained Session 2 Outputting log message : will be explained Session 2 Running and finishing simulation

Workspace ../ns-allinone-3.22/ns-3.22/scratch Run program only in the scratch folder Run program by the commands below ./waf --run scratch/example (or) ./waf --run example

ns-3 in Windows Officially supported Cygwin was supported in the past Virtualization products (VirtualBox, Vmware) How to run simulations using VirtualBox http://www.nsnam.org/wiki/index.php/HOWTO_use_VirtualBox_to_run_simulations_on_Windows_machines How to run simulations using VMware http://www.nsnam.org/wiki/index.php/HOWTO_use_VMware_to_set_up_virtual_networks_(Windows) Cygwin was supported in the past There might be some problems

ns-3 Key Abstractions

Key Abstractions 1.Node 2.Application 3.Channel Host, end system in the Internet Basic computing device abstraction Represented in C++ by the class Node 2.Application A user program that generates some activity to be simulated ns-3 applications run on ns-3 Nodes to drive simulations Represented in C++ by the class Application More details will be provided in Session 3 Ex)OnOffApplication, UdpEchoClientApplication 3.Channel Medium connected by nodes over which data flows Provides methods for managing communication subnetwork objects Represented in C++ by the class Channel Ex) CsmaChannel, PointToPointChannel, WifiChannel

Key Abstractions 4. Net device 5. Topology helpers Like a specific kind of network cable and a hardware device (Network Interface Cards; NICs) NICs are controlled using devices drivers, net devices Represented in C++ by the class NetDevice Net device is installed in a Node to enable the Node to comm. with other Nodes via Channels Ex) CsmaNetDevice (work with CsmaChannel) WifiNetDevice (work with WifiChannel) 5. Topology helpers Topology helpers make ns-3 core operations as easy as possible Create a NetDevice, add a MAC address, install that net device on a Node, configure the node’s protocol stack and connect the NetDevice to a Channel

Topology Helpers Containers Helpers Provides a convenient way to create, manage, and access entities NodeContainer: Provide a convenient way to create, manage and access any Node object NetDeviceContainer: To install NetDevice at the nodes and create Channel between the nodes Helpers Provides a convenient way to create and install entities on nodes or devices PointToPointHelper: Configure and connect PointToPointNetDevice and PointToPointChannel objects. Set DataRate on NetDevices and Delay on Channel InternetStackHelper: To install an Internet Stack (TCP, UDP, IP, etc.) on each of the nodes in the node container Ipv4AddressHelper: Manage the allocation of IP address and assign addresses to the devices using Ipv4InterfaceContainer

NS-3 Basic Simulation Model Application Protocol stack Node NetDevice Sockets-like API Channel Packet(s)‏

Q & A