scieee AI-readable full text Open interactive document viewer

Evaluation of the impact of mobility models on handover in WLAN indoor environments

Martínez Navarro, Jesús

Abstract

Nowadays, mobility models are used to simulate realistic movements produced by the users of a wireless or a mobile network. The aim of this project is to evaluate the impact of mobility models on handover process in Wireless Local Area Networks (WLAN) indoor environments, using the network simulator NS-2. This document contains a previous theoretical characterization of the basic mobility models and their application in the network simulator NS-2, a study of the infrastructure mode support and a modification of the current handover algorithm. The study focuses on two mobility models in WLAN indoor environments: one where movements are completely random (i.e. Random Waypoint) and another one where next step depends on previous movements (i.e. Gauss-Markov). In order to support infrastructure mode operation in WLAN, a new patch with modifications of the source code is applied. Furthermore, a first approach for the development of a new handover algorithm is presented. Simulations are run in two different scenarios: one with 4 Access Points (APs) offering full coverage in the simulated area, and another one with 8 APs, simulating overcoverage in order to guarantee higher capacity for a higher density of users. Results are presented showing a comparative of the cell residence time (CRT) for each scenario. From the results obtained, it is possible to see that the CRT changes depending on the algorithm and the mobility model applied, being lower when the Random Waypoint model is applied. On the other hand, the new handover algorithm designed from the current implementation leads to a decrease in the average CRT.

Full text

MASTER THESIS TITLE: Evaluation of the impact of mobility models on handover in WLAN indoor environments MASTER DEGREE: Master in Science in Telecommunication Engineering & Management AUTHOR: Jesús Martínez Navarro DIRECTOR: Enrica Valeria Zola DATE: January, 20th 2009 Title: Evaluation of the impact of mobility models on handover in WLAN indoor environments Author: Jesús Martínez Navarro Director: Enrica Valeria Zola Date: January, 20th 2009 Overview Nowadays, mobility models are used to simulate realistic movements produced by the users of a wireless or a mobile network. The aim of this project is to evaluate the impact of mobility models on handover process in Wireless Local Area Networks (WLAN) indoor environments, using the network simulator NS-2. This document contains a previous theoretical characterization of the basic mobility models and their application in the network simulator NS-2, a study of the infrastructure mode support and a modification of the current handover algorithm. The study focuses on two mobility models in WLAN indoor environments: one where movements are completely random (i.e. Random Waypoint) and another one where next step depends on previous movements (i.e. Gauss-Markov). In order to support infrastructure mode operation in WLAN, a new patch with modifications of the source code is applied. Furthermore, a first approach for the development of a new handover algorithm is presented. Simulations are run in two different scenarios: one with 4 Access Points (APs) offering full coverage in the simulated area, and another one with 8 APs, simulating overcoverage in order to guarantee higher capacity for a higher density of users. Results are presented showing a comparative of the cell residence time (CRT) for each scenario. From the results obtained, it is possible to see that the CRT changes depending on the algorithm and the mobility model applied, being lower when the Random Waypoint model is applied. On the other hand, the new handover algorithm designed from the current implementation leads to a decrease in the average CRT. INDEX INTRODUCTION................................................................................................1 CHAPTER 1. 802.11 WLANs.............................................................................3 1.1. Introduction and history............................................................................3 1.2. Architecture..............................................................................................3 1.2.1. Ad-Hoc mode....................................................................................3 1.2.2. Infrastructure mode...........................................................................4 1.2.3. Ad-Hoc mode vs. infrastructure mode...............................................5 1.3. Mobility models........................................................................................5 1.3.1. Random Waypoint Mobility Model.....................................................6 1.3.2. Gauss-Markov Mobility Model...........................................................7 CHAPTER 2. NETWORK SIMULATOR NS-2....................................................8 2.1. Introduction..............................................................................................8 2.2. Installation of NS-2 ..................................................................................8 2.3. TCL script example..................................................................................9 2.4. Mobility Tools......................................................................................... 12 2.4.1. Setdest............................................................................................ 12 2.4.2. Bonnmotion.....................................................................................13 2.5. Infrastructure mode support for IEEE 802.11 implementation in NS-2...13 2.5.1. Changes in NS-2............................................................................. 14 2.5.2. Inter-AP communication and mobility support................................. 15 CHAPTER 3. SIMULATION: STUDY OF HANDOVERS.................................. 17 3.1. Scenarios tested for infrastructure mode...............................................17 3.1.1. Scenario 1: 2 static nodes, 1 AP..................................................... 17 3.1.2. Scenario 2: 2 MNs, 4 APs and 1 switch ..........................................18 3.1.2.1. Static nodes connected to different AP .....................................19 3.1.2.2. Mobile nodes connect to the same AP...................................... 20 3.1.2.3. Mobile nodes connect to different APs...................................... 20 3.1.3. Scenario 3: 1 static node, 1 AP, 1 switch and 1 static host.............21 3.1.4. Scenario 4: 1 MN, 4 APs, 1 switch and 1 static host.......................22 3.2. Describing scenarios and handover strategies......................................24 3.2.1. Scenarios........................................................................................24 3.2.2. Handover algorithm......................................................................... 27 3.2.2.1. Current implementation in NS-2................................................27 3.2.2.2. Study of RSS ............................................................................27 CHAPTER 4. CELL RESIDENCE TIME........................................................... 30 4.1. Average CRT.........................................................................................30 4.1.1. Algorithm A...................................................................................... 30 4.1.2. Algorithm B...................................................................................... 31 4.1.2. Comparison.....................................................................................32 4.2. CRT distribution.....................................................................................33 CHAPTER 5. CONCLUSIONS AND ENVIRONMENTAL IMPACT..................39 5.1. Conclusions...........................................................................................39 5.2. Environmental impact ............................................................................39 BIBLIOGRAPHY AND REFERENCES............................................................. 41 ANNEXES........................................................................................................43 Simulation scripts.......................................................................................... 43 Scenario with 4 APs..................................................................................43 Scenario with 8 APs..................................................................................49 Acronyms list ACK Æ Acknowledgement ACRP Æ Association Reply ACRQ Æ Association Request AP Æ Access Point AUTH Æ Authentication BCN Æ Beacon frame BSS Æ Basic Service Set BSSID Æ Basic Service Set Identifier CV Æ Coefficient of variation CONSER Æ Collaborative Simulation for Education and Research CRT Æ Cell Residence Time DARPA Æ Defense Advanced Research Projects Agency ESS Æ Extended Service Set ESSID Æ Extended Service Set Identifier FCC Æ Federal Communications Commission GM Æ Gauss-Markov HO Æ Handover IBSS Æ Independent Basic Service Set ISM Æ Industrial, Scientific and Medical band LAN Æ Local Area Network NIC Æ Network Interface Card NS Æ Network Simulator RSS Æ Received Signal Strength RWP Æ Random Waypoint SAMAN Æ Simulation Augmented by Measurement and Analysis for Networks STA Æ Station UDP Æ User Datagram Protocol WLAN Æ Wireless Local Area Network Introduction 1 INTRODUCTION The aim of this project is to evaluate the impact of mobility models in WLAN indoor environments on handover process, running simulations in infrastructure mode and providing a new handover algorithm. The project is divided into four sections. The first chapter is an introduction to WLANs and mobility models. The second section contains information about the network simulator NS-2 and the modifications applied to achieve the infrastructure mode. Firstly, the current 802.11 implementation in NS-2 will be checked, applying a new patch and changing the source code in order to achieve infrastructure mode simulations. This operation mode will be tested in different configurations. Chapter 3 is dedicated to the study of handovers and the scenarios applied in the final simulations. Two different scenarios will be created with 4 APs and 8 APs for the simulations. The scenario with 8 APs simulates a network where the number of users rises and it is necessary to offer more capacity. Furthermore, two mobility models will be applied: Random Waypoint and Gauss-Markov. In the first one, movements are completely random and in the second one, next step depends on previous movements. Results are displayed in chapter 4, showing comparative tables and graphics of the average cell residence time and its distribution for each scenario. Finally, some conclusions will be exposed examining the results obtained to describe the impact that these models have on the network parameters, and adding possible future work related to the current project. 802.11 WLANs 3 CHAPTER 1. 802.11 WLANs 1.1. Introduction and history Wireless Local Area Network (WLAN) is a communication system of wireless data, commonly used as an alternative to the wired LANs or as an extension of them. It uses radiofrequency technology that allows more mobility to the user because of the absence of cables. WLANs are subject to interference from other electromagnetic sources and can be affected by other interference which causes performance degradation. The power usage is limited, too. The development of radio-based LAN components was possible in 1985, when the Federal Communications Commission (FCC) authorized the public use of the Industrial, Scientific and Medical (ISM) bands; between 902 MHz and 5.85 GHz. People began developing radios and access points without a standard [1]. And in the late 1980s, the IEEE 802 working group developed the Wireless LAN (Local Area Network) Medium Access Control and Physical Layer specifications. The standard was published in 1997, concretely on November 18th. 1.2. Architecture The 802.11 standard defines two operating modes in a wireless network: Ad- Hoc mode and infrastructure mode. While the infrastructure mode setups devices to communicate through an access point, the Ad-Hoc mode works with a direct communication between them. 1.2.1. Ad-Hoc mode Ad-Hoc mode allows the radio network interface card (NIC) to operate in an Independent Basic Service Set (IBSS) network configuration [2]. As it does not requires access points, devices communicate directly with each other in a peer- to-peer mode. Working on this mode, it is possible to form a wireless LAN by only using the devices to connect, without access points or cables. The use of Ad-Hoc mode does not affect the physical layer because only affects the protocols. For that reason, the MAC Layer has all the responsibility. During the process, the active Ad-Hoc station establishes an IBSS and start sending beacons. These frames are needed for the synchronization. The other Ad-Hoc stations, once receive a beacon, they can accept the IBSS parameters and join 10 Evaluation of the impact of mobility models on handover in WLAN indoor environments Then, it is necessary to open a file which will be used for the nam trace data, firstly opening the file “out.nam” for writing and then, creating the trace file where all the relevant data in the simulation will be written. After that, the “finish” procedure is in charge of closing the trace file and starting nam as follows: The next two lines tell the simulator object to execute the “finish” procedure after 5.0 seconds of simulation time and then, to start the simulation. The written code can be useful to start any topology and, to start with a simple one, it is going to be created two nodes and one link. This code will be inserted just before the “proc finish” line. Two nodes have been created, assigning their handles “n0” and “n1”. In order to connect them it is necessary to add: set ns [new Simulator] Set nf [open out.nam w] $ns namtrace-all $nf proc finish {} { global ns nsf $ns flush-trace close $nf nam out.nam & exit 0 } $ns at 5.0 “finish” $ns run set n0 [ns node] set n1 [ns node] $ns duplex-link $n0 $n1 1Mb 10 ms DropTail Network Simulator NS-2 11 This line tells the simulator object to connect the two nodes with a duplex link with 1 Megabit bandwidth, a delay of 10 ms and a DropTail queue. Once the script is saved, it is possible to execute it with the command “ns example.tcl” and to see a nam output like the next: Fig 2.1 Two nodes, one link [6] But, by now, it is only possible to look at the topology. So, the next step is to send some data from node n0 to node n1, from one “agent” to another one (ns uses “agents” to send and receive data). The lines above create a UDP (User Datagram Protocol) agent and attach it to the node n0, then attach a CBR (constant bit rate) traffic generator to the UDP agent. Packet size is fixed to 500 bytes and a packet will be sent every 0.005 seconds. The lines below are added in order to create a Null agent which acts as traffic sink for node n1: #Create a UDP agent and attach it to node n0 set udp0 [new Agent/UDP] $ns attach-agent $n0 $udp0 # Create a CBR traffic source and attach it to udp0 set cbr0 [new Application/Traffic/CBR] $cbr0 set packetSize_ 500 $cbr0 set interval_ 0.005 set null0 [new Agent/Null] $ns attach-agent $n1 $null0 12 Evaluation of the impact of mobility models on handover in WLAN indoor environments Finally, it is necessary to connect the two agents with each other and to tell the CBR agent the moment to send data and the moment to stop sending it. Saving the script and typing again “ns example.tcl”, at this moment is possible to see the simulation in the nam window, how node 0 starts sending data packets to node 1 after 0.5 simulation seconds. It is seen like figure 2.2: Fig. 2.2 Two nodes, one link and sending data [7] 2.4. Mobility Tools There are different ways to generate movement for MNs in NS-2. Setdest and Bonnmotion, used in this project, are exposed in this section. 2.4.1. Setdest Setdest tool is used to generate the position of nodes, their moving speed and moving directions. It is integrated in the package ns-allinone-2.31 [6] and it follows this syntax: Where the meaning of the parameters are the next: $ns connect $udp0 $null0 $ns at 0.5 "$cbr0 start" $ns at 4.5 "$cbr0 stop" setdest -v -n -s -m -M -t -P -p -x -y > scenario-name.tcl Network Simulator NS-2 13 v Æ Version: 1 = 1999 CMU, 2 = 2003 UM n Æ Number of nodes in the scenario s Æ Speed distribution: 1 = uniform, 2 = normal m Æ Minimum speed in m/s M Æ Maximum speed in m/s T Æ Simulation time in seconds P Æ Pause type: 1 = constant, 2 = uniform p Æ Pause time in seconds x Æ Length of the scenario in the x axis y Æ Length of the scenario in the y axis In this project, this tool is used to generate the Random Waypoint mobility model. On the other hand, Bonnmotion tool is used to generate the Gauss- Markov mobility model because setdest does not support it. 2.4.2. Bonnmotion Bonnmotion [8] is a Java software developed in the Communication Systems group at the Institute of Computer Science IV of the University of Bonn [8]. It creates mobility scenarios and analyzes them. The scenarios can be exported for NS-2 and for GlomoSim/QualNet, too. It supports the Random Waypoint model, the Gauss-Markov model, the Manhattan Grid model and the Reference Point Group model. Once the software is installed, to start generating mobility the two command lines to apply are the next: The defining parameters are: n Æ Number of nodes d Æ Duration, simulation time in seconds x Æ Length of the scenario in the x axis y Æ Length of the scenario in the y axis uniformSpeed Æ Speed distribution: true = uniform, false = normal 2.5. Infrastructure mode support for IEEE 802.11 implementation in NS-2 Infrastructure mode simulations are not supported in the existing 802.11 implementation in NS-2.31. The patch applied [9] [10] supports Passive and bm -f scenario1 RandomWaypoint -n -d -x -y bm NSFile -f scenario1 14 Evaluation of the impact of mobility models on handover in WLAN indoor environments Active Scanning, Authentication, Association, Inter-AP communication and mobility support (Handoff). This section outlines the changes which have to be made to the existing NS-2.31 802.11 implementation, to enable infrastructure mode support. 2.5.1. Changes in NS-2 • Beacon Frames and Passive Scanning A node configured as an AP will start transmitting beacon frames every Beacon Interval using BeaconTimer. sendBEACON() function builds the beacon packet and chk_pktBEACON() transmits it. The main fields are Address and BSSI information, Timestamp and Beacon Interval. All the relevant information is stored by recvBEACON(), the beacon reception function. If Scan Type is configured as PASSIVE, the RSS (Received Signal Strength) of all beacons received during ChannelTime are stores and the best AP is determined using passive_scan(). It exists a linked list containing the list of APs and beacon powers, too. Once passive scanning is over, STAs can move on to authentication and association. • Probe frames and Active Scanning When the ScanType of a STA is ACTIVE, it sends out a broadcast Probe Request, which will be received by all APs in range. This probe request transmissions are made through the functions sendPROBEREQ() and check_pktPROBEREQ(); the APs use recvPROBEREQ to receive them and evoke unicast Probe Responses, containing the same information as a Beacon frame, using sendPROBEREP() and check_pktPROBEREP(). At this moment recvPROBEREP is called to store the information in the probe frame. To handle active scanning was created Probe timer, which can be run for the time intervals MinChannelTime and MaxChannelTime. MinChannelTime is the time to declare a channel empty and channel will be declarer devoid of APs if CCA (Clear Channel Assessment) busy is not indicated for this time. On the other hand, MaxChannelTime will be handled if CCA busy was not indicated within MinChannelTime, collecting all Probe Responses After expiring Probe Timer, using active_scan(), the STA processes all the probe responses and selects the strongest AP based on RSS measurements. Network Simulator NS-2 15 • Authentication The function in charge of starting the authentication process of each STA is checkAssocAuthStatus(). This process takes place when the best AP has been determined and the scanning is over. Each STA sends out an Authentication frame to its strongest AP containing sequence number 1 and the specific BSSID. This frame is built by sendAUTHENTICATE() function and the transmission function is check_pktAUTHENTICATE(). Once the AP receives the authentication frame using recvAUTHENTICATE(), it replies with an authentication frame of sequence number 2. Each STA, on reception of the second authentication frame, sets its own authenticated flag and sends an ACK (acknowledgement) to the AP. If the authentication process is successful, the client sets the AP’s MAC address as its BSSID and is ready for association. On the other hand, when the AP receives the ACK from the authenticating node, it sets the authentication state of the STA in a linked list. • Association On this stage, once authentication process is finished, each STA sends the Association Request frame by using sendASSOCREQ() and check_pktASSOCREQ(). The AP, on receiving the Association request frame using recvASSOCREQ(), sends out the Association response, which will contain the Association ID, too. The function in charge of this process are sendASSOCREP() and check_pktASSOCREP(). Each STA receives Association response frames using recvASSOCREP() and sends an acknowledgement to the AP. From this moment it will be able to transfer data packets in the BSS. The AP updates its client list when receives the ACK and STA will be able to transfer data in the BSS through the AP. Packets are filtered using the client state table, discarding packets proceeds from a client which doesn’t belong to the BSS. 2.5.2. Inter-AP communication and mobility support Thanks to the infrastructure mode support, clients of the same or different BSS can exchange data. If there is a connection between two clients of different BSSs, the AP will forward the packets from one BSS to another one. However, if the two clients belong to the same BSS, data will be exchange through one AP. Although it has been simulated inter-AP communication on a wired 16 Evaluation of the impact of mobility models on handover in WLAN indoor environments distribution system, it is possible to achieve communication on a Wireless distribution medium. Moreover, using a multicast method, it is possible to transfer data across multiple BSSs by the ToDs and FromDs bits. The handover process begins when a client moves from one BSS to another one. It is detected by a decrease in RSS (Receive Signal Strength). After three consecutive retransmissions of the same data, it is supposed that the client is out of range of its AP. In Section 3.1, different network configurations are analyzed in order to check the infrastructure mode operation. Figure 2.3 shows all the functions used for the infrastructure mode support. They are divided in two columns, depending on wether they belong to the AP or to the STA. Fig. 2.3 Infrastructure mode support functions sendBEACON() chk_pktBEACON recvBEACON() sendPROBEREQ() chk_pktPROBEREQ() recvPROBEREQ() sendPROBEREP() chk_pktPROBEREP() recvPROBEREP() active_scan() checkAssocAuthStatus() sendAUTHENTICATE() check_pktAUTHENTICATE() recvAUTHENTICATE() sendASSOCREQ() chk_pktASSOCREQ() recvASSOCREQ() sendASSOCREP() chek_pktASSOCREP() recvASSOCREP() STA AP Simulation: Study of handovers 17 CHAPTER 3. SIMULATION: STUDY OF HANDOVERS 3.1. Scenarios tested for infrastructure mode Having applied the patch described on chapter 2 and in order to check the correct operation of the infrastructure mode, four different scenarios have been tested. Mobility has been applied to force handovers, too. 3.1.1. Scenario 1: 2 static nodes, 1 AP The first scenario checks the infrastructure mode operation in a simple topology composed by one AP and 2 mobile nodes without movement. While node 1 is the AP, nodes 0 and 2 represent the two MNs. We expect that data sent from node 2 to 0 go through the AP. Fig. 3.1 2 MNs and 1 AP In the following trace, data sent (i.e. s) and received (i.e. r) at each node is displayed. After the authentication (AUTH) and association request and response (ACRQ and ACRP, respectively) processes, at 5.0 s node 2 starts to send data to node 0 (i.e. cbr). At 5.05 s it is possible to see how packets sent by MN 2 are received by the AP 1 and then redirected to MN 0. Each frame must be acknowledged (i.e. ACK). Beacon frames (i.e. BCN) are sent periodically by the AP in order to set channel parameters among its clients. s 0.001216047 _1_ MAC --- 0 BCN 72 [0 ffffffff 1 533f] r 0.001792085 _2_ MAC --- 0 BCN 72 [0 ffffffff 1 533f] r 0.001792094 _0_ MAC --- 0 BCN 72 [0 ffffffff 1 533f] s 0.016560000 _0_ MAC --- 0 AUTH 58 [0 1 0 0] r 0.017024047 _1_ MAC --- 0 AUTH 58 [0 1 0 0] s 0.017074047 _1_ MAC --- 0 AUTH 58 [13a 0 1 0] r 0.017538094 _0_ MAC --- 0 AUTH 58 [13a 0 1 0] s 0.017548094 _0_ MAC --- 0 ACK 38 [0 1 0 0] r 0.017852141 _1_ MAC --- 0 ACK 38 [0 1 0 0] s 0.029062094 _0_ MAC --- 0 ACRQ 52 [0 1 0 0] r 0.029478141 _1_ MAC --- 0 ACRQ 52 [0 1 0 0] s 0.029728141 _1_ MAC --- 0 ACRP 54 [0 0 1 0] 18 Evaluation of the impact of mobility models on handover in WLAN indoor environments r 0.030160189 _0_ MAC --- 0 ACRP 54 [0 0 1 0] Æ MN 0 is associated with AP1 s 0.030170189 _0_ MAC --- 0 ACK 38 [0 1 0 0] r 0.030474236 _1_ MAC --- 0 ACK 38 [0 1 0 0] s 1.016680000 _2_ MAC --- 0 AUTH 58 [0 1 2 0] r 1.017144038 _1_ MAC --- 0 AUTH 58 [0 1 2 0] s 1.017394038 _1_ MAC --- 0 AUTH 58 [13a 2 1 0] r 1.017858075 _2_ MAC --- 0 AUTH 58 [13a 2 1 0] s 1.029442075 _2_ MAC --- 0 ACRQ 52 [0 1 2 0] r 1.029858113 _1_ MAC --- 0 ACRQ 52 [0 1 2 0] s 1.029928113 _1_ MAC --- 0 ACRP 54 [0 2 1 0] r 1.030360151 _2_ MAC --- 0 ACRP 54 [0 2 1 0] Æ MN 2 is associated with AP1 Æ Packets 1 and 2 are sent from MN 2 to AP 1 and then redirected to MN 0 s 5.050415000 _2_ MAC --- 1 cbr 570 [13a 1 2 800] ------ [2:0 0:0 32 0] [1] 0 0 r 5.051004129 _1_ MAC --- 1 cbr 512 [13a 1 2 800] ------ [2:0 0:0 32 0] [1] 1 0 s 5.051014129 _1_ MAC --- 0 ACK 38 [0 2 0 0] r 5.051318166 _2_ MAC --- 0 ACK 38 [0 2 0 0] s 5.051968129 _1_ MAC --- 1 cbr 570 [13a 0 1 800] ------ [2:0 0:0 32 0] [1] 1 0 r 5.052557267 _0_ MAC --- 1 cbr 512 [13a 0 1 800] ------ [2:0 0:0 32 0] [1] 2 0 s 5.052567267 _0_ MAC --- 0 ACK 38 [0 1 0 0] r 5.052871314 _1_ MAC --- 0 ACK 38 [0 1 0 0] s 5.100630000 _1_ MAC --- 0 BCN 72 [0 ffffffff 1 1440] r 5.101206038 _2_ MAC --- 0 BCN 72 [0 ffffffff 1 1440] r 5.101206047 _0_ MAC --- 0 BCN 72 [0 ffffffff 1 1440] s 5.101296038 _2_ MAC --- 2 cbr 570 [13a 1 2 800] ------ [2:0 0:0 32 0] [2] 0 0 r 5.101885166 _1_ MAC --- 2 cbr 512 [13a 1 2 800] ------ [2:0 0:0 32 0] [2] 1 0 s 5.101895166 _1_ MAC --- 0 ACK 38 [0 2 0 0] r 5.102199204 _2_ MAC --- 0 ACK 38 [0 2 0 0] s 5.102849166 _1_ MAC --- 2 cbr 570 [13a 0 1 800] ------ [2:0 0:0 32 0] [2] 1 0 r 5.103438304 _0_ MAC --- 2 cbr 512 [13a 0 1 800] ------ [2:0 0:0 32 0] [2] 2 0 s 5.103448304 _0_ MAC --- 0 ACK 38 [0 1 0 0] r 5.103752352 _1_ MAC --- 0 ACK 38 [0 1 0 0] 3.1.2. Scenario 2: 2 MNs, 4 APs and 1 switch The second scenario is composed by 2 MNs, 4 APs and a wired node (switch). The infrastructure mode operation is checked when MNs associate to different APs. Three different subscenarios are analyzed: statics nodes in the first one; MN moving among APs in the other two subscenarios. We want to test if roaming is supported. For all subscenarios, Node 0 is the switch. APs are represented by nodes 1, 2, 3 and 4 and mobile nodes are 5 and 6. Simulation: Study of handovers 19 Fig. 3.2 2 MNs, 4 APs and 1 switch 3.1.2.1. Static nodes connected to different AP At 2.0 s CBR traffic starts from node 5 to node 6. Firstly, the MN 5 is associated to the AP 2 and the MN 6 is associated to the AP 4. Packets sent by the MN 5, the transmitter node, to the MN 6 follow the sequence 5-2-0-4-6, providing infrastructure mode operation. s 0.017166137 _5_ MAC --- 0 AUTH 58 [0 1 4 0] r 0.017630275 _2_ MAC --- 0 AUTH 58 [0 1 4 0] s 0.018260275 _2_ MAC --- 0 AUTH 58 [13a 4 1 0] r 0.018724412 _5_ MAC --- 0 AUTH 58 [13a 4 1 0] s 0.030448412 _5_ MAC --- 0 ACRQ 52 [0 1 4 0] r 0.030864550 _2_ MAC --- 0 ACRQ 52 [0 1 4 0] s 0.030954550 _2_ MAC --- 0 ACRP 54 [0 4 1 0] r 0.031386687 _5_ MAC --- 0 ACRP 54 [0 4 1 0] Æ MN 5 is associated with AP 2 s 0.018734412 _5_ MAC --- 0 ACK 38 [0 1 0 0] r 0.019038550 _2_ MAC --- 0 ACK 38 [0 1 0 0] s 1.120490000 _6_ MAC --- 0 AUTH 58 [0 3 5 0] r 1.120954137 _4_ MAC --- 0 AUTH 58 [0 3 5 0] s 1.121384137 _4_ MAC --- 0 AUTH 58 [13a 5 3 0] r 1.121848275 _6_ MAC --- 0 AUTH 58 [13a 5 3 0] s 1.121858275 _6_ MAC --- 0 ACK 38 [0 3 0 0] r 1.122162412 _4_ MAC --- 0 ACK 38 [0 3 0 0] s 1.133692275 _6_ MAC --- 0 ACRQ 52 [0 3 5 0] r 1.134108412 _4_ MAC --- 0 ACRQ 52 [0 3 5 0] s 1.134478412 _4_ MAC --- 0 ACRP 54 [0 5 3 0] r 1.134910550 _6_ MAC --- 0 ACRP 54 [0 5 3 0] Æ MN 6 is associated with AP4 s 1.134920550 _6_ MAC --- 0 ACK 38 [0 3 0 0] r 1.135224687 _4_ MAC --- 0 ACK 38 [0 3 0 0] Æ Packet 25 follows the sequence 5-2-0-4-6 s 2.004681781 _5_ MAC --- 25 cbr 288 [13a 1 4 800] ------- [4194305:2 16777217:3 32 8388608] [1] 0 0 r 2.005065919 _2_ MAC --- 25 cbr 230 [13a 1 4 800] ------- [4194305:2 16777217:3 32 8388608] [1] 1 0 s 2.005075919 _2_ MAC --- 0 ACK 38 [0 4 0 0] + 2.005091 2 0 cbr 230 ------- 0 1.0.1.2 4.0.1.3 1 25 - 2.005091 2 0 cbr 230 ------- 0 1.0.1.2 4.0.1.3 1 25 r 2.005380056 _5_ MAC --- 0 ACK 38 [0 4 0 0] r 2.007459 2 0 cbr 230 ------- 0 1.0.1.2 4.0.1.3 1 25 + 2.007459 0 4 cbr 230 ------- 0 1.0.1.2 4.0.1.3 1 25 - 2.007459 0 4 cbr 230 ------- 0 1.0.1.2 4.0.1.3 1 25 r 2.009827 0 4 cbr 230 ------- 0 1.0.1.2 4.0.1.3 1 25 26 Evaluation of the impact of mobility models on handover in WLAN indoor environments Table 3.2 AP coordinates in the scenario with 8 APs Coordinates x (m) y (m) AP1 75 205 AP2 140 200 AP3 205 205 AP4 80 140 AP5 200 140 AP6 75 75 AP7 140 80 AP8 205 75 Fig. 3.6 Scenario with 8 APs Eight different mobility patterns have been created: six from Random Waypoint model and two from Gauss-Markov. Both models allow setting speed distribution (i.e. uniform or normal), while only RWP allows setting pause times. The mobility patterns are represented as follows: - RWP_u-0: Random Waypoint with uniform speed distribution and pause time set to 0 seconds. - RWP_u-1: Random Waypoint with uniform speed distribution and pause time set to 1 second. - RWP_u-10: Random Waypoint with uniform speed distribution and pause time set to 10 seconds. Simulation: Study of handovers 27 - RWP_n-0: Random Waypoint with normal speed distribution and pause time set to 0 seconds. - RWP_n-1: Random Waypoint with normal speed distribution and pause time set to 1 second. - RWP_n-10: Random Waypoint with normal speed distribution and pause time set to 10 seconds. - GM_u: Gauss-Markov with uniform speed distribution - GM_n: Gauss-Markov with normal speed distribution For each scenario, a MN will be move according to each mobility pattern while sending data to a static host through the switch. In this way, we will record information about handover process. 3.2.2. Handover algorithm This subsection is divided in two parts: the first one refers to the current implementation of the handover algorithm in NS-2, and the second one is a study of the power received by a MN in different situations in order to design a new algorithm. 3.2.2.1. Current implementation in NS-2 As it has seen in section 2.5.2, the current implementation (algorithm A) of the handover process works as follows: when MN has to resend the same packet more than three times, it starts the scanning process in order to find out AP in range with better signal strength: from the new AP list, it select the best AP (i.e. the one with the highest received signal strength) in order to associate to it. In next section, the signal strength is analyzed in order to find out where the node is located when it starts a handover. 3.2.2.2. Study of RSS In order to discover how the current handover strategy works and how to improve it, it has been necessary to study the Received Signal Strength (RSS) level of the mobile node while moving. Three situations have been analyzed: the MN located at the border of another cell, located at a middle point between two cells and located at the border of its cell. Finally, the average RSS found for each situation is displayed in table 3.3. 28 Evaluation of the impact of mobility models on handover in WLAN indoor environments • Situation A: Mobile node at the border of another cell Fig. 3.7 MN at the border of another cell • Situation B: Mobile node at a middle point between two cells Fig. 3.8 MN at a middle point between two cells • Situation C: Mobile node at the border of its cell Fig. 3.9 MN at the border of its cell Simulation: Study of handovers 29 Table 3.3 shows the average RSS, the variance and the standard deviation for the situations A, B, C and for the current implementation of the HO algorithm in NS-2. Table 3.3 Study of RSS Average RSS (W) Variance Standard deviation Situation A 1,04·10-8 9,44·10-19 9,72·10-10 Situation B 2,31·10-9 4,404·10-23 6,636·10-12 Situation C 1,35·10-9 2,689·10-18 1,639·10-9 Current HO algorithm 1,36·10-9 2,594·10-19 1,61·10-9 Results in table 3.3 shows that the RSS values obtained from the simulations applying the current HO algorithm correspond to the “situation C” (MN at the border of its cell). From the previous study, a new algorithm (algorithm B) has been designed in order to analyze the impact of a different handover strategy over mobility. The MN will start looking for a new list of neighboring AP if the next conditions are accomplished: it has lost one data packet and it is located, at least, at a middle point between two cells. This last event is identified according to RSS values displayed in Table 3.3 (situation B: RSS = 2,31·10-9 W). We want to stress here that this new algorithm is just a first step towards the design of a new HO strategy that will improve network performance. In order to apply this new algorithm, “mac-802_11.cc” source file has been modified in NS-2. 30 Evaluation of the impact of mobility models on handover in WLAN indoor environments CHAPTER 4. CELL RESIDENCE TIME This last chapter provides statistics of the cell residence time (CRT) from results obtained from simulation with NS-2. Two different scenarios (i.e. 4 APs and 8 APs) have been analyzed, changing the mobility pattern and the handover algorithm. 4.1. Average CRT In this section, the average CRT, the standard deviation and the coefficient of variation (CV) are provided for each HO algorithm and scenario. 4.1.1. Algorithm A Table 4.1 and 4.2 show the results for the scenario with 4 APs and 8 APs respectively, using handover algorithm A. When the Random Waypoint mobility model is applied, average CRT increases and coefficients of variation decrease as pause time increases. On the other hand, the application of Gauss-Markov mobility model provides higher CRT since this model calculates movements according to the previous ones generated and Random Waypoint generates random movements that change the trajectory of the MN suddenly. Average CRT is lower in the scenario with 8 APs because the number of APs is twice and the simulation area does not change. Table 4.1. Cell residence time in a scenario with 4 APs using handover algorithm A 4 APs Algorithm A RWP_u-0 RWP_u-1 RWP_u-10 RWP_n-0 RWP_n-1 RWP_n10 GM_u GM_n Mean CRT (s) 168,85 174,98 180,97 163,56 184,03 195,50 280,16 272,39 Standard dev. 128,90 116,16 115,68 119,71 122,76 106,97 117,47 111,74 CV 0,763 0,664 0,639 0,732 0,667 0,547 0,419 0,41 Samples 512 494 477 528 469 442 308 317 Cell Residence Time 31 Table 4.2. Cell residence time in a scenario with 8 APs using handover algorithm A 8 APs Algorithm A RWP_u-0 RWP_u-1 RWP_u-10 RWP_n-0 RWP_n-1 RWP_n10 GM_u GM_n Mean CRT (s) 118,32 133,68 137,71 124,03 128,67 138,22 224,21 214,17 Standard dev. 93,08 96,58 101,68 98,20 101,12 103,59 93,89 86,48 CV 0,787 0,722 0,738 0,791 0,786 0,749 0,419 0,163 Samples 730 646 627 697 671 625 385 403 4.1.2. Algorithm B Tables 4.3 and 4.4 show the results for the scenario with 4 APs and 8 APs respectively, using handover algorithm B. Once again, average CRT increases when pause time increases in Random Waypoint mobility model. Furthermore, GM provides higher CRT. Table 4.3. Cell residence time in a scenario with 4 APs using handover algorithm B 4 APs Algorithm B RWP_u-0 RWP_u-1 RWP_u-10 RWP_n-0 RWP_n-1 RWP_n10 GM_u GM_n Mean CRT (s) 88,73 93,75 102,68 87,86 92,59 103,29 205,43 199,38 Standard dev. 78,58 76,59 80,61 71,25 77,02 84,28 83,58 81,14 CV 0.886 0,817 0,785 0,811 0,832 0,816 0,407 0,407 Samples 974 922 841 983 933 836 421 433 Table 4.4. Cell residence time in a scenario with 8 APs using handover algorithm B 8 APs Algorithm B RWP_u-0 RWP_u-1 RWP_u-10 RWP_n-0 RWP_n-1 RWP_n10 GM_u GM_n Mean CRT (s) 62,89 69,24 73,33 67,67 70,51 79,29 134,42 124,01 Standard dev. 48,66 49,67 53,29 57,42 55,80 67,56 61,64 49,21 CV 0,774 0,717 0,727 0,848 0,791 0,852 0,458 0,397 Samples 1374 1248 1178 1277 1225 1090 643 697 32 Evaluation of the impact of mobility models on handover in WLAN indoor environments 4.1.2. Comparison Figure 4.1 compares the average CRT of the current HO algorithm implementation and the new one designed. Algorithm A is represented in black columns and algorithm B is represented in grey columns. As it was supposed, the new algorithm leads to a decrease in the time the MN is in a determined cell because the handover process starts after one retransmission if the MN is located at a middle point between two cells. Then, if the power received from the actual AP is not good enough and a new AP with better RSS is available, the handover process will be realized. This situation causes an increase in the HO rate. CRT in a scenario with 4 APs 0 50 100 150 200 250 300 RWP-uniform RWP-uniform1 RWP-uniform10 RWP-normal RWP-normal1 RWP-normal10 GM-uniform GM-normal Mobility models CRT (s) algorithm A algorithm B Fig. 4.1 CRT comparative in a scenario with 4 APs Figure 4.2 illustrates the average CRT for the two handover algorithms for the scenario composed by 8 APs. Cell Residence Time 33 CRT in a scenario with 8 APs 0 50 100 150 200 250 RWP-uniform RWP-uniform1 RWP-uniform10 RWP-normal RWP-normal1 RWP-normal10 GM-uniform GM-normal Mobility models CRT (s) algorithm A algorithm B Fig. 4.2 CRT comparative in a scenario with 8 APs What is common in the scenario with 4 APs and in the scenario with 8 APs is that the cell residence time is lower when the Random Waypoint mobility model is applied, causing a higher number of handovers. This event occurs because the Random Waypoint model generates random movements without memory and the Gauss-Markov model calculates new movements according to the previous ones and it causes more changes in the trajectory of a MN. 4.2. CRT distribution Finally, the distribution of the CRT values is analyzed, showing the percentage of time the MN resides on a cell. Figures 4.3 and 4.4 show the distribution of the CRT values in a scenario composed by 4 APs, when the Random Waypoint mobility model with pause time set to 0 seconds is applied. The two handover strategies, algorithms A and B, are represented. While algorithm A is represented in black columns, algorithm B is represented in grey columns. 34 Evaluation of the impact of mobility models on handover in WLAN indoor environments CRT distribution in RWP-uniform with 4 APs 0 5 10 15 20 25 30 35 40 45 50 0-60 60- 120 120- 180 180- 240 240- 300 300- 360 360- 420 420- 480 480- 540 540- 600 600- 660 660- 720 720- 780 CRT (s) Percentage (%) algorithm A algorithm B Fig. 4.3 CRT distribution using Random Waypoint uniform model with 4 APs CRT distribution in RWP-normal with 4 APs 0 5 10 15 20 25 30 35 40 45 50 0-60 60-120 120-180 180-240 240-300 300-360 360-420 420-480 480-540 540-600 600-660 660-720 720-780 CRT (s) Percentage (%) algorithm A algorithm B Fig. 4.4 CRT distribution using Random Waypoint normal model with 4 APs The next two figures, 4.5 and 4.6, represent the distribution of the CRT values in a scenario with 8 APs when the Random Waypoint mobility model with pause time set to 0 seconds is applied. Cell Residence Time 35 CRT distribution in RWP-uniform with 8 APs 0 5 10 15 20 25 30 35 40 45 50 0-60 60- 120 120- 180 180- 240 240- 300 300- 360 360- 420 420- 480 480- 540 540- 600 600- 660 660- 720 720- 780 CRT (s) Percentage (%) algorithm A algorithm B Fig. 4.5 CRT distribution using Random Waypoint uniform model with 8 APs CRT distribution in RWP-normal with 8 APs 0 10 20 30 40 50 60 0-60 60- 120 120- 180 180- 240 240- 300 300- 360 360- 420 420- 480 480- 540 540- 600 600- 660 660- 720 720- 780 CRT (s) Percentage (%) algorithm A algorithm B Fig. 4.6 CRT distribution using Random Waypoint normal model with 8 APs As the graphics show, for each scenario shorter CRT appears when the second algorithm is used. Shorter cell residence times (i.e. less than 60 seconds) can Annexes 43 ANNEXES Simulation scripts The simulation scripts are shown in this section: Scenario with 4 APs #=========================================================== =========== # Parameters for 802.11 nodes #=========================================================== =========== Antenna/OmniAntenna set Gt_ 1 ;# Transmit antenna gain Antenna/OmniAntenna set Gr_ 1 ;# Receive antenna gain Antenna/OmniAntenna set ht_ 1.5 ;# Tx antenna heigth Antenna/OmniAntenna set hr_ 1.5 ;# Rx antenna heigth Phy/WirelessPhy set L_ 1.0 ;# System Loss Factor Phy/WirelessPhy set freq_ 2.412e9 ;# Channel 1: 2.412 GHz Phy/WirelessPhy set Pt_ 0.100 ;# Transmit Power (15dBm) Phy/WirelessPhy set CPThresh_ 10.0 ;# Collision threshold Phy/WirelessPhy set CSThresh_ 3.1622777e-12 ;# Carrier Sense Power (- 94dBm) Phy/WirelessPhy set RXThresh_ 9.79644e-10 ;# Receive Power Threshold Mac/802_11 set basicRate_ 1Mb ;# set this to 0 if want to use bandwidth_ for Mac/802_11 set dataRate_ 11Mb ;# both control and data pkts Mac/802_11 set CWMin_ 31 ;# Mac/802_11 set CWMax_ 1023 ;# Mac/802_11 set SlotTime_ 0.000020 ;# 20us Mac/802_11 set SIFS_ 0.000010 ;# 10us Mac/802_11 set PreambleLength_ 144 ;# 144 bit Mac/802_11 set PLCPHeaderLength_ 48 ;# 48 bits Mac/802_11 set PLCPDataRate_ 1.0e6 ;# 1Mbps Mac/802_11 set RTSThreshold_ 2500 ;# bytes: changed so that RTS/CTS has been disabled ENRI Mac/802_11 set ShortRetryLPLCPimit_ 7 ;# retransmissions Mac/802_11 set LongRetryLimit_ 4 ;# retransmissions ############################################################### set opt(chan) Channel/WirelessChannel ;# channel type set opt(prop) Propagation/TwoRayGround ;# radio-propagation model set opt(netif) Phy/WirelessPhy ;# network interface type set opt(mac) Mac/802_11 ;# MAC type 44 Evaluation of the impact of mobility models on handover in WLAN indoor environments set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type set opt(ll) LL ;# link layer type set opt(ant) Antenna/OmniAntenna ;# antenna model set opt(ifqlen) 50 ;# max packet in ifq set opt(nn) 1 ;# number of mobilenodes set opt(adhocRouting) DSDV ;# routing protocol set opt(cp) "" ;# cp file not used set opt(sc) "/home/TFC-jesus/ns-allinone-2.31/NS- 2.31/tcl/ex/802_11/Scenario-mobility.tcl" ;#/home/TFC- jesus/scengen/scen/prueba" ;# node movement file. set opt(x) 280 ;# x coordinate of topology set opt(y) 280 ;# y coordinate of topology set opt(seed) 0.0 ;# random seed set opt(stop) 86400 ;# time to stop simulation set num_wired_nodes 2 #set num_bs_nodes 4 ; this is not really used here. #set opt(ftp1-start) 2.0 # ============================================================ # check for boundary parameters and random seed if { $opt(x) == 0 || $opt(y) == 0 } { puts "No X-Y boundary values given for wireless topology\n" } if {$opt(seed) > 0} { puts "Seeding Random number generator with $opt(seed)\n" ns-random $opt(seed) } # create simulator instance set ns_ [new Simulator] # set up for hierarchical routing $ns_ node-config -addressType hierarchical AddrParams set domain_num_ 5 ;# number of domains lappend cluster_num 2 1 1 1 1 ;# number of clusters in each domain AddrParams set cluster_num_ $cluster_num lappend eilastlevel 1 1 1 2 1 1 ;# number of nodes in each cluster AddrParams set nodes_num_ $eilastlevel ;# of each domain set tracefd [open handoverb1.tr w] set namtrace [open handoverb1.nam w] #$ns_ use-newtrace $ns_ trace-all $tracefd $ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y) # Create topography object set topo [new Topography] Annexes 45 # define topology $topo load_flatgrid $opt(x) $opt(y) # create God create-god [expr $opt(nn) + 5] #create wired nodes set temp {0.0.0 0.1.0} ;# hierarchical addresses for {set i 0} {$i < $num_wired_nodes} {incr i} { set W($i) [$ns_ node [lindex $temp $i]] } $W(0) set X_ 140.0 $W(0) set Y_ 140.0 $W(0) set Z_ 0.0 $ns_ at 0.01 "$W(0) label \"SW\"" $W(1) set X_ 140.0 $W(1) set Y_ 120.0 $W(1) set Z_ 0.0 $ns_ at 0.01 "$W(1) label \"Host\"" set node_(1) $W(1) # Configure for ForeignAgent and HomeAgent nodes $ns_ node-config -mobileIP ON \ -adhocRouting $opt(adhocRouting) \ -llType $opt(ll) \ -macType $opt(mac) \ -ifqType $opt(ifq) \ -ifqLen $opt(ifqlen) \ -antType $opt(ant) \ -propType $opt(prop) \ -phyType $opt(netif) \ -channelType $opt(chan) \ -topoInstance $topo \ -wiredRouting ON \ -agentTrace OFF \ -routerTrace OFF \ -macTrace ON # Create AP1, AP2, AP3 and AP4 set AP2 [$ns_ node 1.0.0] ;# disable random motion set AP3 [$ns_ node 2.0.0] set AP4 [$ns_ node 3.0.0] set AP5 [$ns_ node 4.0.0] $AP2 random-motion 0 $AP3 random-motion 0 46 Evaluation of the impact of mobility models on handover in WLAN indoor environments $AP4 random-motion 0 $AP5 random-motion 0 set mac_(2) [$AP2 getMac 0] $mac_(2) ap [$mac_(2) id] $mac_(2) set RTSThreshold_ 3000 set mac_(3) [$AP3 getMac 0] $mac_(3) ap [$mac_(3) id] $mac_(3) set RTSThreshold_ 3000 set mac_(4) [$AP4 getMac 0] $mac_(4) ap [$mac_(4) id] $mac_(4) set RTSThreshold_ 3000 set mac_(5) [$AP5 getMac 0] $mac_(5) ap [$mac_(5) id] $mac_(5) set RTSThreshold_ 3000 # Position (fixed) for base-station nodes (HA & FA). $AP2 set X_ 75.00000000000 $AP2 set Y_ 205.0000000000 $AP2 set Z_ 0.000000000000 $AP3 set X_ 205.000000000000 $AP3 set Y_ 205.000000000000 $AP3 set Z_ 0.000000000000 $AP4 set X_ 205.000000000000 $AP4 set Y_ 75.000000000000 $AP4 set Z_ 0.000000000000 $AP5 set X_ 75.000000000000 $AP5 set Y_ 75.000000000000 $AP5 set Z_ 0.000000000000 $ns_ at 0.01 "$AP5 label \"AP\"" $ns_ at 0.01 "$AP2 label \"AP\"" $ns_ at 0.01 "$AP3 label \"AP\"" $ns_ at 0.01 "$AP4 label \"AP\"" # create a mobilenode that would be moving between HA and FA. # note address of MH indicates its in the same domain as HA. $ns_ node-config -wiredRouting OFF set MN1 [$ns_ node 2.0.1] set node_(6) $MN1 set mac_(6) [$node_(6) getMac 0] Annexes 47 $mac_(6) set RTSThreshold_ 3000 set AP4address [AddrParams addr2id [$AP4 node-addr]];#Asociación con el AP1 [$MN1 set regagent_] set home_agent_ $AP4address $node_(6) random-motion 0 $ns_ at 0.01 "$MN1 label \"MN\"" $mac_(6) ScanType ACTIVE #$mac_(2) ScanType ACTIVE # create links between wired and BaseStation nodes $ns_ duplex-link $W(0) $AP2 5Mb 2ms DropTail $ns_ duplex-link $W(0) $AP3 5Mb 2ms DropTail $ns_ duplex-link $W(0) $AP4 5Mb 2ms DropTail $ns_ duplex-link $W(0) $AP5 5Mb 2ms DropTail $ns_ duplex-link $W(0) $W(1) 5Mb 2ms DropTail $ns_ duplex-link-op $W(0) $AP2 orient left-up $ns_ duplex-link-op $W(0) $AP3 orient left-down $ns_ duplex-link-op $W(0) $AP4 orient right-down $ns_ duplex-link-op $W(0) $AP5 orient right-up $ns_ duplex-link-op $W(0) $W(1) orient down # setup TCP connections between a wired node and the MobileHost set udp1(6) [new Agent/UDP] $ns_ attach-agent $node_(6) $udp1(6) set cbr1(6) [new Application/Traffic/CBR] $cbr1(6) attach-agent $udp1(6) set udp1(1) [new Agent/UDP] $ns_ attach-agent $node_(1) $udp1(1) set cbr1(1) [new Application/Traffic/CBR] $cbr1(1) attach-agent $udp1(1) set base0 [new Agent/Null] $ns_ attach-agent $node_(1) $base0 $ns_ connect $udp1(6) $base0 $ns_ at 0.0 "$cbr1(6) start" $ns_ at $opt(stop).0 "stop" $ns_ at $opt(stop).0 "puts \"NS EXITING...\" ; $ns_ halt" $ns_ at $opt(stop).0 "puts \"NS EXITING...\" ; $ns_ halt" 48 Evaluation of the impact of mobility models on handover in WLAN indoor environments # source connection-pattern and node-movement scripts if { $opt(cp) == "" } { puts "*** NOTE: no connection pattern specified." set opt(cp) "none" } else { puts "Loading connection pattern..." source $opt(cp) } if { $opt(sc) == "" } { puts "*** NOTE: no scenario file specified." set opt(sc) "none" } else { puts "Loading scenario file..." source $opt(sc) puts "Load complete..." } # Define initial node position in nam for {set i 6} {$i < 7} {incr i} { # 20 defines the node size in nam, must adjust it according to your # scenario # The function must be called after mobility model is defined $ns_ initial_node_pos $node_($i) 5 } # Tell all nodes when the simulation ends $ns_ at $opt(stop).0 "$node_(6) reset"; $ns_ at $opt(stop).0 "$node_(1) reset"; $ns_ at $opt(stop).0 "$AP2 reset"; $ns_ at $opt(stop).0 "$AP3 reset"; $ns_ at $opt(stop).0 "$AP4 reset"; $ns_ at $opt(stop).0 "$AP5 reset"; $ns_ at $opt(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt" $ns_ at $opt(stop).0001 "stop" proc stop {} { global ns_ tracefd namtrace close $tracefd close $namtrace } # some useful headers for tracefile puts $tracefd "M 0.0 nn $opt(nn) x $opt(x) y $opt(y) rp \ $opt(adhocRouting)" Annexes 49 puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)" puts $tracefd "M 0.0 prop $opt(prop) ant $opt(ant)" puts "Starting Simulation..." $ns_ run Scenario with 8 APs #=========================================================== # Parameters for 802.11 nodes #=========================================================== Antenna/OmniAntenna set Gt_ 1 ;# Transmit antenna gain Antenna/OmniAntenna set Gr_ 1 ;# Receive antenna gain Antenna/OmniAntenna set ht_ 1.5 ;# Tx antenna heigth Antenna/OmniAntenna set hr_ 1.5 ;# Rx antenna heigth Phy/WirelessPhy set L_ 1.0 ;# System Loss Factor Phy/WirelessPhy set freq_ 2.412e9 ;# Channel 1: 2.412 GHz Phy/WirelessPhy set Pt_ 0.075;#0.100 ;# Transmit Power (15dBm) Phy/WirelessPhy set CPThresh_ 10.0 ;# Collision threshold Phy/WirelessPhy set CSThresh_ 3.1622777e-12 ;# Carrier Sense Power (- 94dBm) Phy/WirelessPhy set RXThresh_ 9.79644e-10 ;# Receive Power Threshold Mac/802_11 set basicRate_ 1Mb ;# set this to 0 if want to use bandwidth_ for Mac/802_11 set dataRate_ 11Mb ;# both control and data pkts Mac/802_11 set CWMin_ 31 ; Mac/802_11 set CWMax_ 1023 ;# Mac/802_11 set SlotTime_ 0.000020 ;# 20us Mac/802_11 set SIFS_ 0.000010 ;# 10us Mac/802_11 set PreambleLength_ 144 ;# 144 bit Mac/802_11 set PLCPHeaderLength_ 48 ;# 48 bits Mac/802_11 set PLCPDataRate_ 1.0e6 ;# 1Mbps Mac/802_11 set RTSThreshold_ 2500 ;# bytes: changed so that RTS/CTS has been disabled ENRI Mac/802_11 set ShortRetryLPLCPimit_ 7 ;# retransmissions Mac/802_11 set LongRetryLimit_ 4 ;# retransmissions ############################################################### ############################### set opt(chan) Channel/WirelessChannel ;# channel type set opt(prop) Propagation/TwoRayGround ;# radio-propagation model set opt(netif) Phy/WirelessPhy ;# network interface type set opt(mac) Mac/802_11 ;# MAC type set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type set opt(ll) LL ;# link layer type 50 Evaluation of the impact of mobility models on handover in WLAN indoor environments set opt(ant) Antenna/OmniAntenna ;# antenna model set opt(ifqlen) 50 ;# max packet in ifq set opt(nn) 1 ;# number of mobilenodes set opt(adhocRouting) DSDV ;# routing protocol set opt(cp) "" ;# cp file not used set opt(sc) "/home/TFC-jesus/ns-allinone-2.31/NS- 2.31/tcl/ex/802_11/gaussmarkov-uniform1.ns_movements" ;#/home/TFC- jesus/scengen/scen/prueba" ;# node movement file. set opt(x) 280 ;# x coordinate of topology set opt(y) 280 ;# y coordinate of topology set opt(seed) 0.0 ;# random seed set opt(stop) 86400 ;# time to stop simulation set num_wired_nodes 2 #set num_bs_nodes 8 ; this is not really used here. #set opt(ftp1-start) 2.0 # ============================================================ ========== # check for boundary parameters and random seed if { $opt(x) == 0 || $opt(y) == 0 } { puts "No X-Y boundary values given for wireless topology\n" } if {$opt(seed) > 0} { puts "Seeding Random number generator with $opt(seed)\n" ns-random $opt(seed) } # create simulator instance set ns_ [new Simulator] # set up for hierarchical routing $ns_ node-config -addressType hierarchical AddrParams set domain_num_ 9 ;# number of domains lappend cluster_num 2 1 1 1 1 1 1 1 1 ;# number of clusters in each domain AddrParams set cluster_num_ $cluster_num lappend eilastlevel 1 1 1 2 1 1 1 1 1 1 ;# number of nodes in each cluster AddrParams set nodes_num_ $eilastlevel ;# of each domain set tracefd [open 8handover.tr w] set namtrace [open 8handover.nam w] #$ns_ use-newtrace $ns_ trace-all $tracefd $ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y) Annexes 51 # Create topography object set topo [new Topography] # define topology $topo load_flatgrid $opt(x) $opt(y) # create God create-god [expr $opt(nn) + 9] #create wired nodes set temp {0.0.0 0.1.0} ;# hierarchical addresses for {set i 0} {$i < $num_wired_nodes} {incr i} { set W($i) [$ns_ node [lindex $temp $i]] } $W(0) set X_ 140.0 $W(0) set Y_ 140.0 $W(0) set Z_ 0.0 $ns_ at 0.01 "$W(0) label \"SW\"" $W(1) set X_ 140.0 $W(1) set Y_ 120.0 $W(1) set Z_ 0.0 $ns_ at 0.01 "$W(1) label \"Host\"" set node_(1) $W(1) # Configure for ForeignAgent and HomeAgent nodes $ns_ node-config -mobileIP ON \ -adhocRouting $opt(adhocRouting) \ -llType $opt(ll) \ -macType $opt(mac) \ -ifqType $opt(ifq) \ -ifqLen $opt(ifqlen) \ -antType $opt(ant) \ -propType $opt(prop) \ -phyType $opt(netif) \ -channelType $opt(chan) \ -topoInstance $topo \ -wiredRouting ON \ -agentTrace OFF \ -routerTrace OFF \ -macTrace ON # Create AP2, AP3, AP4, AP5, AP6, AP7, AP8 and AP9 set AP2 [$ns_ node 1.0.0] ;# disable random motion set AP3 [$ns_ node 2.0.0] set AP4 [$ns_ node 3.0.0]