1 Network Simulation Using GlomoSim Presented By Akarapon Kunpisut.

Slides:



Advertisements
Similar presentations
How to use TinyOS Jason Hill Rob Szewczyk Alec Woo David Culler An event based execution environment for Networked Sensors.
Advertisements

INTRODUCTION TO SIMULATION WITH OMNET++ José Daniel García Sánchez ARCOS Group – University Carlos III of Madrid.
1 NS-2 Tutorial COMP R2 University of Manitoba March 4, 2009.
Wireless Communication : LAB 3
Introduction 1.  A Simulator  Modular (Component-based)  Open-architecture  For Discrete Event Networks.
Network Simulation One tool to simulation network protocols for the Internet is the network simulator (NS) The simulation environment needs to be set-
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.
Taekyung Kim 0x410 ~ 0x International Standards Organization (ISO) is a multinational body dedicated to worldwide agreement on international.
Spring 2000CS 4611 Introduction Outline Statistical Multiplexing Inter-Process Communication Network Architecture Performance Metrics.
GloMoSim Basics Nirbhay Chaubey Ph.D Student, Computer Science Dept. Gujarat University, Ahmedabad 1.
Emulatore di Protocolli di Routing per reti Ad-hoc Alessandra Giovanardi DI – Università di Ferrara Pattern Project Area 3: Problematiche di instradamento.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 1 Version 4.0 Communicating over the Network Network Fundamentals – Chapter 2.
Ad-Hoc Networking Course Instructor: Carlos Pomalaza-Ráez D. D. Perkins, H. D. Hughes, and C. B. Owen: ”Factors Affecting the Performance of Ad Hoc Networks”,
Random Access MAC for Efficient Broadcast Support in Ad Hoc Networks Ken Tang, Mario Gerla Computer Science Department University of California, Los Angeles.
Exploiting the Unicast Functionality of the On- Demand Multicast Routing Protocol Sung-Ju Lee, William Su, and Mario Gerla
Performance Comparison of Routing Protocols for Ad Hoc Networks PATTERN ENDIF Ferrara.
In-Band Flow Establishment for End-to-End QoS in RDRN Saravanan Radhakrishnan.
Fair Sharing of MAC under TCP in Wireless Ad Hoc Networks Mario Gerla Computer Science Department University of California, Los Angeles Los Angeles, CA.
1 Link Layer & Network Layer Some slides are from lectures by Nick Mckeown, Ion Stoica, Frans Kaashoek, Hari Balakrishnan, and Sam Madden Prof. Dina Katabi.
Isolation of Wireless Ad hoc Medium Access Mechanisms under TCP Ken Tang,Mario Correa,Mario Gerla Computer Science Department,UCLA.
Component-Based Routing for Mobile Ad Hoc Networks Chunyue Liu, Tarek Saadawi & Myung Lee CUNY, City College.
Gursharan Singh Tatla Transport Layer 16-May
Lecturer: Tamanna Haque Nipa
Network Simulation Internet Technologies and Applications.
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.
The Transport Layer.
Redes Inalámbricas Máster Ingeniería de Computadores 2008/2009 Tema 7.- CASTADIVA PROJECT Performance Evaluation of a MANET architecture.
NetSim ZigBee Simulation Code Walkthrough in 10 steps
A Simple and Effective Cross Layer Networking System for Mobile Ad Hoc Networks Wing Ho Yuen, Heung-no Lee and Timothy Andersen.
Introduction to NS2 -Network Simulator- -Prepared by Changyong Jung.
1 Measuring and Explaining Differences in Wireless Simulation Models Dheeraj Reddy, George F. Riley, Yang Chen, Bryan Larish Georgia Institute of Technology.
Institut für Betriebssysteme und Rechnerverbund Technische Universität Braunschweig Multi hop Connectivity in Mobile Ad hoc Networks (MANETs) Habib-ur.
CS 6401 Internetworking Outline Internet Architecture Best Effort Service Model.
Fair Sharing of MAC under TCP in Wireless Ad Hoc Networks Mario Gerla Computer Science Department University of California, Los Angeles Los Angeles, CA.
QualNet Tutorial Yi Zheng.
Network Simulator-2 Sandeep singla 1998A2A7540. NS-2 A discrete event simulator Focused on modeling network protocols –Wired, wireless –TCP,UDP,unicast,multicast.
Dynamic Source Routing (DSR) Sandeep Gupta M.Tech - WCC.
Chapter 15 The Addressing Structure in NS. The Default Address Format 32 lower bits for port-id, 1 higher bit for mcast and the rest 32 higher bits for.
SRI International 1 A Simulation Comparison of TBRPF, OLSR, and AODV Richard Ogier SRI International July 2002.
Packet switching network Data is divided into packets. Transfer of information as payload in data packets Packets undergo random delays & possible loss.
On-Demand Routing Protocols Routes are established “on demand” as requested by the source Only the active routes are maintained by each node Channel/Memory.
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.
Monitoring Troubleshooting TCP/IP Chapter 3. Objectives for this Chapter Troubleshoot TCP/IP addressing Diagnose and resolve issues related to incorrect.
On the Accuracy of MANET Simulators David Cavin Yoav Sasson & André Schiper Presented by Michael W. Totaro Mobile Computing and Wireless Systems (MoCWiS)
July 7, 2003 Building a Wireless LAN traffic test case in ns2 Radio Science Laboratory Department of Electrical and Computer Engineering The University.
November 4, 2003Applied Research Laboratory, Washington University in St. Louis APOC 2003 Wuhan, China Cost Efficient Routing in Ad Hoc Mobile Wireless.
PERFORMANCE EVALUATION OF COMMON POWER ROUTING FOR AD-HOC NETWORK Zhan Liang Supervisor: Prof. Sven-Gustav Häggman Instructor: Researcher Boris Makarevitch.
The OSI Model A Framework for Communications David A. Abarca July 19, 2005.
Distributed-Queue Access for Wireless Ad Hoc Networks Authors: V. Baiamonte, C. Casetti, C.-F. Chiasserini Dipartimento di Elettronica, Politecnico di.
Reliable Adaptive Lightweight Multicast Protocol Ken Tang, Scalable Network Technologies Katia Obraczka, UC Santa Cruz Sung-Ju Lee, Hewlett-Packard Laboratories.
Network Models. The OSI Model Open Systems Interconnection (OSI). Developed by the International Organization for Standardization (ISO). Model for understanding.
LonWorks Introduction Hwayoung Chae.
LESSON Networking Fundamentals Understand TCP/IP.
Analysis the performance of vehicles ad hoc network simulation based
TrueTime.
Module 9 Writing Protocols
Simulators for Sensor Networks
Introduction to ns-2: “The” Network Simulator
Layered Architectures
Chapter 6 The Transport Layer.
اقتباس از Michael AuYeung و چند منبع ديگر ترجمه: مهدي عبداللهي
Karthik Sadasivam Banuprasad Samudrala
Govt. Polytechnic,Dhangar
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Ns-3 Tutorial Xin Li.
Efficient flooding with Passive clustering (PC) in Ad Hoc Networks
Network Basics and Architectures Neil Tang 09/05/2008
Modeling and simulation [NETW707] Tutorial5 – Introduction to Omnet++
Presentation transcript:

1 Network Simulation Using GlomoSim Presented By Akarapon Kunpisut

2 Outline Introduction to Glomosim Glomosim Structure Editing the code Installation Conclusion

3 Introduction 3 methods to analysis network protocol  Mathematical Analysis  Network Simulator (NS, GloMoSim, …)  Test bed

4 Network Simulator (GloMoSim) Requires 2 components  GloMoSim (Global Mobile Information Systems Simulation Library) Network Simulation Environment  Parsec (Parallel Simulation Environment for Complex Systems) C-Base Simulation Language

5 GloMoSim (Scalable Mobile Network Simulator ) a scalable simulation environment supports Wire & Wireless network layered approach Standard APIs parallel discrete-event simulation

6 Parsec C-based simulation language sequential and parallel execution discrete-event simulation models can be used as a parallel programming language. developed by the Parallel Computing Laboratory at UCLA

7 GloMoSim Simulation Layers RTP, TCP, UTP RSVP IP, Mobile IP Wireless Network Layer Clustering (optional) Data Link MAC Radio Model Propagation Model/Mobility Model ApplicationTraffic Generator VC Connection Management Call Acceptance Control, Rate Control Packet Store / Forward Congestion Control, Rate Control Multicast Routing QoS Routing

8 Models Currently Available in GloMoSim Application: TCPLIB (telnet, ftp), CBR (Constant Bit Rate traffic), Replicated file system, HTTP Transport: TCP (Free BSD), UDP, NS TCP (Tahoe) and others Unicast Routing: AODV, Bellman-Ford, DSR, Fisheye, Flooding, LAR (Scheme 1), NS DSDV, OSPF, WRP MAC Layer: CSMA, FAMA, MACA, IEEE Radio: Radio with and without capture capacity Propagation: Free Space, Rayleigh, Ricean, SIRCIM Mobility: Random Waypoint, Random Drunken, ECRV, Group Mobility

9 collection of network nodes each node has it’s own protocol stack parameters and statistics GloMoSim Layered Architecture struct glomo_node_str{ double position_x; GlomoMac macData[xxx]; GlomoNetwork NetworkData; … } GlomoNode; Include\api.h

10 Data Structure for a Layer each layer has its own data structure base on protocol in the layer struct glomo_mac_str { MAC_PROTOCOL macProtocol; int interfaceIndex; BOOL macStats; … void *macVar; } GlomoMac; mac\mac.h

11 Layer Interaction with Events Packets & Message going through layers are annotated with information that simulate inter-layer parameter passing

12 Scheduling Events Two types of Message  Non-Packet Messages Inter-layer event messages Self scheduled (timer) events  Packets/ Cell Messages Inter-node packets Inter-layer packets

13 MAC Radio RadioAccnoiseLayer() GLOMO_MacReceiveRadioS tatusChangeNotification() Inter-layer event messages Mac802_11StartTimer() GLOMO_MacLayer() Non-packet Message Self scheduled (timer) events MSG_MAC_TimerExpired typedef enum { RADIO_IDLE, RADIO_SENSING, RADIO_RECEIVING, RADIO_TRANSMITTING } RadioStatusType;

14 MAC Radio Layer Packet/cell Message Network NetworkIpSend PacketToMacLayer() GLOMO_MacNetwork LayerHasPacketToSend() Mac802_11TransmitDataFrame() Inter-layer packets GLOMO_RadioStartTransmittingPacket() Add Header Inter-layer packets Radio Layer Network MAC GLOMO_MacReceive PacketFromRadio () RadioAccnoiseLayer () Inter-layer packets NetworkIpReceive PacketFromMacLayer() Mac802_11ProcessFrame() Remove Header Inter-layer packets Inter-Node Packet

15 Network MAC GLOMO_MacReceive PacketFromRadio () RadioAccnoiseLayer () Inter-layer packets NetworkIpReceive PacketFromMacLayer() Mac802_11ProcessFrame() Remove Header Inter-layer packets Radio Layer MAC Radio Layer Packet/cell Message Network NetworkIpSend PacketToMacLayer() GLOMO_MacNetwork LayerHasPacketToSend() Mac802_11TransmitDataFrame() Inter-layer packets GLOMO_RadioStartTransmittingPacket() RadioAccnoiseLayer () Add Header Inter-layer packets (Network Layer Packet) (MAC Header Frame) + (Network Layer Packet) Inter-Node Packet /* Data frames. */ Header + Data typedef struct M802_mac_frame { M802_11FrameHdr hdr; char payload[ MAX_NW_PKT_SIZE]; } M802_11_MacFrame; typedef struct _Mac802_11FrameHdr {unsigned short frameType; char Padding1[2]; int duration; NODE_ADDR destAddr; NODE_ADDR sourceAddr; … } M802_11FrameHdr;

16 Data Structure for Layer Interaction Enumerate event type enum { /* for Channel layer */ MSG_CHANNEL_FromChannel, MSG_CHANNEL_FromRadio, /* Message Types for MAC layer */ MSG_MAC_FromNetwork, MSG_MAC_TimerExpired, … /* Default Message */ MSG_DEFAULT }; include\structmsg.h

17 Data Structure for Layer Interaction Message Structure (general information) struct message_str { short layerType; // Layer will received message short protocolType; short eventType; char* packet; char* payLoad; … } message; include\message.h

18 Data Structure for Layer Interaction Message header (for packet) typedef struct _Mac802_11LCtrlFrame { unsigned short frameType; char Padding[2]; int duration; NODE_ADDR destAddr; NODE_ADDR sourceAddr; char FCS[4]; } M802_11LongControlFrame; \mac\802_11.h

19 Message Parameters Message Destination:  Node ID  Layer in that node  Protocol in that layer (optional)  Instance (Interface) optional Message Event Type Event Specific Parameters called info  Both packets and non-packet messages Packet payload Current header position

20 Scheduling an Event Allocate the GloMoSim Message:  Message* msg = GLOMO_MsgAlloc(node, MyID, MyLayer, MyProtocol, MSG_LAYER_PROTO_MY_EVENT); Set the Event Specific Information:  MyEventInfoType* MyEventInfo;  GLOMO_MsgInfoAlloc(node, msg, sizeof(MyEventInfoType));  MyEventInfo-> MyFirstParameter =1;  … Schedule the Event:  GLOMO_MsgSend(node, message, MyChosenDelay);

21 void Mac802_11StartTimer( GlomoNode *node, GlomoMac802_11 *M802, clocktype timerDelay) { Message *newMsg; M802->timerSequenceNumber++; newMsg = GLOMO_MsgAlloc(node, GLOMO_MAC_LAYER, MAC_PROTOCOL_802_11, MSG_MAC_TimerExpired); GLOMO_MsgSetInstanceId(newMsg, M802->myGlomoMac- >interfaceIndex); GLOMO_MsgInfoAlloc(node, newMsg, sizeof(M802- >timerSequenceNumber)); *((int*)(newMsg->info)) = M802->timerSequenceNumber; GLOMO_MsgSend(node, newMsg, timerDelay); } Scheduling an Event (Example) Allocate the GloMoSim Message Set the Event Specific Information Schedule the Event Destination Layer

22 Message Scheduling GLOMO_MsgSend(node, *msg, delay) GLOMO_CallLayer( node, msg) GLOMO_RADIO_LAYER: GLOMO_RadioLayer(node, msg) GLOMO_MAC_LAYER: GLOMO_MacLayer(node, msg); … GLOMO_APP_LAYER: GLOMO_AppLayer(node, msg); if delay == 0 (msg)->layerType

23 Processing Message Events void Mac802_11Layer(GlomoNode *node, int interfaceIndex, Message *msg) { switch (msg->eventType) { case MSG_MAC_TimerExpired) Mac802_11HandleTimeout(node, M802); case MSG_MAC_TimerExpired_PCF) Mac802_11HandleTimeout_PCF(node, M802); … } GLOMO_MsgFree(node, msg); }

24 Transmitting Packet Allocate Message  Message* pktToRadio = GLOMO_MsgAlloc(node, 0, 0, 0); Set Header Information  hdr.frameType = M802_11_DATA;  hdr.sourceAddr = node->nodeAddr;  hdr.destAddr = destAddr;  … Allocate Packet & Set information  GLOMO_MsgPacketAlloc(node, pktToRadio, topPacket- >packetSize);  memcpy(pktToRadio->packet, topPacket->packet, topPacket->packetSize);

25 Transmitting Packet (cont’d) Add Header & Set information  GLOMO_MsgAddHeader(node, pktToRadio, sizeof(M802_11FrameHdr) );  memcpy(pktToRadio->packet, &hdr, sizeof(M802_11FrameHdr)); Transmit Packet  StartTransmittingPacket(node, M802, pktToRadio, M802_11_DIFS);

26 Processing Packet Mac802_11ReceivePacketFromRadio(){ if (hdr->destAddr == node->nodeAddr) { switch (hdr->frameType) { case M802_11_RTS: … case M802_11_DATA: } else if (hdr->destAddr == ANY_DEST){ switch (hdr->frameType) { case M802_11_DATA: Mac802_11ProcessFrame(node, M802, msg); … }

27 Message Function GLOMO_MsgAlloc(node, destId, layer, protocol, enent_type); Functions to retrieve and set parameters individually. GLOMO_MsgInfoAlloc(node, msg, info_size); GLOMO_MsgPacketAlloc(node, msg, packet_size); GLOMO_MsgAddHeader(node, msg, header_size); GLOMO_MsgRemoveHeader(node, msg, header_size); GLOMO_MsgSend(node, msg, delay); GLOMO_MsgFree(node, msg); GLOMO_MsgCopy(node, msg);

28 Editing your code

29 Basic Structure /doc contains the documentation /scenarios contains directories of various sample configuration topologies /main contains the basic framework design /bin for executable and input/output files /include contains common include files

30 Basic Structure (cont’d) /application contains code for the application layer /transport contains the code for the transport layer /network contains the code for the network layer /mac contains the code for the mac laye /radio contains the code for the physical layer

31 Configuration file (\bin\ Config.in) General Simulation Parameter Scenario Topology & Mobility Radio & Propagation Model MAC Protocol Routing Protocol Transport Protocol Application (Traffic Generators) Statistical & GUI options

32 Configuration file (Example) [config.in] NUMBER-OF-NODES3 NODE-PLACEMENTFILE NODE-PLACEMENT-FILE./nodes.input #NODE-PLACEMENTUNIFORM MAC-PROTOCOL NETWORK-PROTOCOLIP ROUTING-PROTOCOLBELLMANFORD APP-CONFIG-FILE./app.conf RADIO-TYPE RADIO-ACCNOISE [nodes.input] 0 0 (20.2, 0.9, 0.11) 1 0 (80.4, 90.8, 0.17) 2 0 (60.7, 30.4, 0.10) [app.conf] #CBR # CBR S 0S 0S

33 In the directory Application MAC Radio Transport … mac.pc 802_11.h 802_11.pc cama.h csma.pc (.h) Basic Definition of functions and data objects (.pc) Actual Functions (Layer.pc) Layer Interface

34 Adding a model or protocol to a layer Initialization Function Finalization Function Simulation Event Handling Function GLOMOPartition() Upper Layer Lower Layer Needs 3 functions

35 Data structure in specific layer typedef struct glomo_mac_802_11_str { GlomoMac* myGlomoMac; int state; /* Statistics collection variables. */ long pktsSentUnicast; … } GlomoMac802_11;

36 Initialization Function void Mac802_11Init (GlomoNode *node, int interfaceIndex, const GlomoNodeInput *nodeInput) { GlomoMac802_11 *M802 = (GlomoMac802_11*) checked_pc_malloc(sizeof(GlomoMac802_11)); M802->myGlomoMac = node->macData[interfaceIndex]; M802->myGlomoMac->macVar = (void *)M802; // Init Data here M802->pktsSentUnicast = 0; }

37 Event Handling Function void Mac802_11Layer (GlomoNode *node, int interfaceIndex, Message *msg) { int timerSequenceNumber = *(int*)(msg->info); // handle simulation “message” Mac802_11HandleTimeout(node, M802); GLOMO_MsgFree(node, msg); }

38 Finalization Function void Mac802_11Finalize (GlomoNode *node, int interfaceIndex) { GlomoMac802_11 *M802 = (GlomoMac802_11*)node->macData[interfaceIndex]->macVar; if (M802->myGlomoMac->macStats == TRUE) { Mac802_11PrintStats(node, M802); } sprintf(buf, "UCAST (non-frag) pkts sent " "to chanl: %ld", M802->pktsSentUnicast); GLOMO_PrintStat(node, "802.11", buf); }

39 Obtaining the information Select what layer you want the statistics for APPLICATION-STATISTICS YES TCP-STATISTICS NO NETWORK-LAYER-STATISTICS YES MAC-LAYER-STATISTICS YES RADIO-LAYER-STATISTICS NO CHANNEL-LAYER-STATISTICS NO MOBILITY-STATISTICS NO config.in

40 Sifting through the Data Sample Output from 1 node: Glomo.stat Node: 0, Layer: , pkts from network: 0 Node: 0, Layer: , BCAST pkts sent to chanl: 69 Node: 0, Layer: NetworkIp, Number of Packets Routed For Another Node: 0 Node: 0, Layer: NetworkIp, Number of Packets Delivered To this Node: 4549 Node: 1, Layer: , pkts from network: 0 Node: 1, Layer: , UCAST (non-frag) pkts sent to chanl: 2499 Node: 1, Layer: , BCAST pkts sent to chanl: 67 …

41 Sifting through the Data Stats Printed for Each Node You’ll Probably need to add Statistics

42 Adding Stats Go through Header and add for Statistic Variables typedef struct glomo_mac_802_11_str { GlomoMac* myGlomoMac; int state; /* Statistics collection variables. */ long pktsSentUnicast; … < Add Stat here !!! } GlomoMac802_11; 802_11.h

43 Adding Stats Initialize your extra stat to zero in the initialize function void Mac802_11Init(){ M802->myGlomoMac = node->macData[interfaceIndex]; M802->state = M802_11_S_IDLE; /* initial Statistic Variable to zero */ M802->pktsSentUnicast = 0; M802->pktsSentBroadcast = 0; M802->pktsGotUnicast = 0; … }

44 Adding Stats Add code to increment your counter void Mac802_11ProcessFrame(){ hdr = (M802_11FrameHdr *)frame ->packet; if (hdr->destAddr == ANY_DEST) { M802->pktsGotBroadcast++; } else{ M802->pktsGotUnicast++; … GLOMO_MsgFree(node, frame); }

45 Adding Stats Add a print statement in “Finalize” function void Mac802_11Finalize(){ M802 = node->macData[interfaceIndex]->macVar; sprintf(buf, "UCAST (non-frag) pkts sent " "to chanl: %ld", M802->pktsSentUnicast); GLOMO_PrintStat(node, "802.11", buf); sprintf(buf, "BCAST pkts sent to chanl: “, "%ld", M802->pktsSentBroadcast); GLOMO_PrintStat(node, "802.11", buf); … }

46 Obtaining Glomosim/Parsec Web site:   Questions:  PARSEC:  GloMoSim: Scalable Mobile Network Simulator

47 Inside the Source Program glomosim-2.0 \glomosim\parsec

48 Installing Parsec copy correct directory to be parsec in … Linux Windows /usr/local/parsec C:\Parsec \glomosim-2.0\parsec\

49 Installing Parsec Windows (Set Environment Variable)  path %path%;c:\devstudio\vc\bin; c:\devstudio\sharedide\bin  set INCLUDE=c:\devstudio\vc\include  set LIB=c:\devstudio\vc\lib

50 Installing GloMoSim UNIX (go to /glomosim/main)  Run "make depend" to create list of depndencies in the Makefile.  Make sure that the right path for the Parsec compiler is specified in the Makefile for the "PAR" variable.  Run "make" to create the executable Windows (go to c:\glomosim\main  Run “makent” to create the executable

51 Compiling GloMoSim (optional) compiles only specific layer by  “make _layerName” or “makent _layerName”  for example  prompt> makent MAC

52 Runnig Program Go to directory glomosim/bin -> type: “glomosim config.in“

53 For gcc v.2.96 and higher setenv (or set or export, depending on your shell) the environment variable PCC_PP_OPTIONS "-D__builtin_va_list= void* -D__STRICT_ANSI__ -E -U__GNUC__ -I."

54 End