THE FIRST STEP TO BECOME FAMILIAR WITH NETWORK SIMULATOR (NS) Neda - - PowerPoint PPT Presentation

the first step to become familiar with network simulator
SMART_READER_LITE
LIVE PREVIEW

THE FIRST STEP TO BECOME FAMILIAR WITH NETWORK SIMULATOR (NS) Neda - - PowerPoint PPT Presentation

THE FIRST STEP TO BECOME FAMILIAR WITH NETWORK SIMULATOR (NS) Neda Mohammadizadeh Cooperative sub-group BBCR group Feb 2012 2 References http://nsnam.isi.edu/nsnam/index.php/User_Information http://nile.wpi.edu/NS/


slide-1
SLIDE 1

THE FIRST STEP TO BECOME FAMILIAR WITH NETWORK SIMULATOR (NS)

Neda Mohammadizadeh Cooperative sub-group BBCR group Feb 2012

slide-2
SLIDE 2

References

  • http://nsnam.isi.edu/nsnam/index.php/User_Information
  • http://nile.wpi.edu/NS/
  • http://www.isi.edu/nsnam/ns/tutorial/index.html
  • Introduction to NS2(PPT), Prepared by Changyong Jung

2

slide-3
SLIDE 3

Outline

  • Introduction on Network Simulator
  • Installation
  • Architecture of NS-2
  • OTcl
  • Simulation Examples

3

slide-4
SLIDE 4

Introduction

  • Network Simulator (NS)
  • Discrete event network simulator
  • Implements
  • Transport layer protocols such as TCP ( reno, tahoe, vegas, sack) and

UPD

  • Router queue management mechanism such as Drop Tail, RED
  • Routing algorithms such as Dijkstra and Ad-hoc Routing (DSDV, DSR,

AODV, TORA)

  • MAC layer protocols (802.11, 802.3, TDMA)
  • Sensor Network (diffusion, gaf), Satellite protocols, and many others
  • Traffic source behavior such as FTP, Telnet, Web, CBR and VBR
  • NS versions:
  • NS-1, NS-2, NS-3

4

slide-5
SLIDE 5

Introduction

  • NS-1:
  • LNBL Simulator tool
  • Developed by the network research group at the Lawrence

Berkeley National Laboratory (1989).

  • Derived from REAL simulator
  • Simulation description language: TCL

5

slide-6
SLIDE 6

Introduction

  • NS-2:
  • Object oriented (OTcl instead of TCL)
  • Built in C++ and provides a simulation interface through OTcl
  • Developed by UC Berkeley
  • Difficult for the first time user
  • Few user friendly manuals
  • Needs scripting language, queuing theory and modeling techniques

knowledge

  • Complaint about inconsistent results
  • BUGs!!!

6

slide-7
SLIDE 7

Introduction

  • NS-3:
  • Maintaining backward compatibility with ns-2? (2005)
  • YANS (Yet Another Network Simulator) -> NS-3 base
  • NS-3.1 (2008) , NS-3.11(2011)
  • Built in C++ and Phyton
  • Make it simpler
  • No support for some protocols which were supported in ns-2

7

slide-8
SLIDE 8

Installation

  • http://nsnam.isi.edu/nsnam/index.php/Downloading_and_install

ing_ns-2

  • Installing on Unix-based systems
  • Installing on Windows using Cygwin
  • Installing on Mac
  • The following “How to install” slides are brought from

Introduction to NS2(PPT), Prepared by Changyong Jung

8

slide-9
SLIDE 9

How to Install

  • Window XP-
  • Go to Website:

http://nsnam.isi.edu/nsnam/index.php/Running_Ns_and_Nam_Under_Windows_9x/2000/XP_Using_Cygwin

  • Read “Requirements and Installation Tips” Carefully.
  • Download cygwin.exe from http://www.cygwin.com/
  • Click the “cygwin.exe”

9

slide-10
SLIDE 10

How to Install

  • Cygwin Installation

10

slide-11
SLIDE 11

How to Install

11

slide-12
SLIDE 12

How to Install

  • Select browse for “cygwin” file( I selected as “default”)

12

slide-13
SLIDE 13

How to Install

  • Local package directory (I recommend c:\cygwin).

13

slide-14
SLIDE 14

How to Install

  • Select to Install all ( I recommend it)
  • You can select “install”, “default”, “uninstall”, “install”, and “reinstall” behind the first

line “all”. If you select “install”, then all sub items will be automatically selected. Otherwise you may lose some items.

14

slide-15
SLIDE 15

How to Install

  • Select download site

15

slide-16
SLIDE 16

How to Install

  • Installing

16

slide-17
SLIDE 17

How to Install

  • Finishing Installing

17

slide-18
SLIDE 18

How to Install

  • NS2 Installation
  • Download ns-allinone-2.29.2.tar.gz from Website and

Save it to the c:/cygwin /usr/local

  • Unpack it: tar xvfz ns-allinone-2.29.2.tar.gz
  • Click on desktop icon “cygwin”

18

slide-19
SLIDE 19

How to Install

19

slide-20
SLIDE 20

How to Install

  • Type “cd ..” to go to the upper folder(“cd” must be low case. And

there is one space between “d” and “.”)

  • Type “cd ..” again.

20

slide-21
SLIDE 21

How to Install

  • “cd usr”, go to folder “usr”
  • “cd local”, go to folder “local”

21

slide-22
SLIDE 22

How to Install

  • Find “install.exe”

22

slide-23
SLIDE 23

How to Install

  • Start to run the installation “./install”

23

slide-24
SLIDE 24

How to Install

  • Installing

24

slide-25
SLIDE 25

How to Install

  • Installing

25

slide-26
SLIDE 26

How to Install

  • Configure system variables and library paths
  • After finishing installing, following window appears

26

slide-27
SLIDE 27

How to Install

  • Configure system variables
  • Go to “My computer” and click “view system information”

27

slide-28
SLIDE 28

How to Install

  • Go to “advanced” Tab and Click “Environmental variables”

28

slide-29
SLIDE 29

How to Install

29

slide-30
SLIDE 30

How to Install

  • Highlight “path” which is “system variable” box and press the “Edit”

button.

30

slide-31
SLIDE 31

How to Install

31

slide-32
SLIDE 32

How to Install

  • Add the following path separated with “;” make sure to

not change the existing path. /usr/local/ns-allinone-2.29.2/bin /usr/local/ns-allinone-2.29.2/tcl8.4.11/unix /usr/local/ns-allinone-2.29.2/tk8.4.11/unix

32

slide-33
SLIDE 33

How to Install

  • Go to cygwin and type the following content

Export LD_LIBRARY_PATH=/usr/local/ns-allinone- 2.29/otcl-1.11 Export LD_LIBRARY_PATH=/usr/local/ns-allinone-2.29/lib Export TCL_LIBRARY_PATH=/usr/local/ns-allinone- 2.29/tcl8.4.11/library

33

slide-34
SLIDE 34

How to Install

34

slide-35
SLIDE 35

NS-2 Architecture

NS Simulator Library Network Component Objects Network Setup Modules Event Scheduler Objects

  • The event scheduler and the basic network component objects in the

data path are written and compiled using C++.

  • To use NS, you program in OTcl script language

35

slide-36
SLIDE 36

Plumbing

Network Setup:

  • Creating possible data paths among network objects.
  • The power of NS comes from plumbing.

Event is a packet ID that is unique for a packet

  • scheduled time
  • the pointer to an object that handles the event.

An event scheduler

  • keeps track of simulation time
  • fires all the events in the event queue

Event Scheduling

36

slide-37
SLIDE 37

NS-2 Architecture

OTcl and C++ http://nile.wpi.edu/NS/

37

slide-38
SLIDE 38

OTcl

Executing a test file: ns ex-tcl.tcl Results:

38

slide-39
SLIDE 39

Event Scheduler

http://nile.wpi.edu/NS/

39

  • 1. Real-time scheduler
  • 2. Non-real-time scheduler
  • List
  • Heap
  • Calendar

. . . set ns [new Simulator] $ns use-scheduler Heap $ns at 300.5 "complete_sim" . . . proc complete_sim {} { . . . }

slide-40
SLIDE 40

Network Component

Node:

  • Unicast or

Multicast

  • Routing Protocol

Link:

  • Tracing
  • Queue monitor

Unicast

  • $ns rtproto type
  • type: Static, Session, DV, cost, multi-path

Multicast

  • $ns multicast (right after set $ns [new Scheduler])
  • $ns mrtproto type
  • type: CtrMcast, DM, ST, BST

create-trace {type file src dst}

40

slide-41
SLIDE 41

Partial OTcl class hierarchy

41

http://nile.wpi.edu/NS/

slide-42
SLIDE 42

Other important tasks

Post simulation: Trace analysis Queue Monitor Troubleshooting: Installation problems Simulation Problems

42

slide-43
SLIDE 43

NS Results

Network Animator (NAM)

  • A graphical simulation display tool
  • Developed as a part of VINT project
  • Has a nice graphical user interface
  • Can graphically present information

NS Simulation Text-based results NAM

43

slide-44
SLIDE 44

Simulation Example

http://nile.wpi.edu/NS/

44

slide-45
SLIDE 45

45

slide-46
SLIDE 46

Where to find…

/ns-2/tcl/lib

ns-lib.tcl: The simulator class and most of its member function definitions ns-default.tcl: The default values for configurable parameters ns-packet.tcl: The packet header format initialization implementation

  • ther OTcl files: implementation of compound network objects or the

front end (control part) of network objects

46

slide-47
SLIDE 47

Summary

Network Simulator (NS): is an object-oriented discrete-event network simulator. Implements different network protocols. is written in C++ and OTcl. (NS-2) It was the first step to be familiar with NS. Keep going…

47

slide-48
SLIDE 48

Thank You

48