Rate Adaptation Department of Information Science & Engineering, BVBCET Hubli May 26, 2014 ACKNOWLEDGMENT The sense of contentment and elation that accompanies the successful completion of the rst phase of our project and its report would be in- complete without mentioning the names of the people who helped us in accomplishing this. We take this opportunity to thank our principal Dr. Ashok Shettar, for providing healthy environment in the college, which helped in concentrating on the task. We express a deep sense of gratitude to our H. O. D. Prof. Meena. S. M. for providing the inspiration required for taking the project to its completion. We sincerely thank Prof. Narayan D. G. for his inspiring guidance and promising support they gave during the course of the project. Last but not the least we like to thank all the sta members, teaching and non - teaching sta for helping us during the course of the project. Mr. Anup Shanbhag Mr. Rahul Hosmani Ms. Sana Chandsha Mr. Vinayak Anegundi ABSTRACT A wireless mesh network (WMN) is a communications network made up of radio nodes organized in a mesh topology. Wireless mesh networks often consist of mesh clients, mesh routers and gateways. The mesh clients are often laptops, cell phones and other wireless devices while the mesh routers forward trac to and from the gateways which may, but need not, connect to the Internet. The coverage area of the radio nodes working as a single network is sometimes called a mesh cloud. Access to this mesh cloud is dependent on the radio nodes working in harmony with each other to create a radio network. A mesh network is reliable and oers redundancy. When one node can no longer operate, the rest of the nodes can still communicate with each other, directly or through one or more intermediate nodes.Mesh networks may involve either xed or mobile devices. The solutions are as diverse as communication needs, for example in dicult environments such as emergency situations, tunnels, oil rigs, battleeld surveillance, high speed mobile video applications on board public transport or real time racing car telemetry. An important possible application for wireless mesh networks is VoIP. By using a Quality of Service scheme, the wireless mesh may support local telephone calls to be routed through the mesh. Here we developed a new Routing Metric which considers link load, loss ratio and interference. And then applied a Rate adaptive mechanism which further improved the performance of the metric. Keywords :MultiRadio, Rate adaption, wireless mesh networks i Contents 1 Introduction 2 1.1 Literature Survey: . . . . . . . . . . . . . . . . . . . . . . . . 3 1.2 Problem Statement . . . . . . . . . . . . . . . . . . . . . . . 10 1.3 Scope of the the project . . . . . . . . . . . . . . . . . . . . . 11 2 REQUIREMENT ANALYSIS 12 2.1 System Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 2.2 Functional Requirements . . . . . . . . . . . . . . . . . . . . . 12 2.2.1 Module 1: Incorporation of multiple interface for OLSR. 12 2.2.2 Module 2: Proposal of new Routing metric . . . . . . 13 2.2.3 Module 3: Incorporation of Rate Adaptive Transmis- sion in current NS-2 . . . . . . . . . . . . . . . . . . . 13 2.3 Software and Hardware requirement . . . . . . . . . . . . . . 14 2.3.1 Software Requirements . . . . . . . . . . . . . . . . . . 14 2.3.2 Hardware Requirements . . . . . . . . . . . . . . . . . 14 3 SYSTEM DESIGN 15 3.1 Architecture Design . . . . . . . . . . . . . . . . . . . . . . . 15 3.2 Data Design . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.2.1 Packet Format for OLSR protocol . . . . . . . . . . . 16 3.2.2 Packet format for Hello message . . . . . . . . . . . . 18 3.2.3 Packet format for TC message . . . . . . . . . . . . . 19 3.3 Component Level Design . . . . . . . . . . . . . . . . . . . . . 20 3.3.1 Link Sensing . . . . . . . . . . . . . . . . . . . . . . . 20 3.3.2 Neighbor Detection . . . . . . . . . . . . . . . . . . . . 21 3.3.3 Multipoint Relay Selection . . . . . . . . . . . . . . . 22 3.3.4 Topology Control Message Diusion . . . . . . . . . . 23 3.3.5 Routing Table calculation . . . . . . . . . . . . . . . . 24 3.3.6 Rate Adaptation Algorithm . . . . . . . . . . . . . . . 24 ii 4 IMPLEMENTATION 26 4.1 New Routing Metric CLIA . . . . . . . . . . . . . . . . . . . . 26 4.1.1 Implementation in OLSR pkt.h and repositories.h . . 27 4.1.2 Implementation in mac-timers.h . . . . . . . . . . . . 29 4.1.3 Implementation in mac-802 11.cc . . . . . . . . . . . 30 4.1.4 Implementation in OLSR.cc . . . . . . . . . . . . . . . 33 4.1.5 Implementation in cbr trac.cc . . . . . . . . . . . . 33 5 Results and Discussion 35 5.1 Performance metrics: . . . . . . . . . . . . . . . . . . . . . . . 35 5.2 Simulation Environment . . . . . . . . . . . . . . . . . . . . . 36 6 Conclusion and Future Work. 43 6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 iii List of Figures 1.1 Wireless Mesh Network Architecture . . . . . . . . . . . . . . 3 1.2 WCETT-LB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.3 CATT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.4 ILA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.5 CWB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 1.6 MIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.7 C2WB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.8 iAWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1.9 Link Sensing . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 1.10 Neighbor Detection . . . . . . . . . . . . . . . . . . . . . . . . 10 2.1 System model . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.1 System Architecture . . . . . . . . . . . . . . . . . . . . . . . 16 3.2 OLSR packet format . . . . . . . . . . . . . . . . . . . . . . . 17 3.3 Hello message packet format . . . . . . . . . . . . . . . . . . . 18 3.4 Hello message packet format . . . . . . . . . . . . . . . . . . . 20 4.1 CLIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.1 Scenario I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 5.2 Throughput Vs Packet Rate of Scenario I . . . . . . . . . . . 37 5.3 End to end delay Vs Packet Rate of Scenario I . . . . . . . . 37 5.4 PDF Vs Packet Rate of Scenario I . . . . . . . . . . . . . . . 38 5.5 Scenario II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 5.6 Throughput Vs Packet Rate of Scenario II . . . . . . . . . . . 39 5.7 End to end delay Vs Packet Rate of Scenario II . . . . . . . . 39 5.8 PDF Vs Packet Rate of Scenario II . . . . . . . . . . . . . . . 40 5.9 Scenario III . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 5.10 Throughput Vs Packet Rate: CLIA vs CLIA-RA . . . . . . . 41 5.11 Scenario IV . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 iv Wireless Mesh Networks 5.12 Throughput Vs Packet Rate: CLIA vs CLIA-RA . . . . . . . 42 Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 1 Wireless Mesh Networks Chapter 1 Introduction A wireless mesh network is a communications network made up of radio nodes organized in a mesh topology. Wireless mesh networks often consist of mesh clients, mesh routers and gateways. The mesh clients are often lap- tops, cell phones and other wireless devices while the mesh routers forward trac to and from the gateways which may, but need not, connect to the Internet. Wireless mesh networks hold great promise in the wireless trans- mission, particularly if the problem of providing sucient network capacity can be addressed. As mesh nodes are equipped with multiple radios, they introduce intra-ow and interow interference. Thus, there is a need for new routing metrics and techniques to improve Quality of Service. Many cross layer routing metric are proposed in the literature survey. We propose a new metric by considering the drawbacks of two well-known metrics Interference Aware routing (iAWARE) and Estimated Transmission Count (ETX). The new routing metric will help us chose the optimum path by considering the various parameters like interference, delay. Later, we address the joint problem of routing and application layer rate adaption using routing metric parameters. Wireless Mesh Networks can be classied into three types as follows: Infrastructure wireless mesh network: An infrastructure wire- less mesh network (WMN) is a hierarchical network consisting of mesh clients, mesh routers and gateways. Mesh routers constitute a wireless mesh backbone, to which mesh clients are connected as a star topol- ogy, and gateways are chosen among mesh routers providing Internet access. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 2 Wireless Mesh Networks Client WMN: Client WMN provides peer-to-peer networking facil- ity between the client nodes. Client nodes are normally single radio devices with optional routing capability depending on the end user requirements. Client WMNs are very simple to design but scalability and limited resource allocation are the critical issues which may cause throughput degradation in the network. Hybrid WMN:Hybrid WMNs consist of both hierarchical and client architectures. Mesh routers are equipped with the bridging function- ality in order to integrate with other networks like wired networks, WiFi, MANETs and VANETs is an example of hybrid WMNs. Figure 1.1: Wireless Mesh Network Architecture 1.1 Literature Survey: ETX[1] is dened as the number of expected transmission plus re- transmissions required to successfully deliver a packet over a wireless link. ETX is an additive metric.Expected transmission count and re- transmissions required to successfully deliver a packet over that link. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 3 Wireless Mesh Networks ETX =1/df.dr df:packet delivery ratio in forward direction dr:packet delivery ratio in back ward direction Poor performance in ETX is due to assumption that the channel condi- tions are static in nature. It does not measure trac load and interference on the network. ETT[2]Expected transmission time; It measures the transmission rate of individual link. ETT = ETX x (S / B) S:Average packet size B:Data rate ETT is an improved version of ETX, but still has drawbacks of being unaware of trac load, intra-ow interference and inter-ow interference. WCETT-LB[3]Extension of ETT which considers packet loss ratio and transmission rate of each link. It also provides load balancing to avoid congestion. Figure 1.2: WCETT-LB L(path): load balancing component QLi: mean/average queue length Bi: transmission rate which captures level of congestion. Ni: total number of child nodes using node i as their next hop path on p. CATT[4]Contention aware transmission time It predicts location de- pendent Contention and rate diversity in the links. Isotonic behavior of CATT makes it possible to work with link state routing protocols. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 4 Wireless Mesh Networks Figure 1.3: CATT Ni, Nj:Total number of links interfering in transmission on link I and link j respectively. Rk, Rj: Packet size of link containing 1 and 2 hop neighbors respectively. Bk, Bj: Bandwidth of links 1 and 2 hop neighbors respectively. Tj: packet transmission attempt rate on link j. It captures interow and intraow interference simultaneously. But it as- sumes that all the neighboring nodes to participate in the interference (which is an over estimate).It also uses active probing which has an over- head. ILA[5]Interference load aware routing metric It is a hybrid metric based on load, interfering neighbors and transmission rates.It measures inter ow, intra ow interferences, transmission rates and packet loss ra- tio. Figure 1.4: ILA P: path in the network. MTI: Metric of Trac interference. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 5 Wireless Mesh Networks CSC: (Channel Switching Cost) measures eciency of ows routed through path p. MTI measures quantity of trac generated by interfering neighboring nodes. ETT:It measures the dierence in transmission rate and packet loss ratio. AIL: Average interfering Load (when node i and node j are transmitting over the channel C) Nl(C): set of interfering neighbor of node i and j ILij: interference load of neighbors. CSC: Channel Switching Cost, it captures intra ow interference : It is a scaling factor to balance the eect of MTI and CSC min(ETT): smallest ETT min(AIL): average load ILA ILA uses active probing (overhead high) which does not consider trans- mission delay in order to route the trac eciently. CWB[6] Contention Window based Routing metric.It consider chan- nel utilization and average contention window. It is a load interference routing metric which guides the routing protocol to balance trac loads on the links and increase throughput by routing to- wards less congested areas. Figure 1.5: CWB FER: Frame Error Rate CW0: Minimum contention window r: maximum back o stage : (Channel utilization component )Channel Busy time CBT CWB captures inter ow and trac load but fail to capture intra ow interference. This metric is poor when network changes quickly. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 6 Wireless Mesh Networks MIND[7]Metric for interference and channel diversity.It captures in- terference and load aware parameters on the basis of passive monitoring technique. MIND captures both inter ow and intra ow interference in a intelligent manner by considering both physical and logical models. It induces com- plexity in implementation in virtual Networks. Figure 1.6: MIND INTERLOAD:captures interow interference and load CSC:captures intra ow interference n: measures total number of wireless links m: total number of nodes in the path p. IR:Interference Ratio, it is used to measure interference between links SINR:Signal to noise plus interference ratio SNR:Signal to noise ratio Total time: It is the measure of time form rst attempt to the receiving of ACK. Idle Time: Back o time in radio nodes. MIND captures both inter ow and intra ow interference in a intelligent manner by considering both physical and logical models. It induces com- plexity in implementation in virtual Networks. C2WB[8]C2WB is a routing metric that leverages real-time radio channel quality information to maximize the achieved throughput of a WMN. It uses service time as a metric to approximate quality of the link without using any heuristic approaches. CWl: Average Contention window of the node link l Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 7 Wireless Mesh Networks Figure 1.7: C2WB FER: Frame Error Rate. Tbac, l: Back o time of the link Idle Time: Back o time in radio nodes. C2WB measures intra ow interference, data rate and frame error rate to compute the most optimal path for transmission. iAWARE[9]iAWARE stands for Interference Aware. This routing metric addresses the problem of interference by combining the interference ratio (IR) with the ETT metric. Figure 1.8: iAWARE iAWARE has no MAC layer interference measurement mechanism, as it only capture the interference at a node level. Lack of load balancing pa- rameters may lead the trac to a congested route. OLSR[10]Optimized Link State Routing Protocol is a proactive link state routing protocol, which uses hello and topology control messages to discover and then disseminate link state information throughout the Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 8 Wireless Mesh Networks mobile ad-hoc network. The functionality of OLSR species the behavior of a node, equipped with OLSR interfaces participating in the MANET and running OLSR as routing protocol. Link sensing: Link sensing is done to detect the type of link exist between local interface and the remote interface. Link Sensing is ac- complished through periodic emission of HELLO messages over the interfaces through which connectivity is checked. A separate HELLO message is generated for each interface. Resulting from the link sens- ing is the local link set, describing links between local interfaces and interfaces. Figure 1.9: Link Sensing In the gure 1.9, nodes A and B runs OLSR on multiple interfaces. B uses the address of b1 as its main address. Nodes D and C runs on single interfaces (d1 and c1). To keep up-to-date information on what links exist between a node and its neighbors, the link set is maintained. Neighbor Detection: Neighbor detection is done by a node to detect the type of its neighbor. Neighbor detection populates the 1-hop neigh- bor repository and only uses the main addresses of nodes. Whenever a link entry is created, the neighbor table is queried for a corresponding neighbor entry. A neighbor is said to be a symmetric neighbor if there exists at least one Link-entry in the link set connecting a local inter- face to one of the neighbors interfaces where the symmetric timer is not timed out. When a link-entry is deleted, the corresponding neigh- bor entry is also removed if no other link entries exist for this neighbor. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 9 Wireless Mesh Networks Figure 1.10: Neighbor Detection The Figure 1.10 represents the neighbor detection process. This is done through the exchange of HELLO message packets. If node B wants to nd its neighbor it oods the HELLO message through the whole topology. The nodes which are its neighbors will signal the node B by sending the HELLO message packet back to it. In this case the nodes A, C, D are detected as its neighbors. Multipoint Relay Selection: The concept of multipoint relaying is to reduce the number of duplicate retransmissions while forwarding a broadcast packet. This technique restricts the set of nodes retransmit- ting a packet from all nodes, to a subset of all nodes. Each node selects its MPR set from among its 1-hop symmetric neighbors. This set is selected such that it covers all symmetric strict 2-hop nodes. The in- formation required to perform this calculation is acquired through the periodic exchange of HELLO messages. The MPR set is re-calculated when a change in 1-hop or 2-hop Neighbor sets with bi-directional link is detected. The MPR selection process reduces the number of retransmissions. The gure at the left side shows the process of ooding without MPR selections. So the number of retransmissions increases. If the ooding is done by only considering the MPRs the retransmission decreases which reduces the trac. 1.2 Problem Statement To propose a cross layer rate adaptive technique for data transmis- sion in multi-radio wireless mesh networks based on a new routing metric Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 10 Wireless Mesh Networks and adapt the transmission rate at application layer based on routing metric parameters. 1.3 Scope of the the project To integrate the existing OLSR routing protocol with Multiple Inter- faces in NS-2. To design and implement a new Routing metric for multiple radio wireless mesh networks. To implement rate adaptive mechanism to improve the quality of ser- vice. To carry out extensive performance analysis of proposed techniques using various random topologies and trac. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 11 Wireless Mesh Networks Chapter 2 REQUIREMENT ANALYSIS This chapter deals with the requirements of the entire system.It also spec- ies the methodologies to achieve the requirements specied. In this chapter we specify about the System model, Functional Requirements, Performance requirements, Software Quality Attributes and the project plan 2.1 System Model The system model as shown in gure 2.1 represents the cross layer routing for wireless mesh network which has parameter acquisition from dierent layers and using them in a routing metric to select an optimum path for transmission in the wireless network. 2.2 Functional Requirements This part deals with the various functional requirements of the sys- tem. 2.2.1 Module 1: Incorporation of multiple interface for OLSR. The existing ns-2 OLSR does not have multiple interfaces. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 12 Wireless Mesh Networks Figure 2.1: System model The task is to scale up the existing OLSR protocol and incorporate multiple interfaces. 2.2.2 Module 2: Proposal of new Routing metric Choosing the optimal path in wireless networks very tedious. There are many metrics proposed for calculation of optimal path. We propose a new metric by considering the drawbacks of two well-known metrics Interference Aware routing (iAWARE) and Estimated Transmission Count (ETX). The task is to propose a new routing metric which helps in calculating the optimal path in the network for data transmission. It considers link load, loss ratio and interference. 2.2.3 Module 3: Incorporation of Rate Adaptive Trans- mission in current NS-2 Rate adaption is a technique of reducing the rate of transmission in the network whenever congestion occurs. The existing NS-2 does not have this facility. The task is to incorporate Rate Adapative transmission in existing NS-2 to further improve the performance. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 13 Wireless Mesh Networks 2.3 Software and Hardware requirement There are many additional hardware and software which are re- quired for the development of any software application; they also consti- tute a major part of the application. This section provides the overview of the additional requirements used in the development of this application. 2.3.1 Software Requirements Implementation of the routing metric and the analysis will be done with C++ programming as backend coding. Operating System: Linux Open SUSE. Topology creation will be done using TCL scripts as front-end coding and the OLSR protocol changes was done using C++ programming. 2.3.2 Hardware Requirements The system should contain minimum of 2GB RAM and 256MB GPU. Since the project is completely based on simulation no explicit hard- ware is required. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 14 Wireless Mesh Networks Chapter 3 SYSTEM DESIGN A software design document (SDD) is a written description of a software product, that gives a software development team an overall guidance of the architecture of the software project. An SDD usually accompanies an architecture diagram with pointers to detailed feature specications of smaller pieces of the design. Practically, a design document is required to coordinate a large team under a single vision. A design document needs to be a stable reference, outlining all parts of the software and how they will work. The document is commanded to give a fairly complete description, while maintaining a high-level view of the software. 3.1 Architecture Design System design phase is a main core part of software development. System design takes software requirement specications as input and it concerns on the system development by providing a call return architec- ture and algorithm for the modules, So that the coding of the system will be easily carried out. It also decides the interconnection between the modules. The gure shows the system architecture of the project. Link sensing updates the link set of local information base. The HELLO message is used for link sensing. The processing of various packets is done by packet processing module. Then routing metric measurements are made on the link to select the ecient route. Whenever a link tuple is created neighbor detection is carried out by each node which updates the 1-hop and 2-hop neighbor set. For the ecient ooding and to reduce the trac which Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 15 Wireless Mesh Networks happens through the ooding MPR are selected from this neighbor set so that there is no duplication created. This is done by MPR selection. This discovered topology information is diused in the network through the TC message using the default forwarding algorithm. Routing table calculation module takes the information from these all modules and calculate the routing table hence the ecient route to route the packet. Figure 3.1: System Architecture 3.2 Data Design This section involves dierent message or packet formats and the repositories. 3.2.1 Packet Format for OLSR protocol The basic layout of any packet in OLSR is as follows (omitting IP and UDP headers): Packet Length: The length in bytes of the entire packet, including the header Packet Sequence Number: A sequence number incremented by one each time a new OLSR message is transmitted by this host. A sepa- rate Packet Sequence Number is maintained for each interface so that Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 16 Wireless Mesh Networks Figure 3.2: OLSR packet format packets transmitted over an interface are sequentially enumerated. Message type:An integer identifying the type of this message. Mes- sage types of 0-127 are reserved by OLSR while the 128-255 space is considered private and can be used for custom extensions of the protocol. Vtime: This eld indicates for how long after reception a node will consider the information contained in the message as valid. The time interval is represented in a mantissa-exponent format. Message Size:The size of this message, including message header, counted in bytes. Originator Address:Main address of the originator of this message. Time To Live: The maximum number of hops this message can be forwarded. Using this eld one can control the radius of ooding. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 17 Wireless Mesh Networks Hop Count: The number of times the message has been forwarded. Message Sequence Number: A sequence number incremented by one each time a new OLSR packet is transmitted by this host. 3.2.2 Packet format for Hello message Figure 3.3: Hello message packet format Reserved: This eld must be set to 0000000000000 to be in com- pliance with this specication. HTime: This eld species the HELLO emission interval used by the node on this particular interface Willingness: Willingness is set for any of the following values. 1. WILL NEVER = 0 2. WILL LOW = 1 3. WILL DEFAULT = 3 4. WILL HIGH = 6 Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 18 Wireless Mesh Networks 5. WILL ALWAYS = 7 Link code structure: Link Code value holds two dierent elds, of two bits each they are Neighbor Type and Link Type. 1. Link types: (a) UNSPEC LINK - indicating that no specic information about the links is given. (b) ASYM LINK - indicating that the links are asymmetric. (c) SYM LINK - indicating that the links are symmetric with the interface. (d) LOST LINK - indicating that the links have been lost. 2. Neighbor Types: (a) SYM NEIGH - indicating that the neighbors have at least one symmetrical link with this node. (b) MPR NEIGH - indicating that the neighbors have at least one symmetrical link AND have been selected as MPR by the sender. (c) NOT NEIGH - indicating that the nodes are either no longer or have not yet become symmetric neighbors. Link Message Size: The size of the link message, counted in bytes and measured from the beginning of the Link Code eld and until the next Link Code eld. Neighbor Interface Address: The address of an interface of a neighbor node. 3.2.3 Packet format for TC message Advertised Neighbor Sequence Number (ANSN): Sequence number is associated with the advertised neighbor set. Every time a node detects a change in its advertised neighbor set, it increments this sequence number. This number is sent in this ANSN eld of the TC message to keep track of the most recent information. Multipoint Relay Selector address: This eld contains the main address of the node which selected the MPR. QoS elds values: This eld represents the various QoS parameters which need to be considered. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 19 Wireless Mesh Networks Figure 3.4: Hello message packet format 3.3 Component Level Design Component-level design establishes the algorithmic detail required to ma- nipulate data structures, eect communication between software compo- nents via their interfaces, and implement the processing algorithms allo- cated to each component. The below design describes the OLSR protocol. 3.3.1 Link Sensing Link Sensing is accomplished through periodic emission of HELLO mes- sages. This is done for detection of local link set i.e. all the neighboring nodes are sensed and a neighboring nodes set is calculated. Linksensing() ALGORITHM linksensing() // Performs Hello Message generation and updates its Link set // Input: none // Output: Updated Linkset While true generateHelloMessage() OP <- Read HelloMessage from Neighbour Node processHelloMessage(OP) Delay 2 sec processHelloMessage(OP) ALGORITHM processHelloMessage() // Processes the HelloMessage and updates the link set // Input: OLSR Packet with HelloMessage Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 20 Wireless Mesh Networks // Output: Updates Link Set If OP->vtime >current time If not SourceAddr= L InterfaceAddr in LinkSet Create new tuple and update L Neigbour iface addr=sourceaddr L local iface addr = Address of the Interface received hello message L SYM Time = current time 1 (expired) L time = current time + validity time Else //tuple exists Modify tuple as L ASYM time=current time + validity time if OP->iaddr = OP->Message->iAddr if L linktype = LOST LINK L SYM time=current time 1 else if L linktype is SYM LINK or ASM LINK L SYS time=current time + validity time L time = L SYM time + NEIGB HOLD TIME L time=max(L time, L ASYM time) 3.3.2 Neighbor Detection First all the routes to destination are found. Then all the neighbors and the links are detected and used for transmission of packets. processHelloMessage(OP) ALGORITHM processHelloMessage() // Processes the HelloMessage and updates the link set // Input: OLSR Packet with HelloMessage // Output: Updates Link Set If OP ->vtime >current time If not SourceAddr=L InterfaceAddr in LinkSet Create New tuple and update L Neigbour iface addr=sourceaddr L local iface addr = Address of the Interface received hello message L SYM Time = current time 1 (expired) L time = current time + validity time Else //tuple exists Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 21 Wireless Mesh Networks Modify tuple as L ASYM time=current time + validity time if OP->iaddr = OP->Message->iAddr if L linktype = LOST LINK L SYM time=current time 1 else if L linktype is SYM LINK or ASM LINK L SYS time=current time + validity time L time = L SYM time + NEIGB HOLD TIME L time=max(L time, L ASYM time) UpdateNeigborSet() ALGORITHM updateNeigbourSet() // Triggers when there is some updation in Link Set //Input: Changes in Link Tuple // Output: Updates N status in neighbor set If L SYM time <= current time set N status to SYM Else set N status to NOT SYM CreateNeigborSet() ALGORITHM createNeigbourSet() // Triggers when new Link tuple is Deleted // Input: Changes in Link Tuple // Output: Removes tuple from neighbor set MainAddr <- getRemovedAddrfromlinkset (L neighbour iface addr) // Fetches main address from the Link set Delete Neighbor Set tuple with N neighbor main addr as MainAddr 3.3.3 Multipoint Relay Selection Each node selects its MPR set independently. This set contains subset of 1-hop neighbors which provide maximum reachability guarantees from 2-hop neighbors to given node. ALGORITHM: MPR Selection //Selects MPRs from the set of 1 hop neighbor which covers maximum set of 2-hop neigbor set //Input: selected 1-hop neighbor and 2-hop neighbor set Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 22 Wireless Mesh Networks //Output: MPR set Start with an empty MPR set MPR(x); While there still exist nodes N(x) Let y be one of the node in N(x) y be the only node from N(x) provides reachability to a node in N2(x) add y to MPR set In case of a tie in the above step, select that node which is already in MPR(x). Mark y as covered End 3.3.4 Topology Control Message Diusion Topology control messages are broadcast and retransmitted by the MPRs with the purpose of providing each node in the network with sucient link state information to allow route calculation. ALGORITM TC msg diffusion // Provides each node in the network, link state information to allow route calculation. //Input:OLSR packet received,message to be sent, interface address. //Output:none Compute validity time from Vtime field If sender iface addr=iface addr and ttl >1 Retransmit the message If there exist some tuple in the topology sset where: T last addr == originator address AND T seq >ANSN Discard the message If T last addr == originator address AND T seq <ANSN Remove the tuple from the topology set For each of the advertised neighbor main address received in the TC message: If there exist some tuple in the topology set where: T dest addr == advertised neighbor main address, AND T last addr == originator address, then the holding time of that tuple MUST be set to: T time = current time + validity time. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 23 Wireless Mesh Networks else T dest addr = advertised neighbor main address, T last addr = originator address, T seq = ANSN, T time = current time + validity time. 3.3.5 Routing Table calculation Routing table calculation is done by taking the information from TC mes- sage which declares the topology in the network. Algorithm: Routing table calculation //triggers when there is some changes in linkset, neighbor set, MPR, TC message set, multiple information base set. //input: changes in repositories, r table //output: routing table(gives the appropriate route to destination) if changes in link set for each changes in link set set r table field (i) <- link tuple(i) if changes in neighbor set for each changes in 1 hop neighbor set set r table field(i) <- 1 hop neighbor tuple(i) if changes in 1 hop neighbor set for each changes in 2 hop neighbor set set r table fields(i) <- 2 hop neighbor tuple if changes in topology cont msg set for each changes in topology cont msg set set r table fields(i) <- topology cont msg tuple if changes in multi asso base set for each changes in multi asso base set(i) set r table fields(i) <- multi asso base tuple(i) update r table 3.3.6 Rate Adaptation Algorithm ALGORITHM RateAdaptation //Input: ETX(Expected Transmission Count), IR(Interference Ratio), TxRate(Initial Transmission Rate), LB(Lower Bound), UB(Upper Bound) Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 24 Wireless Mesh Networks //Output: New TxRate BEGIN IR-VAL (1.0 - IR) * 100 ETX-VAL ETX LNK-COST ETX-VAL + IR-VAL IF LNK-COST > THRESHOLD-VAL THEN TxRate TxRate - Incr IF TxRate < LB THEN TxRate LB ENDIF ELSE TxRate TxRate + Incr IF TxRate > UB THEN TxRate UB ENDIF ENDIF nTxRate TxRate RETURN nTxRate END Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 25 Wireless Mesh Networks Chapter 4 IMPLEMENTATION This chapter contains detailed information about the code level imple- mentation of CLIA routing metric. Here, we describe the changes and implementation done, in all the required functions of the existing OLSR wireless mesh protocol in NS 2.33. 4.1 New Routing Metric CLIA The CLIA metric of Link l is dened as follows: CLIA The new routing metric derived here is termed as CLIA It is the new routing metric which stands for Contention Load and Interference Aware.It assigns weights to individual links which considers link load, loss ratio and interference. Figure 4.1: CLIA ETX:Expected Transmission Count. CW: Contention Window. IR: Interference Ratio. NL: Number of interferer nodes. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 26 Wireless Mesh Networks Cn: Channel Utilization. CLIAl and CLIAp are routing metric value of individual link and whole path respectively. 4.1.1 Implementation in OLSR pkt.h and repositories.h typedef struct OLSR_iface_address { /// Interface Address nsaddr_t iface_address_; /// Link quality extension double link_quality_; double nb_link_quality_; /// Link delay extension double link_delay_; double nb_link_delay_; double nb_sum_link_delay_;//Added by Vinicius double Nl_CBT_;//Added By Vinicius inline nsaddr_t& iface_address() { return iface_address_; } /// Link quality extension inline double& link_quality() { return link_quality_; } inline double& nb_link_quality() { return nb_link_quality_; } /// Link delay extension inline double& link_delay() { return link_delay_; } inline double& nb_link_delay() { return nb_link_delay_; } inline double& nb_sum_link_delay() { return nb_sum_link_delay_; } inline double& link_CBT() {return Nl_CBT_;}//Added By Vinicius inline double etx() { double etx_; double mult = (double) (link_quality() * nb_link_quality()); double delay = (double) (link_delay() + nb_link_delay()); double BETA; Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 27 Wireless Mesh Networks if(irVal>=0.9) BETA = 1; /// MILD-IR Optimization else if(irVal<0.9 && irVal>=0.5) BETA = 0.2; else BETA = 0.1; if(chanutil < 0.1) chanutil = 0.1; printf("IR : %lf\n",irVal); printf("Nl : %d\n",interfererNodes); printf("CW : %lf\n",CW); printf("Cn : %lf\n",chanutil); switch (parameter_.link_quality()) { case OLSR_BEHAVIOR_ETT: return (mult < 0.01) ? 100.0 : ((double) 1.0 / (double) mult) * (double) delay; break; case OLSR_BEHAVIOR_ETX: if(metricSel == 0 ) { etx_ = (mult < 0.01) ? 100.0 : (double) 1.0 / (double) mult; rtMetric = etx_ ; } else { etx_ = (mult < 0.01) ? 100.0 : (double) 1.0 / (double) mult; rtMetric = etx_ ; if(tRate<4096*19) etx_ = (etx_ + interfererNodes) / irVal ; else etx_ = (etx_ + interfererNodes) / irVal + BETA * (CW * chanutil) / irVal; } return etx_; break; case OLSR_BEHAVIOR_MIND: if(metricSel == 0 ) { etx_ = (mult < 0.01) ? 100.0 : (double) 1.0 / (double) mult; } else { etx_ = (mult < 0.01) ? 100.0 : (double) 1.0 / (double) mult; Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 28 Wireless Mesh Networks if(tRate<4096*19) etx_ = (etx_ + interfererNodes) / irVal ; else etx_ = (etx_ + interfererNodes) / irVal + BETA * (CW * chanutil) / irVal; } return etx_; break; case OLSR_BEHAVIOR_ML: return mult; break; case OLSR_BEHAVIOR_NONE: default: return 0.0; break; } } } OLSR_iface_address; 4.1.2 Implementation in mac-timers.h class MacTimer : public Handler { public: . . private:. . protected: . . double s_idle_period; double idle_period_; . . } class BackoffTimer : public MacTimer { public: . . void pause(void); void resume(double difs,int state=0); private: . Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 29 Wireless Mesh Networks . }; 4.1.3 Implementation in mac-802 11.cc //Added by Daniel Pereira #include "ErrorModel80211.h" ///////////////////////////////////////////////////////////// // Added by Sushmita to support event tracing #include "agent.h" #include "basetrace.h" #include <math.h> #include <mild.h> . . . inline void Mac802_11::checkBackoffTimer() { if(is_idle() && mhBackoff_.paused()) { mhBackoff_.resume(phymib_.getDIFS()); /////////////////////////// MultiRadio-OLSR /////////////////// //Added by Daniel Pereira and Vinicius Cunha if (pktTx_ && mhBackoff_.idle_period() >= 0.0) { struct hdr_cmn *ch = HDR_CMN(pktTx_); ch->idle_period = mhBackoff_.idle_period(); } //////////////////////////////////////////////////////// } if(! is_idle() && mhBackoff_.busy() && ! mhBackoff_.paused()) mhBackoff_.pause(); } inline void Mac802_11::transmit(Packet *p, double timeout) { /////////////////////////// MultiRadio-OLSR ////////////// float total_period = 0.0; float idle_period = 0.0; Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 30 Wireless Mesh Networks /////////////////////////////////////////////////////// tx_active_ = 1; /////////////////////////// MultiRadio-OLSR ///////// struct hdr_cmn *ch = HDR_CMN(p); if (mhBackoff_.idle_period() >= 0.0) { total_period = Scheduler::instance().clock() - macmib_.arrival_time_; //idle_period = mhBackoff_.idle_period(); //p->txinfo_.cbt = (total_period - idle_period) / total_period; //ch->cbt = (total_period - idle_period) / total_period; //ch->idle_period = idle_period; ch->total_period = total_period; //printf("[%f] Rx Power idle:%f \n", Scheduler::instance().clock(), mhBackoff_.idle_period()); if (ch->idle_period > ch->total_period) printf("[%f] Rx Power idle:%f > total:%f \n", Scheduler::instance().clock(), ch->idle_period, ch->total_period, ch->ptype_); } ////////////////////////////////////////////////// if (EOTtarget_) { assert (eotPacket_ == NULL); eotPacket_ = p->copy(); } . . . . MAC_MIB::MAC_MIB(Mac802_11 *parent) { /* * Bind the phy mib objects. Note that these will be bound * to Mac/802_11 variables */ parent->bind("RTSThreshold_", &RTSThreshold); parent->bind("ShortRetryLimit_", &ShortRetryLimit); parent->bind("LongRetryLimit_", &LongRetryLimit); parent->bind("ScanType_", &ScanType); Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 31 Wireless Mesh Networks parent->bind("ProbeDelay_", &ProbeDelay); parent->bind("MaxChannelTime_", &MaxChannelTime); parent->bind("MinChannelTime_", &MinChannelTime); parent->bind("ChannelTime_", &ChannelTime); /////////////////////////// MultiRadio-OLSR ////////////// arrival_time_ = 0.0; arrival_lock_ = false; ///////////////////////////////////////////// } . . . . /////////////////////////// MultiRadio-OLSR ////////////// //Added by Daniel Pereira and Vinicius Cunha bind_bool("cbt_", &cbt_); bind ("N_", &N_); //tblCBT = new int [N_]; tblCBT_idx = 0; tblIR_idx = 0; tblCBTValue_idx = 0; //Create bidimentional array to store CBT values tblCBT = new double*[N_]; tblIR = new double*[N_]; tblCBTValue = new double*[N_]; for (int row=0; row<N_; row++) { tblCBT[row] = new double[CBT_SMOOTH]; tblIR[row] = new double[IR_SMOOTH]; tblCBTValue[row] = new double[CBT_SMOOTH]; } . . . Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 32 Wireless Mesh Networks 4.1.4 Implementation in OLSR.cc #include <olsr/OLSR.h> #include <olsr/OLSR_pkt.h> #include <olsr/OLSR_printer.h> #include <olsr/OLSR_dijkstra.h> #include <olsr/OLSR_parameter.h> #include <math.h> #include <limits.h> #include <address.h> #include <ip.h> #include <cmu-trace.h> #include <map> #include <mild.h> /// Length (in bytes) of UDP header. #define UDP_HDR_LEN 8 //Added by Daniel Pereira //const int EM80211_MAX_SNR=50; int pktSize; double rtMetric; double maxETT=0.0; double minETT=999999999999.0; bool rateEnabled = false; int metricSel = 0; //0->ETX and 1->CLIA 4.1.5 Implementation in cbr trac.cc #include "random.h" #include "trafgen.h" #include "ranvar.h" #include <mild.h> double tRate; . . Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 33 Wireless Mesh Networks . double CBR_Traffic::next_interval(int& size) { tRate = rate_; /// Mild IR // Recompute interval in case rate_ or size_ has changes if(!assign) { oldRate=rate_; assign=1; incr=4096; } . . . if(rateEnabled) { double ir,metric; //if(ir <= 0.1) ir = 0.1; //else if(ir >= 0.9) ir = 0.9; //printf("\nIR : %lf\tMETRIC : %lf",ir,rtMetric); ir = (1.0-irVal) * 100; metric = rtMetric + ir; //printf("\nMetric : %lf",metric ); if(metric>140) { rate_-=incr; //if(rate_<oldRate/thresh) if(rate_< (oldRate * thresh)) rate_=oldRate * thresh; } else { rate_+=incr; //if(rate_>oldRate*thresh) if(rate_>(oldRate*(thresh + 0.7))) rate_= oldRate * (thresh + 0.7); } } Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 34 Wireless Mesh Networks Chapter 5 Results and Discussion This chapter contains the results obtained as output of our project and the analysis of the same. This section evaluates the performance of the metric CLIA with existing metrics. We have used ns-2 simulator version 2.33 to analyze the proposed routing metric. 5.1 Performance metrics: The performance of each routing metric is compared using the three QoS parameters throughput, average end-to-end delay and packet loss fraction. Throughput: This is the sum of data packets delivered to the termi- nals in the network. Average End-to-End Delay: This is the average overall delay for a packet to traverse from a source node to a destination node. Packet loss fraction: The total percentage of transmitted packets that are lost or dropped in the network during routing from source to destination. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 35 Wireless Mesh Networks 5.2 Simulation Environment We create node topologies using CMU tool setdest to generate large number of nodes and their movements. The tool uses a random way point model. We also set up random trac connections of CBR between nodes using a trac-scenario generator script cbrgen.tcl.We evaluate the performance of these routing protocols for these topologies. Figure 5.1: Scenario I Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 36 Wireless Mesh Networks Figure 5.2: Throughput Vs Packet Rate of Scenario I Figure 5.3: End to end delay Vs Packet Rate of Scenario I Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 37 Wireless Mesh Networks Figure 5.4: PDF Vs Packet Rate of Scenario I Figure 5.5: Scenario II Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 38 Wireless Mesh Networks Figure 5.6: Throughput Vs Packet Rate of Scenario II Figure 5.7: End to end delay Vs Packet Rate of Scenario II Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 39 Wireless Mesh Networks Figure 5.8: PDF Vs Packet Rate of Scenario II Figure 5.9: Scenario III Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 40 Wireless Mesh Networks Figure 5.10: Throughput Vs Packet Rate: CLIA vs CLIA-RA Figure 5.11: Scenario IV Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 41 Wireless Mesh Networks Figure 5.12: Throughput Vs Packet Rate: CLIA vs CLIA-RA Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 42 Wireless Mesh Networks Chapter 6 Conclusion and Future Work. 6.1 Conclusion WMN is a communication network made up of radio nodes orga- nized in mesh topology. Wireless mesh networks consist of mesh routers and mesh clients, where mesh routers have minimal mobility and form the backbone of WMNs. Several routing metrics are proposed for WMN. But, these routing metrics fail to recognize characteristics such as dier- ent transmission rates, packet loss rates, and interference. The proposed metric performs better then ETX and iAWARE. The Rate Adaptation Mechanism further improves the performance of the proposed metric. 6.2 Future Work To implement application based rate adaptation algorithm for spe- cic applications like FTP, video transmissions.Make a patch for the net- work simulator so others can learn and continue on. Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 43 Wireless Mesh Networks Bibliography [1] DSJDCouto,DAguayo,JBicket,RMorris,Ahighthroughputpathmetricformultihop wirelessrouting.Wirel.Netw.11,419434(2005).http://dx.doi.org/10.1007/s11276- 005-1766-z [2] BSadeghi,VKanodia,ASabharwal,EKnightly,Opportunisticmediaaccessformulti rateadhocnetworks,inProceedingsofthe8thannualinternationalconferenceonMobilecomputing andnetworking,MobiCom02,ACM,NewYork,2002,pp.2435.http://doi.acm.org/10.1145/ 570645.570650 [3] LMa,MDenko,Aroutingmetricforloadbalancinginwirelessmeshnetworks,in21st InternationalConferenceonAdvancedInformationNetworkingandApplicationsWorkshops,2007, AINAW07,NiagaraFallsOntario,Canada,21-23May2007,vol.2,pp.409414 [4] MGenetzakis,VSiris,Acontention-awareroutingmetricformulti-ratemulti- radio meshnetworks,in5thAnnualIEEECommunicationsSocietyConferenceonSensor,MeshandAdHoc CommunicationsandNetworks,2008. SECON08,SanFrancisco,California,USA,16- 20June2008, pp.242250 [5] DMShila,TAnjali,Loadawaretracengineeringformeshnetworks.Comput.Commun .31(7),1460-1469(2008).http://www.sciencedirect.com/science/article/B6TYP- 4RP0MMN10/ 2/8d112fe4f3e 25b28e71fb245e8f23b0e [6] LTNguyen,RBeuran,YShinoda,Aload-awareroutingmetricforwirelessmeshnetworks,inIEEE Symposiumon ComputersandCommunications,ISCC,Marrakech,Morocco,6- 9July2008,pp.429435 [7] VBorges,DPereira,MCurado,EMonteiro,Routingmetricforinterferenceandchannel diversityinmultiradiowirelessmeshnetworks,inAdHoc,MobileandWirelessNet- Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 44 Wireless Mesh Networks works,vol.5793,ed. byPRuiz,JGarcia-Luna-Aceves,(Springer,BerlinHeidelberg,2009),pp.5568 [8] LTNguyen,RBeuran,YShinoda,Aninterferenceandloadawareroutingmetric forwirelessmeshnetworks Department of Information Science & Engineering, B.V.B.C.E.T., Hubli - 31. 45