Jae Chung and Mark Claypool

Slides:



Advertisements
Similar presentations
Introduction to Network Simulator NS-2 Part I
Advertisements

Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
1 ns-2 Tutorial, part 2 Dave Anderson, Xiaowei Yang (Modified from Polly Huang’s slides)
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,
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.
Chapter 1 OO using C++. Abstract Data Types Before we begin we should know how to accomplish the goal of the program We should know all the input and.
Scripts and Flow Control. Scripts So far we have been entering commands directly into the command line But there is a better way Script files (and functions)
Functions.
Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2003) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
15-744: Computer Networking L-3 The network simulator ns-2 Slides loosely based on a tutorial by Polly Huang, ETH Zurich.
EECS122 - UCB1 Project 3: ns Simulation of Application-Level Routing Improve the application performance by user-level / application-level routing. Understand.
Submitters: Stella Pantofel Michael Halperin Igor Berman
Fork and Exec Unix Model Tutorial 3. Process Management Model The Unix process management model is split into two distinct operations : 1. The creation.
Better Behaved, Better Performing Multimedia Networking Jae Chung and Mark Claypool Computer Science Department Worcester Polytechnic Institute Proceedings.
NS2 Tutorial Aga Zhang Dependable Computing Lab. Outline Introduction Fundamental Skills - Tcl and OTcl Network Simulator - ns-2 Study Project - Mobile.
AlgoTutor Tutorial (3) Program Pad J. Yoo, S. Yoo, C. Pettey, S. Seo, and Z. Dong MTSU Computer Science Department Making the transition from the algorithm.
QualNet 2014/05/ 尉遲仲涵. Outline Directory Structure QualNet Basic Message & Event QualNet simulation architecture Protocol Model Programming.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
NS2 Tutorial for CS740 Jianming Wu *modified from Aga Zhang.
Compiled Matlab on Condor: a recipe 30 th October 2007 Clare Giacomantonio.
Launch SpecE8 and React from GSS. You can use the chemical analyses in a GSS data sheet to set up and run SpecE8 and React calculations. Analysis → Launch…
NS2 - Appendix Ming-Feng Yang. 2 2 Outline NS2 Models NS2 Directory Structure Extending NS2 in OTcl Extending NS2 in C++ NS2 related links.
Ns-3 tutorial Katto lab Tadashi Yamazaki 8 November 2012.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
Version How to Use Packet Tracer MarinaMD.
Variables and Functions. Open your Encoder program Let’s begin by opening the “Labyrinth Auto Straight” code. Save this file as Labyrinth with variables.
Reporting – Sort Orders, Selections, and Related Data TEC02 Brian Ciccolo.
CSE 232: C++ debugging in Visual Studio and emacs C++ Debugging (in Visual Studio and emacs) We’ve looked at programs from a text-based mode –Shell commands.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
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.
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.
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
Threads and Singleton. Threads  The JVM allows multiple “threads of execution”  Essentially separate programs running concurrently in one memory space.
Boolean expressions, part 1: Compare operators. Compare operators Compare operators compare 2 numerical values and return a Boolean (logical) value A.
Network Simulator 2 Network Simulator 2 Practice SungKyunKwan-Univ Mobile Computing LAB ( 안혜환
GNU Make Computer Organization II 1 © McQuain What is make ? make is a system utility for managing the build process (compilation/linking/etc).
Overview of VANET Project(2011) on NS2 Perspective Part 1 of 2 Jae-Myeong Lee Human-centric Mobile Computing Lab.
(Modified from Polly Huang’s and last year’s original)
Basic concepts of C++ Presented by Prof. Satyajit De
NS2_Trace and Monitoring support 報告者:羅士捷
3 Introduction to Classes and Objects.
Introduction to ns-2: “The” Network Simulator
WORKSHOP 3 GSE IMPORT.
Reliable Transport CS 3700 Project 3.
Including Your Modules into NS 2
Programming Language Concepts (CIS 635)
Chapter 12: Pointers, Classes, Virtual Functions, and Abstract Classes
Introduction to the C Language
Fork and Exec Unix Model
Python Lessons 13 & 14 Mr. Kalmes.
ns-3 Waf build system ns-3 Annual Meeting June 2017
Reliable Transport CS 3700 Project 3.
Network Performance modelling and simulation
Tonga Institute of Higher Education
Our Environment We will exercise on Microsoft Visual C++ v.6
Python 19 Mr. Husch.
Python Lesson’S 1 & 2 Mr. Kalmes.
Appendix F C Programming Environment on UNIX Systems
Lab 4: Introduction to Scripting
CISC 361 Operating Systems Midterm Review
SPL Programming – Procedure Pattern
Python 19 Mr. Husch.
SPL – PS1 Introduction to C++.
Presentation transcript:

http://nile.wpi.edu/NS/ Jae Chung and Mark Claypool NS2 by example http://nile.wpi.edu/NS/ Jae Chung and Mark Claypool

OTcl Linkage adding a new basic network object an example working around making OTcl linkage from C++ code an example creating a simple and dull agent called "MyAgent“ no behavior of an agent (i.e. no packet creation and transmission)

Export C++ class to OTcl MyAgent C++ Network Component Derived from Agent OTCL的物件 Linkage object between C++ and OTCL OTCL Agent/MyAgentOtcl The Linkage Objec

啟動時就會產生負責建立C++的object, 只會有一個 How it works NS started  executes static variable "class_my_agent" the "Agent/MyAgentOtcl" class and its appropriate methods (member functions) are created in OTcl space ) create an instance in OTcl space by "new Agent/MyAgentOtcl" "MyAgentClass::create" that creates an instance of "MyAgent" and returns the address. 啟動時就會產生負責建立C++的object, 只會有一個

Export C++ class variables to OTcl configure (or change) variables in C++ from OTcl using the input simulation script. binding functions are placed in the "MyAgent" constructor function - bind(): real or integer variables - bind_time(): time variable - bind_bw(): bandwidth variable - bind_bool(): boolean variable

Export C++ Object Control Commands to OTcl defining a "command" member function of your C++ object ("MyAgent")

Execute an OTcl command from C++. Example: to print message in OTcl space Get the address of “Tcl::instance()” Then you can use function in OTcl

Compile and Run Download "ex-linkage.cc" file, and save it under the "ns-2/common" directory. Open "Makefile", add “common/ex-linkage.o" at the end of object file list (OBJ_CC = ). Re-compile NS using the "make" command. Download the "ex-linkage.tcl" file that contains "MyAgent" testing OTcl commands. (see Figure 22 for the input script and the result) Run the OTcl script using command "ns ex-linkage.tcl".

Example argc = 2, argv[0], argv[1]

Add New Queue Objective priority 15 to Q1 Others to Q2 Total queue size (Q1+Q2) <=PQ Serve Q1 and Q2 in turn

Constructor 物件建立時會執行

Compile and Run Download “dtrr-queue.h“ & “dtrr-queue.cc” files, and save it under the "ns-2/queue" directory. Open "Makefile", add “queue/dtrr-queue.o" at the end of object file list (OBJ_CC = ). Re-compile NS using the "make" command. Download and run the "ex-dtrr-queue1.tcl” file

ex-dtrr-queue1.tcl 修改成根據flow id (fid)來判斷 Fid=1 to queue 1, high priority Otherwise, to queue 2, low priority Observe that no loss at CBR flow if it is set to fid=1.