Date : 2010/11/23 Speaker : Chia-Wen Lu 1.  Network Simulation  Introduction to NS2  Simple Simulation Example 2.

Slides:



Advertisements
Similar presentations
Wireless Communication : LAB 3
Advertisements

Ns Tutorial 成功大學電機所電腦與網路組 博士候選人 柯志亨
Introduction to Network Simulator NS-2 Part I
An Introduction to NS-2 * Gayatri Swamynathan CS 276 TA *some slides are from a presentation by Haobo Yu & Nader Salehi, USC/ISI.
NS-2 Shahin Shayandeh December 2004 Session 2. Ns programming  Create the event scheduler  Turn on tracing  Create network  Setup routing  Insert.
Brief Intro to ns2: The most widely used Network Simulator COMP5416 Advanced Network Technologies Based on: Marc Greis's
Ns-2 Tutorial Exercise (1) Multimedia Networking Group, The Department of Computer Science, UVA Jianping Wang Adopted from Nicolas’s slides Jianping Wang,
Ns-2 tutorial Karthik Sadasivam Banuprasad Samudrala CSCI 5931 Network Security Instructor : Dr. T. Andrew Yang.
How to Add a New Protocol in NS2 Xu Leiming CSCW Lab. at CS Dept., Tsinghua Univ. June 1, 2001.
5-Jul-141 S.Pushpalatha, Associate Professor, PSNACET.
Introduction to NS. Information Main website Documentation, mailing list archive, tutorial Location of Source codes –C++ files.
什麽是 WiMAX ? WiMAX 代表 Worldwide Interoperability for Microwave Access ,是屬於 IEEE 標準 的一種點到多點寬頻無線存取技術。 與 標準定義的 Wi-F 網路一樣, WiMAX 也 是一種無線上網技術,只是它的訊號範圍更廣、
在 Ad-hoc 網路中實現點對 點發送訊息與廣播訊息. 檔案下載  範例程式可在下列網址取得  DEMO 程式可在下列網址取得
1 Network Simulator (NS-2). 2 講義 Network Simulator (NS2) Part 1: 下載 Part 2: 安裝與測試 Part 3: 劇本 Part 4: 數據.
CNA 2008 Project 1 TA: 徐志偉 Office: EA Grading policy: Total (100%) Report (20%) Socket Programming: (80%) –Basic (60%) –Advanced (20%)
Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2003) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
CprE 543x – ns-2 Tutorial Zak Abichar, Dept of Electrical and Computer Engineering Iowa State University Ames,
Windows Processing Design
Wireless Protocol Bluetooth
Project I : RTP Speaker : Jiun-Wei Chiu Advisor : Prof. Shun-Ren Yang Date : Oct. 9, 2008.
Network Simulator (NS-2)
Introduction - 1 Introduction to Local Area Networks (LANs)  All rights reserved. No part of this publication and file may be reproduced, stored in a.
網路程式設計 簡易網路程式 2. 簡易線上溝通程式 3. 網路應用程式 4.Servlet 程式設計 5.
Network Simulator Tutorial. The Network Simulator - ns-2 NS2 is a discrete event simulator targeted at networking research.
The Network Simulator NS-2 & SCTP Module Student : Kuo-Lun Lu Advisor : Dr. Jen-Yi Pan.
提出 Loop Free Multi-Path Routing 協定 why: 1. 行動節點傳輸距離限制和任意移動 造成路徑中斷和拓樸改變 2. 減少重找路的成本 3.Loop Free P9.
RTP Real-Time Transport Protocol Speaker: Hsiao-Ting Wang Advisor: Quincy Wu Date: July 2 nd 2009.
Wireless Sensor Network for Tracking the Traffic in INTERNET Network Routers Supervisor: Mark Shifrin Students: Yuriy Kipnis Nir Bar-Or Networked Software.
EECS122 - UCB1 Measurements and Modeling Table of Contents 1. Measurements Measurements 2. Modeling and its Shortcomings Modeling and its Shortcomings.
 A network simulator is a piece of software or hardware that predicts the behavior of a network, without an actual network being present.
Network Simulator (NS2) 1 Tutorial on Network Simulator (NS2) Hemant Kumar Rath Infonet Lab, Dept of Electrical Engineering IIT Bombay, Mumbai
Wireless Networking and Systems CSE 590 ns2 tutorial.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
Bridging the Gap: Turning a Network Simulation into an Emulation Mac Newbold.
NS2 - Appendix Ming-Feng Yang. 2 2 Outline NS2 Models NS2 Directory Structure Extending NS2 in OTcl Extending NS2 in C++ NS2 related links.
資料通訊與電腦網路原理 資料傳輸線路的傳遞模式 資料於傳輸線路的移動 並列傳輸、序列傳輸 基頻、寬頻.
RPL: IPv6 Routing Protocol for Low power and Lossy Networks
JIA-HUI HUANG INSTITUTE OF COMPUTER SCIENCE AND INFORMATION ENGINEERING NATIONAL TAIPEI UNIVERSITY OF TECHNOLOGY Network Simulator – NS-2 1.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
NetFlow Very useful for traffic analysis Very useful for traffic analysis Standard sampler: Standard sampler: –Cisco Netflow –Juniper Traffic Sampling.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
Internet Computing KUT Youn-Hee Han
Asus WL-500GP OS/Platform/Environment Introduction.
區域網路系統 明新技術學院資訊管理學系專任助理教授 工研院電通所無線通訊技術組顧問 清華大學資訊工程學系博士 林文宗博士 or
Communication within Clouds: Open Standards and Proprietary Protocols for Data Center Networking Conference: Communications Magazine, IEEE (Volume:50,
Quality evaluation of MPEG4 video transmission over GPRS networks.. Presented by: Abdullah M. Rana Multimedia Communication.
1 NS Fundamentals. USC INFORMATION SCIENCES INSTITUTE 2 OTcl and C++: The Duality C++ OTcl Pure C++ objects Pure OTcl objects C++/OTcl split objects ns.
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.
Lab 2, Network Simulator ns2 Shiv Kalyanaraman Yong Xia (TA) Satish Raghunath Sept 4,
Network Simulator Tutorial Wireless Networks. Acknowledgements Material is taken from the presentations by Jim Kurose, University of Massachusetts, Amherst.
Network Simulator 2. Introduction Open source network simulator NS uses two languages: C++ and OTcl  C++ is fast to run but slower to change Kernel 
The Creation of NS2 Simulated Environment ( 1 ) LI Chengbo
July 7, 2003 Building a Wireless LAN traffic test case in ns2 Radio Science Laboratory Department of Electrical and Computer Engineering The University.
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
Lab 2, Network Simulator ns2
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
Ch 1: Simulation of Computer Networks. 1.1 Computer Networks and the Layering Concept Layering Concept Service Interface Protocol.
7. Network Simulation Network Performance and Quality of Service.
Ch7: Link and Buffer Management. 2 Portrait of A Mobile Node Node ARP Propagation and antenna models MobileNode LL MAC PHY LL CHANNEL LL MAC PHY Classifier:
NS-2 Simulator 최 종 훈 Contents  About NS  Installation  Based on Linux  Based on Windows  Architecture  Using NS-2  Example  References.
DMET 602: Networks and Media Lab
(Modified from Polly Huang’s and last year’s original)
Analysis the performance of vehicles ad hoc network simulation based
Network Simulators.
Simulators for Sensor Networks
Mobicom ‘99 Per Johansson, Tony Larsson, Nicklas Hedman
Introduction to ns-2: “The” Network Simulator
Karthik Sadasivam Banuprasad Samudrala
Network Performance modelling and simulation
Presentation transcript:

Date : 2010/11/23 Speaker : Chia-Wen Lu 1

 Network Simulation  Introduction to NS2  Simple Simulation Example 2

 Network Simulation  Introduction to NS2  Simple Simulation Example 3

Suppose you devise a great protocol. How do you show that it’s great? - Experiment - Mathematical model - graph theory - Simulation - programming (e.g., C++ or NS2) 4

advantagedisadvantage Experiment realistic expensive sometime not possible Mathematical model insight assumptions Simulationeasy (cheap) verification not much insight assumptions 5

Platform: - hardware, software, or hybrid Developer: - commercial or in-house Source code: - open or close Paradigm: - time-dependent/non-time-dependent; time-driven/event-driven 6

simulation performance - execution speed - scalability - fidelity - cost Network Layer - free: NS2, GloMoSim - commercial: Opnet, QualNet 7

 Network Simulation  Introduction to NS2  Simple Simulation Example 8

Network Simulator (Version 2) - widely known as NS2 - event driven simulation tool - wired / wireless network, protocols (e.g. routing algorithms, TCP, UDP) 9

10  有線網路 網路層: DV, LS, PIM-SM 傳輸層: TCP 、 SCTP and UDP 應用層: FTP, SIP, CBR, stochastic 排隊模型: Drop-tail, RED, FQ, SFQ QoS : MPLS 、 IntServ and Diffserv  無線網路 網路類型: MANET, Sensor Networks 路由方式: AODV, DSR, DSDV , Mobile IP 等等 鏈結層: , , ,Smac 等

11 Events a, b, and c are executed in order - example program 1 initialize {system states} 2 initialize {list of events} 3 while {state != finalState} % or while {this.event != Null} 4 expunge the previous event from list of events; 5 set SimClock := time of current event; 6 execute this.event 7 end while

Run by a set of events (schedule list) Time gap between two events is not fixed Simulation advance from one event to another Event may induce one or more events new event is usually inserted into the list 12

Gathering information right after every event execution Simulation finishes - at a pre-specified time - when there is no more event 13

 Point-to-point wired communication link - a one-way communication 14

15 Arrival: - a packet arrival event Complete: - a successful packet transmission even t

PacketService time Arrival time Complete time P1303 P2225 P P1 0 P2 2 P3 4 P1 3 P2 5 P3 6

17

two key languages C++ - defines the internal mechanism of the simulation Objects Otcl (Object-oriented Tool Command Language ) - sets up simulation scenarios Linked together using TclCL 18

19

Two language architecture: C++ and OTcl C++ - compiler - fast to run (run on machine codes) - slow to change (need compilation) OTcl - interpreter - slow to run; fast to change Why two languages? C++ coding styles 20

 Compile and create “prog.exe” - recompile for every minor changes (e.g., number of nodes, link speed) 21

 C++ coding with input arguments - use parameters input argument - e.g., “prog ” - what if there are too many parameters? 22

 C++ coding with input files - put input parameters in a configuration file - no need to change C++ code - one input argument—the filename - NS2 style!! - configuration file is called “Tcl Simulation script” 23

 Start from Tcl simulation script  For each line: - execution path: Tcl -> Otcl -> C++ - returning path: C++ -> OTcl -> Tcl (next line) 24

 Network Simulation  Introduction to NS2  Simple Simulation Example 25

26

 4 nodes : n0, n1, n2, n3  n0 and n2 =>2 Mbps 頻寬,10 ms 傳遞延遲時間 n1 and n2 =>2 Mbps 頻寬,10 ms 傳遞延遲時間  n2 and n3 =>1.7 Mbps 頻寬,20 ms 傳遞延遲時間  FTP session is based on TCP  CBR session is based on UDP 27

# 產生一個模擬的物件 set ns [new Simulator] # 產生傳輸節點 (n0,n1) set n0 [$ns node] set n1 [$ns node] # 產生路由器節點 (n2) set n2 [$ns node] # 產生資料接收節點 (n3) set n3 [$ns node] 28

#n0-n2,2Mbps 頻寬,10ms 傳遞延遲時間 $ns duplex-link $n0 $n2 2Mb 10ms DropTail #n1-n2,2Mbps 頻寬,10ms 傳遞延遲時間 $ns duplex-link $n1 $n2 2Mb 10ms DropTail #n2-n3, 1.7Mbps 頻寬,20ms 傳遞延遲時間 $ns duplex-link $n2 $n3 1.7Mb 20ms DropTail 29

# 建立 UDP 連線 (n1 到 n3) set udp [new Agent/mUDP] $ns attach-agent $n1 $udp set null [new Agent/mUdpSink] $ns attach-agent $n3 $null $ns connect $udp $null 30

# 在 UDP 連線之上建立 CBR 應用程式 set cbr [new Application/Traffic/CBR] $cbr attach-agent $udp $cbr set type_ CBR 31

# 設定 FTP 和 CBR 資料傳送開始和結束時間 $ns at 0.1 "$cbr start" $ns at 1.0 "$ftp start" $ns at 4.0 "$ftp stop" $ns at 4.5 "$cbr stop" 32

# 執行模擬 $ns run 33

34

 Introduction to Network Simulator NS2 by T. Issariyakul and E. Hossain.  

Q & AQ & A 36