Performing RWA Simulation With NS An introduction to NS & RWA simulation constructs.

Slides:



Advertisements
Similar presentations
Object Oriented Programming
Advertisements

TRAINING SERVICES NIGTEL-CS TRAINING SERVICE Mobile Telecommunications in Africa especially Nigeria has recorded rapid growth and expansion in the.
Wireless Communication : LAB 3
CSC458 Programming Assignment II: NAT Nov 7, 2014.
1 ns-2 Tutorial, part 2 Dave Anderson, Xiaowei Yang (Modified from Polly Huang’s slides)
Network Simulation One tool to simulation network protocols for the Internet is the network simulator (NS) The simulation environment needs to be set-
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,
LAB 3 NS2 Preliminaries. Contents TCL/OTCl Fundamentals Creating Network Setting Connections Generating Traffic Inserting Errors Configuring for multicast.
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.
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??
1 Special Topics: Diffserv Model Xuan Chen Nov 22, 2002.
1 Chapter 5 Nodes and Packet Forward Reporters:m 林青 m 曾慶昌.
15-744: Computer Networking ns-2 Tutorial Based on slides from John Heidemann, Polly Huang, and Amit Manjhi.
Color Aware Switch algorithm implementation The Computer Communication Lab (236340) Spring 2008.
1 Internet Networking Spring 2004 Tutorial 13 LSNAT - Load Sharing NAT (RFC 2391)
Katz, Stoica F04 EECS 122 Introduction to Computer Networks (Fall 2003) Network simulator 2 (ns-2) Department of Electrical Engineering and Computer Sciences.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
A New Household Security Robot System Based on Wireless Sensor Network Reporter :Wei-Qin Du.
15-744: Computer Networking L-3 The network simulator ns-2 Slides loosely based on a tutorial by Polly Huang, ETH Zurich.
1 Introduction to C++ Programming Concept Basic C++ C++ Extension from C.
P2P Over MANET An Introduction to Mobile Resource Sharing.
Color Aware Switch algorithm implementation The Computer Communication Lab (236340) Spring 2008.
C++ fundamentals.
NS2 Tutorial Aga Zhang Dependable Computing Lab. Outline Introduction Fundamental Skills - Tcl and OTcl Network Simulator - ns-2 Study Project - Mobile.
Network Management Concepts and Practice Author: J. Richard Burke Presentation by Shu-Ping Lin.
QualNet 2014/05/ 尉遲仲涵. Outline Directory Structure QualNet Basic Message & Event QualNet simulation architecture Protocol Model Programming.
OMNET++. Outline Introduction Overview The NED Language Simple Modules.
Redes Inalámbricas Máster Ingeniería de Computadores 2008/2009 Tema 7.- CASTADIVA PROJECT Performance Evaluation of a MANET architecture.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
NS2 Tutorial for CS740 Jianming Wu *modified from Aga Zhang.
Unified Modeling Language, Version 2.0
JIA-HUI HUANG INSTITUTE OF COMPUTER SCIENCE AND INFORMATION ENGINEERING NATIONAL TAIPEI UNIVERSITY OF TECHNOLOGY Network Simulator – NS-2 1.
1 Network Simulator Tutorial. 2 Network Simulation * Motivation: Learn fundamentals of evaluating network performance via simulation Overview: fundamentals.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Hardware Implementation of a Signaling Protocol Polytechnic University Center for Advanced Technology in Telecommunications Haobo Wang Malathi Veeraraghavan.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
NS2 Chapter 5.  A node is an OTcl class, but most of its components are TclObjects.  All node contain at least the following components ◦ An address.
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,
Abstraction ADTs, Information Hiding and Encapsulation.
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 
NS-2 Shahin Shayandeh December 2004 Session 1. Ns-2, the Network Simulator  A discrete event simulator Simple model  Focused on modeling network protocols.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Applications and transport agent API 許庭瑋.
1 CSE Programming in C++. 2 Overview Sign roster list Syllabus and Course Policies Introduction to C++ About Lab 1 Fill Questionnaire.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Lab 2, Network Simulator ns2
1 NS-2: the network simulator 15 September 2005 Network Lab., SNU Changjee Joo.
LonWorks Introduction Hwayoung Chae.
Overview of VANET Project(2011) on NS2 Perspective Part 1 of 2 Jae-Myeong Lee Human-centric Mobile Computing Lab.
Jae Chung and Mark Claypool
(Modified from Polly Huang’s and last year’s original)
NS2_Trace and Monitoring support 報告者:羅士捷
Paul Ammann & Jeff Offutt
Systems Analysis and Design With UML 2
Introduction to ns-2: “The” Network Simulator
CHAPTER 3 Architectures for Distributed Systems
Introduction to NS Srinath Perur.
Object Oriented Analysis and Design
Karthik Sadasivam Banuprasad Samudrala
Network Performance modelling and simulation
Aga Zhang Dependable Computing Lab
Presentation transcript:

Performing RWA Simulation With NS An introduction to NS & RWA simulation constructs

Optical Networking Research Group Information Network Lab, USTC2 Outline Part I: NS Programming Basics Object oriented mechanisms Overview of NS Simulator The Lamp Example Packet Handling in NS—from a transport protocol’s perspective Part II: Build in NS a platform for RWA Simulation Network Model Architectural Overview Internals…

Optical Networking Research Group Information Network Lab, USTC3 What’s Object Oriented… Object An object is a software bundle of variables and related methods. [java.sun.com] Variable => State Methods => Behavior OOP. A software design method that models the characteristics of abstract or real objects using classes. [java.sun.com]

Optical Networking Research Group Information Network Lab, USTC4 Why Object Oriented… Modularity Easy for maintenance Easy for code Reuse Information hiding Transparency Security Inheritance Structuring and Organizing Software

Optical Networking Research Group Information Network Lab, USTC5 Object Oriented Programming struct a Class a member v1; member v2; method m1; method m2; … member v1; member v2; method m1; method m2; … variable v1; variable v2; … variable v1; variable v2; … procedure p Some operation on instances of struct a Class b base class a member v2b; method m2b; … member v2b; method m2b; …

Optical Networking Research Group Information Network Lab, USTC6 NS – A Schematic Overview C++ Compiled Hierarchy OTcl Interpreted Hierarchy

Optical Networking Research Group Information Network Lab, USTC7 NS – A Schematic Overview C++ /OTcl Implementation C++ and OTcl Interaction OTcl Object Implementation Simulation Scripts What to do? For ordinary users For Advanced users

Optical Networking Research Group Information Network Lab, USTC8 An Example -- Lamp May change ON/OFF Status May change brightness Status and Brightness may be monitored

Optical Networking Research Group Information Network Lab, USTC9 From this example, You will know how to… Implement a class in C++ Implement a class in OTcl Combine OTcl and C++ codes Write simple simulation scripts

Optical Networking Research Group Information Network Lab, USTC10 An Example: Lamp Interfaces: switch: switch the ON/OFF status of the lamp object show_status: Show the current ON/OFF status of the lamp object brighten: make the lamp object brighter darken: make the lamp object darker Member variables status: current status of the lamp object, {ON, OFF} brightness: current brightness of the lamp object in integer voltage, current, resistance: electro. character. of the lamp object OTcl C++ OTcl C++

Optical Networking Research Group Information Network Lab, USTC11 Lamp Implementation in C++ class Lamp_C: public TclObject { private: real resistance, current, voltage; int brightness; public: Lamp_C(real r) {resistance = r;} void brighten(int step); void darken(int step); } void Lamp_C::brighten(int step) { resistance -= log(step); //need check here!!! current = voltage/resistance; brightness = C*pow (current, 2); } void Lamp_C::darken(int step) { resistance +=log(step); //need check here!!! current = voltage/resistance; brightness = C*pow (current, 2); } class Lamp_C: public TclObject { private: real resistance, current, voltage; int brightness; public: Lamp_C(real r) {resistance = r;} void brighten(int step); void darken(int step); } void Lamp_C::brighten(int step) { resistance -= log(step); //need check here!!! current = voltage/resistance; brightness = C*pow (current, 2); } void Lamp_C::darken(int step) { resistance +=log(step); //need check here!!! current = voltage/resistance; brightness = C*pow (current, 2); } … Lamp_C mylamp = new Lamp_C(50.0); mylamp.brighten(10); mylamp.darken(30); … Lamp_C mylamp = new Lamp_C(50.0); mylamp.brighten(10); mylamp.darken(30); …

Optical Networking Research Group Information Network Lab, USTC12 Lamp Implementation in OTcl Class Lamp_TCL Lamp_TCL set status OFF Lamp_TCL set brightness 0 Lamp_TCL instproc switch { state } { $self instvar status if {$state != “”} { set status $state } return $status } Lamp_TCL instproc show_status { } { $self instvar status puts “Current status is :$status” puts “Current brightness is :$brightness” } Class Lamp_TCL Lamp_TCL set status OFF Lamp_TCL set brightness 0 Lamp_TCL instproc switch { state } { $self instvar status if {$state != “”} { set status $state } return $status } Lamp_TCL instproc show_status { } { $self instvar status puts “Current status is :$status” puts “Current brightness is :$brightness” } C:\ns-2.1b8win\ns ↲ % % set mylamp [new Lamp_TCL] % $mylamp show_status % $mylamp switch ON % $mylamp show_status Result: Current status is :OFF Current brightness is : 0 Current status is :ON Current brightness is : 0 C:\ns-2.1b8win\ns ↲ % % set mylamp [new Lamp_TCL] % $mylamp show_status % $mylamp switch ON % $mylamp show_status Result: Current status is :OFF Current brightness is : 0 Current status is :ON Current brightness is : 0

Optical Networking Research Group Information Network Lab, USTC13 Comparing C++ and OTcl class Lamp_C: public TclObject { private: real resistance, current, voltage; int brightness; public: Lamp_C(real r) {resistance = r;} void brighten(int step); void darken(int step); } void Lamp_C::brighten(int step) { // … } void Lamp_C::darken(int step) { //… } class Lamp_C: public TclObject { private: real resistance, current, voltage; int brightness; public: Lamp_C(real r) {resistance = r;} void brighten(int step); void darken(int step); } void Lamp_C::brighten(int step) { // … } void Lamp_C::darken(int step) { //… } Class Lamp_TCL Lamp_TCL set status OFF Lamp_TCL set brightness 0 Lamp_TCL instproc switch { state } { #... } Lamp_TCL instproc show_status { } { #... } Class Lamp_TCL Lamp_TCL set status OFF Lamp_TCL set brightness 0 Lamp_TCL instproc switch { state } { #... } Lamp_TCL instproc show_status { } { #... }

Optical Networking Research Group Information Network Lab, USTC14 NS: OTcl and C++ Combined Static class LampClass:public TclClass { public: LampClass::TclClass(“Lamp_TCL”) {} TclObject * create(int, const char * const *) { return (new Lamp_C( )); } }class_Lamp; Int Lamp_C::init( ){ … bind(“brightness”,&brightness); … } Static class LampClass:public TclClass { public: LampClass::TclClass(“Lamp_TCL”) {} TclObject * create(int, const char * const *) { return (new Lamp_C( )); } }class_Lamp; Int Lamp_C::init( ){ … bind(“brightness”,&brightness); … } int Lamp_C::command(int ac, const char*const* av){ if (strcmp(av[1], “brighten") == 0){ int step = atoi(av[2]); brighten(step); return TCL_OK; } if (strcmp(av[1], “darken”) == 0) { int step = atoi(av[2]); darken(step); return TCL_OK; } return TclObject::command(ac,av); } int Lamp_C::command(int ac, const char*const* av){ if (strcmp(av[1], “brighten") == 0){ int step = atoi(av[2]); brighten(step); return TCL_OK; } if (strcmp(av[1], “darken”) == 0) { int step = atoi(av[2]); darken(step); return TCL_OK; } return TclObject::command(ac,av); }

Optical Networking Research Group Information Network Lab, USTC15 NS: OTcl and C++ Combined if (strcmp(av[1], “darken”) == 0) { int step = atoi(av[2]); Tcl & tcl = Tcl::instance(); char cmd[50],ret[10]; sprintf(cmd, “%s switch”, name()); tcl.eval(cmd); if(strcmp(tcl.result(), “OFF”)){ return TCL_OK; } darken(step); return TCL_OK; } if (strcmp(av[1], “darken”) == 0) { int step = atoi(av[2]); Tcl & tcl = Tcl::instance(); char cmd[50],ret[10]; sprintf(cmd, “%s switch”, name()); tcl.eval(cmd); if(strcmp(tcl.result(), “OFF”)){ return TCL_OK; } darken(step); return TCL_OK; }

Optical Networking Research Group Information Network Lab, USTC16 NS: OTcl and C++ Combined C:\NetSim\ns-2.1b8a-win\ns ↲ % %set mylamp [new Lamp_TCL] % $mylamp show_status % $mylamp switch ON % $mylamp brighten 100 % $mylamp show_status % Result: Current status is :OFF Current brightness is : 0 Current status is :ON Current brightness is : 32 C:\NetSim\ns-2.1b8a-win\ns ↲ % %set mylamp [new Lamp_TCL] % $mylamp show_status % $mylamp switch ON % $mylamp brighten 100 % $mylamp show_status % Result: Current status is :OFF Current brightness is : 0 Current status is :ON Current brightness is : 32 Use OTcl –magic of manipulating:  Configuration, setup and one-time stuff  Manipulating existing C++ objects Use C++ –power of Computing:  Packet processing  Computational complex jobs  Anything you like !

Optical Networking Research Group Information Network Lab, USTC17 Lamp Conclusion Interfaces: switch, show_status, brighten, darken brighten, darken Member variables status brightness, voltage, current, resistance Implementation C++/OTcl OTcl Invocation in C++ : tcl.eval(...), tcl.result(...); C++ Invocation in OTcl : Lamp::command(...); Variable binding: bind(...);

Optical Networking Research Group Information Network Lab, USTC18 Packet Handling in NS: From A Protocol’s Perspective int RWAAgent::command(int argc, const char * const * argv){ … if (strcmp(argv[1],”get-connect-request”) = = 0){ Packet *pkt = allocpkt(); hdr_rwa *hdrrwa = hdr_rwa::access(pkt); hdrrwa->msg_type = CONNECTION_REQUEST; … send(pkt,0); } … } int RWAAgent::command(int argc, const char * const * argv){ … if (strcmp(argv[1],”get-connect-request”) = = 0){ Packet *pkt = allocpkt(); hdr_rwa *hdrrwa = hdr_rwa::access(pkt); hdrrwa->msg_type = CONNECTION_REQUEST; … send(pkt,0); } … } >>>

Optical Networking Research Group Information Network Lab, USTC19 Packet Handling in NS: From A Protocol’s Perspective void RWAAgent::recv(Packet* pkt, Handler*){ hdr_rwa *hdrrwa = hdr_rwa::access(pkt); int msgtype = hdrrwa->msg_type; … switch (msgtype){ case CONNECTION_REQUEST: //process this packet … break; … } Packet::free(pkt); } void RWAAgent::recv(Packet* pkt, Handler*){ hdr_rwa *hdrrwa = hdr_rwa::access(pkt); int msgtype = hdrrwa->msg_type; … switch (msgtype){ case CONNECTION_REQUEST: //process this packet … break; … } Packet::free(pkt); }

Optical Networking Research Group Information Network Lab, USTC20 Build in NS a platform for RWA Simulation Extensions to Class Simulator Extensions to Class Node RWA Agents new! Connection Request Generator new!

Optical Networking Research Group Information Network Lab, USTC21 Network Model

Optical Networking Research Group Information Network Lab, USTC22 Components DWDM Node Interfaces, Fibers, Wavelengths Wavelength Converter RWA Agent Simple Signaling(Connection Setup/Teardown) Routing (Fixed, Explicit Routing) Connection Request Generator Arrival Rate Hold Time

Optical Networking Research Group Information Network Lab, USTC23 Architectural Overview Linked_DWDM_nodes_ Linked_interfaces_ Linked_RWA_Agents_

Optical Networking Research Group Information Network Lab, USTC24 Architectural Overview RWA Agent DWDM Node Edge Node Transit Node Connect Request Generator RWA Peer

Optical Networking Research Group Information Network Lab, USTC25 Internals of Connection Request Generator Descriptions Base Class: TrafficGenerator Functionality: generating connection request Hold time … Destination node… Wavelength change allowed ? “$agent get-connect-request $ht $dst $change_allow”get-connect-request Configurable Parameters: Mean arrival rate Mean hold time

Optical Networking Research Group Information Network Lab, USTC26 Internals of RWA Agent Descriptions: Base Class: Agent Functionality: Packet processing Connection request/setup/release Route lookups Change node status A list of timers Connection timeouts …

Optical Networking Research Group Information Network Lab, USTC27 Internals of RWA Agent OTcl part Route lookups Interfacing with Node C++ Part Receiving/processing/sending packets Connection timeouts

Optical Networking Research Group Information Network Lab, USTC28 Structure of A RWA Packet struct hdr_rwa{ int src, dst; int sid; int msg_type; int fid, lambda; char er [MAX_HOPS*5] ; int rtptr; … } struct hdr_rwa{ int src, dst; int sid; int msg_type; int fid, lambda; char er [MAX_HOPS*5] ; int rtptr; … } Message Types: CONNECTION_REQUEST_MSG CONNECTION_RELEASE_MSG CONNECTION_CONFIRM_MSG CONNECTION_BLOCKED_MSG EXPLICIT_ROUTE_MSG Global Session ID: NODEID * CONST + local_sid …

Message Processing In RWA Agents

Optical Networking Research Group Information Network Lab, USTC30 Finding RWA Peers Node/DWDM instproc get-rwa-agent {peer_node} { $self instvar linked_rwa_agents_ set na [llength $linked_rwa_agents_] for {set i 0} {$i < $na } {incr i} { set rwa_agent [lindex $linked_rwa_agents_ $i] if {[$rwa_agent set peer_node_] == $peer_node} { return $rwa_agent } return -1 } Node/DWDM instproc get-rwa-agent {peer_node} { $self instvar linked_rwa_agents_ set na [llength $linked_rwa_agents_] for {set i 0} {$i < $na } {incr i} { set rwa_agent [lindex $linked_rwa_agents_ $i] if {[$rwa_agent set peer_node_] == $peer_node} { return $rwa_agent } return -1 }

Optical Networking Research Group Information Network Lab, USTC31 Internals of DWDM Node Descriptions Base class: Node Functionality Management of physical resources Data structures Lambda_table Converter_table ER_routing_table Connection_table

Optical Networking Research Group Information Network Lab, USTC32 Internals of DWDM Node OTcl part Attaching RWA agents/Traffic generator Interfacing with RWA Physical interface mapping (object  index) C++ Part A Lambda table /converter table /connection table Connection query interface Nodal statistics Static Routes

Optical Networking Research Group Information Network Lab, USTC33 Connection Table Structure struct connect_struct{ short src, dst; int global_sid_; short in_lambda, out_lambda; short in_inf, out_inf; short in_fid, out_fid; short prevhop; intholdtime; inter_entry; entry_statusstatus; }; struct connect_struct{ short src, dst; int global_sid_; short in_lambda, out_lambda; short in_inf, out_inf; short in_fid, out_fid; short prevhop; intholdtime; inter_entry; entry_statusstatus; }; sid = NODEID * CONST + local_sid [Prefix] [local] [Globally Unique] sid = NODEID * CONST + local_sid [Prefix] [local] [Globally Unique]

Connection Initiation and confirmation on Nodes

Connection Request Processing on Nodes

Optical Networking Research Group Information Network Lab, USTC36 To Start Simulation… Create Network Topology Create DWDM Nodes Build Links between Nodes Configure RWA Agents on every node Install Traffic Generator on Edge Nodes Configure Traffic Generators Install Static Routes On Edge Nodes Start Traffic and do an “$ns run”

Optical Networking Research Group Information Network Lab, USTC37 Thank You ! Questions are welcome…