An Energy-Aware On-Demand Routing Protocol for Ad-Hoc Wireless Networks

An ad-hoc wireless network is a collection of nodes that come together to dynamically create a network, with no fixed infrastructure or centralized administration. An ad-hoc network is characterized by energy constrained nodes, bandwidth constrained …

Authors: Mallapur Veerayya

An Energy-Aware On-Demand Routing Protocol for Ad-Hoc Wireless Networks
Dissert ation Appro v al This is to certify that this dis sertation titled: An Energy-Aw are On-Dem and Routing Proto col for Ad- Ho c Wireless Net w orks by Mallapur V eera yy a R ol l No. 06307416 is appro ved for the degree of Ma ster of T echnology Examiner: Prof. V. M. Gadre Sup ervisor: Prof. Abha y Karandik ar Examiner: Prof. Bik ash Kumar Dey Co-Sup ervisor: Dr. Vishal Sharma Principal Consultan t & T ec hnolo gist Metanoia, Inc. USA Chairp erson: Prof. Sridhar Iy er Date: M. T ec h. Degree Dis s ertation An Energy-Aw are On-Demand Routing Proto col for Ad-Ho c Wireless Net w orks Submitt ed in pa rtia l f ulfillm en t of the requirements for the deg ree of Master of T ec h nology in Communic ation Engine ering and Signa l Pr o c essing by Mallapur V eera yy a Roll No. 06307416 Under the guidanc e of Prof. Abha y Karandik ar Dr. Vishal Sh arma, Metanoia, Inc. Departmen t of Electrical Engineering Indian Institute of T ec hnolog y Bom ba y July , 2008 Ac knowledgmen ts With deep sense of gratitude, I w ould like to thank m y adviser, Prof. Abha y Karandik ar for his timely input and guidance during the en tire course of the pro ject. My sincere thanks to m y co-adviser Dr. Vishal Sharma, Principal Consultan t & T ec h- nologist, Metanoia Inc., USA., without whom this thesis would not hav e b een p ossible. It is a great learning exp erience to w ork under his guida nce. The regular inputs and encouraging feedbac ks hav e alwa ys help ed me in doing researc h in the rig h t direction. I am v ery thankful to Heman t Rath fo r his contin uous in teraction in the lab during the entire pro ject. I am a lso tha nkful to, Punit Ra t ho d fo r his guidance in scripting and Ash utosh Gore for his v aluable inputs and guidance in rep ort writing. I w ould lik e to thank all m y fellow labmates f o r their co op eration in creating a vibran t en vironmen t in the lab to w or k. I w ould lik e to tak e this as an opp or t unity to thank Defence Researc h and Dev elopmen t Organisation for giving me an opp o r t unit y to p ersue m y Master’s at Indian Institute of T ec hno lo gy , Bo mba y I thank m y parents fo r their contin uous supp ort and encouragemen t during m y en tire Master’s course. Mallapur V ee ra yy a July 2008 Abstract An ad- ho c wireless net w ork is a collection of nodes that come together to dy namically create a net work, with no fixed infrastructure o r cen tralized administration. An ad-ho c net work is c haracterized b y energy constrained no des, bandwidth constrained links and dynamic top ology . With the grow ing use o f wireless netw orks (including ad-ho c net works ) for real- time applications, suc h as v oice, video, and real-time data, the need for Qualit y of Service (QoS) guaran tees in t erms of dela y , bandwidth, and pac k et lo ss is b ecoming increasingly imp ortan t. Pro viding QoS in ad-ho c net w orks is a c hallenging task b ecause of dynamic nature of netw ork top ology and imprecise state information. Hence, it is imp ortant t o ha v e a dynamic routing proto col with fast re-ro uting capability , whic h also pro vides stable route during the life-time of the flo ws. In this thesis, w e hav e pr o p osed a nov el, energy aw are, stable routing proto col named, Stabilit y-based QoS- capable Ad-ho c On-demand D istance V ector (SQ-A ODV), whic h is an enhancemen t of the w ell-know n Ad-ho c On-demand Distance V ector ( A ODV) routing proto col for ad-ho c wireless net w or ks. SQ-A OD V utilizes a cross-la yer design approach in whic h information ab out t he residual energy of a no de is used for route selection and main t enance. An imp ortant feature of SQ-A ODV pro to col is t hat it uses only lo cal infor- mation and requires no a dditional comm unication or co-op eration b et wee n t he netw ork no des. SQ-AOD V p ossesses a mak e-b efore-break re-routing capabilit y that enables near- zero pac k et drops and is compatible with the basic AOD V dat a formats and op eration, making it easy to adopt in ad-ho c net works. W e demonstrate, through extensiv e sim ulatio n results in NS-2, that the increased route stability affo rded b y SQ-AOD V leads to substan tially b etter QoS p erformance. Our results show t ha t under a v ariet y of a pplicable net w ork lo ads and settings, SQ- A O DV ac hiev es pac k et deliv ery ratio, on av erage, 10-1 5 % b etter than either A O DV or Minim um Drain Rate (MDR ) ro uting proto col, and no de expiration times 10 - 50% b etter than either A ODV or MDR, with pack et delay and con trol ov erhead comparable to t ha t of AOD V. Con ten ts List of T ables iii List of Figures iv 1 In tro duction 1 1.1 Bac kgro und . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Related W ork . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Con tributio ns of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.4 Organization of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2 Ad-Ho c On-deman d D ist ance V ec t or (AOD V) Rout ing Proto col 6 2.1 P at h D isco very . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1.1 Rev erse Path Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.2 F orward P ath Setup . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.1.3 Route T a ble Management . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 P at h Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.2.1 Lo cal Connectivit y Managemen t . . . . . . . . . . . . . . . . . . . . 10 3 Stabilit y-based QoS-capable AOD V ( SQ-A ODV) 11 3.1 In tro duction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.1 P at h D isco very . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1.2 P at h Maintenance . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4 Sim ulation Exp erimen ts, Results and Discussions 15 4.1 Demonstration of SQ-A ODV F eatures . . . . . . . . . . . . . . . . . . . . . 16 4.1.1 Sim ulatio n Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.1.2 Results and Discussions . . . . . . . . . . . . . . . . . . . . . . . . 18 4.2 V alidation of MDR Implemen tatio n . . . . . . . . . . . . . . . . . . . . . . 21 4.2.1 MDR Implemen tation . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.2.2 Sim ulatio n Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.2.3 Results and Discussions . . . . . . . . . . . . . . . . . . . . . . . . 23 4.3 P erfor ma nce Comparison of SQ- A ODV, MDR and A OD V . . . . . . . . . 26 4.3.1 Sim ulatio n Setup for Set A . . . . . . . . . . . . . . . . . . . . . . . 26 i 4.3.2 Results and Discussions fo r Set A . . . . . . . . . . . . . . . . . . . 27 4.3.3 Sim ulatio n Setup for Set B . . . . . . . . . . . . . . . . . . . . . . . 30 4.3.4 Results and Discussions fo r Set B . . . . . . . . . . . . . . . . . . . 31 5 Summary and F uture W ork 34 6 In tro duction t o NS-2 36 A C++ a nd O Tcl Link age in NS-2 . . . . . . . . . . . . . . . . . . . . . . . . 36 B Simplified User’s View o f NS-2 . . . . . . . . . . . . . . . . . . . . . . . . . 37 7 Details of SQ-AOD V in NS-2 39 A F ormat of Routing P a c ke ts in AOD V and SQ-AOD V . . . . . . . . . . . . 39 B Route Disco v ery in SQ- A O D V . . . . . . . . . . . . . . . . . . . . . . . . . 45 C Route Main tenance in SQ-AOD V . . . . . . . . . . . . . . . . . . . . . . . 51 C1 Mak e-Before- Br eak Re-r outing in SQ-AOD V . . . . . . . . . . . . . 51 References 57 ii List of T ables 4.1 V alues of P arameters Used for the Sim ulatio n o f the 12 No de T op ology . . 17 4.2 Initial Energy of No des fo r Eac h Exp erimen ts in Joules . . . . . . . . . . . 18 4.3 Source-destination P airs in t he 12 No de T opolog y . . . . . . . . . . . . . . 18 4.4 V alues of P arameters Used for MDR V erification . . . . . . . . . . . . . . . 23 4.5 V alues of P arameters Used for Sim ula tion Set A . . . . . . . . . . . . . . . 26 4.6 Sim ulatio n Results for Set A . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.7 P ar a meters a nd Their V alues Used fo r Sim ulation Set B . . . . . . . . . . . 31 4.8 Av erage Num b er of Hops for Sim ulation Set B . . . . . . . . . . . . . . . . 33 iii List of Figures 1.1 A Simple Ad-Ho c Netw ork with 9 P articipating No des . . . . . . . . . . . 2 2.1 Rev erse P ath Setup in AOD V . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 F orward P ath Setup in AOD V . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.1 Cross-la yer Design Used in SQ-AOD V . . . . . . . . . . . . . . . . . . . . 12 4.1 12 No de T opolo gy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.2 P ack et D eliv ery R atio fo r EXPT1 . . . . . . . . . . . . . . . . . . . . . . . 19 4.3 P ack et D eliv ery R atio fo r EXPT2 . . . . . . . . . . . . . . . . . . . . . . . 19 4.4 P ack et D eliv ery R atio fo r EXPT3 . . . . . . . . . . . . . . . . . . . . . . . 20 4.5 P ack et D eliv ery R atio fo r EXPT4 . . . . . . . . . . . . . . . . . . . . . . . 20 4.6 P ack et D eliv ery R atio fo r EXPT5 . . . . . . . . . . . . . . . . . . . . . . . 21 4.7 49 No de T opolo gy with 12 Sessions . . . . . . . . . . . . . . . . . . . . . . 23 4.8 No de Expiration Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.9 Connection Expiration Time . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.10 No de Expiration Time [ 1 ] . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 4.11 Connection Expiration Time [ 1 ] . . . . . . . . . . . . . . . . . . . . . . . . 25 4.12 NET: Sessions Commence at Start of Sim ulation . . . . . . . . . . . . . . . 28 4.13 NET: Random Session Start Times . . . . . . . . . . . . . . . . . . . . . . 29 4.14 CET: Sessions Commence at Start of Sim ula t io n . . . . . . . . . . . . . . . 29 4.15 CET: Random Session Start Times . . . . . . . . . . . . . . . . . . . . . . 30 4.16 Av erage Pac k et Delev ery Ratio fo r Sim ulation Set B . . . . . . . . . . . . . 31 4.17 Av erage Control Ov erhead for Sim ula tion Set B . . . . . . . . . . . . . . . 32 4.18 Av erage Pac k et Delay for Simulation Set B . . . . . . . . . . . . . . . . . . 33 A1 C++ a nd O Tcl Link age in NS-2 . . . . . . . . . . . . . . . . . . . . . . . . 37 B1 Simplified User’s View o f NS-2 . . . . . . . . . . . . . . . . . . . . . . . . . 38 A1 RREQ P a c ket F ormat in A OD V . . . . . . . . . . . . . . . . . . . . . . . 42 A2 RREQ P a c ket F ormat in SQ-A ODV . . . . . . . . . . . . . . . . . . . . . 42 A3 RREP Pac k et F ormat in AOD V . . . . . . . . . . . . . . . . . . . . . . . 43 A4 RREP Pac k et F ormat in SQ- A O DV . . . . . . . . . . . . . . . . . . . . . 43 A5 ERR OR P a c ke t F ormat in A OD V and SQ- AOD V . . . . . . . . . . . . . . 44 iv B1 Flo w-c ha rt of AOD V::recv() F unction . . . . . . . . . . . . . . . . . . . . . 46 B2 Flo w-c ha rt of AOD V::rt resolve () F unction . . . . . . . . . . . . . . . . . . 47 B3 Flo w-c ha rt of AOD V::sendRequest() F unction . . . . . . . . . . . . . . . . 48 B4 Flo w-c ha rt of AOD V::recvA OD V() F unction . . . . . . . . . . . . . . . . . 48 B5 Flo w-c ha rt of AOD V::recvRequest() F unction . . . . . . . . . . . . . . . . 49 B6 Flo w-c ha rt of AOD V::recvRequest() F unction . . . . . . . . . . . . . . . . 49 B7 Flo w-c ha rt of AOD V::sendReply() F unction . . . . . . . . . . . . . . . . . 50 B8 Flo w-c ha rt of AOD V::recvReply() F unction . . . . . . . . . . . . . . . . . . 50 C1 Flo w-ch art of A OD V::rt ll failed() F unction . . . . . . . . . . . . . . . . . 53 C2 Flo w-ch art of A OD V::lo cal rt repair() F unction . . . . . . . . . . . . . . . 5 3 C3 Flo w-ch art of A OD V::n b delete() F unction . . . . . . . . . . . . . . . . . . 54 C4 Flo w-ch art of A OD V::handle link failure() F unction . . . . . . . . . . . . . 5 4 C5 Flo w-ch art of A OD V::rt do wn() F unction . . . . . . . . . . . . . . . . . . . 5 4 C6 Flo w-ch art of A OD V::sendError() F unc tion . . . . . . . . . . . . . . . . . . 5 4 C7 Flo w-ch art of A OD V::recvError() F unc tion . . . . . . . . . . . . . . . . . . 5 5 C8 Com bined Flow-c hart of RC R-timer and R CR function o f SQ-AOD V . . . 55 C9 Flo w-ch art of Mak e-b efore-break F eature of SQ-A ODV . . . . . . . . . . . 56 v Chapter 1 In tro duction 1.1 Bac kgro u nd An ad- ho c wireless netw ork is a collection of no des t ha t come together t o dynamically create a net work, with no fixed infr astructure or cen tralized administration as sho wn in Figure 1.1 . F or a source to send data pack ets to a destination that is not in its direct ra nge of tra nsmission, the pac kets m ust b e rela y ed through one or more intermediate no des. F or example, in F igure 1.1 , if no de A wishes to communicate with no de F that is outside of A’s direct transmission range, the pac k ets will hav e to b e rela yed either through no des B and E or through no des B and C. Hence, a no de m ust act b oth as a host and a router. A routing proto col is, therefore, required to find t he b est p ossible route to relay a pac ket to its desired destination. Tw o k ey functions o f suc h a routing proto col are: • D etermination of ro ut es for v arious source-destination pairs • D eliv ery o f data pac k ets to t heir correct destination Ev en if the no des in the ad-ho c net w o r k are stationar y , the quality of the wireless links b et w een them v aries – b oth due to the v arying amoun ts of in terference created b y the tr a nsmissions in the netw ork, and due to the v ariabilit y of the wireless link. Thus , a dynamic routing proto col (as opp osed to a set of static routes) is required to find the b est p ossible route to r elay a pac ket to its desired destination. Ad-ho c netw orks hav e a num b er of applications to day , due to their ability to pro vide an instant netw ork infrastructure t o supp ort comm unications in temp orary or mobile en- vironmen ts. F or instance, an ad- ho c netw ork is ideal for a battlefield scenario to form a command, control, and comm unications net w o r k for tactical military communic ations. Another example is the abilit y to establish a commercial and educational use netw ork in remote a r eas, where traditiona l communication infra structure is non-existen t, infeasible or exp ensiv e. Since ad-ho c net w orks can b e setup on-demand, with no constrain t on connectivit y/top o lo gy , they also offer unique b enefits for applications suc h as cit y surv eil- lance net w orks or netw orks for la w enforcemen t or rescue/disaster managemen t. In eac h 1 Figure 1.1: A Simple Ad-Ho c Netw ork with 9 Participating No des of these applicatio ns, the net work in question ma y b e static or semi-static, with differen t t yp es of data riding on it. With the g r owing use of wireless net w o rks (including a d-ho c net w o rks) for real-time applications, such as voice, video, and real-time data , the need for Qualit y of Service (QoS) gua ran tees in terms of delay , bandwidth, and pac k et loss is b ecoming increasingly imp ortant. This is particularly c hallenging for ad-ho c netw orks, where the no des are in v aria bly constrained b y energy . Moreov er mobility and the time-v arying shared wireless medium mak es QoS provis ioning m uc h more difficult. A key to enabling QoS gua ran tees in ad-ho c net w orks, therefore, is a dynamic routing pro to col tha t can adapt quick ly to net work changes . Existing routing proto cols fo r a d-ho c net w o rks ma y b e broadly classified in to : table- driven [ 2 ] [ 3 ] and o n -demand [ 4 ] [ 5 ] proto cols. T able-driv en proto cols are proactiv e, i.e., they try to k eep up-to-date routing information ab out the en tire net w ork thro ugh p erio dic up date messages, and can incur significant ov erhead in man y cases. The on-demand proto cols, on t he ot her hand, are reactiv e, i.e., they disco ver routes a s and when required b y the sources. Since resources in ad- ho c net w orks are often scarce, on-demand prot o cols app ear t o b e more suitable fo r suc h net w or ks. 1.2 Related W ork Standard QoS architec tures prop osed for the In ternet, suc h as the Integrated Services (In tServ) mo del [ 6 ] or the Differen tiated Services (D iffServ) mo del [ 6 ] a re not directly applicable to a d-ho c net works , b ecause they w ere not designed with the wireless environ- men t in mind. Giv en the gr owing imp ortance of Q o S in wireless net w o rks, ov er the last few ye ars, a n umber of w orks hav e prop osed w ay s to impro ve QoS in an ad-ho c wireless 2 en vironmen t. In [ 7 ], the authors prop osed an extension to Ad- Ho c On- demand Distance V ec tor (A O D V) [ 4 ] routing proto col to support QoS, assuming the a v ailability of some stationary links in the net w ork. The a uthors introduced the notion of no de stabili ty , based on a no de’s history , whic h incorp ora t ed b oth, a no de’s mobilit y and its pa ck et pro cessing ratio . Only stable no des we re considered for routing. Ho w ever, the authors did not consider t he impact tha t unpredictable link failures w ould hav e on re- r o uting. In [ 8 ] the authors prop osed a Qualit y-o f -Service a ware Source init ia ted Ad-ho c Routing (QuaSAR) proto col, whic h adds Q o S con tr o l mec hanisms t o all phases of source routing. The proto col main t ains an estimate of the battery p ow er required b y the application, a nd uses that in the path selection pro cess, while at t empting to g iv e guaran tees on the latency and bandwidth of a flow . The route is selected b y the source, af t er collecting statistics on all p ossible routes that satisfy a flow s latency , bandwidth, and p ow er requiremen ts. Energy consumption in ro uting a flow is minimized b y c ho osing the “shortest” path, b y mapping signal strength to distance. A characteris tic of QuaSAR is that it effectiv ely trades reduced pack et drops for increased proto col ov erhead. The route request messages in QuaSAR m ust carry latency , bandwidth, signal strength, and battery p o w er informa- tion for all no des along the path to enable the selection of a path tha t satisfies the Qo S requiremen ts o f a session. QuaSAR requires deployin g a completely new pro to col, and suffers from p o or scalabilit y , since source r outing can cause the length o f route request and route reply messages to b ecome excessiv e in larger netw orks. F urthermore, the basic QoS capabilities of QuaSAR are examine d for a rather limited scenario, with only a single source and single (mobile) destination. In [ 9 ] authors ha v e prop osed a stable, w eight-based, on-demand routing proto col. The difference with QuaSAR is that instead of carrying the differen t parameters themselv es, the authors use them to compute a comp osite “weigh t”, whic h is the one carried in the proto col messages . The w eigh t used to select stable routes is based on three comp o nen ts: Route Expiration Time (RET), whic h is the predicted time of link break age b et w een t w o no des due to mobility , Error Coun t (EC), whic h captures the n um b er of link failures due to mobilit y , and Hop Coun t (HC). The authors ha ve assumed that all no des are sync hronized via a Global Positioning System (GPS), so that tw o adjacen t no des ma y predict the RET. While the pro p osed sc heme ma y com bat against link breaks due to mobility , link breaks due to the draining no de energy is a fa ctor that also must b e accoun ted for when computing weigh ts for stable routing. In [ 10 ], the authors hav e prop osed a stable route selection sc heme based on Link Expiration Time Threshold ( LE T th ). The Link Expiration Time ( LE T ) is computed based on a prediction of neigh b or mobility . LE T computation needs to kno w the po sition of the neighbors, and hence requires p erio dic top ology up dat es. How ev er, the authors ha v e not considered the impact that unpredictable link failures w ould ha v e on re-ro uting. In [ 1 ], the authors prop osed a new metric, Energy-Drain-Ra te (EDR), whic h is defined 3 as t he rate at which energy is consumed at a give n no de at time t . The corr esp o nding cost function is defined as: C r = minT i r ( t ) , where, T i r ( t ) = E i r ( t ) D R i ( t ) , where, D R i ( t ) is the drain rate of no de i a t time t and E i r ( t ) is the residual bat tery p ow er of no de i at time t . Th us the life-time of a path is determine d by the minim um T i r ( t ) along that path. The Minim um Drain Rate (MD R ) [ 1 ] mec hanism selects the ro ute with maxim um life-time. Eac h no de monitors its energy consumption during a given past interv al τ and main t a ins the dra in r a te v alue using a n exp onen tial w eighted mov ing av erage. The prop osed MDR algorithm attempts to select the b est p ossible stable route for a g iv en source and des- tination. The p erio dic route up date used in MDR, how ev er, so on b ecomes costly , as it increases control ov erhead and degrades p erformance at higher net w ork loads. F rom the prop osals review ed so far [ 7 ], [ 9 ], [ 10 ], [ 1 ] it is clear that there is a need fo r a stable routing proto col that can provide stabilit y to the routes selected for routing Qo S- enabled applications, and also has mec ha nisms fo r fa st re-routing to tac kle unpredictable link break ages. F urthermore, for the sc heme to b e scalable, the stability should come at minim um or no ov erhead. 1.3 Con tributio n s of t he Thesis A k ey to providing QoS guarante es in ad- ho c net w orks is to find, not just an y ro ut e to the desired destination, but rather a route that can, with high probability , surviv e for the duration of the session. This ensures that comm unication once initiat ed will not b e disturb ed. It is also useful to hav e a mechanis m to quic kly find an alt ernate route, if one exists, fo r the session, in case of unpredictable link failure. In this thesis, w e ha v e prop osed an energy-aw are on-demand routing proto col whic h also pro vides stable routes to the flo ws during their life-time to supp ort QoS in a d- ho c net works . The prop o sed energy-aw are, stable routing proto col named, Stabilit y-based QoS-capable Ad-ho c On- demand Distance V ec tor (SQ-AOD V) pro t o col is an enhance- men t of the w ell-known AOD V [ 4 ] proto col for ad-ho c wireless net works . SQ-A OD V utilizes a cross-la y er design approac h in whic h informatio n ab out the curren t residual energy , av erage energy dra in-rate of a no de, a nd the session-duration (if known ) of the application is used t o find a stable route. SQ-A OD V also do es a proactiv e route mainte- nance using “ m ake-b efor e-br e a k ” mec hanism for finding an alternate route for the session when the energy drain rate of a no de suggests t ha t it will cease for warding b efore the session is completed. Since SQ- A ODV uses only lo cal info r mation and requires no addi- 4 tional comm unication or co-op eration b et wee n the netw ork no des, it increases the pac k et deliv ery ratio in the netw ork at virtual ly no overhe ad making it more suitable for ad-ho c wireless en vironmen t. 1.4 Organization o f the Th e sis The t hesis consists of 5 chapters. Chapter 1 , g iv es a brief in t ro duction to wireless ad- ho c net works, and need for QoS supp or t and dynamic routing prot o col in wireless a d- ho c net w orks. Some o f the prop o sed QoS and stability-based rout ing proto cols are also review ed in this c hapter. Chapter 2 , giv es a brief in tro duction to A ODV routing proto col, whic h w e ha v e mo dified to r ealize SQ - A OD V in NS-2 [ 11 ]. A detailed description and op eration of SQ-A OD V is presen ted in Chapter 3 . In Chapter 4 , we ha ve giv en a complete details of our sim ulation scenarios, results along with discussions. Finally , Chapter 5 give the summary o f the thesis along with some of t he future works . 5 Chapter 2 Ad-Ho c O n-demand Distance V ector (A OD V) Routing P roto col In this c hapter, we giv e a v ery brief in tro duction to AOD V [ 4 ], which w e hav e mo dified in designing SQ- A ODV. Since the phases of op eration of SQ-A ODV remain the same as those of A ODV, it is imp ortant to first understand the basic op eration of AOD V. AOD V is a destination-based reactiv e proto col. It av oids routing lo ops b y tagging an unique sequence n umber to route informatio n for eac h destination. This sequence num b er is generated or originated b y the destination. AOD V for its op erat ion assumes symmetric links b et ween neigh b oring no des. That is, the links are bidirectional, and should ha v e same prop erties in b oth directions. AOD V routing proto col uses differen t ro uting messages to disco ve r the ro utes and maintain links. • R REQ is a route request message used whenev er a new route to a destination is required. • R REP is a reply message for a route request. • Periodic HELLO messages ar e broadcast to che c k the presence of immediate activ e neigh b ors. If a no de do es not lie along an activ e route, it neither main ta ins routing information nor participates in the exc hange of routing information. The proto col consists of t w o basic pro cesses: 1. Path disco v ery 2. Path mainten ance 2.1 P ath Disco v ery A pa t h discov ery pro cess is initiated whenev er a source no de needs to send data pac k ets to a destination no de and do es not hav e a route informatio n for this destination no de. 6 Consider the netw ork in Figure 1.1 . Supp ose no de A w an ts to send data pack ets to no de G and do es not ha v e a r o ute info r ma t ion. Then no de A initiates a route disco ve ry pro cess b y broadcasting a RREQ pac k et to its immediate neigh b ors (in our case no de B). Eac h in termediate no de a fter receiving the first RREQ pac k et do es the fo llo wing: • Chec ks whether it has a current route informa t io n ab o ut the destination no de • If it has a curren t route informatio n, it sends a RREP bac k to the source no de • If it do es not hav e a curren t route information, it rebroadcasts the RREQ to its neigh b oring no des and k eeps a record o f the fo llo wing infor ma t io n for setting up a rev erse path: – D estination IP address – Source IP address – Bro a dcast ID – Expiration time for the rev erse pa th entry – Source no de sequence n umber Ev ery subseq uen t RR EQ (copies) with the same bro a dcast ID is discarded. In our case assume no de B rebroa dcasts t he RREQ to its immediate active neigh b ors A, C a nd E and k eeps a record. No de C after receiving R R EQ rebroa dcasts t he RREQ to its immediate neigh b ors B, D, E and F, and keep s a record. No de D simply times out b ecause its only neigh b or is no de C from which it has receiv ed R REQ. All inte rmediate no des rep eat this op eration of either rebroadcasting or timing o ut till RREQ reaches the final destination. Finally , when RREQ reach es the desired destination no de G, the no de will unicast a RREP message back to the source thro ugh t he r evers e p ath setup . 2.1.1 Rev erse P ath Setup A source sequence n um b er is used to main tain freshness information ab out the rev erse path to the source. In Figur e 2.1 , RREQ trav els form no de A to v arious active inter- mediate no des and when it finally reac hes the destination no de G, it automatically sets up the rev erse path fr o m the destination to source. T o do this rev erse pat h setup every in termediate no de (in our case no des B and E) records the address of the active neighbor from whic h it receiv ed the first copy o f the RR EQ. These rev erse path en tries are main- tained f or sufficien t amount of time so that the RREQ pac ket trav erses the net w or k and pro duce a reply bac k to t he source. The rev erse path that is setup from no de E to no de A is indicated b y solid arrows in F igure 2.1 . 7 Figure 2.1: Reve rse P ath Setup in A OD V Figure 2.2: F orw ard P a th Setup in A ODV 8 2.1.2 F orw ard P ath Setup As the RREP trav els back to the source using a rev erse route, either from the destination no de or an in termediate no de that has a curren t route infor mation ab out t he destination, eac h no de alo ng t his rev erse path sets up a forw ard p ointe r to the no de from whic h the RREP is receiv ed. Each no de also up dates the t imeout information for this source to destination, and records the latest destination sequence n um b er. In Figure 2.2 solid arro ws indicate the forw ar d path from node A to no de G . This path is setup with the help of forw a r d p ointers as the RREP tra v els ba ck from destination no de G to source no de A. The no des that ar e not activ e along the path determined by the R REP will timeout and delete the rev erse p ointers . Once the forward path is setup a nd t he RREP reac hes the source no de A, source no de A will immediately start data transmission. 2.1.3 Route T able Managemen t Apart from the source and destination sequence n umbers as en tr ies in the r o uting table, there are expiration timers asso ciated with reve rse path entries and route in v alidat ion. The purp ose of the timer mean t fo r reve rse path en try is to giv e timeout informatio n for purging of those r eve rse pat h en tries in the no des that do not lie along the path determined b y RREP . In Figure 2.1 no des C, D, F, H and I purge there en tries after this timer expiration. This expiration t ime dep ends on the size of the ad-ho c net work. There is another expiration timer whic h is used to inv a lidate a route already av a ilable in the cac he. A neighbor is considered to b e activ e, if it originates or relays at least one pack et for tha t destination in the timeout p erio d and the address of t he active neigh b ors is also en tered in the table. Hence a no de maintains the fallowing information f o r each route table en try: • D estination IP address • Next hop • Number of hops • Sequence num b er f o r the destination • Active neigh b ors for that route • Expiration time for the route table en try If there is more than one r o ute en try fo r a particular destination, the no de c ho oses the one with higher sequence num b er. If the sequence n umbers ar e same then a route with smaller metric ( less num b er of hop coun t) is c hosen. 9 2.2 P ath Main tenanc e If a no de mo v es fro m the curren t lo cation to a new lo cation in the net w ork, the routing will not b e affected unless this no de w a s in the active routing path. When a source no de mo v es to a new lo cation in the net w ork a nd affects the route of an activ e session (i.e., b efore route in v alidation timer expires), then the source can re-initiate a route disco v ery pro cedure if a route to the desired destination is still required. On the other hand, if an in termediate no de of a n a ctiv e session mo ves fro m its presen t p osition, then a sp ecial RREP is sen t to the affected source no des. P erio dic HELLO messages are used to detect link failures. Link fa ilures can also b e detected if a no de is unable to fo r ward a pac ket t o the next hop. Once a link failure is detected, an unconditional RR EP with fresh sequence n umber and hop count set to infinit y is broadcast to activ e neighbors. Within some time all activ e no des in t he net w ork will kno w ab o ut link f ailure. The source no des can r estart the discov ery pro cess if they still need a route to a destination. 2.2.1 Lo cal Connectivit y Managemen t No des learn ab out their neigh b ors in t w o wa ys. One w a y is whenev er a no de receiv es a broadcast message from a neighbor it up dates its lo cal connectivit y . Other w a y is to broadcast HELLO messages to its active neigh b ors. If a no de do es not receiv e HELLO messages consecutiv ely , this indicates that lo cal connectivit y is c ha nged. 10 Chapter 3 Stabilit y-based Q oS-capable A OD V (SQ-A OD V ) In this c ha pter, w e presen t our energy-a w are on- demand routing proto col SQ-AOD V. W e explain the op era t io n of SQ-A OD V a lo ng with the cross-la yer design used to implemen t the pro t o col in NS-2 [ 11 ]. 3.1 In tro du ction SQ-A OD V is an enhancemen t to t he we ll-kno wn A OD V [ 4 ] routing proto col, whic h w e ha v e discussed in Chapter 2 . The enhancemen ts are done in b oth Path D isc overy and Path Maintenanc e phases of AOD V t o mak e it a stable and dynamic routing proto col. The tw o main features of SQ-A ODV ar e it: • Provides stable routes b y accoun ting for the residual life-time at in termediate no des (calculated using the curren t Av erage- Energy-Drain-Rate (AEDR)) and the dura- tion of the session (if kno wn) at t he route selection stage. • G uards ag ainst link break ages that arise when the energy o f a no de(s) along a path is depleted, b y p erforming a mak e-b efore-break r e- route (where p ossible). This minimizes pack et loss and session disruptions. The first feature ensures that SQ-A OD V only routes sessions along routes that either ha v e in termediate no des with sufficien t energy to last the length of the session or along routes that maximize the residual lif e-time of the b ottlenec k no de, thus ensuring, with v ery hig h pro babilit y , that session disruption due t o energy depletion at an in termediate no de do es not o ccur. It turns out that this increased stability leads to substan tially b etter QoS in terms of pac k et deliv ery ratio (PDR) and pac k et dela y (PD), ev en without explicitly accounting f o r bandwidth, j it t er o r dela y requireme n ts, as our subseque n t results demonstrate. 11 The second feature ensures that when a link break due to no de energy depletion is imminen t, SQ-A OD V proactiv ely re-routes sessions, without losing any pac k ets. Once again, this provides near-zero pac k et loss and sup erior QoS p erfo rmance. Figure 3.1: Cross-la yer Design Used in SQ-AOD V The op eration of SQ-AOD V utilizes the cross-la yer design depicted in Figur e 3.1 , where energy information from the ph ysical la y er is used in admission con trol decisions at the net w or k lay er and to turn-off sessions at the application lay er. W e no w explain t hese t w o features in more detail. 3.1.1 P ath Disco v ery The first mo dification/feature is outlined in Algorithm 1, and helps in c ho osing an ap- propriate sequence of in termediate no des for the requesting session. Algorithm 1 : Selection o f an Inte rmediate No de as Router 1: An inte rmediate no de N receiv es a RREQ ; 2: if Session-Dur ation is sp ecified in the RREQ then 3: Chec k 4: if Curr ent-Ener gy > ( Session -Dur ation × AEDR ) then 5: Up date Bot tlenec k life-time field of R R EQ ; 6: ADMIT the session and forward the RR EQ to the neigh b ors 7: else 8: REJECT the session, and DROP the RR EQ 9: end if 10: else 11: if C urr ent-Ener gy > Threshold-1 then 12: Up date Bott lenec k life-time field of RR EQ ; 13: ADMIT the session and forw ard the RR EQ to the neigh b ors 14: else 15: REJECT the session, and DROP the RRE Q 16: end if 17: end if 12 The application la y er of a source that wishes to communicate with a destination, generates data pac k ets and transmits them to the net work lay er. A t the net w ork la y er, the ro uting proto col resp onsible f o r finding a route to the desired destination initia tes a route disco ve ry pro cedure, if it do es not already hav e a route for that destination. W e assume here that, if the session-duration is kno wn, the application lay er directly pro vides that to the netw ork lay er, as sho wn in Figure 3.1 . If not, eac h inte rmediate no de uses a heuristic and accepts a session only if it has at least Threshold-1 of residual life ( Threshold-1 is the residual energy o f a no de with whic h the no de is alive f or the next X seconds at curren t AEDR, in our implemen tation X = 5 seconds). The source broadcasts R o ute R equest (RREQ) pac k ets to its neigh b ors when it has no route to the desired destination. When a RREQ pack et reac hes an interme diate no de, Algorithm 1 queries the ph ysical lay er for the curren t residual energy , and c hec ks whether the residual energy at the curren t AEDR is sufficien t to last the duration of the flow. The sess ion is only admitted if that is the case. If t he session-duration is unkno wn, the algorithm a dmits the sess ion only if the residual energy at the no de is ab ov e Threshold-1 . Before forwarding, the no de up dates the b ottlenec k lif e- t ime field of the RREQ pac k et. The Energy-Drain-Rat e (EDR) is computed as a difference b et w een the energy E n o f the no de at p erio dic in terv als divided by the length of t he interv a l. Thus , EDR( t 2 ) = E n ( t 1 ) − E n ( t 2 ) t 2 − t 1 , where E n ( t 1 ) a nd E n ( t 2 ) a re energy lev els of the no de at times t 1 and t 2 resp ectiv ely . Finally , this EDR is av eraged using exp onen tial a v erag ing with α = 0 . 5 to compute the AEDR as follows: AEDR(t) = α × EDR(t) + (1- α ) × AEDR(t-1) . Finally , when the RREQ pac k ets reac h the destination, it pic ks a route that maximize the ro ute life-time b y selecting the one with maximum life-time of the b o ttlenec k no de. 3.1.2 P ath Main tenance The second mo dification/feature helps the ro uting proto col to adapt quic kly to imminen t link break age lik ely to o ccur when the energy of a no de is fully dra ined. The algo r it hm fo r this is depicted in Algorithm 2 . Since the phy sical la yer k eeps tra ck of t he AEDR, it sends an alarm to the netw ork lay er shortly b efore it is ab out to drain completely i.e., when the current energy of the no de is less than Threshold-2 ( T hreshold-2 is the residual energy of a no de with whic h the no de is aliv e fo r t he next Y seconds at curren t AEDR, in our implemen tation Y = 1 second). The routing proto col adapts to this ev ent, and its b eha vior dep ends on whether the no de is an interme diate no de ( I ) or a destination no de ( D ). 13 If the no de receiving the drain alarm fro m its phy sical la y er is an in termediate no de, it sends a Ro ute Change R equest (R CR) pack et to all source no des using it a s an interme di- ate hop to wards their respectiv e destinations. The source upon receiving the R CR pac k et, b egins a new route disco v ery pro cedure f or the session, a nd th us, with high probability , finds a new route b efore an actual link break o ccurs o n the o r ig inal route, leading to the make-b ef o r e-br e ak b ehav ior. This reduces pac ket drops due to link break age and the consequen t dela y incurred, and enables the routing proto col to quic kly adapt to net w ork c hanges, if an alternate pa th t o the desired destination exists. If the no de b eing drained is a destination no de, it sends a request to the source to stop all tr a ffic transmission to itself. When the request reache s the source, the net work lay er sends a stop signal to the application, as sho wn in Fig. 3.1 , preve n ting further transmission of data. This reduces the n um b er o f pa c ke t drops in the net w ork and increases pack et deliv ery ratio, and re- duces resource usage by av oiding pac k et transmissions to una v ailable destinations. If a source no de itself is ab o ut to drain, it simply con tin ues to transmit data until it cannot transmit a n ymore. Algorithm 2 : Route Maintenance by Mak e-b efore-break 1: No de N p erio dically compute t he E D R and che c k for Curr ent-Ener gy ; 2: if Curr ent-Ener gy < Threshold-2 then 3: Chec k 4: if N = = I then 5: Send RCR to all the source no des using this no de as router 6: end if 7: if N = = D then 8: Send a Stop-T raffic request to all sources that are communic ating with this destination 9: end if 10: end if Note t hat SQ-AOD V uses only lo cal info r mation, and requires no additio na l comm u- nication or co-op eratio n b et w een the no des. Indeed, the algorithms desc rib ed ab ov e could b e used with a ny underlying ro uting proto col, but w e use A ODV proto col as it is one of the most p opular ad- ho c rout ing proto cols. 14 Chapter 4 Sim ulation Exp erimen ts, Results and Discussi ons In this chapter, w e presen t and discuss a wide range o f results of extensiv e sim ulations that w e hav e conducted in NS-2 [ 11 ] (V ers ion 2.30 ) , to compare the p erformance of SQ-AOD V with that of MDR [ 1 ] and A OD V [ 4 ]. W e hav e considered the f ollo wing six parameters: • Pac ket Delivery Ratio (PDR ) : is the r atio of the n umber of pac kets successfully receiv ed b y all destinations to the to tal n um b er of pack ets injected into the net w ork b y all sources. The PDR is therefore a n um b er b etw een 0 and 1. • N ormalized Control Overhead : is the ratio of n um b er of routing pack ets trans- mitted (hop wise) b y all the no des to the total n um b er of pack ets successfully receiv ed by all destinations in the net w or k. The norma lized con t r o l o v erhead is therefore a num b er greater than 0. • A v er age P ac ket Delay: is the sum of the times tak en by the successful data pac kets to tra vel from their sources to destinations divided by t he total num b er of success ful pac k ets. The a v erage pac ke t delay is measured in seconds. • A v er age Hop Coun t: is the sum of the num b er of hops tak en b y the successful data pac k ets to trav el from their sources to destinations divided by the total num b er of successful pack ets. The av erage hop coun t is measured in n um b er of hops. • N o de Expiration Time (N ET) : is the time for whic h a no de has b een aliv e b efore it mus t halt transmission due to ba t tery depletion. The no de expiration time is plotted as num b er of no des aliv e at a giv en time, for differen t p oin ts in time during the sim ulation. • Connection Expiration Time ( CET) : is the time for whic h a connection has b een a ctiv e b efore it m ust cease transmission due to the non-av ailabilit y of a route b et w een source and destination. This o ccurs when no des alo ng the path expire or 15 b ecome unreac hable due to p o or link conditions. The connection expiration t ime is expresse d in seconds. W e presen t our sim ulation results in 3 differen t parts, and are as follows: 1. D emonstration of SQ-AOD V features 2. V alidation of MDR [ 1 ] implemen tation 3. Performance comparison of SQ-AOD V, MDR and AOD V [ 4 ] 4.1 Demonstrati o n of SQ-A OD V F eatures In this section, w e presen t o ur sim ulation results to demonstrate the energy a w ar eness and mak e-b efore-break re-routing f eatures of SQ- A OD V b y comparing the pa ck et deliv ery ratio p erformance with tha t of AOD V. 4.1.1 Sim ulation Setup W e hav e considered the 12 -no de to p ology in 500 m x 1000 m a rea as show n in Figure 4.1 . The no des ar e iden tical in their capabilit y , but are initia lized with differen t energies in differen t exp erimen ts Expt1 to Expt5, t ha t w e ha v e conducted, and there is no mobilit y in the net w ork. T o calibrate the loa d that can b e supp orted by the net w ork, an extensiv e series of sim ulations with one, t w o , three, a nd fiv e sim ultaneous sessions was conducted with v ary- ing a v erage session data r ates. W e found that when the aggregate rate of sessions at the no des exceede d ab out 22 5 Kbps on a v erage, the pac k et drop r a te in the net w ork b ecame excess iv e, indicating that t he net w ork was saturated b ey ond capacity . W e ha ve thu s used this ra t e as 100% load, and nor ma lized using this. The MA C lay er proto col is IEEE 802.11 DCF (Distributed Co-ordination F unction) with the PLCP (Phys ical Lay er Con vergenc e Prot o col) data rate b eing 1 Mbps. The parameters used in the sim ulations for Expt1 to Expt5 are listed in T able 4.1 . Here w e demonstrate the PD R p erformance of SQ-A ODV under a v ariet y of differen t net work loads and no de energies, and assess the b enefit of its mak e-b efore-break strategy . In eac h exp erimen t Expt1 to Expt5, the initial energy lev els of the no des is randomly c hosen b et w een 10 Joules to 100 Joules, and compared the p erfo rmance of PDR for SQ- A O DV and AOD V. The starting times of the sessions w ere c hosen suc h that there w ere at most b etw een 3-5 sessions in par allel in t he net w ork at any instant. The net w ork lo a d w as v aried from ab out 20% to 90%, so the session data rate is v aried from 1 5 Kbps t o 65 Kbps (3- 5 sessions of 15 Kbps eac h equates to 20% of 225 Kbps (225 Kbps equals 100% load) and 3 -5 sessions of 65 Kbps each equates to 9 0 % of 22 5 Kbps). Eac h exp erimen t is run 50 times (eac h initialized with differen t seed), and the resulting PDR is a v eraged o ver 16 Figure 4.1: 12 No de T opolog y T able 4.1: V alues of Parameters Used for the Sim ulation of the 12 No de T opolog y P ack et size 512 Bytes P ack ets/Session 1000 Date tra ffic P oisson with exp onen tial in ter- arriv al time MA C Proto col IEEE 8 0 2.11 DCF PCLP Dat a rate 1 Mbps Buffer length 50 Pac k ets T ransmit p ow er 0.2818 W Propagation mo del Tw o-R a y Gr o und 17 these 50 runs. There are 1 2 sessions in each experimen t, with 1000 pack ets p er session, generated as p er a P oisson pr o cess. The energy distribution of the no des fo r eac h of the 5 exp erimen ts Expt1 to Expt5, as we ll as the source-destination pairs for eac h session a re summarized in T able 4.2 and T able 4.3 , resp ectiv ely . T able 4.2: Initial Energy of No des for Eac h Exp erimen ts in Jo ules No de Expt1 Ex pt2 Expt3 Expt4 Expt5 1 45 29 94 82 93 2 20 91 40 73 39 3 24 40 29 37 64 4 62 97 87 33 31 5 59 82 73 90 73 6 93 82 50 30 35 7 85 50 87 64 100 8 68 34 54 28 19 9 24 15 24 86 61 10 3 0 17 18 8 6 49 11 5 5 43 35 9 0 87 12 3 9 20 95 1 1 97 T able 4.3: Source-destination P airs in the 1 2 No de T opolog y S ession N o. { src, dst } 1 { 1 , 11 } 2 { 2 , 12 } 3 { 3 , 11 } 4 { 8 , 6 } 5 { 10 , 1 } 6 { 2 , 4 } 7 { 12 , 3 } 8 { 4 , 2 } 9 { 11 , 1 } 10 { 7 , 6 } 11 { 8 , 10 } 12 { 12 , 1 } 4.1.2 Results and Discussions The pack et deliv ery rat io for each of the exp erimen ts Expt1 to Expt5, fo r b oth SQ- A OD V and A ODV [ 4 ] is plotted in Figures 4 .2 - 4.6 . It can b e observ ed that, in all cases, and for all loads, the pack et delive ry r atio is impro v ed substan tially , and SQ-A O D V outp erforms A O DV. This is b ecause there are some no des whose battery life is limited. Cho osing these no des a s intermed iate no des, as is done b y AOD V, leads to disconnections in the 18 15 25 35 45 55 65 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Session data rate in Kbps Packet delivery ratio EXPT1 SQ−AODV AODV Figure 4.2: P ack et Deliv ery Rat io for EXPT1 15 25 35 45 55 65 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Session data rate in Kbps Packet delivery ratio EXPT2 SQ−AODV AODV Figure 4.3: P ack et Deliv ery Rat io for EXPT2 19 15 25 35 45 55 65 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Session data rate in Kbps Packet delivery ratio EXPT3 SQ−AODV AODV Figure 4.4: P ack et Deliv ery Rat io for EXPT3 15 25 35 45 55 65 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Session data rate in Kbps Packet delivery ratio EXPT4 SQ−AODV AODV Figure 4.5: P ack et Deliv ery Rat io for EXPT4 20 15 25 35 45 55 65 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Session data rate in Kbps Packet delivery ratio EXPT5 SQ−AODV AODV Figure 4.6: P ack et Deliv ery Rat io for EXPT5 session. SQ-AOD V, on the other hand, p erforma s b etter b ecause, (i) it c ho oses those in termediate no des whose energy is sufficien t to supp ort the ses sion for its entire durations or it c ho oses t ho se in termediate no des whic h maximize the life-time of the route, and (ii) its mak e-b efore-break strategy that re-routes a session pro activ ely when a link failure due to depletion of no de energy is imminen t. Thu s, SQ-A OD V is successful in reducing pac ket drops in the netw ork drastically . Additionally , in SQ-A O DV, the traffic of a source is stopp ed just as a destination is ab out to dra in, leading to savin g of net work resources, b y not tr a nsmitting pack ets that w ould, in an y case, not b e used by the destination. 4.2 V alidation of MD R Imple men tatio n In this section w e giv e a brief intro duction to the Minim um Drain Rate (MDR) [ 1 ] routing proto col and its implemen t a tion in NS-2 [ 11 ]. W e also presen t the sim ulation results to demonstrate the correctness o f o ur implemen tation. Since MDR is an energy-aw are routing prot o col with a system mo del and op eration quite similar t o that o f SQ-AOD V, w e hav e c hosen MDR for comparison with SQ- A O D V. 4.2.1 MDR Implemen tation Minimum dr ain r ate is basically a mec hanism used to select a path b et w een a source and destination that maximizes the life-time of a route. In MDR the life-time of a path is dictated by the life-time of the b o ttlenec k no de along the path. The life-time of a no de is calculated using the curren t Average-Energy-Drain-Rate (AEDR). Eac h no de calculates 21 the Energy-Drain-Rate (EDR), b y calculating the energy consumed by the no de for the last T seconds ( T = 6 seconds as sp ecified b y MD R authors in Section 3 of [ 1 ]). This computed EDR is av eraged using exp onential weigh ted moving av erage (with α = 0 . 3 as sp ecified by MDR authors in Section 3 of [ 1 ]). Let D R i ( t ) b e the dra in rate of no de i at time t and E i r ( t ) is t he residual battery p o w er of no de i at time t . Th us, the life-time of a path is determined by the minim um T i r ( t ) along that path, where, T i r ( t ) = E i r ( t ) D R i ( t ) . Th us, the Minim um Drain Ra t e (MDR ) mechanis m selects t he route with maxim um life-time. W e ha ve used A O DV [ 4 ] a s the underlying routing proto col and made necessary mo d- ifications for our MDR implemen tation. In [ 1 ], authors ha v e used D ynamic Source Rout- ing (DSR) as underlying routing proto col f o r implemen tation o f MDR, ho w ev er authors claim that underlying routing proto col do es not mak e a difference in the p erformance of the MDR sc heme. Since b oth DSR and AOD V are on- demand ro uting proto cols and we ha v e already used AOD V for implemen tio n of SQ-A OD V, w e decided to use AOD V for MDR implemen tation. F or MDR routing proto col implemen tation, w e ha v e mo dified the RREQ message of A O DV to carry the b ottlenec k life-time information o f the path. As the RREQ message tra v els from source t o destination, the b ott lenec k life-time field of the RREQ messages is up dated. The destination no de w aits either for 0 . 25 second s af t er the first RREQ receiption or f or the receiption of 3 RREQs, and finally reply to the RREQ that maximizes the life- time of the pat h. MDR up da t es its routes ev ery 10 seconds to maintain up-to- date routing information. Hence a source no de ke ep up dating the routes b y perio dic route disco ve ries. W e hav e sim ula t ed the A OD V-based MD R , and presen t the simulation setup and the results in the Section 4.2.2 a nd Section 4.2.3 resp ectiv ely . 4.2.2 Sim ulation Setup W e consider the 49-no de static top ology ( where there is no no de mobility ) with 12 ses- sions as show n in Fig. 4.7 for our simulations. This is the same dense net work scenario considered in [ 1 ]. The no des are distributed uniformly in an area of size 540 m x 54 0 m, and are iden tical in their capabilit y , but are initialized with different energies . The source and destinations ha v e higher initial energy than other no des, this is to mak e sure that the comm unication b et w een source and destination starts. The MA C lay er proto col is IEEE 802.11 DCF (Distributed Co-ordination F unction) with the PLCP (Phys ical Lay er Con vergenc e Prot o col) data rate b eing 1 Mbps. The parameters used for these sim ulations are listed in T able 4.4 . The data traffic in all the sessions is CBR, with data pac k ets at eac h no de arriving at 3 pac kets /sec and all the 22 Figure 4.7: 49 No de T opolog y with 12 Sessions sessions star t ing at the start of the sim ulatio n. Initial energy of the source/destinations are chose n randomly b et w een 50 to 75 Joules and that of in termediate no des are selected b et w een 25 to 50 Joules. The sim ulat io n w as r un 5 0 times (eac h initialized with a differen t seed), a nd the resulting parameters are av eraged ov er these 50 runs. T able 4.4: V alues of Parameters Used for MDR V erification P ack et size 512 Bytes Sim ulatio n t ime 800 sec Date tra ffic CBR with 3 pkts/sec MA C Proto col IEEE 8 0 2.11 DCF PCLP Data rate 1 Mbps Buffer length 50 Pac k ets P t consume 0.2818 W P r consume 0.2818 W Propagation mo del Tw o-R a y Gr o und 4.2.3 Results and Discussions The results of No de Expiration Time and Connection Expiration Time, generated with our implemen tation of MD R routing proto col are plotted in Fig ur e 4.8 and Figure 4.9 23 0 100 200 300 400 500 600 0 5 10 15 20 25 30 35 40 45 Simulation time in seconds Number of nodes alive MDR (w/o overhearing) Figure 4.8: No de Expiration Time 1 2 3 4 5 6 7 8 9 10 11 12 200 250 300 350 400 Connections Expiration time in seconds MDR (w/o overhearing) Figure 4.9: Connection Expiration Time 24 Figure 4.10: No de Expiration Time [ 1 ] Figure 4.11: Connection Expiration Time [ 1 ] 25 resp ectiv ely and F ig ure 4.10 and F igure 4.11 are the results from t he MDR pap er [ 1 ] for No de Expiration Time and Connection Expiration Time resp ectiv ely with * sign as sample p o in ts. Although autho rs of MDR pap er [ 1 ] hav e not giv en enough informatio n to duplicate their results, w e hav e rev erse engineered the net work parameters to g et close to their r esults. W e hav e sim ulat ed an A OD V-based MDR a nd the plots in Figure 4.8 and F igure 4.9 are qualitatively similar to those in origional MDR pap er, this v erifies the b eha vior of our implemen tation o f MDR is similar to that of orig inal MDR pap er. 4.3 P erformance Comparis on of SQ-A ODV, MDR and A OD V In this section, w e presen t the sim ulation results to compare the p erforma nce o f the three proto cols SQ-AOD V, MDR and AOD V. F or p erformance comparison, w e ha v e conducted t w o set of exp erimen ts, Set A a nd Set B . Set A is designed to ev aluate the ov erall p erformance of SQ-A OD V, MDR and AOD V, for CBR traffic sources, while Set B is designed t o ev aluate the o v erall p erformance SQ- A O D V, MDR and A OD V, for Poiss on traffic sources and at varying network lo ads. W e presen t the results o f these 2 sets along with the sim ulation setup in the next section. 4.3.1 Sim ulation Setup for Set A W e consider the 49-no de stat ic to p ology (where there is no no de mobilit y) with 12 sessions as sho wn in Fig ure 4.7 , This is t he same dense netw ork scenario considered in [ 1 ]. The no des a r e distributed uniformly in an ar ea of size 54 0 m x 5 40 m, a nd are iden tical in their capa bility , but ar e initialized with differen t energies. T able 4.5: V alues of Parameters Used for Sim ulation Set A P ack et size 512 Bytes Sim ulatio n t ime 800 seconds Date tra ffic CBR with 3 pkts/sec MA C Proto col IEEE 8 0 2.11 DCF PCLP Data rate 1 Mbps Buffer length 50 Pac k ets T ransmit p ow er 0.2818 W Propagation mo del Tw o-R a y Gr o und Sim ulatio n Set A in volv es 2 exp erimen ts. In the first, all sessions b egin transmission at the start o f the sim ulation, and the sim ulation runs fo r a fixed duration (800 s). In the second, the session start times are c hosen randomly . In b oth exp erimen ts, the initial energy of the no des is uniformly distributed b etw een 25 J and 100 J, and da ta at each no de arriv es at 3 pkts/sec or ab out 12 Kbps. Ev ery exp erimen t was run 50 times (eac h 26 initialized with a differen t seed), and the resulting parameters av eraged o ver these 50 runs. The net work parameters used in sim ulation Set A are detailed in T able 4.5 . 4.3.2 Results and Discussions for Set A The results of the tw o exp erimen ts from sim ulation Set A are presen ted in T able 4.6 , while the plots of NET and CET are presen ted in Figs. 4.12 - 4.15 T able 4.6: Simulation Results for Set A P ar a meter Set-A(1) Set-A(2) SQ-A OD V MDR AOD V SQ-A ODV MDR A O DV PDR 0.9760 0.8456 0.8681 0.9892 0.9 2 01 0.8926 COH 0.7742 13.3207 1.08 77 0.3402 4.1554 0.825 6 PD (sec) 0.0618 0.2429 0.0543 0.0348 0.0 5 08 0.0353 W e see fro m T able 4.6 that the PDR for SQ- A ODV in the t w o experiments is impro v ed b y 12.5% and 10.8%, resp ectiv ely , relativ e to A ODV . This is b ecause choosing no des with limited battery life, as happ ens in AOD V, leads to (a voidable) disconnections of sessions. SQ-A OD V, on the other hand, p erforms b etter b ecause: ( i) it c ho oses those in termediate no des whose energy is sufficien t to supp ort the session for its en tire duration or it c ho oses no des to maximize the life-time of the route, and (ii) due to its make-before-br eak strategy , whic h re- r o utes a session proa ctively when link fa ilure due to depletion of no de energy is imminen t. Th us, SQ-AOD V succes sfully reduces pack et drops in the netw ork quite significan tly . Similarly , the PDR in MDR in the t w o cases is p o orer by 15.4% and 7.5%, respective ly as compared to SQ-AOD V. This is b ecause MDR’s p erio dic route up date feature adds substan tial routing ov erhead in the net w ork. In fact, T a ble 4.6 sho ws that MDR o v erhead is approximately 17 times a nd 12 times w orse than that o f SQ-AOD V, resp ectiv ely , and almost 1 2 times and 5 times worse than tha t o f A ODV, resp ective ly . This leads to its m uch low er PDR. The pa ck et delay for b oth SQ-AOD V and A ODV is comparable in b oth cases. W e p osit that this is b ecause the delay in SQ- A OD V is the result o f tw o o pp osing factors. On the one hand, finding stable routes, where the life-time of the b o ttlenec k no de is maximized, may lead to long er (but more stable) routes, th us increasing delay . On the other hand, proa ctive ro ute main tenance by w a y of mak e-b efore-break decreases delay , since no r etra nsmissions need o ccur while an alternativ e rout e is lo cated. These t wo factors hav e a comp ensatory effect, making the pack et dela y in SQ - A OD V of the same order as that in A ODV. Results in Section 4.3.4 ( T able 4.8 ) demonstrate the comp ensatory effects whic h mak es the dela y in SQ-AOD V and AOD V comparable. MDR, b y con trast, imp oses a m uc h higher load on the net work due to its p erio dic route up dates making 27 the data pack ets to w ait longer, leading t o a dela y t ha t is ab out 4 times and 1.5 times, resp ectiv ely , the dela y for AOD V or SQ-AOD V. 0 100 200 300 400 500 600 10 15 20 25 30 35 40 45 50 Simulation time in seconds Number of nodes alive Expiration of nodes SQ−AODV MDR AODV Figure 4.12: NET: Sessions Commence at Start of Sim ulat io n W e see f r o m Figs. 4.1 2 and 4.13 that in our net work setting, running SQ-AOD V impro v es the no de expiration time b y b et w een 25 t o 1 00 seconds ov er A ODV , and b y b et w een 100 to 150 seconds o v er MDR. In other words, f or a giv en n um b er of no des aliv e, this equates to SQ-A OD V extending the no de life-time b y b et w een 10 %-25% o v er A O DV, and b y b et w een 25%-35% ov er MDR. View ed ano t her w a y , at a given sim ulation time, SQ-A OD V typically has b etw een 10%-25% more no des aliv e than do es AOD V, and has b etw een 20%-60% more no des aliv e than do es MDR. This is b ecause SQ-AOD V’s proactiv e route maintenance is very economical of no de energy . In addition, due to the proactiv e mec hanism in SQ-AOD V, a source stops tra nsmitting traffic if a destination is ab out to drain, whic h sav es resources b y minimizing the transmission of pa ck ets tha t w ould not ha v e b een receiv ed by the destination in a n y case (due t o its expiring). The no des in MDR, on the o ther hand, expire fa ster than they do in either A ODV or SQ- A O DV b y a significan t mar g in, this is b ecause the p erio dic up dates of MDR consume energy a t a substan tially faster ra te, causing no des to expire muc h quic k er, as our results demonstrate. Figs. 4.14 and 4.15 illustrate that in our net w ork setting, in terms o f CET, AOD V p erforms b etter b y ab out 10-50 seconds o ver b oth SQ-A O DV and MDR. (Note that the x-axis in these figures simply indicates the numb er of c onne ctions tha t ha v e expired, a nd is not the connection iden t ifier . Th us, the connections that expire under eac h proto col can b e differen t. So, for example, F ig. 4.14 sho ws that 6 connections expire a t appro ximately 200 seconds with A ODV, at 180 seconds with SQ-A OD V, a nd at 165 seconds with MDR. 28 100 200 300 400 500 600 700 800 10 15 20 25 30 35 40 45 50 Simulation time in seconds Number of nodes alive Expiration of nodes SQ−AODV MDR AODV Figure 4.13 : NET: Random Session St a rt Times 1 2 3 4 5 6 7 8 9 10 11 12 0 100 200 300 400 500 600 Connections Expiration time in seconds Expiration of connections SQ−AODV MDR AODV Figure 4.14: CET: Sessions Commence at Start of Simulation 29 1 2 3 4 5 6 7 8 9 10 11 12 100 150 200 250 300 350 400 450 500 550 600 650 Connections Expiration time in seconds Expiration of connections SQ−AODV MDR AODV Figure 4.15: CET: Random Session Start Times Ho w ev er, t he 6 sessions that expire under each proto col a r e not the same sessions). This equates t o A OD V connection expiration times b eing an ywhere b etw een 30%-7% b etter than those of SQ-AOD V or MDR. This is b ecause, in SQ- A O DV: (i) a source on receiving a n R CR fr o m an in termediate no de tries only a fixed (but configurable; in our case 3) times b efore it reaches the maximum n umber of retries and ends the session, and (ii) in termediate no des reject a new sess ion once its residual-energy is b ellow Threshold-1. By contrast A ODV k eeps retrying and so has a higher probability of finding a path, and k eeping the session aliv e for longer. In the case of MDR, ho wev er, it is the con trol o verhe ad pac kets that cause the no de energy to drain faster, leading to the sessions expiring quick er than with A ODV or SQ-AOD V. W e not e that the sligh tly hig her connection expiration times in AOD V do come at the cost of lo w er PD R and low er no de expiration times, whic h implies that ev en though the connections may b e aliv e for a longer p erio d in A ODV, they do not successfully transmit as m uc h data as SQ-AOD V do es. 4.3.3 Sim ulation Setup for Set B W e consider the same 49 - no de static top olo gy (where there is no no de mobility) with 12 sessions as sho wn in Figure 4.7 for Set B. The no des are distributed uniformly in an area of size 5 4 0 m x 540 m, and are iden tical in their capability , but are initialized with differen t energies. In this set The traffic ar riv es as p er a P oisson pro cess, for differen t net work loads. The initial no de energies are uniformly distributed b etw een 75 J and 300 J, and the sim ulation is run un til each session has transmitted 3000 pack ets, while the session data rates v ary from 1 5 Kbps to 65 Kbps. Here w e again examine p erformance 30 b y comparing PDR, control o v erhead ( COH) and pa ck et dela y (PD) at diff e r ent network lo ads . T able 4.7: P ar a meters and Their V alues Used f o r Simu lation Set B P ack et size 512 Bytes P ack ets/Session 3000 Date tra ffic P oisson with λ = 15 Kbps - 65Kbps MA C Proto col IEEE 8 0 2.11 DCF PCLP Dat a rate 1 Mbps Buffer length 50 Pac k ets T ransmit p ow er 0.2818 W Propagation mo del Tw o-R a y Gr o und Ev ery exp erimen t was run 5 0 times (eac h initia lized with a differen t seed), and the resulting parameters av eraged ov er these 50 runs. The net work parameters used in sim u- lation Sets A and B a re detailed in T able 4.7 . 4.3.4 Results and Discussions for Set B W e observ e f rom Fig. 4.16 , the PDR o f SQ-AOD V is substan tia lly b etter than that for A O DV or MDR. In fact, the PDR f o r SQ-A ODV is improv ed b y b et w een 25%-13 % ov er A O DV and b y b et ween 22%-1 8 % ov er MDR ov er the netw ork loads considered. The key reason for this are the tw o prop erties of SQ-AOD V discussed in Chapter 3 , whic h induce stable rout es for the sessions and b olster PDR. 15 25 35 45 55 65 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 Data rate per session in Kbps Packet delivery ratio Average Packet Delivery Ratio SQ−AODV MDR AODV Figure 4.16 : Av erage P ac ket Deleve ry R atio fo r Sim ulation Set B 31 The PDR of MDR is b etter than that of A ODV b y 5%- 1 0% at low er loads, but is reduced b y equal amount at higher loads b ecause of its extra ov erhead, whic h degrades MDR p erformance a t higher net w o rk loa ds. 15 25 35 45 55 65 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Data rate per session in Kbps Normalized overhead Average Normalized Overhead SQ−AODV MDR AODV Figure 4.17: Average Con trol Ov erhead for Simulation Set B Fig. 4.17 show s that SQ-AOD V has marginally higher normalized con trol o v erhead (b et w een 1%-3% higher) than A OD V. This is b ecause, as explained in Chapter 3 , to supp ort stable routing, SQ-AOD V uses p er-session (or p er- flow) based routing (as opp osed to simple destination-ba sed routing used in AOD V). F or this, con trol pack ets of SQ-A ODV carry extra flow-id informatio n a lo ng with source and destination, and also pack ets need tra v el all the wa y to destination to find a stable path, leading to a marginally hig her con tr o l o v erhead. W e see that MDR has the highest con trol o v erhead, almost 30 0 % higher than either A O DV or SQ- A O DV at lo a ds ab o v e 35 Kbps, rising to o v er 1000% higher at low er loads. This is b ecause of the control o v erhead of MDR. In particular, at low er loads the con trol o v erhead of MDR b ecomes v ery high, b ecause it tak es substan tial time for the sources to generate 3000 pack ets. In the meantime, the regula r p erio dic up date pro cedures of MDR con tinue accumu lating significant control o v erhead. Finally F ig. 4.18 illustrates that, the dela y exp erienced by pack ets in SQ-AOD V is almost the same or marginally b etter than that in AOD V, at all loa ds under considera- tion. This is b ecause the delay in SQ-A ODV is the result of t w o opp osing factors. On the o ne hand, finding stable routes, where the life-time of the b ottlenec k no de is maxi- mized, may lead to longer (but more stable) routes, th us increasing dela y . On the other hand, proactiv e route maintenance by w a y of mak e- b efore-break decreases delay , since no r etra nsmissions need o ccur while an alternativ e route is lo cated. These tw o factor s 32 15 25 35 45 55 65 0 0.5 1 1.5 2 2.5 3 Data rate per session in Kbps Average packet delay in seconds Average Packet Delay SQ−AODV MDR AODV Figure 4.18 : Av erage P ac ket Delay for Simulation Set B ha v e a comp ensatory effect, making the pack et dela y in SQ-A OD V of the same order a s that in A OD V. The dela y exp erienced in MDR is b et ween 25 0-500 ms higher, or b et w een 20%-50% higher than that in A OD V and SQ-A ODV b ecause, at higher loads data pac k ets ha v e to w a it longer due to p erio dic route up dates. The a dv antage with SQ-A ODV is that it is designed to prov ide stable routes a nd a fast re-routing capability to the no des in ad-ho c net w o r ks at minim um ov erhead to t he net work. This helps in making effectiv e use of netw ork resources, as demonstated b y our simulation r esults. T able 4.8: Ave rage Number of Hops for Sim ulation Set B Proto col Session D ata Rate 15 Kbps 25 Kbps 35 Kbps 4 5 Kbps 55 Kbps 65 Kbps SQ-A OD V 4 .9503 5.0 165 5.0519 5.0487 5.09 38 5.224 4 MDR 5.0147 5.0258 5.0800 5.16 16 5 .0861 5.1 326 A O DV 4.5294 4 .4972 4.5858 4.658 1 4.6 9 84 4.731 1 T able 4.8 giv es the num b er of hops tak en by the data pac k ets to tra v el from source to destination in SQ-AOD V, MDR and AOD V, on an a v erage. As w e can see the n um b er of hops tak en b y SQ-AOD V and MDR is increased b y ab out 11% ov er AOD V on an a verage o v er all loads. This should clearly indicate that the pac k et dela y in case of SQ-AOD V w ould ha ve b een more, but the proactiv e route main tenance by w ay o f mak e-b efore-break decreases dela y in SQ- A ODV, leading to an almost similar dela y in b oth SQ - A OD V and A O DV ov er all lo a ds. On the other hand fo r MDR, the data pac k ets exp erience a lar g er dela y compared to b oth SQ-AOD V and AOD V as explained earlier in Section 4.3.2 . 33 Chapter 5 Summary and F uture W ork In this thesis, we ha v e prop osed a nov el, energy-a w are, stable r outing proto col named, Stabilit y-based QoS-capa ble Ad-ho c On-demand Distance V ector (SQ- A O DV) proto col whic h is an enhancemen t of the w ell-kno wn AOD V prot o col for a d- ho c wireless net works . SQ-A OD V utilizes a cross-lay er design appro ac h in whic h info rmation ab out the residual energy of a no de is used f or route selection and main tenance. An imp o rtan t feature of SQ- A O DV is that it uses only lo cal infor mation and requires no additional comm unication or co-op eration b etw een the net w o rk no des. SQ- A O D V ha s a proactiv e route main tenance b y make -b efore-break whic h increases t he pac k et deliv ery ratio in the net work at virtually no extra ov erhead, making it mor e suitable for a d-ho c wireless en vironmen t. SQ-AOD V is also compatible with the ba sic A OD V data formats and op eration, making it easy to adopt in ad- ho c netw orks. Sim ulatio n results show s under v ariet y of applicable net work loads and netw ork pa- rameters, SQ-A ODV proto col ac heiv es pac k et deliv ery ratio, on an av erage, 10-15% b etter than either A ODV or Minim um Drain Rate (MDR) routing proto col, and no de expiration times 1 0-50% b etter than either A ODV or MDR , with pack et dela y and control ov erhead comparable t o that of AOD V. Sev eral directions of future w ork are p ossible f r o m here. The first is to com bine our sc heme explicitly with QoS routing, thereb y incorp orating bandwidth a nd dela y con- strain t s in the path selection pro cess. Another is to consider the effects of mobilit y and fading in our stable routing proto col. 34 App endix 35 Chapter 6 In tro duction to NS-2 In this app endix, we giv e a ve ry brief in tro duction to NS-2. This in tro duction helps a reader to get a basic o rien ta t ion to NS-2 and enable the reader to b etter understand the implemen tation details of SQ- A O D V giv en in App endix 7 . NS-2 is an ob ject-or iented, discrete ev ent driv en net w o rk sim ulator written in C++ and OTcl (Ob ject-orien ted T o ol command la ng uage). NS-2 provide s substantial supp or t for sim ulat ing wired and wireless net w o r ks with netw ork pr o to cols suc h as TCP and UDP . NS-2 has supp ort for, traffic source b ehavior suc h as FTP , W eb, CBR and VBR, router queue managemen t mec hanism suc h as Drop T ail, RED and CBQ, standard rout ing proto cols a nd Link lay er proto cols for b oth wired and wireless net w o rks. Although NS-2 is v ery easy to use o nce y ou get to know it, but is quite difficult for a b eginner. T o get a feel of what is NS-2 , a b eginner is recommended to exercise some of the examples given in [ 12 ]. One can also find a more detailed do cumen tation of NS-2 in [ 13 ], whic h is written with the depth of a skilled user. A C++ and OTcl Link age in NS-2 NS-2 is written in b oth C++ and OTcl languages, with data path using C++ and con trol path using OTcl. In order to reduce the pack et and ev ent pro cessing time, the ev en t sc heduler and the basic net work comp onen t o b jects are written a nd compiled using C++. These compiled ob jects a r e made a v ailable to OTcl in terpreter thro ugh OTcl link age as sho wn in Fig. A1 . The OTcl link age creates a matc hing OTcl ob ject for eac h of the C++ o b jects. Th us giving the con trol of the C++ ob jects to O Tcl. There are ob jects in C++ that do not need OTcl con tro l, these ob jects are not in OTcl space. Similarly there are ob jects that are en tirely implemen ted in OTcl and are no t in C++ space. Th us, there is a matc hing OTcl ob ject hierarc h y very similar t o that of C++. W e no w giv e a v ery brief explanation as how NS works . 36 Figure A1: C++ and OTcl Link age in NS-2 B Simplifie d Use r’s View of NS-2 As sho wn in Fig. B1 , NS-2 is Ob ject-oriented Tcl (OTcl) script inte rpreter that ha s a sim ulation ev ent sc heduler and net work comp onen t ob ject libraries, and net w o r k setup helping mo dule libraries. The pro cedure for sim ulating a net w ork scenario using NS-2 is as follo ws: User has to write a pro gram using OTcl script languag e. This program basically initiates an ev ent sc heduler, sets up a net w o rk top ology using net work comp onen t ob jects and helping mo dules, and t ell the traffic sources when to star t and stop the transmission of pack ets through the ev en t sc heduler. This OTcl script is executed by NS-2 to generate the trace o f ev en ts. The ev en t sc heduler will k eep tra ck of sim ulation time and dump all the ev en ts of the ev en t queue sc heduled at the current time, in to an output file to generate the trace file out put. Th us generated trace file is further pro cessed b y user written scripts to analyze the sim ulatio n results. Alternativ ely , the sim ulation results can also b e visualized using Netw ork AniMater (NAM) 37 Figure B1: Simplified User’s View of NS-2 38 Chapter 7 Details of SQ-A OD V in NS-2 In this app endix, w e pro vide implemen ta t io n details of SQ- A O D V in Netw ork Sim ulator V ersion-2 [ 11 ] (NS-2). W e first give the c hanges made to the A ODV routing pro t o col pac ket formats, and then giv e the changes made to the functions of A OD V to conv ert them into corresp onding functions o f SQ-AOD V. A F ormat o f Rou ting P ac k ets in A OD V an d SQ-AOD V The format of the RREQ is as sho wn in the Figure A1 , and contains the following fields: • Type – Indicates the t yp e of the pa c ke t to differen tia te b etw een RREQ, RREP , ERR OR pack ets • H op count – The n umber o f hops from originator no de to the no de handling the request • B roadcastID – A sequence num b er uniquely iden tifying the particular RREQ pac ket when tak en in conjunction with o riginating no de’s IP address • Dest ination IP address – IP address of the destination for whic h a route is desired • Dest ination sequence n um b er – The lat est sequence n um b er receiv ed in the past b y the origina t o r for any route t ow ards the destination • Source IP address – The IP address of the no de which originat ed the RREQ • Source sequence num b er – The curren t sequence n um b er to b e used in the route en try p o in ting to wards the source of the route request The RREQ pac ket f ormat mo dified for SQ-AOD V is as sho wn in Figure A2 and the additional fields a dded are: • Flow id – A sequence num b er uniquely iden tifying a flo w (fo r whic h a route is desired) when tak en in conjunction with t he orig ina tor and the destinations IP address 39 • Session-duration – The session-duration information pro vided by the application of a flow • B ottlenec k life-time – The lif e-time o f the b ottlenec k no de along the path t a k en b y the RREQ pac k et In SQ-AOD V routing is p er session based as against destination-ba sed in A ODV . A route is uniquely identified by the triple { Src, Dst and Flow id } , hence the RREQ pack et carries the flow id information to facilitate p er session ba sed routing. Session-duration is one of the para meters used to a dmit a new flow , hence t his infor ma t io n is a lso need to b e carried in RREQ pack ets to find a ro ut e that can surviv e a t least for the duration of the session. F or flows not sp ecifying the session-duration, SQ- A ODV finds a stable path by selecting a path that maximizes the b o t t leneck no de life-time along the path, to facilitate this a field is added to carry t he b ottlenec k lif e-time of the no de along a path. The format of the RREP is as show n in the Figure A3 , a nd con tains the f ollo wing fields: • Type – Indicates the t yp e of the pa c ke t to differen tia te b etw een RREQ, RREP , ERR OR pack ets • H op count – The n umber o f hops from originator no de to the no de handling the request • Dest ination IP address – IP address of the destination for whic h a route is desired • Dest ination sequence n um b er – The lat est sequence n um b er receiv ed in the past b y the origina t o r for any route t ow ards the destination • Source IP address – The IP address of the no de which originat ed the RREQ • Life-time – The time for whic h no des r eceiving the R R EP consider the route to b e v alid • Timestamp – The time at whic h the RREP pac ket has b een sen t by a no de (either destination o r inte rmediate) to wards the source requesting for a route The RREP pack et fo rmat mo dified fo r SQ-AOD V is as sho wn in F igure A4 and the fields added ar e: • Flow id – A sequence num b er uniquely identifying a flow (for whic h a route is desired) when tak en in conjunction with t he orig ina tor and the destinations IP address • RCR flag – A flag to indicates whether the RREP pac k et is a Route Change Request (RCR) pac k et or no t 40 Flo w id field is a dded to facilitate the p er-session based ro uting in SQ- A ODV. The mak e-b efore-break re-routing mec hanism of SQ-AOD V requires a n RC R pac k et t o b e sen t b y a no de whic h is ab out to drain. RREP pack et is used as RC R pack et b y setting R CR flag to 1. The IP address of the no de ab out to dr a in is sen t in place of destination sequence n umber field of RREQ, this information is critical for handling the RCR pac k et in the net w ork. The format of the ERR OR pack et b oth in A O DV and SQ-AOD V is as sho wn in the Figure A5 , and contains the following fields resp ectiv ely: • Type – Indicates the t yp e of the pa c ke t to differen tia te b etw een RREQ, RREP , ERR OR pack ets • Dest coun t – The n um b er of unreachable destinations included in the ERR OR pac ket • Unreacha ble destinations – The IP address of the destinations t hat hav e b ecome una v ailable due to a link break • Unreacha ble destination sequence n um b er – The sequence num b er in the route table en try for the destination listed in the Unreac hable destination field The follo wing fields a r e added t o the ERR OR pac k et format o f A O DV to use it for SQ-A OD V: • Unreacha ble source – The IP address of the source, whic h is pa rt of the t r iple (src/dst/flo w id) iden tifying a route, got affected due to link f a ilure • Unreacha ble flo w id – The flow id of a flo w, whic h is par t of the triple (src/dst/flo- w id) iden tifying a route, got affected due to link f a ilure Since the routing in SQ- A ODV is p er session based, source and flo w id information has to b e carried as additio nal information b y the ERROR pac ke ts to facilitate the route main t enance, when a link break due to either mobility of a no de or v ariation in the medium o ccurs. 41 Figure A1: RREQ Pac k et F ormat in A OD V Figure A2: RREQ P ac ket F ormat in SQ-AOD V 42 Figure A3: RREP P ac k et F ormat in A OD V Figure A4: RREP P ac ket F ormat in SQ-A ODV 43 Figure A5: ERROR P ack et F ormat in A ODV a nd SQ- A O D V 44 B Route Di s co v ery in SQ-A OD V When a source no de w an ts to comm unicate with a destination, the a pplication la y er o f the source no de generates data pack ets and send them to the netw ork la y er. In AOD V or SQ- AOD V a pack et is r eceiv ed by AOD V::recv(P ack et *p, Handler *h) function. The basic op eration of the recv function is depicted in Fig. B1 . The source no de che c ks whether a v alid route to the destination exists (in SQ-AOD V, a route is iden tified by triple src/dst/flo w id). If a v alid route at the source exists then data pack ets a re fo r warded using this v alid route. If a r o ute do es not exist the source no de initiates a route disco v ery pro cess. The f unction A OD V::rt resolv e(P ac k et *p) is resp onsible for resolving a route for the data pac k ets and its op era t ion is as depicted in Fig. B2 . A source no de initiates a route disco very pro cess b y broadcasting a RREQ pac k et. As sho wn in Figure A2 , in SQ-A ODV flo w id and session-duration informat ion (if specified) is carried in RREQ pac k et to facilitate a p er session based routing, and find routes that la st for the duration of a session. AOD V::sendRequest(nsaddr t dst) function (A ODV::s endR- equest(nsaddr t src, nsaddr t dst, u in t8 t flow id) function in SQ-AOD V) is r esp o nsible for bro a dcasting RR EQ pac k ets to 1 -hop neighbors, and its op erat ion is depicted in Fig- ure B3 . When an interme diate no de receiv es a RREQ pack et the pac ket is pro cessed by the A O DV::recvA ODV(P ac ket *p) function a nd AOD V::recvRequest(P ac k et *p) functions, whose op eration is as depicted in Figure B4 , and F igures B5 and B6 resp ectiv ely . In case of SQ-AOD V a n intermediate no de cannot reply to the RREQ pac k ets b ecause, (i) the routing is p er session based (ii) destination selects a path (among av aila ble) whic h maximizes the life-time of the route (iii) applies the Alg o rithm 1 explained in Chapter 3 to forw ard the R REQ pac kets . Eac h in termediate no de b oth in AOD V and SQ-AOD V sets up a rev erse route to the previous hop from whic h the R REQ pack et has b een receiv ed. In SQ-A OD V the b o ttlenec k life-time field of RREQ pac ke t is up dated b efore re-broa dcasting the R R EQ pac k et. In AOD V, when a RREQ pac k et reache s the destination, no de generates a RREP pac ket to r eply to this request. On the other hand in SQ- A O D V, a destination no de w aits for either 0.25 seconds aft er the first RR EQ arr iv al o r thr ee RREQ pac ket ar- riv als from differen t paths t o reply to a R REQ that maximizes life-time of the path. Figure B7 depicts the basic op eration of A OD V::sendReply(nsaddr t ip dst, u in t32 t hop count, nsaddr t rp dst, u in t32 t rpseq, u in t32 t lifetime, double timestamp) func- tion (A OD V::sendReply(nsaddr t ip dst, u in t32 t hop coun t, nsaddr t rp dst, u in t32 t rpseq, u in t3 2 t lifetime, do uble timestamp, u int8 t flo w id, u in t8 t rcr flag) function in SQ-A OD V) in A OD V. An in t ermediate no de receiving this RREP in A ODV or SQ-A OD V will unicast the RREP pack et tow ards the source using rev erse route information, and sets a forward p oin ter to the hop from which the RREP has arriv ed. This forw ard p ointer 45 is nothing but the route established f or the curren t session. The RREP pack et receiv ed b y a no de is pro cessed using the A OD V::recvReply(P ac k et *p), and its op eration is depicted in F igure B8 . The source start forw arding data pac ke ts once it receiv es the RREP pack et. Figure B1: Flow-c hart of A OD V::recv() F unction 46 Figure B2: Flow-c hart of A OD V::rt resolv e() F unction 47 Figure B3: Flow-c hart of A OD V::sendReques t() F unction Figure B4: Flow -c hart o f A ODV::recvA OD V() F unction 48 Figure B5: Flow-c hart of A OD V::recvRequest() F unction Figure B6: Flow-c hart of A OD V::recvRequest() F unction 49 Figure B7: Flow-c hart of A OD V::sendReply() F unc tion Figure B8: Flow-c hart of A OD V::recvReply() F unc tion 50 C Route Main tenance in S Q- AOD V A O DV has capabilities of b oth proactiv e and reactive route main tenance. Since SQ- A O DV is an enhancemen t to A ODV it inherits the capa bilities of AOD V. Apart from these route maintenanc e capabilities, SQ- AOD V has a mec ha nism of make-before-break re-routing. W e first explain the basic A ODV route main tenance mec hanisms and then giv e the make -b efore-break re-routing feature of SQ-AOD V. The pro a ctiv e mainte nance in AOD V is by p erio dic hello messages in whic h ev ery no de in the netw ork broadcast hello messages to its neighbor s ev ery one second. Reactive main t enance is done by sending ERR OR pac k ets to the sources whenev er the link lay er detects a link break age. If the reactiv e maintenance is enabled then proactiv e maintenanc e (Neigh b orTimer and HelloTimer) is disabled. When a no de detects a link failure through link lay er feedbac k it initia tes the mainte- nance pro cess by broadcasting the ERROR pack et to 1-hop neigh b ors. The A ODV::rt ll f - ailed(P ack et *p) function is resp onsible for the initia tion of t he main tenance pro cess and its op eration as depicted in Figure C1 . D uring a route main tenance the route is repaired ei- ther through a lo cal repair (if the bro ken link is near to the destination) or through the ER- R OR pac k ets. Lo cal route repair is done using the A OD V::lo cal rt repair(ao dv rt entry *rt, Pac k et *p) function, and its basic op eration is as depicted in Figure C2 In case of the brok en link close to the source no de the route main tenance is initi- ated b y the AOD V::handle link failure(nsaddr t id) function whose op eration is depicted in Figure C4 . The handle link failure function sends an ERROR pack et with the help of A OD V::sendError(P ack et *p, b o ol jitter=true) function and the basic op eration of sendError function is depicted in Figure C6 . when the ERROR pac k et finally reac hes the source of a flo w whose ro ut e is down due to the link failure, the source no de initiates a route disco v ery pro cess to find an alternate route. C1 Mak e-Before-Break Re-routing in SQ - A OD V In this section w e explain the details of mak e-b efore-break re-routing feature of SQ-A ODV. T o implemen t mak e-b efore-break re-routing mec hanism, w e ha ve added a timer called R CR-timer in the basic A ODV co de. The RCR-timer expires ev ery 100 msec, and on ev ery expiry the A ODV ::rcr() function is called. The com bined op eration of R CR-timer and rcr f unction is as depicted in Fig. C8 . In rcr function a c heck is p erformed to find whether the curren t-energy of the no de is less than Threshold-2 . If so, a Route Change Request (RCR) pac k et is broadcast to the 1- ho p neigh b ors of this no de. After receiving a broa dcast RCR pack et, eac h neigh b or c hec ks whether the dr a ined no de is t he destination o r the source o r an inte rmediate no de of a route. This c heck is p erformed for ev ery forw ard en try in the rout ing table, a nd dep ending on whether drained no de is source/destination/in termediate no de for the flows of neighbors, eac h neighbor 51 pro cesses the RCR pac k et uniquely as depicted in F ig. C9 . If the drained no de is, a destination of a ny flow in the ro uting table of the neigh- b or indicating its destination has drained, and the neighboring no de whic h receiv ed the broadcast RC R is a source of the flo w then the source no de will immediately stop the traffic. On the other hand, if the neighboring no de whic h receiv ed the broadcast R CR is an in t ermediate no de of the flow then this in termediate no de sets the RCR-flag in the routing ta ble and sends an unicast RC R pac k et to wards the source of t he flow. If the no de from whic h a broa dcast RCR has come happ ens to b e a source for an y of the routes in the routing ta ble of neigh b ors then the neigh b oring no de simply free t his broadcast R CR pac k et. If the no de from whic h a broadcast R CR has come happ ens to b e an intermed iate no de for an y of the routes in t he routing table of neighbor s, and if the 1-hop neigh b oring no de is a source of the flow then the source broadcast a RREQ pack et to initiate a route disco ve ry pro cess. On the other hand, if the no de whic h receiv ed the broadcast RC R is an in termediate no de of a flo w t hen this in t ermediate no de sets the RCR-flag in the routing table and sends an unicast R CR pac ket to w a rds the source of the flo w. In case of a route with more than one hop an in termediate no de has to unicast the R CR pac ket tow ards the source of the flow. No w, if this unicasted R CR pac ket has reac hed one more in termediate no de of the flow then the intermediate no de f orw a rds the RC R pac ket using the reve rse route information in its routing table. On the o ther hand if the unicasted RCR has r eached a source no de of a flow the source no de will c hec k whether the drained no de is the destination or an intermediate no de o f the flo w, if the destination has drained then, the source simply stops the traffic, else if an in termediate no de has dra ined then source initiates a route disco v ery pro cess b y bro a dcasting a R REQ pack et. 52 Figure C1: Flow -c hart of AOD V::rt ll failed() F unction Figure C2: Flow-c hart of A O D V::lo cal rt repair() F unction 53 Figure C3: Flow -c hart of AOD V::nb delete() F unction Figure C4: Flow -c hart of AOD V::handle link failure() F unction Figure C5: Flow -c hart of AOD V::rt dow n() F unction Figure C6: Flow-c hart of A O D V::sendError() F unction 54 Figure C7: F low-c hart of A O DV::recvError() F unction Figure C8: Combined Flow-c hart of R CR-timer and R CR function of SQ- A ODV 55 Figure C9: Flow-c hart of Mak e-b efore-break F eature of SQ-A ODV 56 References [1] D . Kim., J. Gar cia-Luna-Acev es, K. Obraczk a, J.-C. Cano, and P . Manzoni, “Routing mec hanisms for mobile ad ho c net w orks based on the energy drain ra te,” IEEE T r ansactions on Mobile Computing , vol. 2, no. 2, pp. 161–173, 2003. [2] C. P erkins a nd P . Bhagw at, “Highly dynamic Destination-Sequenced Distance-V e ctor routing (DSDV) for mobile computers,” in Pr o c. of A CM SIGCO MM’94 , pp. 234– 244, O ct. 1 9 94. [3] C. Chiang, H. W u, W. Liu, and M. Gerla, “Routing in clustered multihop, mobile wireless net w o r ks with fading c hannel,” in Pr o c. of IEEE SI C ON’97 , pp. 197–2 11, Apr. 1 997. [4] C. P erkins and E. Roy er, “Ad ho c on demand distance vec tor (A OD V) routing,” in Pr o c. of IEEE WMCSA’99 , pp. 99–100, F eb. 1999 . [5] D . Jo hnson and D. Maltz, “Dynamic source routing in ad ho c wireless net w or ks,” in Mobile Computing , vol. 353, pp. 153–181, Klu w er Academic Publishers, 199 6. [6] Z . W ang, I nternet QoS: Ar chite ctur es and Me chanisms for Q uality of Servic e . Morgan Kaufmann, 1st ed., 2001. [7] J. Punde, N. Pissinou, and K. Makki, “O n quality of service routing in a d-ho c net- w orks,” in Pr o c. of LCN’03 , pp. 276–2 78, Oct. 2003. [8] S. R. Medidi and K.-H. Vik, “Qualit y of service-a w are source-initiated ad-ho c rout- ing,” IEEE SEC ON’04 , pp. 108 – 117, Oct. 2004. [9] N. W ang and J. Chen, “A Sta ble On- D emand R outing Proto col for Mobile Ad Ho c Net works with W eigh t-Based Strategy,” IEEE PDCA T’06 , pp. 166 –169, Dec. 2006 . [10] J. Lian., L. Li., and X. Zh u., “A Multi-Constrain t QoS Ro uting Proto col with Route- Request Selection Based on Mobile Predictibg in MANET,” IEEE CISW’07 , pp. 34 2 – 345, D ec. 20 07. [11] “Netw ork Sim ulator, NS-2.” h ttp:/ /www.isi.edu /nsnam/ns. [12] “NS by Example.” http://nile.wpi.edu/NS/. 57 [13] “NS Do cumen ta t io n.” h ttp://www.isi.edu/nsnam/ns/ns-documen tation.h tml. 58

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment