Está en la página 1de 81

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

LI NI U
Cng vi s gia tng nhanh chng v s lng cng nh cng ngh ca cc thit b di ng ko theo nhu cu ca ngi s dng cng ngh khng dy ngy cng cao v a dng.V vy p ng c xu th , mng thng tin khng dy ngy nay phi gnh vc trng trch ln hn l gii quyt vn v lu lng a phng tin, tc cao,cht lng ngy cng phi tt hn. Song song vi yu cu h tr a phng tin vi cht lng dch v (QoS) m bo, cc cng ngh giao tip khng dy khc nhau xut hin,Ad hoc l mt kiu mng thng tin khng dy linh hot. l tp hp ca hai hay nhiu thit b c trang b kh nng ni mng v truyn thng khng dy.Cc thit b c th giao tip vi cc nt mng khc ngay lp tc trong vng ph sng hay mt thit b khng dy khc ngoi bn ngoi vi iu kin c cc nt trung gian chuyn tip thng tin t nt ngun n nt ch.Ad hoc c kh nng t t chc v thch nghi, khi hnh thnh c th b gii tn bt c lc no m khng cn n bt c s qun tr h thng no.Ad hoc c nhiu dng khc nhau v c th di chuyn,ng c lp hay ni mng.Cc nt mng c th pht hin s c mt ca cc thit b khc trong gii v tuyn v thc hin s bt tay cn thit cho php truyn thng, chia s thng tin v dch v.Tp ca mng thng tin ty bin thay i ng do cc thit b khng b rng buc vo mt v tr c th nn vic truy nhp phng tin tp trung. Giao thc nh tuyn phi gim lu lng iu khin, n gin tnh ton ng nh tuyn. Chnh v th giao thc nh tuyn ng vai tr quan trng trong vn hnh mng Ad hoc. n l tng quan v bn giao thc nh tuyn trong mng Ad hoc, nh gi thng lng ca cc giao thc da trn cng m phng OMNET++. Do thi gian cng nh trnh cn hn ch, n khng trnh khi nhng thiu st, em rt mong nhn c kin ng gp. c th hon thnh c n tt nghip ny, em c hc hi nhng kin thc qu bu t cc thy, c gio ca Trng i hc Bch Khoa H Ni trong sut nm

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc nm i hc. Em v cng bit n s dy d, ch bo tn tnh ca cc thy, cc c trong thi gian hc tp ny. Em xin by t lng bit n ca mnh ti thy Nguyn Trung Dng B mn H thng vin thng Khoa in t vin thng Trng i hc Bch Khoa H Ni, ngi nh hng cho nhng nghin cu ca em, ngi trc tip hng dn v ch bo em hon thnh n ny. Cui cng, em xin cm n gia nh, bn b lun to iu kin thun li, ng vin v gip em trong sut thi gian hc tp v nghin cu n. Ngoi ra, kin thc thu c t cc thy c cng l ngun c v tinh thn ln nht gip em c th tp trung v hon thnh tt ti tt nghip ny. H Ni, thng 5- 2009 Sinh vin V Huy Cng

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

TM TT N
Mng Ad hoc l mt cng ngh hu dng trong mng khng dy. Cng ngh ny cho php cc nt mng giao tip trc tip vi nhau bng cch s dng my thu pht v tuyn m khng cn c c s h tng c nh. y l mt c trng ring ca mng Ad hoc so vi cc mng truyn thng trc y nh mng cellular hay mng LAN khng dy khi cc nt giao tip vi nhau thng qua trm gc (Base Station). Tuy nhin, mang Ad hoc phi i mt vi mt s thch thc nh gii hn phm vi truyn dn, vn trm n, mt gi do li ng truyn, s chuyn ng ca cc nt mng lm thay i tuyn ng, s rng buc v bng thng v nng lng. Giao thc nh tuyn c s dng Khm ph tuyn gia cc nt gip cho vic giao tip trong mng d dng hn. Mc ch chnh ca mt giao thc nh tuyn trong mng Ad hoc l thit lp tuyn ng chnh xc v hiu qu gia cc cp nt. n a ra tng quan v bn giao thc nh tuyn: DYMO, DSR, AODV, OLSR, s dng cng c m phng OMNET++ v nh gi tr u cui ca cc giao thc ny da trn cc thng s t ra.

n gm 5 chng
Chng 1: Tng quan v mng Ad hoc

Chng 2: nh tuyn trong mng Ad hoc

Chng 3: Thng s nh gi v m hnh chuyn ng trong m phng mng Ad hoc

Chng 4: M phng v nh gi thng lng ca OLSR, AODV, DSR v DYMO bng OMNET++

Chng 5: Kt lun

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

ABSTRACT
Ad hoc networks are the ultimate frontier in wireless communication. This technology allows network nodes to communicate directly to each other using wireless transceivers without the need for a fixed infrastructure. This is a very distinguishing feature of ad hoc networks with respect to more traditional wireless networks, such as cellular networks and wireless LAN, in which nodes communicate with each other through BS. Some challenges that ad hoc networking faces are limited wireless transmission range, hidden terminal problems, packet losses due to transmission errors, mobility- induced route changes, bandwidth and battery constraints. In order to facilitate communication within the network, a routing protocol is used to discover routes between nodes. The primary goal of such an Ad hoc network routing protocol is correct and efficient route establishment between a pair of nodes so that message may be delivered in a timely manner. This thesis provides an overview of four different routing protocols: DYMO, DSR, AODV, OLSR, uses OMNET++ simulator and evaluates throughput of these protocols based on a given set of parameters.

The thesis has a total of 5 chapters:


Chapter 1: Overview of Ad hoc network

Chapter 2: Routing in Ad hoc network

Chapter 3: Protocol Evaluation parameters and Mobility models for Ad hoc network simulation

Chapter 4: Simulating and evaluating throughput of AODV, OLSR, DSR and DYMO in OMNET++

Chapter 5: Summary

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

MC LC
LI NI U.....................................................................................................1 TM TT N................................................................................................3 ABSTRACT..........................................................................................................4 MC LC...........................................................................................................5 DANH SCH HNH V......................................................................................8 DANH SCH BNG BIU.................................................................................9 1 CHNG 1. TNG QUAN V AD HOC NETWORK ....................................10
1.1 M U..............................................................................................................................10 1.2 KHI NIM.........................................................................................................................11 1.3 C IM..........................................................................................................................12 1.4 NG DNG.........................................................................................................................13 1.4.1 Dich vu khn cp..........................................................................................................13 1.2.2 Hi nghi........................................................................................................................14 1.2.3 Home Networking.........................................................................................................14 1.2.4 Mang ca nhn (PAN).....................................................................................................15 1.2.5 H thng nhung (embeded system)...............................................................................16 1.2.6 Mang xe c (vehicular network)...................................................................................16 1.2.7 Mang cam bin (sensor network).................................................................................16 1.3 NHNG THCH THC I VI MNG AD HOC........................................................17 1.3.2 Chi phi cho vic s dung tn s...................................................................................17 1.3.3 C ch truy nhp...........................................................................................................17 1.3.4 inh tuyn va chuyn tip goi tin trong MANET.........................................................18 1.3.5 Hiu qua s dung ngun nui......................................................................................18 1.3.6 c tinh TCP................................................................................................................19 1.4.2 Cht lng dch v (QoS).............................................................................................19 1.4.3 Tnh an ton v bo mt..............................................................................................19

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc CHNG 2. NH TUYN TRONG MNG AD HOC......................................20
2.1 GIAO THC NH TUYN C IN..............................................................................21 2.1.nh tuyn da trn trng thi lin kt..........................................................................21 2.1.1. nh tuyn da trn vector khong cch....................................................................22 2.2 GIAO THC NH TUYN CHO MNG AD HOC.........................................................22 2.2.1 Cc yu cu chung........................................................................................................22 2.2.2 Phn loi.......................................................................................................................25 2.2.2.1 nh tuyn theo bng, nh tuyn theo yu cu v nh tuyn lai...................25 2.2.2.2 Cu trc v phn b tin trnh nh tuyn........................................................27 2.2.2.3 Khai thc cc metric mng cho nh tuyn......................................................28 2.2.2.4 c lng topo, ch, v tr cho nh tuyn.....................................................29 2.3 OPTIMIZED LINK STATE ROUTING(OLSR)...................................................................29 2.3.1 Bu chn Multipoint relay............................................................................................30 2.3.2 Truyn b bn tin iu khin topo (Topology control)................................................32 2.3.3 Tnh ton tuyn.............................................................................................................32 2.4 DYNAMIC SOURCE ROUTING (DSR)..............................................................................32 2.4.1 nh tuyn ngun..........................................................................................................32 2.4.2 Khm ph tuyn............................................................................................................33 2.4.3 Duy tr tuyn.................................................................................................................36 2.5 AD HOC ON- DEMAND DISTANCE VECTOR ROUTING (AODV)................................37 2.5.1 Khm ph tuyn............................................................................................................38 2.5.2 Thit lp tuyn ng ngc.......................................................................................39 2.5.3 Thit lp tuyn ng thun........................................................................................40 2.5.4 Qun l bng nh tuyn...............................................................................................42 2.5.5 Cp nht ng nh tuyn..........................................................................................43 2.6 DYNAMIC MANET ON- DEMAND (DYMO).....................................................................43

3 CHNG 3 THNG S NH GI V M HNH CHUYN NG TRONG M PHNG MNG AD HOC..................................................................46


3.1 THNG S NH GI GIAO THC MNG AD HOC...................................................46 3.1.1 Thng s nh gi cht lng......................................................................................46 3.1.1.1 T l gi nhn c...........................................................................................47 3.1.1.2 Tr t u cui n u cui............................................................................47 3.1.1.3 Thng lng t u cui n u cui.............................................................47 3.1.1.4 Phn ti thng tin nh tuyn............................................................................48

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc


3.1.2 Thng s kch bn.........................................................................................................48 3.1.2.1 Thng s di chuyn............................................................................................48 2.4.3.1 Thi gian tm dng..............................................................................................49 3.2 M HNH DI CHUYN M PHNG MNG AD HOC...................................................49 3.2.1 M hnh di chuyn ngu nhin.....................................................................................50 3.2.2 M hnh di chuyn hng ngu nhin vi vn tc khng i.....................................50 3.2.3 M hnh di chuyn Random Waypoint.........................................................................50 3.2.4 M hnh di chuyn hng ngu nhin..........................................................................51

4 CHNG 4. M PHNG V NH GI THNG LNG CA AODV, OLSR, DSR V DYMO BNG OMNET++ ............................................................53
4.1 GII THIU CHUNG V OMNET++...............................................................................53 4.1.1 Tng quan v Omnet++...............................................................................................53 4.1.1.1 Omnet ++ l g ?...............................................................................................53 4.1.1.2 Cc thnh phn chnh ca OMNeT++.............................................................53 4.1.1.3 ng dng...........................................................................................................54 4.1.1.4 M hnh trong OMNeT++................................................................................54 4.1.2 S dng OMNeT++......................................................................................................56 4.1.2.1 Xy dng v chy th cc m hnh m phng..................................................56 4.1.2.2 Chy cc ng dng trong OMNeT++..............................................................59 4.2 M PHNG........................................................................................................................62 4.2.1 Khi to m phng.......................................................................................................62 4.2.2 Mt s hnh nh m phng...........................................................................................62 4.2.3 Kt qu m phng cc giao thc nh tuyn mng Ad hoc.........................................67 4.2.3.1 Thng lng u cui - u cui......................................................................68 4.2.4 nh gi v kt lun.....................................................................................................69

5 CHNG 5. KT LUN.......................................................................................70 TI LIU THAM KHO...................................................................................71 BNG THUT NG VIT TT........................................................................73 PH LC..........................................................................................................74

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

DANH SCH HNH V


Hinh 1.1 M hinh m t khi nim mng Ad hoc...................................................11 Hinh 1.2 ng dung cho cac dich vu khn cp khi co thin tai...............................13 Hinh 1.3 ng dung trong cac hi nghi.....................................................................14 Hinh 1.4 ng dung cho home networking...............................................................15 Hinh 1.5 ng dung cho mang ca nhn.....................................................................15 Hinh 1.6 ng dung cho mang xe c..........................................................................16 Hnh 2.1 H ta c bn m t mi trng mng Ad Hoc.................................23 Hnh 2.2 Phn loi cc giao thc nh tuyn trong mng Ad hoc..........................26 Hnh 2.3 Qu trnh pht trn lan bn tin qung b................................................30 Hnh 2.4 Bu chn MPR...........................................................................................31 Hnh 2.5 Khm ph tuyn trong DSR.......................................................................34 Hnh 2.6 Duy tr tuyn, nt C khng th chuyn tip t A n E qua .................36 lin kt ti bc nhy tip theo D ca n.................................................................36 Hnh 2.7 Thit lp tuyn ng i ngc................................................................40 Hnh 2. 8 Thit lp tuyn ng thun.....................................................................42 Hnh 2.9: S khc nhau gia AODV v DYMO......................................................44 Hnh 3.1 M hnh di chuyn Random Waypoint.....................................................51 Hnh 3.2 M hnh di chuyn hng ngu nhin.......................................................52 Hnh 4.1 Cc module n gin v kt hp...............................................................55 56 Hnh 4.2 Cc kt ni..................................................................................................56 Hnh 4.4 Qu trnh gi bn tin RREQ ca DYMO.................................................64 65

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Hnh 4.5 Qu trnh gi bn tin RREP ca DYMO..................................................65 66 Hnh 4.6 Qu trnh gi gi tin d liu ca DYMO..................................................66 67 Hnh 4.7 Qu trnh gi ACK bo nhn ca DYMO................................................67 Hnh 4.9 Thng lng u cui - u cui.............................................................69 Qua biu thng lng < hnh 4.9 > ta nhn thy thng lng t l thun vi gi nhn.............................................................................................................................69 Thng lng ca DYMO l cao nht do DYMO l giao thc nh tuyn hot ng theo yu cu hoc theo bng iu khin,l s ti u ca DSR v AODV.Khi cc nt mng chuyn ng lin tc,thng lng ca DYMO vn rt cao ...................69 Thng lng ca OLSR cao hn AODV v DSR v OLSR c th p ng khi topo mng thay i, n cho php khm ph tuyn nhanh chng ti cc hng xm v cc MPR ca chng thit lp kt ni vi cc nt khc.......................................69 Khi mc di chuyn tng (gim pausetime) th thng lng ca 3 giao thc DSR, AODV, OLSR gim r rt vi mc gim tng ng nhau.Trong khi th DYMO th hin c s n nh ca mnh khi c thng lng kh cao.OLSR c thng lng cao hn AODV v DSR....................................................................69

DANH SCH BNG BIU


Bng 3.1 Bng cc bin trong thng s di chuyn....................................................48 Bng 4.1 Bng thng s nh gi dng trong m phng........................................67

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

CHNG 1. TNG QUAN V AD HOC NETWORK

Chng ny trnh by cc khi nim tng quan nht v mng Ad hoc, cc ng dng trong nhiu lnh vc cuc sng ca mng Ad hoc. ng thi, cp n cc thch thc m mng Ad hoc ang phi i mt.

1.1 M U
Mng my tnh t lu tr thnh mt phn khng th thiu i vi nhiu lnh vc i sng x hi, t cc h thng mng cc b n h thng mng ton cu nh Internet. Mng my tnh a mi ngi trn th gii n gn nhau hn, mi ngi c tip cn vi mt ngun thng tin, tri thc phong ph. X hi pht trin, con ngi vn ng khng ngng, mt ngi kt ni vo mng bng cp vt l th vic di chuyn ca h b hn ch, nhu cu t ra l va kt ni va c th di chuyn v c th kt ni bt c u mt cch n gin. Chnh nhu cu ny kch thch ngnh cng nghip mng khng dy tim nng pht trin mnh m. Mng Ad hoc l mt kiu mng khng dy rt linh hot. l tp hp ca hai hay nhiu thit b c trang b kh nng ni mng v truyn thng khng dy. Cc thit b nh vy c th giao tip vi tt c thit b mng khc ngay lp tc trong di v tuyn (vng ph sng, phm vi m thit b mng nhn bit c) hay mt thit b v tuyn khc nm ngoi di v tuyn ca chng vi iu kin c cc node trung gian chuyn tip thng tin t node ngun n node ch. Thit b h tr mng Ad hoc a dng v s dng kh ph bin nh laptop, in thoi di ng Internet. V c nhiu u th vt tri v nhng thch thc cn gii quyt, ngy nay mng Ad hoc v ang c nghin cu trin khai thnh cng mt s nc m ph bin l M. Mng Ad hoc c bit hu ch trong cc ng dng nh khc phc thm ha thin nhin, quc phng, y t, hi ngh nn c xu hng ng dng rng ri trn th gii.

V Huy Cng- T3- K49

10

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

1.2 KHI NIM


Mng Ad hoc l t hp ca cc node di ng c kt ni vi nhau bng cc lin kt khng dy, cc node t do di chuyn nn kin trc mng c th thay i lin tc m khng d on c. Mi node mng c mt giao din v tuyn giao tip vi cc node mng khc thng qua sng v tuyn hoc hng ngoi. Cc mng ny khng dng bt c s h tr c s h tng mng c nh hay chu s qun l tp trung no. y l mt c im ring bit ca mng Ad hoc so vi cc mng khng dy truyn thng mng chia , mng WLAN, trong cc node (cc thu bao di ng ) lin lc vi nhau thng qua trm v tuyn c s.

Hinh 1.1 M hinh m t khi nim mng Ad hoc Trong Ad hoc khng tn ti khi nim qun l tp trung, n am bo mng s khng b sp v trng hp nut mng di chuyn ra ngoi khong truyn dn ca cc nut mng khc. Nut mng c th ra vo bt c lc no. Do khong truyn dn ca nut mng l hn ch nn chng trao i thng tin bng phng php truyn gi tin qua nhiu bc (Multihops). lm c iu ny, th tt c cc nut mng phi c kh nng chuyn tip

V Huy Cng- T3- K49

11

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc gi tin n nut mng khc, do vy tt c cc nut mng trong Ad hoc c th hot ng nh my trm v router. Nn nut mng c th bao gm mt router v mt my trm lin kt vi nhau. Mt router thc hin cc giao thc nh tuyn, my trm di ng c a ch IP. Ad hoc cng c kh nng thc hin thay i v cu hnh mng v khc phc s c ca nut mng thng qua th tc cu hnh li mng. V d: Nu nut mng ri khi mng s gy ra s c lin kt, nut mng b nh hng c th yu cu ng nh tuyn mi v vn s c gii quyt. iu ny s gy ra tr trn mng, tuy nhin vi ngi s dng Ad hoc vn hot ng bnh thng. Ad hoc c nhiu u im ca mng truyn thng v tuyn thng thng, lin kt gia cc nt mng c hnh thnh ngay khi chng nm trong khong truyn dn ca nhau

1.3 C IM
Ad hoc thng c m t c cu trc mng thay i do s thay i v tr ca cc nut mng. Cc giao thc nh tuyn c c ch t pht hin cc thay i v nh tuyn thng qua cc thut ton nh tuyn thng thng nh vector khong cch v trng thi cc lin kt. Mt c im khc ca cc nut mng trong mng Ad hoc: b gii hn v kh nng ca CPU, b nh, dung lng pin v bng thng. Khi nng lng s dng b gii hn ko theo gii hn v kh nng truyn dn. Thit b truy nhp, mi trng v tuyn cng c cc c im c bit m ngi thit k cn lu tm khi a ra cc giao thc nh tuyn cho Ad hoc. V d: cc lin kt mt chiu, n xut hin trong trng hp 2 nut mng c cng sut pht khc nhau nn c khong truyn dn khc nhau, ch cho php mt nut mng nghe nut mng kia. Lin kt mt chiu ch c trong Ad hoc, khng tn ti trong mng t bo. S dng phng php nh tuyn nhiu bc th cc nut mng c th tit kim c nng lng pht ra.

V Huy Cng- T3- K49

12

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

1.4 NG DNG
Ad hoc c ng dung cho hi thao, ng dung trong qun s. No cung c s dung cho trng hp trin khai c s ha tng mang la kho khn. Vi du: khach hang co th chia se tp tin d liu sn bay, sinh vin trao i thng tin vi nhau trong tit hoc Khi may tinh di ng giao tip thng qua giao din mang LAN v tuyn, thi nhom cac may tinh o hinh thanh mng Ad hoc, khi o may tinh co th truy nhp Internet, tai nguyn trn mang nh may in, may scan...

1.4.1 Dich vu khn cp


Bt ky u khi co trng hp khn cp xay ra u cn co s kt hp ca cac nhn vin cu h. Giai phap thng thng la dung thit bi v tuyn. Tuy nhin, khi c s ha tng bi hong hoc khng con hoat ng thi giai phap la gi? Ad hoc chinh la cu tra li nhanh nht va phu hp nht. iu nay co th khng co y nghia vi khu vc tn tht nho, tuy nhin vi tham hoa thin nhin co khu vc anh hng tan pha rng ln, vic lin lac rt quan trong nn Ad hoc tr thanh giai phap hu ich.

Hinh 1.2 ng dung cho cac dich vu khn cp khi co thin tai

V Huy Cng- T3- K49

13

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

1.2.2 Hi nghi
Trong hi nghi, hi thao cn trao i thng tin gia cac ai biu hoc vi hi nghi khac. y la mt nhu cu ln trong thi ai phat trin nhanh v thng tin nh hin nay, khi ma giai phap homenetwork cha tht s sn sang. Giai phap hin tai la s dung cac mang co sn cho cac ai biu tham d tuy nhin no co tr ln, vi du giai phap Mobile IP .Va Ad hoc la giai phap chim u th.

Hinh 1.3 ng dung trong cac hi nghi

1.2.3 Home Networking


Ro rang s hin din cua may tinh xach tay va ng dung khng dy lam nhu cu v home network tng cao.Vic s dung ky thut cua Ad hoc cho phep chung t cu hinh va hinh thanh mang, iu nay tin li cho ca ngi khng tht s am hiu v mang cung nh giam c chi phi cho xy dng thit k mang. Hn na, nu ta co nhu cu s dung may tinh cng s, trng hoc thi khi lng thng tin quan ly mang giam xung ro rt.

V Huy Cng- T3- K49

14

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hinh 1.4 ng dung cho home networking

1.2.4 Mang ca nhn (PAN)


thi ai thng tin thi 1 ngi cn mang theo nhiu cng cu h tr cho cng vic (in thoai,Palm...) khi chung c lin kt vi nhau hinh thanh mang ca nhn PAN thi ro rang mang lai nhiu tin ich hn cho ngi s dung. PAN la mang di ng do con ngi khng th ngi yn mt ch, tuy nhin khi kt ni vi mang PAN khac cn tr giup cua Ad hoc.

Hinh 1.5 ng dung cho mang ca nhn

V Huy Cng- T3- K49

15

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

1.2.5 H thng nhung (embeded system)


Ngay cang co nhiu may moc cn kt ni vi nhng vt xung quanh keo theo nhu cu cua Ad hoc. No co th la chi co kha nng kt ni mang, tng tac c vi home network tim kim d liu trn internet hoc co th kt ni vi in thoai, co th iu chinh volume cua TV khi co cuc goi n....ap ng nhiu nhu cu cua ngi s dung.

1.2.6 Mang xe c (vehicular network)


VANET (Vehicular Ad Hoc Network) gi l mng xe c Ad hoc, l h thng mng khng cn c s h tng, c to thnh t cc phng tin xe c lu thng trn ng. Chng c trang b thit b thu pht c th lin lc, chia s v trao i thng tin vi nhau ging nh mt nt trong mng Ad hoc. Thng tin trao i trong mng VANET bao gm thng tin v lu lng xe c, tnh trng kt xe, tai nn giao thng, nguy him cn trnh v c nhng dch v thng thng nh dch v a phng tin, Internet....

Hinh 1.6 ng dung cho mang xe c

1.2.7 Mang cam bin (sensor network)

V Huy Cng- T3- K49

16

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Mang cam bin khng dy la mt ng dung in hinh cua Ad hoc. Hin nay a co nhng quan tm ang k cho s phat trin kiu mang nay,chu yu la trong qun s, cng an, tinh bao, khao c hoc, nghin cu ia ly....Cac b cam bin co th co kich thc nho nhng kha nng truyn thng va lu tr tng i tt. Trong qun s a dung nhng may moc hin ai nhng kich c gn nh hat bui nn i phng rt kho phat hin va pha huy chung. Trong linh vc y t, cac b cam bin cho phep giam sat lin tuc thng tin tiu chun v s sng. Trong cng ngh thc phm, ky thut nhip cam bin c ap dung giam sat cht lng co th giup ngn nga cac san phm khng at yu cu nn tng mc thoa man cho khach hang. Trong nng nghip, cac b cam bin co th giup xac inh cht lng t trng va m, chung cung co th phat hin cac hp cht khac. Ngoai ra, cac b cam bin cung c s dung rng rai trong thng tin thi tit va mi trng.

1.3 NHNG THCH THC I VI MNG AD HOC


1.3.2 Chi phi cho vic s dung tn s
Hu ht cac mng Ad hoc th nghim hin nay u da trn bng tn ISM. ngn nga nhiu, mng Ad ho phai hoat ng qua mt s dai ph cu th nao o, c cp phat. Ph tn khng chi c cp phat va giam sat cht che ma con cn phai c tra phi.

1.3.3 C ch truy nhp


Khng ging nh mang t bao, trong mng Ad hoc khng co s iu khin tp trung va ng b toan cuc. Do o cac phng phap a truy nhp truyn thng nh TDMA va FDMA khng con thich hp na. Ngoai ra, nhiu giao thc iu khin truy nhp phng tin MAC (Media Access Control) cung khng giai quyt c s di ng

V Huy Cng- T3- K49

17

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc cua nt mng. Do vy, cac ky thut lp lich trinh va inh thi h tr QoS gp nhiu kho khn. Trong mng Ad hoc, do cung mt phng tin truyn thng c chia se bi nhiu bn tham gia nn thu tuc truy nhp n knh chung phai c thc hin theo kiu phn b nh s h tr cua giao thc MAC. Giao thc MAC phai tinh n truy nhp knh trong khi ng thi phai tranh c s xung t vi cac nut ln cn. Do vy, khi tinh toan thit k cac giao thc MAC cho mng Ad hoc phai tinh n kha nng di chuyn, vn u cui n va cac vn lin quan khac.

1.3.4 inh tuyn va chuyn tip goi tin trong MANET


c tinh ng cua mng Ad hoc gy ra s thay i thng xuyn va kho oan trc cua topo mang, lam tng kho va phc tap inh tuyn gia cac nut di ng. Nhiu giao thc va thut toan inh tuyn a c xut cho mng Ad hoc, tuy nhin mi giao thc li c mt hn ch ring. Do vy, nghin cu v cc giao thc nh tuyn trong Ad hoc l mt vn rt quan trng.

1.3.5 Hiu qua s dung ngun nui


Hu ht cac giao thc trong mang hin nay khng quan tm n tiu tn nng lng ngun nui vi cac may chu va cac b tinh tuyn thng c gia inh la tinh va c cp ngun t ngun in chinh. Tuy nhin, cac thit bi di ng hu ht c cp ngun t ngun nui c lp.Ky thut ngun nui vn thng i chm hn so vi ky thut vi x ly. Thi gian cp ngun cua pin loai tt nh Li-ionh hin nay cung chi ti a t 2 n 3 gi (hin nay c mt s laptop c thi gian s dng ln n 8h, tuy nhin gi thnh vn cn kh cao). S gii han thi gian hoat ng nh th noi ln tinh cn thit phai bao tn tt ngun nui. c bit, i vi mng Ad hoc, do cac thit bi di ng phai thc hin vai tro cua ca h thng u cui (tng tac ngi dung khi thc hin cac ng dung ngi dung) ln vai tro cua mt h thng trung gian (chuyn tip goi tin) nn se tiu tn nng lng ngun nui mt cach ang k, c bit la cac nut trung gian.

V Huy Cng- T3- K49

18

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

1.3.6 c tinh TCP


TCP (Transmission Control Protocol) la mt giao thc cui-cui c thit k phuc vu vic iu khin nghen va iu khin lung trong mang. TCP la mt giao thc hng lin kt nn cn co mt giai oan thit lp kt ni u tin cho vic truyn d liu. Kt ni bi loai bo khi vic truyn d liu hoan thanh. Vi internet hin nay, giao thc mang IP la phi kt ni nn cn co mt giao thc truyn dn hng kt ni ang tin cy qua mt giao thc mang khng tin cy. Tuy nhin, TCP gia s rng cac nut trong tuyn la tnh nn vic iu khin nghen va iu khin lung chi c thc hin cac nut ngun va ch. TCP da vao vic o ac thi gian toan trinh-RTT (Round Trip Time) va mc tn tht goi kt lun la co nghen mach xay ra trong mang hay khng. TCP khng th phn bit c s co mt cua tinh di ng va s nghen mang. Cac nut chuyn ng trong mt kt ni co th gy tn tht goi va lam cho RTT dai hn. Do vy, cn co mt s cai tin bao am rng giao thc truyn dn thc hin tt ma khng anh hng n thng lng truyn thng cui-cui.

1.4.2 Cht lng dch v (QoS)


Kha nng cung cp QoS cua mt mang phu thuc vao cac c tinh bn trong cua toan b cac thanh phn mang, t cac lin kt truyn phat n tng MAC va tng mang. Cac kt ni khng dy co nng lc thp va hay thay i, ti l li cao. Cac topo mang la ng va co ty l mt goi cao. Cac giao thc MAC da trn truy nhp ngu nhin khng h tr QoS. Cac giao thc MAC QoS giai quyt vn v xung t phng tin, h tr truyn thng unicast tin cy, va cung cp vic d tr tai nguyn cho cac lu lng thi gian thc trong mi trng khng dy phn tan. Rt nhiu cac giao thc MAC va cac cai tin a c xut cung cp vic am bao QoS cho lu lng thi gian thc trong mi trng khng dy phn tan bao gm giao thc GAMA/PR va c ch xung t BB.

1.4.3 Tnh an ton v bo mt


V Huy Cng- T3- K49 19

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Mi trng v tuyn trong mng Ad hoc l mi ngon bo b cho cc cuc tn cng mo danh do c tnh qung b ca n. Cc giao thc nh tuyn trong mng Ad hoc cn c h tr tnh nng xc thc, m ha nng cao tnh an ton, hiu nng ca mng. TNG KT Chng ny trnh by nhng l thuyt tng quan mng Ad hoc. Trong mng Ad hoc, topo mng thng xuyn thay i. Do vy, cc giao thc nh tuyn trong mng Ad hoc cn gii quyt s di chuyn ca nt, rng buc nng lng,bng thng

CHNG 2. NH TUYN TRONG MNG AD HOC


V Huy Cng- T3- K49 20

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc c tinh ng cua Ad hoc gy ra s thay i thng xuyn va kho oan trc cua topo mang, lam tng kho va phc tap inh tuyn gia cac nut di ng. Nhiu giao thc nh tuyn c a ra, tuy nhin, chng vn gp phi mt s hn ch nht nh. Chng ny trnh by 4 loi giao thc trong mng Ad hoc: OLSR, AODV, DSR v DYMO.

2.1 GIAO THC NH TUYN C IN


Hin nay, cc giao thc nh tuyn a ra vi Ad hoc u da trn mt giao thc nh tuyn c in lm thut ton c bn; do , vic tm hiu nghin cu cc hot ng c bn ca cc giao thc ny l ht sc cn thit. Giao thc c in nh: nh tuyn theo vector khong cch, nh tuyn theo trng thi lin kt c s dng t rt lu v tr nn rt quen thuc. Tuy nhin, cc giao thc ny ch thch hp cho cu trc mng tnh, hot ng hiu qu mng Ad hoc c tc di chuyn thp, cu trc mng t thay i. Ngoi ra, giao thc ny hot ng ph thuc vo bn tin iu khin nh tuyn, nn vi s lng nt mng tng, yu cu trao i gia cc nt mng tng ln, thng tin cp nht nh tuyn ln, chng s tiu tn bng thng, nng lng v CPU. Bi v hai loi giao thc nh tuyn trn duy tr nh tuyn n tt c cc nt mng, n khng quan tm nt mng c tham giao truyn thng tin trong mng ti mi thi im hay khng. Hn na, giao thc nh tuyn c in rng buc lin kt phi l hai chiu, nn cn c nhng ci thin nht nh cho thng tin v tuyn ni chung v mng Ad hoc ni ring.

2.1.nh tuyn da trn trng thi lin kt


Phng php nh tuyn da trn trng thi lin kt da trn gi ca mi lin kt (cost) v nt mng phi duy tr cu trc mng hon chnh vi tham s ny. Tham s gi s c cp nht bng cch mi nt mng s gi thng tin qung b mt cch lin tc gi ca cc lin kt xut pht t n ti tt c cc nt mng khc s dng thut ton flooding. Mi nt mng khi nhn c cc thng tin ny s cp nht cu trc mng v s dng thut ton tn ng i ngn nht chn nt mng tip theo cho ng nh

V Huy Cng- T3- K49

21

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc tuyn n nt mng khc. Lin kt c th c gi khng chnh xc do nhiu nguyn nhn nh tr ng truyn, s phn tch ca mng... Cc cu hnh mng thay i c th hnh thnh nh tuyn khp kn (loop), tuy nhin, ng nh tuyn kiu ny c thi gian tn ti ngn v chng s b xa ngay khi bn tin i qua ton b mng.

2.1.1. nh tuyn da trn vector khong cch


Phng php ny nh tuyn da trn vector khong cch, c ci tin hn so vi phng php nh tuyn da trn trng thi lin kt: mi nt mng ch gim st gi ca lin kt xut pht t n, v khng qung b thng tin n tt c nt mng; n gi qung b u n n nt lin cnh thng tin v khong cch ngn nht ti nt khc trong mng. Nt mng khc khi nhn c thng tin ny s tnh ton li bng nh tuyn thng qua thut ton tm ng i ngn nht. Giao thc ny hot ng hiu qu hn, n gin hn v yu cu t b nh lu tr hn. Song, n c th sinh ra ng nh tuyn khp kn c thi gian tn ti thay i di ngn khc nhau, v bng nh tuyn c th xy dng t thng tin tn ti lu qu trn mng (khng c cp nht).

2.2 GIAO THC NH TUYN CHO MNG AD HOC


2.2.1 Cc yu cu chung
Do cc nt trong mng Ad Hoc lun di ng v c nhiu c tnh khc bit nn khng th p dng cc giao thc nh tuyn thng thng. Cc mng Ad Hoc thng c c trng bi mt topo ng do cc nt di chuyn lm thay i v tr vt l ca chng. i vi mng Ad Hoc, giao thc nh tuyn ng t ra hiu qu v ph hp hn cc phng php nh tuyn da trn vect khong cch v trng thi lin kt. Thch thc trong vic thit k cc giao thc nh tuyn l kh nng cp nht c mc di ng ca nt mng. Chch mc di ng ny l nguyn nhn lm thay i ton b cu trc topo ca mng. Mt nt di ng thng b gii hn bi kh nng x l ca CPU, dung lng lu tr, cng sut ngun v di thng.

V Huy Cng- T3- K49

22

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Mi trng truy cp, mi trng v tuyn cng c nhng thuc tnh c bit cn phi ch khi thit k cc giao thc cho mng Ad Hoc. V d cc ng truyn v hng. Nhng ng truyn ny xut hin khi hai nt c cng khc nhau v cho php ch mt nt nghe c nt kia. Nhng chng cng c th xut hin do nhiu t mi trng xung quanh. a chng trong mi trng v tuyn c th gy ra tng ch cng sut truyn v tng ch cng sut do mi quan h cn bc hai gia vng ph sng v cng sut pht ra. Bng cch s dng a chng, cc nt c th truyn cc gi tin i s dng cng sut ra thp. Hnh 2.1 M t cc trc c bn c th s dng c t mi trng mng Ad Hoc. Trc u tin l s cc nt trong mng. Trc th hai l tc m ti topo mng thay i. Trc th ba l ti lu lng trong mng. Khi mi trng di chuyn t gc ca 3 trc, vn nh tuyn tr nn kh khn hn. Tng s nt, tng tc thay i topo (ngha l tng tnh di ng ca nt), hoc tng ti lu lng mong mun trn mng l thch thc i vi cc giao thc trong mng Ad Hoc.

Hnh 2.1 H ta c bn m t mi trng mng Ad Hoc Yu cu i vi mt giao thc nh tuyn cho mng Ad hoc l g? Sau y l mt s yu cu quan trng:

V Huy Cng- T3- K49

23

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hot ng phn tn: Giao thc nh tuyn trong mng Ad Hoc phi l giao thc phn tn yu cu tin cy cao. Do cc nt l di ng nn giao thc nh tuyn tp trung l khng ph hp. Mi nt mng phi thng minh to cc quyt nh nh tuyn s dng cc nt ln cn.

Khng lp vng: nng cao cht lng hot ng, giao thc nh tuyn cn m bo ng nh c cung cp khng b lp vng, iu ny s lm gim lng ph bng thng v cng sut tiu hao ca CPU.

S dng cc siu nt: Tt c cc giao thc hin c u gi nh rng cc nt di ng l c cng cc c tnh da trn bn cht ca mng t t chc l tp hp ca cc nt ngang hng. Mc d iu ny c th ng trong mt s trng hp, tuy nhin, c trng hp m mng c cc nt c bng thng cao, ngun nui n nh, lin kt khng dy tc cao hn so vi cc nt khc. Cc nt nh vy c gi l cc siu nt. Cc mng t t chc trong trng hp ny thng c cu trc 2 mc: vng backbone v vng ph. Vng backbone bao gm cc siu nt. Thm vo cc siu nt thng c gi nh l c di chuyn thp hn cc nt thng duy tr s n nh ca backbone. Cc nt thng khng cn c quyt nh nh tuyn.

Hot ng da trn yu cu: Ti thiu ha phn thng tin iu khin trong mng, giao thc nh tuyn thuc nhm nh tuyn theo yu cu c th p ng c iu ny. N ch tm ng khi cn thit v khng qung b thng tin iu khin lin tc. Tnh tin phong (proactive): Trong mt s trng hp, tr ln do hot ng da trn yu cu l khng chp nhn c. Do phi s dng c tnh tin phong nu ti nguyn ca mng (v mt gii thng) nm trong khong cho php.

V Huy Cng- T3- K49

24

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

H tr cc lin kt mt chiu: Mi trng v tuyn c th l nguyn nhn hnh thnh cc lin kt theo mt hng. S dng kiu lin kt ny v kiu lin kt hai chiu s nng cao hiu nng ca giao thc nh tuyn.

Bo mt: Mi trng v tuyn rt d b tn cng, khai thc thng tin, do m ha v chng thc l cch bo mt thng thng nht c p dng hin nay.Vn l vic phn b cc kha v cc nt trong mng Ad hoc.

Bo ton nng lng: Nt mng trong mng Ad hoc c th l my tnh xch tay hay loi client nh gn khc nh PDA thng c gii hn v thi gian s dng ca pin, nn cn c ch ch (standby mode) tit kim nng lng. Do , giao thc nh tuyn s dng cn h tr ch ch ca nt mng.

Nhiu ng nh tuyn: Nhm gim s ln tc ng do s thay i v cu trc mng v khi nhiu ng nh tuyn b nghn. Nu nh mt ng nh tuyn khng s dng c na th mt ng nh tuyn khc c th thay th. Nh vy, giao thc khng cn khi to li th tc tm ng.

H tr QoS: C nhiu loi QoS cn c s h tr ca cc giao thc nh tuyn, n ph thuc vo mc ch ca mng; chng hn, h tr lu lng thi gian thc...

2.2.2 Phn loi


so sch v phn tch cc giao thc nh tuyn cho mng Ad hoc, cc phng thc phn loi hp l l rt quan trng. Cc phng thc phn loi gip cho cc nh nghin cu v cc nh thit k hiu c nhng c trng khc nhau v mi quan h gia cc giao thc. Cc c trng ny ch yu lin quan n vic tp hp thng tin nh tuyn, n vai tr m mt nt c th m nhn trong qu trnh nh tuyn. 2.2.2.1 nh tuyn theo bng, nh tuyn theo yu cu v nh tuyn lai

V Huy Cng- T3- K49

25

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Mt trong nhng phng thc ph bin nht phn loi cc giao thc nh tuyn cho mang Ad hoc l da trn vic thng tin nh tuyn c tp hp v c duy tr nh th no bi cc nt di ng. S dng phng thc ny, cc giao thc nh tuyn cho mnh Ad hoc c phn chia nh bng 2.2.

Hnh 2.2 Phn loi cc giao thc nh tuyn trong mng Ad hoc Cc giao thc nh tuyn proactive: cn c gi l cc giao thc nh tuyn theo bng (table-driven). S dng cc giao thc ny, cc nt di ng c gng nh gi lin tc cc tuyn trong mng khi mt gi cn phi chuyn tip th tuyn sn sng s dng. Mi nt duy tr mt hay nhiu bng cha thng tin nh tuyn ti cc nt trong mng. Tt c cc nt trong mng s cp nht cc bng ny duy tr mt cch ph hp thng tin v tnh trng ca mng, do tiu nh tuyn trong cc giao thc ny l kh ln. Khi topo mng thay i, cc nt truyn cc bn tin thng bo cho nhau cp nht thng tin v tuyn ca ton b mng. Giao thc nh tuyn trng thi lin kt ti u OLSR (Optimized Link State Routing) v giao thc nh tuyn vector khong cch tun t ch DSDV (Dynamic Destination-Sequenced DistanceVector Routing) l hai v d ca giao thc nh tuyn proactive

V Huy Cng- T3- K49

26

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Cc giao thc nh tuyn reactive: cn c gi l cc giao thc nh tuyn theo yu cu (on-demand). S dng cc giao thc ny, th tc xc nh tuyn ch c gi theo yu cu. Vic ny c thc hin thng qua hot ng khm ph tuyn ng (route discovery). Qu trnh khm ph tuyn kt thc sau khi hoc c mt tuyn c tm ra hoc khng c tuyn no sn c sau khi kim tra ton b cc tuyn ng. Trong mng Ad hoc, cc tuyn ang hot ng c th b t do tnh di ng ca nt. Do , duy tr tuyn l mt hot ng quan trng ca nh tuyn theo yu cu. So snh vi nh tuyn theo bng, t tiu nh tuyn l 1 u im ca nh tuyn theo yu cu. Tuy nhin, s dng nh tuyn theo yu cu th vic gi gi tin s c tr ln do nt ngun phi tm ng trc khi gi d liu. Hai giao thc reactive in hnh l giao thc nh tuyn vector khong cch theo yu cu AODV (Ad hoc Ondemand Distance Vector Routing) v giao thc nh tuyn nh tuyn ngun ng DSR (Dynamic Source Routing). Cc giao thc nh tuyn lai (hybrid) c xut kt hp u im ca 2 loi giao thc trn v khc phc cc nhc im ca chng. Thng thng, cc giao thc lai c trin khai trong mng c cu trc phn cp. Khi , cc c tnh nh tuyn theo bng v nh tuyn theo yu cu s c khai thc c lp cc mc phn cp khc nhau. Zone Routing Protocol (ZRP) v Hybrid Ad Hoc Routing Protocol l nhng v d ca giao thc lai. 2.2.2.2 Cu trc v phn b tin trnh nh tuyn

Mt phng thc phn loi khc l da trn vai tr c th c ca nt trong c ch nh tuyn. Trong giao thc nh tuyn ng b, tt c cc nt di ng c cng vai tr v chc nng. WRP, DSR, AODV v DSDV l nhng v d v nh tuyn ng b. Cc giao thc ny thng gi nh rng cu trc mng l phng. Trong mt giao thc nh tuyn bt ng b, mt s nt m nhn vai tr qun l v chc nng khc nhau. Thut ton phn tn c s dng la chn cc nt c bit ny. Trong mt s trng hp, cc phng php nh tuyn bt ng b gn lin vi cu trc mng phn cp d V Huy Cng- T3- K49 27

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc dng t chc v qun l cc nt. Cc giao thc nh tuyn bt ng b c th c phn chia da trn vic t chc cc nt di ng, chc nng nh tuyn v qun l c thc hin nh th no. Theo , cc giao thc nh tuyn bt ng b trong mng Ad hoc c chia thnh nh tuyn phn cp theo vng, nh tuyn phn cp theo nhm v nh tuyn theo nt li. Trong cc giao thc nh tuyn theo vng, cc thut ton xy dng vng khc nhau c trin khai cho vic t chc nt; v d, mt s thut ton xy dng vng s dng thng tin v tr a l. Khai thc hiu qu vic phn chia vng s gim c ng k tiu duy tr thng tin nh tuyn. Cc nt di ng trong cng mt vng bit ng n cc nt khc s c chi ph nh hn so vi vic duy tr thng tin nh tuyn ti tt c cc nt trong ton mng. Mt s nt hot ng nh l gateway v m nhn truyn thng lin vng. ZRP v ZHLS l hai giao thc nh tuyn theo vng cho mng Ad hoc. Cc giao thc nh tuyn theo nhm s dng thut ton xy dng nhm cho vic bu chn trng nhm (cluster-head). Cc nt di ng c nhm thnh cc nhm, trng nhm ng vai tr qun l thnh vin v m nhn chc nng nh tuyn. Clusterhead Gateway Switch Routing (CGSR) l mt v d ca nh tuyn theo nhm. Trong cc giao thc nh tuyn theo nt li, cc nt c bit c t ng la chn gp thnh 1 backbone trong mng. Cc nt backbone m nhn cc vai tr c bit, nh l xy dng v theo di ng nh tuyn, qung b gi tin d liu. Core-Extraction Distributed Ad Hoc Routing (CEDAR) l mt v d in hnh ca loi nh tuyn ny. 2.2.2.3 Khai thc cc metric mng cho nh tuyn

Cc metric s dng cho vic xy dng tuyn ng c th c s dng phn loi cc giao thc nh tuyn trong mng Ad hoc. Gn nh mi giao thc nh tuyn cho mng Ad hoc s dng s chng lm metric. Nu c nhiu tuyn ng c sn, tuyn no c s chng nh nht s c la chn. Nu tt c cc lin kt khng dy c cng xc sut li th ng nh tuyn ngn s n nh hn ng nh tuyn di v c th gim tiu lu lng, gim xung t gi tin. Tuy nhin, gi nh c cng xc sut li c th khng tn ti trong mng Ad hoc. Theo , s n nh lin kt phi c cn

V Huy Cng- T3- K49

28

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc nhc trong pha xy dng tuyn ng. Vi d, Associatively Based Routing (ARB) v Signal-Based Routing (SSR) c xut s dng s n nh lin kt v mnh tn hiu nh l mt metric cho nh tuyn. Vi s ph bin ca in ton di ng, mt s ng dng di ng c th c cc yu cu QoS khc nhau. p ng cc yu cu ny, cc metric QoS tng ng ln c s dng cho vic nh tuyn v chuyn tip gi tin trong mng Ad hoc. Ging nh mng c dy, cc giao thc nh tuyn QoS cho mng Ad hoc c th s dng cc metric, nh l bng thng, tr, tr jitter, t l li gi tin v chi ph. V d, bng thng v n nh lin kt c s dng trong CEDAR lm metric cho vic xy dng tuyn ng. 2.2.2.4 c lng topo, ch, v tr cho nh tuyn

Trong mt giao thc nh tuyn theo topo cho mng Ad hoc, cc nt tp hp thng tin topo mng cho vic nh tuyn. Ngoi cc giao thc nh tuyn theo topo, mt s giao thc nh tuyn theo ch c xut cho mng Ad hoc. Trong cc giao thc ny, mt nt ch cn bit next-hop trn ng nh tuyn khi chuyn tip gi tin ti ch. V d, DSR l giao thc nh tuyn theo topo v AODV, DSDV l giao thc nh tuyn theo ch. Vic sn c ca h thng nh v ton cu (GPS) hoc cc h thng nh v tng ng cho php cc nt di ng truy nhp thng tin v tr a l mt cch d dng. Trong cc giao thc nh tuyn theo v tr, mi quan h v v tr gia cc nt chuyn tip gi tin v nt ch, cng vi s di chuyn ca nt, c th c s dng trong c qu trnh khm ph tuyn v chuyn tip gi tin. Location Aided Routing (LAR) v Distance Routing Effect Algorithm for Mobility (DREAM) l cc giao thc nh tuyn theo v tr cho mng Ad hoc. Sau y l mt s giao thc nh tuyn c xut cho mng Ad hoc.

2.3 OPTIMIZED LINK STATE ROUTING(OLSR)


OLSR l giao thc nh tuyn theo bng v l mt s ti u ca giao thc trng thi lin kt c in, hon ton thch hp cho mng di ng Ad hoc. OLSR ti thiu ha tiu nh tuyn bng cch ch s dng cc nt c chn pht trn lan lu lng V Huy Cng- T3- K49 29

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc iu khin, c gi l Chuyn tip a im MPR (Multipoint Relay). K thut ny gim ng k s lng yu cu truyn li pht trn lan mt bn tin ti tt c cc nt trong mng.

2.3.1 Bu chn Multipoint relay

Hnh 2.3 Qu trnh pht trn lan bn tin qung b MPR l ti thiu ha overhead khi pht trn lan bn tin trong mng bng cch gim s ln truyn li trong cng mt vng. Mi nt trong mng la chn mt tp hp cc nt hng xm trc tip ca n lm MPR. Hng xm ca nt A m khng nm trong tp hp MPR ca A c th nhn v x l cc bn tin qung b nhng khng th truyn cc bn tin qung b nhn c t A. Mi nt la chn tp hp MPR t nhng hng xm trc tip (one-hop) ca n. Tp hp MPR ca nt A, k hiu l MPR(A), l tp con ca tp hp cc hng xm trc tip ca A, phi tha mn nhng iu kin sau: mi nt trong hng xm hai bc (two-hop) ca A phi c mt lin kt trc tip n MPR(A). Tp hp MPR cng nh th tiu lu lng iu khin ca giao thc nh tuyn cng nh. Mi nt phi duy tr thng tin v tp hp hng xm m chng chn lm MPR. Tp hp ny gi l MPR selector set ca mt nt. V Huy Cng- T3- K49 30

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 2.4 Bu chn MPR Trong OLSR, mi nt truyn bn tin Hello nh k (v d mt giy mt bn tin) trn mi giao din ca nt. Mc ch chnh ca bn tin Hello cho php mi nt c th khm ph tuyn trc tip ti hng xm ca n. Bn tin Hello c qung b tng chng mt (hop-by-hop) v phi khng c truyn trc . Bn tin Hello bao gm tn ca nt khi to, hng xm trc tip m nt khi to truyn bn tin khm ph, v cc nt m nt khi to chn lm MPRs. Khi mt nt nghe thy bn tin Hello, n kim tra liu bn tin c phi c pht sinh t hng xm mi hay khng, v nu ng, nt s cp nht vo danh sch hng xm trc tip ca nt. Bn tin Hello rt quan trng trong vic h tr khi nim MPR. Mi nt kim tra bn tin Hello nhn c t hng xm ca n xem n liu c c la chn lm MPR ca bt k hng xm no khng. Nu vy, nt s pht trn lan cc cp nht nh tuyn c pht sinh t cc hng xm m chn n l MPR. Mi nt cng c th khm ph liu cc nt c l hng xm hai bc t bn tin Hello, bi v danh sch cc hng xm hai bc c lit k trong bn tin Hello ca nt hng xm trc tip ca n. Mi nt la chn MPR trn c s hng xm hai bc, do vy mi hng xm hai bc phi nhn c bn tin MPR.

V Huy Cng- T3- K49

31

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

2.3.2 Truyn b bn tin iu khin topo (Topology control)


Bn tin iu khin topo c truyn i vi mc ch cung cp cho mi nt trong mng cc thng tin lin kt trng thi y cho php tnh ton c tuyn ng.

2.3.3 Tnh ton tuyn


Thng tin trng thi lin kt a ra c thc hin thng qua trao i nh k cc bn tin, cng ging nh cu hnh giao din ca cc nt, bng nh tuyn ca mi nt c th c tnh ton.

2.4 DYNAMIC SOURCE ROUTING (DSR)


Giao thc nh tuyn ngun ng DSR l giao thc nh tuyn n gin v hiu qu. Giao thc ny c thit k s dng trong cc mng Ad hoc v tuyn a chng c tc di chuyn cao ca cc nt. Cc nt ny phi hp vi nhau chuyn tip cc gi tin. Do vy gi tin c th c chuyn n cc nt khng nm trong vng ph sng ca chnh nt . Khi cc nt trong mng di chuyn, tham gia hoc ri khi mng th ton b cc th tc nh tuyn c xc nh v duy tr mt cch t ng bi giao thc nh tuyn DSR. DSR bao gm 2 c ch c bn: Khm ph tuyn (Route Discovery) v Duy tr tuyn (Route Maintenance). Khm ph tuyn v Duy tr tuyn hot ng hon ton theo yu cu.

2.4.1 nh tuyn ngun


DSR pht hin v s dng cc tuyn ngun. Nt gi tin s phi nm c ton b thng tin v trnh t sp xp ca cc chng (v tr cc nt) ca mng ti mt nt ch. Mi gi tin c nh tuyn s mang thng tin v danh sch cc chng ny trong tiu . u im quan trng ca th tc nh tuyn ngun l cc nt trung gian khng cn phi duy tr vic cp nht thng tin nh tuyn khi chuyn tip cc gi tin bi v bn thn cc gi mang thng tin quyt nh vic nh tuyn (danh sch y cc nt theo trnh t m gi phi i qua). V Huy Cng- T3- K49 32

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Vic tp hp thng tin v topo mng ti nt ngun ca mi gi cho php nt ngun phn pht cc gi tin mt cch hiu qu trong mng. iu ny rt thch hp vi vic qun l ti nguyn trong mng Ad hoc. Giao thc nh tuyn da trn cc tuyn ngun cn c thm 2 li ch. Th nht, giao thc c th chng minh c mt cch n gin tnh khng lp vng bi v tuyn ngun c s dng iu khin nh tuyn cc gi. Th hai, mi tuyn ngun l mt bn k sn v mt ng truyn c th, tin cy truyn cc thng tin qua mng. DSR s dng cc tuyn ngun v mi gi c nh tuyn da trn mt tuyn ngun khm ph c, tuy nhin nhng ci thin gn y i vi DSR cho php hu ht cc gi tin khng phi mang theo phn tiu cha thng tin y v tuyn ngun.

2.4.2 Khm ph tuyn


Khm ph tuyn c thc hin bng cch pht trn lan yu cu qua mng tm kim mt tuyn ti ch no . Trong dng n gin nht, nt ngun A mun khm ph mt tuyn ti nt ch D th A s pht qung b gi tin Yu cu tuyn RREQ v gi ny tip tc c qung b bi cc nt trung gian cho n khi n n c nt ch D. Trong c ch ny, nhiu ti u ha c s dng gii hn tn s v phm vi ca cc Khm ph tuyn. Khi mt nt S mun gi mt gi tin n D, u tin n s t vo phn tiu ca gi tin mt tuyn ngun trong ch ra th t ca cc chng m gi tin s phi i qua. Thng thng, nt S s t c mt tuyn ngun thch hp thng qua vic tm kim trong B nh tuyn ca n cc tuyn bit trc y. Tuy nhin nu khng tm thy tuyn no trong B nh tuyn, n s khi to th tc Tm kim tuyn ng tm ra mt tuyn ngun ti D. Trong trng hp ny ta gi nt S l nt ngun cn nt D l nt ch trong th tc Khm ph tuyn. Trc khi khi to mt gi tin RREQ, nt ngun chn mt nhn dng yu cu (Request_id) t trong gi tin RREQ. Cp <a ch nt ngun, nhn dng yu cu> l duy nht.
^ | "A" id=2 ^ | "A,B" id=2 ^ | "A,B,C" id=2 ^ "A,B,C,D" | id=2

V Huy Cng- T3- K49

33

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc


+-----+ +-----+ +-----+ +-----+ +-----+ | A |---->| B |---->| C |---->| D |---->| E | +-----+ +-----+ +-----+ +-----+ +-----+ | | | | v v v v

Hnh 2.5 Khm ph tuyn trong DSR Hnh 2.5 minh ha qu trnh Khm ph tuyn n gin, nt A c gng khm ph tuyn ti nt E. khi u Khm ph tuyn, A truyn mt tin bo RREQ. Mi tin bo RREQ nhn dng nt ngun v ch ca Khm ph tuyn. Nhn dng yu cu c xc nh bi nt ngun ca Yu cu. Mt RREQ bao gm mt bn ghi danh sch a ch ca tng nt trung gian m tin bo RREQ i qua. Gi tr ban u ca bn ghi tuyn l mt danh sch trng. Khi mt nt nhn c bn tin RREQ ny (v d nh nt B trong v d), nu n l ch ca Khm ph tuyn, n s gi li bn tin Tr li tuyn RREP ti khi to ca Khm ph tuyn, chuyn bn copy ca bn ghi tuyn c cng dn t RREQ; khi nt ngun nhn c RREP, n ct gi tuyn ny trong B nh tuyn s dng khi gi cc gi tin tip theo ti ch ny. Mt khc, nu mt nt nhn RREQ m nhn c mt bn tin RREQ khc t nt ngun, mang theo nhng nhn dng yu cu v a ch ch ging nhau hoc nu a ch ring ca nt ny nm trong bo co tuyn ca RREQ, n s t chi Yu cu. Nu khng, nt ny s gn a ch ring ca n vo bn ghi tuyn trong bn tin RREQ v tip tc qung b n. Trong v d, nt B s qung b bn tin RREQ, n s c nhn nt C, nt C v nt D cng vy, n s broadcast Yu cu, kt qu l copy ca Yu cu s c nhn bi nt E. Trong vic bn tin RREP tr li nt ngun trong th tc Khm ph tuyn, chng hn nt E tr li nt A trong hnh 2.5, nt E s kim tra B nh tuyn ca n xem liu c mt tuyn ngc v nt A, v nu tm c n s s dng tuyn ny lm tuyn ngun phn pht cc gi tin bao gm c gi RREP. Nu khng tm c mt tuyn ngc tr li A, E c th thc hin th tc Khm ph tuyn t n ti A. trnh kh nng quay li v hn c th ca cc Khm ph tuyn, n s chn bn tin RREP vo chnh bn tin V Huy Cng- T3- K49 34

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc RREQ ca n i vi nt A. S dng c ch ny n cng c kh nng cng theo cc gi d liu nh khc v d nh gi TCP SYN trn mt bn tin RREQ. Nt E cn c th o v tr sp xp ca cc chng trong bn ghi tuyn v s dng tuyn o v tr ny nh mt tuyn ngun i vi cc gi tin mang bn tin RREP ca chnh n. Khi khi to mt Khm ph tuyn, nt ang gi s gi li bn sao ca gi tin ban u trong b nh m ni b (Send Buffer) gi l b m gi. Ngoi ra Send Buffer cn cha cc bn sao ca cc gi tin khng truyn i c do cha tm ra mt tuyn ngun ti ch. Mi gi trong Send Buffer c gn cho mt nhn thi gian ch ra thi gian chng tn ti trong Buffer v gi tin s b loi b sau khi thi gian lu li trong Send Buffer qu hn; Send Buffer khng b trn, k thut FIFO hoc k thut tng ng khc c th c s dng truyn cc gi tin i trc khi chng ht hn. Trong trng hp gi tin cn lu li trong Send Buffer m cha truyn i c th thnh thong nt mng li thit lp mi th tc Khm ph tuyn ty theo a ch ch ca cc gi. Tuy nhin, tn sut khi to cc Khm ph tuyn mi cn phi c gii hn do c th xy ra trng hp ch ca th tc khi to tuyn thay i v khng th ti c. Trn thc t, do gii hn v phm vi truyn dn v tuyn v s di chuyn ca cc nt trong mng nn nhiu khi cu trc mng b phn mnh, ngha l khng c th t sp xp ca cc chng m qua gi tin c chuyn tip ti ch. Kiu phn mnh nh vy c th him gp hoc ph bin ty thuc vo kiu di chuyn v mt ca cc nt trong mng. Trong trng hp vi mi gi tin, mt th tc Khm ph tuyn c khi to th mt s ln cc gi RREQ khng hu ch c truyn t nt ny ti tt c cc nt khc trong mng. gim phn ph tri tiu do cc Khm ph tuyn trn ngi ta phi gii hn tn sut khi to cc Khm ph tuyn t mt nt bt k n cng mt ch. Nt ch c php khi to Khm ph tuyn mi sau khi i ht khong thi gian ti thiu cn thit c th thit lp th tc Khm ph tuyn mi. T kt qu ca vic kim tra bn sao cc tuyn ngun ghi c, thut ton Khm ph tuyn ngn chn c vic lp cc RREQ trong mng. l mt thuc tnh hiu chnh quan trng v l nguyn nhn to ra thuc tnh khng lp vng ca DSR. S dng V Huy Cng- T3- K49 35

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc cc nhn dng yu cu l mt ti u n gin khi cc RREQ ban u tri rng hng ra pha ngoi so vi nt ngun v rt bt s cc gi RREQ bao quanh b khi to.

2.4.3 Duy tr tuyn


Khi gi hoc chuyn tip mt gi tin ti ch D no s dng tuyn ngun, mi nt s c nhim v gim st v khng nh rng gi tin n c chng tip theo trn tuyn ngun hay cha; gi tin s c truyn li (sau mt s ln cho php) cho ti khi nt ny nhn c khng nh rng n n c nt tip theo.V d trng hp c minh ha trong hnh 2.6 di y: nt A gi mt gi tin ti E s dng mt tuyn ngun thng qua cc nt trung gian B, C v D. Trong trng hp ny nt A chu trch nhim v vic nhn gi tin nt B, nt B chu trch nhim vic nhn gi tin nt C, nt C li chu trch nhim v vic nhn gi tin nt D, v c nh th n nt cui cng nt D phi chu trch nhim v vic nhn gi tin nt E. Trong nhiu trng hp khng nh vic nhn gi tin khng nh hng g i vi giao thc DSR do thc t y l mt phn ca cc th tc lp MAC.

Hnh 2.6 Duy tr tuyn, nt C khng th chuyn tip t A n E qua lin kt ti bc nhy tip theo D ca n Nu c ch ny khng tn ti v sn c cc nt th khi nt gi tin s dng mt bt thng tin trong phn tiu ca gi tin yu cu mt phc p t nt tip theo thng qua phn mm c bit trong DSR. Thng thng phc p qua phn mm ny c truyn trc tip ti nt gi tin. Tuy nhin nu ng lin kt gia hai nt l lin V Huy Cng- T3- K49 36

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc kt n hng th phc p ny c th phi i qua rt nhiu chng khc nhau quay li nt gi tin Nu gi tin c truyn li qua mt s chng v vt qu s ln cc i cho php m vn cha nhn c khng nh t nt tip theo, nt ny s gi bn tin bo li tuyn RERR quay tr li nt gi bn tin ban u xc minh tuyn b li t nt no. V d trong hnh 2.6 trn : nu nt C khng th truyn tin n nt D tip theo, C s gi bn tin RERR v nt A v tng trnh rng tuyn t C n D b t. Khi A s xa ng lin kt b li ny khi b nh tuyn ca n. Vic truyn li bn tin ban u by gi l nhim v v chc nng ca cc th tc lp cao hn nh TCP. Trong trng hp phi gi li gi tin ti chnh ch E v nu trong b nh tuyn ca nt A c mt tuyn khc ti E (v d t cc bn tin tr li tuyn t cc th tc khm ph tuyn trc hoc l t vic nghe lm c cc thng tin nh tuyn t cc gi tin khc) th n s gi ngay gi tin s dng tuyn mi . Nu khng n s thc hin mt th tc khm ph tuyn mi ti ch E ni trn

2.5 AD HOC ON- DEMAND DISTANCE VECTOR ROUTING (AODV)


AODV cho php nh tuyn nhiu bc gia cc nt mng thit lp v duy tr mng Ad hoc. AODV da trn thut ton vector khong cch nhng thuc loi nh tuyn theo yu cu, n ch yu cu ng nh tuyn khi cn thit. Thut ton nh tuyn AODV kh ph hp cho cu hnh mng ng. AODV a ra cc tuyn khng b lp ngay c khi n ang sa cc lin kt li. Bi v giao thc ny khng yu cu qung b tuyn nh k trn ton mng, nn yu cu ton b bng thng c sn cho mt nt di ng thc cht l thp hn so vi cc giao thc khc, nhng giao thc yu cu qung b. AODV s dng lin kt i xng gia cc hng xm. Gi tin khng i theo tuyn ng gia cc nt khi mt trong nhng nt khng nghe c t cc nt khc. Nhng nt khng nm trn cc tuyn ng hot ng; chng s khng duy tr bt c thng tin nh tuyn no cng nh khng tham gia vo bt k s trao i bng nh

V Huy Cng- T3- K49

37

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc tuyn nh k no. Hn na, mt nt khng phi khm ph v duy tr mt tuyn ti nt khc cho ti khi hai nt cn giao tip vi nhau, tr khi nt ng vai tr nh mt trm chuyn tip trung gian duy tr kt ni gia hai nt khc . Khi mt kt ni cc b ca nt di ng c thit lp, mi nt c th nhn thy cc nt khc trong vng ln cn ca n bng mt vi k thut, bao gm qung b cc b cc bn tin Hello. Bng nh tuyn ca cc nt trong vng ln cn c to ra ti u thi gian p ng ti vi s di chuyn cc b v cung cp thi gian p ng nhanh cho cc yu cu thit lp tuyn mi. Mc tiu chnh ca thut ton AODV: Gi broadcast cc gi tin khm ph tuyn khi cn thit.

Phn bit gia pht hin-qun l kt ni cc b trong vng ln cn vi duy tr topo mng chung.

Qung b thng tin v s thay i kt ni cc b ti cc nt hng xm m thc s cn thng tin. AODV s dng mt c ch Khm ph tuyn vi s ci bin ca thut ton DSR.

Thay v nh tuyn ngun, AODV tin tng vo s thit lp ng cc entry trong Bng nh tuyn cc nt trung gian. AODV s dng s th t nt mng ch gip cho tuyn ng lun cp nht v khng hnh thnh ng nh tuyn khp kn. Hn na, AODV cng h tr nh tuyn multicast v gii quyt c vn m v hn trong thut ton Bellman Ford.

2.5.1 Khm ph tuyn


Qu trnh Khm ph tuyn c khi to bt c khi no mt nt ngun mun giao tip vi cc nt mng khc nhng n li khng c thng tin nh tuyn trong Bng nh tuyn ca n. Mi nt duy tr hai b m: s th t nt v broadcast ID. Nt ngun khi to Khm ph tuyn bng cch qung b gi tin RREQ ti hng xm ca n. RREQ cha cc trng sau: <source_addr source sequence# broadcast_id dest_addr dest sequence # hop_cnt>

V Huy Cng- T3- K49

38

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Trong : source _addr: a ch ngun source sequence: s th t ngun broadcast_id: nh danh ca RREQ dest_addr: a ch ch dest sequence: s th t ch hop_cnt : s chng

Cp <source_addr, broadcast_id> c xc nh duy nht vi mi bn tin RREQ. broadcast_id c tng ln khi nt ngun khi to mt RREQ mi. Mi nt hng xm khi nhn c bn tin RREQ s gi li mt bn tin RREP ti nt ngun nu n bit mt tuyn ti ch, hoc tip tc qung b bn tin RREQ ti nt hng xm sau khi tng hop_cnt. Ch rng mi nt c th nhn c nhiu bn sao ca cng mt RREQ t cc hng xm. Khi mt nt trung gian nhn c mt RREQ, nu n nhn RREQ vi cng broadcast_id v a ch ch, n s loi b RREQ v khng chuyn tip gi tin na. Nu mt nt khng th p ng c RREQ, n s theo di cc thng tin sau thit lp tuyn ng ngc cng nh thit lp tuyn ng thun dnh cho vic truyn gi tin RREP. a ch IP ch a ch IP ngun Broadcast ID

Thi gian ht hn ca entry tuyn ng ngc

S th t ca nt ngun

2.5.2 Thit lp tuyn ng ngc


C hai s th t c cha trong mt bn tin RREQ: s th t ngun v s th t ch cui cng c bit bi ngun. S th t ngun c s dng duy tr thng tin mi v tuyn ng ngc ti ngun, v s th t ch ch ra rng tuyn ng ti ch V Huy Cng- T3- K49 39

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc phi mi nh th no n c th c chp nhn bi ngun. Khi bn tin RREQ c gi t nt ngun ti cc nt ch khc nhau, n s t ng thit lp cc tuyn ng ngc t tt c cc nt ti nt ngun. thit lp tuyn ng ngc, mi nt phi ghi li a ch ca hng xm m t n nhn c bn sao u tin ca RREQ. Cc entry tuyn ng ngc c duy tr trong khong thi gian va bn tin RREQ c th truyn trn mng v tr li li ti nt gi.

Hnh 2.7 Thit lp tuyn ng i ngc

2.5.3 Thit lp tuyn ng thun


Cui cng, bn tin RREQ s n c mt nt bit c tuyn ti nt ch. u tin, nt nhn c bn tin RREQ s kim tra chc chn rng bn tin RREQ c nhn trn mt lin kt hai chiu. Nu mt nt trung gian c mt entry tuyn ti ch yu cu, n so snh s th t ch trong entry tuyn ca chnh n vi s th t ch trong bn tin RREQ xc nh xem tuyn c dng c hay khng. Nu s th t ch trong bn tin RREQ ln hn, nt trung gian s khng s dng tuyn trong bng entry tuyn ca n p ng RREQ. Khi , nt trung gian s tip tc qung b RREQ. Cc nt trung gian ch tr li khi s th t ch trong bng entry ca n ln hn so vi trong V Huy Cng- T3- K49 40

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc bn tin RREQ. Nu nt trung gian c mt tuyn hin hnh ti nt ch v nu bn tin RREQ ny cha c nhn trc , nt s gi unicast mt bn tin RREP ti hng xm m t n nhn c RREQ. Mt bn tin RREP cha cc thng tin sau: <a ch ngun, a ch ch, th t ch# s chng, thi gian sng> Trong khi mt gi tin qung b ti mt nt c tuyn ti ch, mt tuyn ng ngc c thit lp ti nt ngun ca gi tin RREQ. Khi RREP tr li nt ngun, mi nt dc theo tuyn ng thit lp mt con tr thun ti nt m t RREP n, cp nht thng tin timeout cho cc entry ti nt ngun v nt ch, ghi li s th t ch mi nht cho tuyn c yu cu. Thit lp tuyn ng thun khi RREP t nt ch D ti nt ngun S. Nt khng nm trn tuyn c xc nh bi RREP s ht hn sau ACTIVE_ROUTE_TIMEOUT (3000ms) v s xa con tr ngc. Mt nt nhn RREP s truyn RREP u tin v nt ngun. Nu mt nt nhn nhiu hn mt RREP, n s cp nht thng tin nh tuyn ca n v truyn RREP ch khi RREP c s th t ch ln hn hoc bng RREP trc vi mt s chng nh hn. N s loi b ht cc RREP khc m n nhn c. iu ny gim s lng bn tin RREP truyn ti nt ngun ng thi m bo rng thng tin nh tuyn l nhanh v mi nht. Nt ngun c th truyn d liu ngay sau khi nhn c RREP u tin v sau c th cp nht thng tin nh tuyn nu n hc c mt tuyn mi tt hn.

V Huy Cng- T3- K49

41

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 2. 8 Thit lp tuyn ng thun

2.5.4 Qun l bng nh tuyn


Gn lin vi cc entry tuyn ng ngc l mt b m thi gian, c gi l b m thi gian ht hn RREQ. Mc ch ca b m thi gian ny l thanh lc nhng entry tuyn ng ngc t nhng nt khng nm trn tuyn ng t ngun ti ch. Thi gian ht hn ph thuc vo kch thc ca mng Ad hoc. Mt thng s quan trng khc gn vi entry nh tuyn l thi gian timeout ca cc tuyn ang c lu gi, hay thi gian m sau tuyn ng ny coi nh ht hiu lc. Trong mi entry Bng nh tuyn, a ch ca nt hng xm m gi tin i qua n ch cng c duy tr. Mt nt c coi l hot ng i vi ch khi n to ra hay chuyn tip t nht mt gi tin ti ch trong khong thi gian timeout . Thng tin ny c duy tr tt c cc nt ngun c th c thng bo khi c mt lin kt b t. Mi nt duy tr mt entry cho mi ch cn n. Mi entry cha cc thng tin sau: ch 42

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Next hop S chng S th t ch Cc hng xm cn hot ng cho ch Thi gian ht hn cho entry bng nh tuyn

Mi khi mt entry tuyn c dng truyn gi tin d liu t ngun ti ch, timeout cho entry s c reset ti thi gian hin ti cng thm timeout. Nu mt tuyn mi c yu cu cho mt nt di ng, cc nt di ng so snh s th t ch ca tuyn mi vi tuyn hin ti. Nu s th t tuyn mi cao hn, n s c chn, nu bng nhau th tuyn mi s c chn khi c metric nh hn (s chng t hn) ti ch.

2.5.5 Cp nht ng nh tuyn


Khi mt nt mng pht hin ng nh tuyn n nt bn cnh khng hot ng, n s xa trong bng nh tuyn v gi mt bn tin Lin kt hng RERR. AODV s dng danh sch nt mng bn cnh cn hot ng ghi nh nt mng ang s dng ng nh tuyn trong bng nh tuyn. Nt mng nhn c bn tin ny cng s lp li qu trnh gi bn tin. Cui cng bn tin cng n c gi n tt c nt mng c lin quan, t chng c th dng vic gi thng tin hoc yu cu ng nh tuyn mi thng qua bn tin RREQ.

2.6 DYNAMIC MANET ON- DEMAND (DYMO)


DYMO l giao thc nh tuyn theo bng mi nht, hin vn ang c pht trin bi MANET trong IETF. DYMO c th coi l s kt hp ca AODV v DSR. Mc tiu ca n l thit k n gin, gim thiu yu cu h thng , n gin ha vic thc thi giao thc. Mt mt, DYMO cng s dng s th t m bo trnh lp tuyn, mt khc, DYMO a ra cc c tnh mi nh l thc hin tnh ton tuyn ng. Bn cnh thng tin tuyn ng v mt mc tiu c yu cu, mt nt cng nhn c thng tin v tt c cc nt trung gian nm trn mt tuyn ng mi khm ph c. y l mt khc bit c bn gia DYMO v AODV, trong th AODV ch to ra entry bng nh tuyn

V Huy Cng- T3- K49

43

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc cho nt ch v nt next-hop, cn DYMO th lu tr tuyn ng cho mi nt trung gian. iu ny c th hin qua hnh 2.9.

Hnh 2.9: S khc nhau gia AODV v DYMO Khi s dng AODV, mt nt A ch bit ng ti B v D sau khi Yu cu tuyn c p ng. Trong DYMO, nt A cng bit c ng ti C. DYMO c th thit lp v duy tr cc tuyn ng unicast trong cc kch bn mng IPv4 v IPv6 bng cch s dng c ch sau: Nhm pht hin mt tuyn mi n mt nt ch, mt nt gi mt bn tin Yu cu tuyn RREQ ti tt c hng xm trong phm v truyn sng ca n. iu ny cng nhn c bng cch gi bn tin ti 1 a ch multicast cc b ring. Khi mt nt trung gian nhn c mt RREQ n thit lp tuyn ng ti tt c cc nt m gi tin i qua. Sau nt s gn a ch ca chnh n vo bn tin v truyn bn tin ti tt c cc nt ln cn. Bng cch ny th RREQ c qung b mt cch hiu qu trn mng v cui cng l n ch ca n. ich p ng RREQ bng cch gi unicast mt bn tin Tr li RREP tr v nt m n m t n nhn c RREQ. Cng nh trong qu trnh qung b RREQ, nt ny li gn a ch ca n v ghi ch tt c cc thng tin nh tuyn c trong RREP. Cng vi thng tin nh tuyn c c trc khi chuyn tip RREQ tng ng, nt trung gian c kh nng gi RREP tr v nt ngun ca RREQ.

V Huy Cng- T3- K49

44

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Nt ny cng s bit c tuyn ng ti nt ch c yu cu, cng nh l ng ti mi nt trung gian, v ngc li. Mt nt trung gian cng c th to ra RREP nu nh n bit tuyn ng ti ch. phn ng tt vi mng c mc di chuyn cao, cc lin kt trn tuyn ng bit c c th c theo di, bng cch s dng giao thc nhn bit hng xm (Neighboehood Discovery Protocol) hoc kim tra phn hi nhn c tng data link. Mt h thng cng c th la chn khng bt tnh nng theo di, n gin ch xa cc tuyn khng cn hot ng. Khi mt nt pht hin lin kt li, n s gi mt bn tin RERR thng bo c tt c cc nt ln cn, thng bo cho chng bit v tt c cc tuyn t.

TNG KT Qua vic nghin cu mt s giao thc trong mng Ad hoc ta c th thy rng cha c giao thc no c y cc tnh nng v khng th khng nh giao thc no l ti u cho mng Ad hoc. Tuy nhin, chc nng chnh ca cc giao thc l tm c ng i ti ch, khng phi ng ngn nht hay ng ti u nht c p ng.

V Huy Cng- T3- K49

45

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

3 CHNG 3 THNG S NH GI V M HNH CHUYN NG TRONG M PHNG MNG AD HOC


Nh trnh by chng 2, giao thc nh tuyn trong mng Ad hoc u tp trung gii quyt vn v khi nim c trng ca mi trng v tuyn. Nhng giao thc no l tt nht, ph hp nht? N ph thuc vo cu trc v thuc tnh ca mng, mt nt mng, mc di chuyn ca nt mng, kch c mi trng, kiu di chuyn ca cc nt mng...

3.1 THNG S NH GI GIAO THC MNG AD HOC


C hai thng s nh gi: thng s nh gi cht lng v thng s kch bn.

3.1.1 Thng s nh gi cht lng


Cc thng s ny c s dng a ra chnh xc nhng g xy ra trong qu trnh m phng v cung cp cc thng tin c gi tr v cc giao thc nh tuyn. Do , n dnh c nhiu s quan tm khi nghin cu giao thc nh tuyn m phng.

V Huy Cng- T3- K49

46

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc 3.1.1.1 T l gi nhn c

nh ngha: T l gi nhn c RD l t l gia s gi nhn c bi nt ch (PR) v s gi c gi i t lp ng dng ca nt ngun (PS). RD = PR / PS (CT 3.1) ngha: giao thc nh tuyn hot ng tt phi c gi tr R D cao do kh nng tn dng bng thng v tuyn l rt quan trng. Thng s ny phn nh t l gi tin b mt, mc hon chnh v ng n ca giao thc nh tuyn.

3.1.1.2

Tr t u cui n u cui

nh ngha: Tr t u cui n u cui l thi gian m gi tin truyn trn mng t nt ngun n nt ch. N bao gm nhiu gi tr nh trn mng: tr b m, tr chuyn tip gi tin nt trung gian, tr truyn dn v thi gian truyn li gi tin (trong trng hp gi tin b mt). C th tnh thi gian tr theo hai cch: Tdelay = Trev T send Hoc: (CT 3.2) Tdelay = T buffer + Trelay + Tprop + Tresend (CT 3.3)

ngha: Trong mng gi v tuyn khng c QoS th gi tr tr ph thuc vo giao thc nh tuyn. Mt thng s quan trng l thi gian tr trong b m, tc l gi tin c lu gi trong b m khi cha c ng nh tuyn n ch trc khi b hy. Nu nh nt mng t thi gian ln th t gi tin trn mng b hy, nhng cng c ngha tr trung bnh trong mng cng tng ln. V ngi thit k h thng s quyt nh: t l gi hy b thp hay thi gian tr, iu ny lin quan n gi tr tr u cui n u cui. 3.1.1.3 Thng lng t u cui n u cui

nh ngha: thng lng l t l gia s gi tin d liu c truyn trn mt n v thi gian.

V Huy Cng- T3- K49

47

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc ngha: Khi bng thng sn c trn mng bit, th trong m phng bng thng thc s c c l bao nhiu? Thng s thng lng T s cho bit bng thng thc s khi m phng v c th cho thy s hiu qu ca giao thc nh tuyn mc no. Khi thng lng trung bnh cao ngha l bng thng dnh cho nh tuyn l t, khi giao thc nh tuyn hot ng tt. 3.1.1.4 Phn ti thng tin nh tuyn

nh ngha: l t l gia gi tin nh tuyn c gi i vi s gi d liu c gi ti ch. ngha: Ti thng tin nh tuyn l mt thng s quan trng vi mng Ad hoc, n cng cho bit hiu nng s dng bng thng ca giao thc nh tuyn: bao nhiu bng thng c s dng cho bn tin nh tuyn, bao nhiu bng thng c s dng cho cc gi tin d liu. Phn ti nh tuyn trong giao thc nh tuyn theo yu cu thng thng l ln do n phi gi bn tin cp nht nh k trn ton mng. Trng hp l tng l khng c bn tin nh tuyn, ch c gi tin d liu c truyn trn mng; tuy nhin, nu khng c giao thc nh tuyn th khng th trin khai thc t.

3.1.2 Thng s kch bn


Cc thng s kch bn c tnh ton t d liu u vo ca m phng, hoc c th l bin u vo (v d nh thi gian tm dng). N khng ph thuc vo giao thc nh tuyn hoc qu trnh m phng cng nh cc thng s nh gi cht lng m ta nghin cu trn. N cung cp s so snh tht nht gia cc giao thc. 3.1.2.1 Thng s di chuyn

N nh gi s chuyn ng trong mng bng cch tnh ton di chuyn ca nt mng lin quan gia cc cp nt trn mng. Thng s ny tng ng vi s thay i lin kt trong m hnh khi m nt mng di chuyn theo m hnh nh trc. Bng 3.1 Bng cc bin trong thng s di chuyn

V Huy Cng- T3- K49

48

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Tn bin Dist(nx, ny)t n i Ax(t) Mx T
t

Mod

M t Khong cch gia nt X v nt Y thi im t S nt mng Ch s Khong cch trung bnh gia cc nt x vi cc nt khc thi im t Di chuyn trung bnh ca nt x vi cc nt trong thi gian m phng Thi gian m phng Bc thi gian m phng Di chuyn trong ton b kch bn [m/s]

Bc 1: tnh khong cch trung bnh ca cc nt x vi cc nt khc trong mng c thc hin cc thi im t=0, t= 0 + X, t=0 + 2X, ... t = T, theo cng thc: (CT 3.4) Bc 2: Tnh di chuyn ca nt x theo cng thc: (CT 3.5) Bc 3: Tnh thng s di chuyn cho c kch bn: (CT 3.6)

2.4.3.1

Thi gian tm dng

Thi gian tm dng l mt bin u vo ca m phng. Khi s dng nh mt thng s nh gi, thi gian tm dng ca tt c cc nt trong m phng c s dng o kim thng s chuyn ng. Khi gi tr trung bnh cng ln th nt mng cng t di chuyn trong mng.

3.2 M HNH DI CHUYN M PHNG MNG AD HOC


Trong mng Ad hoc, nt mng di chuyn t v tr ny n v tr khc, nn kh khn khi tm ra m hnh di chuyn c th cho m phng. c th m phng giao thc nh

V Huy Cng- T3- K49

49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc tuyn th cn phi c s pht trin v s dng m hnh di chuyn cho nt mng, do vic xc nh m hnh di chuyn l rt quan trng. M hnh di chuyn yu cu phi m t di chuyn ca nt mng ging nh trong thc t, cn c s thay i v hng v tc di chuyn trong nhng khong thi gian hp l. Chc chn nt mng thc khng th di chuyn theo ng thng vi tc khng i trong sut qu trnh m phng. Vn tc c th thay i v gim n 0, tng t hng di chuyn cng s thay i. C rt nhiu m hnh p dng cho mng Ad hoc, c th tng ng vi tng ng cnh kch bn m phng, trong gii hn n cp mt s m hnh tiu biu.

3.2.1 M hnh di chuyn ngu nhin


M hnh di chuyn ngu nhin l m hnh di chuyn n gin da trn hng v vn tc ngu nhin, trong vn tc v hng hin ti ca hai hay nhiu nt mng hon ton c lp vi gi tr c ca chng. Do , m hnh s phi i mt vi hin tng khng ging thc t: dng t ngt, c vng quay nhn, ng di chuyn quanh co hon ton ngu nhin. khc phc vn ny, ngi ta c th thay i m hnh bng cch tnh ton vn tc hay hng di chuyn hoc c hai.

3.2.2 M hnh di chuyn hng ngu nhin vi vn tc khng i


y l m hnh sa i ca m hnh di chuyn ngu nhin nhng m bo tt c nt mng c gn cho mt vn tc nh nhau trong sut qu trnh m phng. Sau khi hng chn mt cch ngu nhin trong khong (0, 2), cc nt bt u di chuyn. Khi gp bin ca khu vc m phng, n ny khi bin vi mt gc xc nh bi hng n, cc nt di chuyn thao ng mi.

3.2.3 M hnh di chuyn Random Waypoint


M hnh ny c s dng thi gian tm dng khi thay i hng v vn tc. Hai hay nhiu nt mng mt v tr trong mt khong thi gian (thi gian tm dng). Khi ht thi gian tm dng, nt mng chn ngu nhin vn tc trong khong (0, maxspeed)

V Huy Cng- T3- K49

50

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 3.1 M hnh di chuyn Random Waypoint

3.2.4 M hnh di chuyn hng ngu nhin


M hnh ny khc phc nhc im ca m hnh Random Waypoint, do cc nt trong m hnh Random Waypoint thng chn cc ch mi v xc sut chn thng l trung tm khu vc m phng hoc ng i qua trung tm khu vc m phng. Khi cc nt mng c xu hng hi t, phn tn... trong m hnh di chuyn hng ngu nhin, cc nt chn hng thay v chn ch, sau n di chuyn theo hng n bin ca khu vc m phng, ngay khi n bin n dng li trong mt khong thi gian v chn hng khc (0, 180o) v tip tc qu trnh .

V Huy Cng- T3- K49

51

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 3.2 M hnh di chuyn hng ngu nhin TNG KT Vic la chn cc thng s nh gi giao thc v m hnh di chuyn l rt quan trng. Thng qua cc thng s , ta c th nh gi c im mnh cng nh im yu ca mt giao thc mng. Qua , ta c th la chn c giao thc ph hp cho nhng gi thit v yu cu t ra.

V Huy Cng- T3- K49

52

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

4 CHNG 4. M PHNG V NH GI THNG LNG CA AODV, OLSR, DSR V DYMO BNG OMNET++
Chng ny s gii thiu v cng c m phng giao thc nh tuyn mang Ad hc, m phng cc giao thc nh tuyn, gi thit u vo cho qu trnh m phng. Kt qu m phng v nh gi, kt lun.

4.1 GII THIU CHUNG V OMNET++


4.1.1 Tng quan v Omnet++
4.1.1.1 Omnet ++ l g ?

OMNeT++ l vit tt ca cm t Objective Modular Network Testbed in C++. OMNeT++ l mt ng dng cung cp cho ngi s dng mi trng tin hnh m phng hot ng ca mng. Mc ch chnh ca ng dng l m phng hot ng ca mng thng tin, tuy nhin do tnh ph cp v linh hot ca n, OMNeT++ cn c s dng trong nhiu lnh vc khc nh m phng cc h thng thng tin phc tp, cc mng kiu hng i (queing networks) hay cc kin trc phn cng OMNeT++ cung cp sn cc thnh phn tng ng vi cc m hnh thc t. Cc thnh phn ny (cn c gi l cc module) c lp trnh theo ngn ng C++, sau c tp hp li thnh nhng thnh phn hay nhng m hnh ln hn bng mt ngn ng bc cao (NED). OMNeT++ h tr giao din ha, tng ng vi cc m hnh cu trc ca n ng thi phn nhn m phng (simulation kernel) v cc module ca OMNeT++ cng rt d dng nhng vo trong cc ng dng khc. 4.1.1.2 Cc thnh phn chnh ca OMNeT++

Trong OMNeT++ c cc thnh phn chnh sau: Th vin phn nhn m phng (simulation kernel)

V Huy Cng- T3- K49

53

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Trnh bin dch cho ngn ng m t tnh trng (topology description

language) NED (nedc) (GNED) Giao din ha thc hin m phng, cc lin kt bn trong cc file thc Trnh bin tp ha (graphical network editor) cho cc file NED

hin m phng (Tkenv) Giao din dng thc hin m phng (Cmdenv) Cng c (giao din ha) v th kt qu vector u ra (Plove) Cng c (giao din ha) m t kt qu v hng u ra

(Scalars)Cng c ti liu ha cc m hnh 4.1.1.3 Cc tin ch khc Cc ti liu hng dn, cc v d m phng ng dng OMNeT++ l mt cng c m phng cc hot ng mng bng cc module c thit k hng i tng. OMNeT++ thng c s dng trong cc ng dng ch yu nh: M hnh hot ng ca cc mng thng tin M hnh giao thc M hnh ha cc mng kiu hng i M hnh ha cc h thng a b vi x l (multiprocessor) hoc cc h thng

phn cng theo cc m hnh phn tn khc (distributed hardware systems) 4.1.1.4 M hnh trong OMNeT++ 54 nh gi kin trc phn cng nh gi hiu qu hot ng ca cc h thng phc tp

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Mt m hnh trong OMNeT++ bao gm cc module lng nhau c cu trc phn cp. su ca cc module lng nhau l khng gii hn, iu ny cho php ngi s dng c th biu din cc cu trc logic ca cc h thng trong thc t bng cc cu trc m hnh. Cc module trao i thng tin vi nhau thng qua vic gi cc message. Cc message ny c th c cu trc phc tp ty . Cc module c th gi cc message ny theo hai cch, mt l gi trc tip ti a ch nhn, hai l gi i theo mt ng dn c nh sn, thng qua cc cng v cc kt ni. Cc module c th c cc tham s ca ring n. Cc tham s ny c th c s dng chnh sa cc thuc tnh ca module v biu din cho topology ca m hnh. Cc module mc thp nht trong cu trc phn cp ng gi cc thuc tnh. Cc module ny c coi l cc module n gin, v chng c lp trnh trong ngn ng C++ bng cch s dng cc th vin m phng. Mt m hnh trong OMNeT++ cha cc module lng nhau c cu trc phn cp, trao i thng tin vi nhau bng cch gi cc message. Mi m hnh ny thng biu din cho mt h thng mng. Module mc cao nht trong cu trc phn cp c gi l module h thng. Module ny c th cha cc module con, cc module con cng c th cha cc module con ca ring n. su phn cp i vi cc module l khng gii hn, iu ny cho php ngi s dng c th d dng biu din mt cu trc logic ca mt h thng trong thc t bng cu trc phn cp ca OMNeT++. Cu trc ca m hnh c th c m t bng ngn ng NED ca OMNeT++

Hnh 4.1 Cc module n gin v kt hp Cc module c th cha nhiu module con v c gi l module kt hp. Cc module n gin l cc module c cp thp nht trong cu trc phn cp. Cc module

V Huy Cng- T3- K49

55

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc n gin cha cc thut ton ca m hnh. Ngi s dng trin khai cc module n gin bng ngn ng C++, s dng cc th vin m phng ca OMNeT++. Cc module trao i thng tin bng vic gi cc message. Trong thc t, message c dng khung (frame) hoc l cc gi tin (packet) c truyn i trong mng. Cc message c th c cu trc phc tp ty . Cc module n gin c th gi cc message i mt cch trc tip n v tr nhn hoc gi i theo mt ng dn nh sn thng qua cc cng (gates) v cc lin kt (links). Cc cng (gates) l cc cng vo, ra ca cc module. Message c gi i qua cc cng ra v c nhn vo thng qua cc cng vo. Mi kt ni (connection) hay cn gi l lin kt (link) c to bn trong mt mc n trong cu trc phn cp ca cc module: bn trong mt module kt hp, mt kt ni c th c to ra gia cc cng tng ng ca hai module con, hoc gia cng ca module con vi cng ca module kt hp.

Hnh 4.2 Cc kt ni Tng ng vi cu trc phn cp ca mt m hnh, cc message thng di chuyn qua mt lot cc kt ni vi im bt u v kt thc l cc module n gin. Tp cc kt ni i t mt module n gin v n mt module n gin c gi l route.

4.1.2 S dng OMNeT++


4.1.2.1 Xy dng v chy th cc m hnh m phng 56

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc a. Mt m hnh OMNeT++ bao gm nhng phn sau Ngn ng m t topology NED (file c phn m rng .ned): m t cu

trc ca module vi cc tham s, cc cng Cc file.ned c th c vit bng bt k b son tho hoc bt k b son tho hoc s dng chng trnh GNED c trong OMNeT++ nh ngha cu trc ca cc message (cc file c phn m rng .msg):

Ngi s dng c th nh ngha rt nhiu kiu message v thm cc trng d liu cho chng. OMNeT++ s dch nhng nh ngha ny sang cc lp C++ y . M ngun ca cc module n gin. y l cc file C++ vi phn m

rng l .h hoc .cc. b. H thng m phng cung cp cho ta cc thnh phn sau Phn nhn m phng. Phn ny cha code qun l qu trnh m phng

v cc th vin lp m phng. N c vit bng C++, c bin dch v c t cng dng vi cc file th vin (cc file c phn m rng l .a hoc .lib). Giao din ngi s dng. Giao din ny c s dng khi thc hin qu

trnh m phng, to s d dng cho qu trnh sa li, biu din (demonstration) hoc khi thc hin m phng theo tng khi (batch execution of simulations). C mt vi kiu giao din trong OMNeT++, tt c u c vit bng C++, c bin dch v t cng nhau trong cc th vin (cc file c phn m rng l .a hoc .lib) c. Thc hin m phng v phn tch kt qu Cc chng trnh thc hin m phng (the simulation executable) l cc chng trnh c lp, tc l n c th chy trn cc my khc khng ci t OMNeT++ hay cc file m hnh tng ng. Khi chng trnh khi ng, n bt u c file cu hnh (thng thng l file omnetpp.ini). File ny cha cc thit lp iu khin nhiu qu trnh m phng, trong trng hp n gin nht l cc qu trnh m phng ny s c thc hin ln lt bi mt chng trnh m phng (simulation program).

V Huy Cng- T3- K49

57

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc u ra ca qu trnh m phng l cc file d liu. Cc file ny c th l cc file vector, cc file v hng hoc cc file ca ngi s dng. OMNeT++ cung cp mt cng c ha Plove xem v v ra ni dung ca cc file vector. Tuy nhin chng ta cng nn hiu rng kh m c th x l y cc file kt qu m ch dng ring OMNeT++; cc file ny u l cc file c nh dng c th c c bi cc gi x l ton hc ca cc chng trnh nh Matlab hay Octave, hoc c th c a vo tnh ca cc chng trnh nh OpenOffice Calc, Gnumeric hay Microsoft Excel. Tt c cc chng trnh ny u c chc nng chuyn dng trong vic phn tch s ha, v biu din (visualization) vt qua kh nng ca OMNeT++. Cc file v hng cng c th c biu din bng cc cng c Scalar. N c th v c cc biu , cc th da vo tp hp cc ta (x,y) v c th xut d liu vo clipboard c th s dng trong cc chng trnh khc nhm a nhng phn tch chi tit hn. d. Giao din ngi s dng Mc ch chnh ca giao din ngi s dng l che nhng phn phc tp bn trong cu trc ca cc m hnh i vi ngi s dng, d dng iu khin qu trnh m phng, v cho php ngi s dng c kh nng thay i cc bin hay cc i tng bn trong ca m hnh. iu ny l rt quan trng i vi pha pht trin v sa li trong d n. Giao din ha cng c th c s dng trnh din hot ng ca m hnh. Cng mt m hnh ngi s dng c th trn nhiu giao din khc nhau m khng cn phi thay i g trong cc file m hnh. Ngi s dng c th kim th v sa li rt d dng qua giao din ha, cui cng c th chy n da trn mt giao din n gin v nhanh chng c h tr thc hin theo khi (batch execution) e. Cc th vin thnh phn Cc kiu module c th c lu ti nhng v tr c lp vi ch m chng thc s c s dng. c im ny cung cp cho ngi s dng kh nhm cc kiu module li vi nhau v to ta cc th vin thnh phn. f. Cc chng trnh m phng c lp V Huy Cng- T3- K49 58

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Cc chng trnh thc hin qu trnh m phng c th c lu li nhiu ln, khng ph thuc vo cc m hnh, s dng cng mt thit lp cho cc module n gin. Ngi s dng c th ch ra trong file cu hnh m hnh no s c chy. iu ny to kh nng cho ngi s dng c th xy dng nhng chng trnh thc hin ln bao gm nhiu qu trnh m phng, v phn phi n nh mt cng c m phng c lp. Kh nng linh hot ca ngn ng m t topology cng h tr cho hng tip cn ny. 4.1.2.2 Chy cc ng dng trong OMNeT++

Nh trnh by phn m u, mt h thng mng m phng trong OMNeT++ gm cc thnh phn sau: Windows) Qu trnh xy dng mt chng trnh m phng u tin, dch cc file NED v cc file message thnh C++, s dng NED Cc file.ned m t topo mng. Cc file c phn m rng .msg cha khai bo cc message. Cc file C++ (c phn m rng l .cc trong UNIX hoc .cpp trong

compiler (nedc) v message compiler (opp_msgc). Qu trnh tip theo ging nh bin dch m ngun C/C++ Trong Linux: cc file .cc file.o. Trong Windows: cc file .cpp file .obj. Sau tt c cc file trn s c lin kt (link) vi cc th vin cn thit

to thnh file .exe. C th ta cn phi lin kt vi cc th vin sau: Phn nhn m phng c gi l sim_std (nh cc file libsim_std.a,

sim_std.lib, etc)

V Huy Cng- T3- K49

59

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc Giao din ngi dng: cung cp th vin mi trng (file libenvir.a, etc)

v cc tin ch tkenv v cmdenv (libtkenv.a, libcmdenv.a, etc). Cc file .o (hoc .obj) phi c lin kt ti th vin mi trng cng vi hoc tkenv hoc cmdenv. Hnh di y cho chng ta hnh nh qu trnh x l khi m hnh c xy dng v hot ng

File m t cu trc mng

*.ned
NEDC compling File m t cu trc mng sau khi dch *_n.cc

File x l ca simple modules *.cc

Th vin li ca chng trnh m phng *.lib / *.a

Th vin giao din ngi dng *.lib / *.a

C++ compiling Linking Chng trnh m phng File cu hnh Omnetpp.ini

Chy chng trnh

File kt qu *.vec, *.sna, *.sca

Hnh 4.3 Lc xy dng v chy mt chng trnh m phng OMNeT++ V Huy Cng- T3- K49 60

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc *.ned l cc file m t topo mng cng nh cu trc ca cc modul, n s dng ngn ng NED (Nework Description ), l ngn ng chuyn bit dng ring cho OmNet+ +. S pht trin tip theo ca NED l GNED (Graphic NED) lm cho vic m t topo mng c trc quan hn bng cch dng cc cng c ho m t. Cc file ned sau c NEDC (NED compiler) dich sang code C++ m t cu trc mng sang ngn ng C++ di dng file *_.cc. Cc file x l ca cc simple moduls l phn ct li khi vit chng trnh m phng v c vit bng ngn ng C++ bng cch k tha cc lp c sn ca OmNet++, ngi vit trin khai cc hot ng ca mng nh nh tuyn, x l gi tin n v i, xc nh hnh vi ca cc simple modul c m t trong *.ned khi c s kin xy ra vi n. Th vin li ca chng trnh m phng c cung cp bi OmNet++, n bao gm rt nhiu cc lp v cc hm c sn phc v cho chng trnh m phng nh cc lp cSimplemodul, cMessage..., cc hm ngu nhin Th vin giao din ngi dng cung cp giao din cho chng trnh m phng. OmNet++ vi cc phin bn gn y s dng hai kiu giao din l giao din dng lnh cmd (command) v giao din ho da trn tcl/tk. Giao din ho rt trc quan nn c a dng hn. Sau khi dch v lin kt ta c mt chng trnh m phng da trn nn OmNet++. File omnetpp.ini khi ng cc gi tr cn thit. omnetpp.ini do ngi lp trnh vit, n rt quan trng chy mt chng trnh m phng vi cc tham s c thay i c c kt qu thng k mong mun. Cui cng l cc file kt qu bao gm file *.vec l cc file vector, n l cc bin thay i theo thi gian trong qu trnh m phng, gi tr ca bin v thi gian tng ng c lu vo file ny. Trong qu trnh vit code s xc nh bin no c lu. File *.sna phc v cho qu trnh sa li. File *.sca (scalar file) lu cc gi tr thng k c c sau khi kt thc m phng, v d nh s cuc gi thc hin s cuc gi b t chi x l kt qu thng k t c, ta c th vit mt chng trnh nh hoc s dng cc

V Huy Cng- T3- K49

61

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc cng c c sn. OmNet++ cung cp chng trnh Plove v cc file *.vec, cn i vi cc file *.sca ta c th dng mt chng trnh tnh ton bt k.

4.2 M PHNG
4.2.1 Khi to m phng
Trong tt c cc kch bn m phng, n s dng m hnh di chuyn Random Waypoint vi cc thng s sau:

Vn tc ti a speedmax: bt k thi im no vn tc c gi tr ngu nhin trong khong [0, speedmax].

S nt mng: gi tr ny khng thay i trong ton b qu trnh m phng, n s dng 25 nt mng trong kch bn m phng. Kch c mi trng m phng: n s dung khu vc m phng 500x500m cho ton b kch bn m phng. Thi gian m phng : 300s cho tt c kch bn m phng. Thi gian tm dng: thay i vi cc gi tr 0, 100, 200, 300.

4.2.2 Mt s hnh nh m phng


Sau y l tun t cc qu trnh ca DYMO: Khm ph tuyn bng cch gi RREQ, gi bn tin RREP, gi gi tin d liu, v gi ACK bo nhn.

V Huy Cng- T3- K49

62

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Trc khi gi gi tin ti mt ch, mt nt s kim tra trong B nh tuyn ca n c tuyn ti ch hay khng. Nu khng c, n s gi bn tin RREQ Khm ph tuyn (hnh 4.4).

V Huy Cng- T3- K49

63

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 4.4 Qu trnh gi bn tin RREQ ca DYMO

Cc nt nhn c bn tin RREQ, nu nt l ch hoc bit mt tuyn ng ti ch, n s gi li bn tin RREP v ngun (hnh 4.5)

V Huy Cng- T3- K49

64

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 4.5 Qu trnh gi bn tin RREP ca DYMO

Nh vy, nt ngun c mt tuyn ti ch v n thc hin qu trnh gi gi tin d liu hnh (hnh 4.6).

V Huy Cng- T3- K49

65

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 4.6 Qu trnh gi gi tin d liu ca DYMO

Nt ch nhn c gi tin d liu, n s gi ACK ti nt ngun xc nhn n nhn c gi t nt ngun (hnh 4.7).

V Huy Cng- T3- K49

66

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 4.7 Qu trnh gi ACK bo nhn ca DYMO

4.2.3 Kt qu m phng cc giao thc nh tuyn mng Ad hoc


Bng 4.1 Bng thng s nh gi dng trong m phng

V Huy Cng- T3- K49

67

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Thng s Phm vi truyn dn Bng thng Thi gian m phng Kch thc mi trng m phng Loi lu lng Tc gi gi tin Kch thc gi tin S nt S ngun gi gi tin Tc ti a

Gi tr 250m 54Mbps (802.11g) 300s 500m x 500m CBR 4 packet/s 512 bytes 25 5 20m/s

Kch bn l mt phn rt quan trng trong m phng, y n a ra 4 gi tr cn o cho thi gian tm dng ca nt mng: 0, 100, 200, 300. Thi gian tm dng bng 0, nt mng chuyn ng lin tc; thi gian tm dng bng 300, nt mng coi nh ng yn (khng chuyn ng). Cc nt bt u gi gi tin d liu sau 60s (mng hi t). 4.2.3.1 Thng lng u cui - u cui

V Huy Cng- T3- K49

68

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

Hnh 4.9 Thng lng u cui - u cui Qua biu thng lng < hnh 4.9 > ta nhn thy thng lng t l thun vi gi nhn. Thng lng ca DYMO l cao nht do DYMO l giao thc nh tuyn hot ng theo yu cu hoc theo bng iu khin,l s ti u ca DSR v AODV.Khi cc nt mng chuyn ng lin tc,thng lng ca DYMO vn rt cao Thng lng ca OLSR cao hn AODV v DSR v OLSR c th p ng khi topo mng thay i, n cho php khm ph tuyn nhanh chng ti cc hng xm v cc MPR ca chng thit lp kt ni vi cc nt khc Khi mc di chuyn tng (gim pausetime) th thng lng ca 3 giao thc DSR, AODV, OLSR gim r rt vi mc gim tng ng nhau.Trong khi th DYMO th hin c s n nh ca mnh khi c thng lng kh cao.OLSR c thng lng cao hn AODV v DSR

4.2.4 nh gi v kt lun
Trong mi trng kch c trung bnh v s lng nt nh, khi mt di chuyn, hay tc pht gi tng dn th DYMO l giao thc hot ng kh n nh khi c t l gi nhn cao hn so vi cc giao thc khc. Tuy nhin, theo mt s kt qu nghin cu cho thy DYMO li to ra kh nhiu bn tin nh tuyn so vi AODV v DSR. Do vy, khng th khng nh DYMO l mt giao thc ti u. Hin nay cha c mt giao thc no c th p ng y yu cu vi mt giao thc nh tuyn trong mng Ad hoc. Cc giao thc cn c ci tin hn na c th p ng c cho mng Ad hoc ng thi h tr multicast, QoS, bo mt

V Huy Cng- T3- K49

69

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

5 CHNG 5. KT LUN
Mng Ad hoc hin ang tham gia vo mi mt ca cuc sng v ha hn s pht trin mnh m trong tng lai. Do l mt phn cng ngh ca mng khng dy nn mng Ad hoc c tha hng nhiu u im ca mng khng dy hin nay v ng thi cng c nhng u th c bit m cc mng khc khng c. n l s nhn nhn tng quan v mng Ad hoc. Ngoi ra, n cng tp trung vo nghin cu cc giao thc nh tuyn mng Ad hoc hin nay, c th l bn giao thc DYMO, DSR, AODV, OLSR. ng thi s dng cng c m phng OMNET++ phn tch nh gi cht lng giao thc nh tuyn mng Ad hoc (DYMO, DSR, AODV, OLSR). Qua , chng ta thy c th mnh v hn ch ca tng loi giao thc; khng c giao thc no p ng tiu chun mng Ad hoc v mt QoS, bo mt. Mng Ad hoc vn cn l mt cng ngh mi trong vi nm gn y Vit Nam v cha c nhiu kt qu th nghim, nh gi v n. Do , vic tham gia rt hn ch, vi ngi nghin cu ch c cch dng m phng. Chnh v vy, nh hng pht trin ca V Huy Cng- T3- K49 70

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc em l ngoi vic nghin cu l thuyt, s tm hiu su hn v cng c m phng OMNET++ c kt qu m phng chnh xc v y . ng thi em s i su tm hiu v kh nng trin khai mng Ad hoc vo thc tin ti Vit Nam. Trong tng lai, em mong mun s tip tc nghin cu v vn ny cng nh pht trin m rng n. Cng do thi gian nghin cu nn khng trnh khi thiu st, em rt mong nhn c s nhn xt, ng gp kin ca cc thy c trong b mn cng nh trong khoa n ca em v nhng nghin cu sau ny s cn thnh cng hn na. Mt ln na em xin chn thnh cm n thy Nguyn Trung Dng B mn H thng vin thng Khoa in t vin thng Trng i hc Bch Khoa H Ni nhit tnh hng dn, ch bo v nh hng cho chng em thc hin thnh cng n. H Ni, thng 5 nm 2009. Sinh vin

V Huy Cng

TI LIU THAM KHO


[1] Subir Kumar Sarkar, T G Basavaraju, C Puttamadappa, Ad hoc Mobile Wireless Network Principles, protocols, and Applications, Auerbach Publications, 2007. [2] Amitabh Mishra, Security and quality of service in Ad hoc wireless networks, Cambridge University Press, 2008. [3] Prasant Mohapatra and Srikanth Krishnamurthy, Ad hoc network Technologies and Protocols, Spinger Science and Business Media, 2005. [4] Michel Barbeau and Evangelos Kranakis, Principles of Ad hoc networking, Wiley, 2007. [5] Krishna Gorantala, Routing Protocols in Mobile Ad hoc network, June 15, 2006. [6] Jabson Andres, Metric in Ad hoc networks, Master thesis, 2000. [7] Narendra Singh Yadav and R.P.Yadav, The Effects of Speed on the Performance of Routing Protocols in Mobile Ad-hoc Network.

V Huy Cng- T3- K49

71

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc [8] Azzedine Boukerche, Algorithms and protocols for wireless and mobile Ad hoc network, Wiley, 2009. [9] A. Boukerche, Performance Evaluation of Routing Protocols for Ad Hoc Wireless Networks, Mobile Networks and Applications, 9, pp. 333-342, 2004. [10] Samir R. Das, Performance Comparison of Two On-demand Routing Protocols for Ad Hoc Networks, Division of Computer Science The University of Texas at San Antonio San Antonio, TX 78249-066 U.S.A.
[11] Sehrish Abrejo, Asadullah Shah, Kamran Khowaja, Asma Ansari Pakistan Analysis

of MANET Routing Protocols using Scenario Based Mobility Models, Department of Computer Science Isra University, Hyderabad. [12] Ashwini Kumar Pandey,Study of MANET Routing Protocols by Simulation Experiments,Department of Computer Science Southern Illinois University Edwardsville
MAY 2004

[13] Farooq Anjum and Petros Mouchtaris, Security for wireless Ad hoc networks , Wiley, 2007
[14] Georgios Koltsidas and Fotini-Niovi Pavlidou, Single-path and Multipath Routing

Algorithms for Mobile Ad Hoc Networks, Dept. of Electrical and Computer


Engineering, Aristotle University of Thessaloniki, Thessaloniki, Greece

[15] S. Gowrishankar, T.G. Basavaraju, M. Singh, Subir Kumar Sarkar , Scenario based Performance Analysis of AODV and OLSR in Mobile Ad hoc Networks, Jadavpur University, Acharya Institute of Technology India [16] http://tools.ietf.org/html/draft-ietf-manet-aodv-09 [17] http://tools.ietf.org/html/draft-ietf-manet-dymo-17 [18] http://hipercom.inria.fr/olsr/draft-ietf-manet-olsr-11.txt [19] http://www.ietf.org/proceedings/04mar/I-D/draft-ietf-manet-dsr-09.txt

V Huy Cng- T3- K49

72

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

BNG THUT NG VIT TT


Ch vit tt ABR ACK AODV AP BS CBR DEST DHCP DSDV DSR DYMO FDMA Id Ch y Associativity-Based Routing Acknowledgement Ad Hoc On-Demand Distance Vector Ch ting Vit nh tuyn theo lin kt Bo nhn giao thc inh tuyn vector khoang cach theo yu cu Ad hoc Access point im truy cp Base station Trm gc Constant Bit Rate Tc bit c nh Destination ch Dynamic host configuration protocol Giao thc cu hnh host ng Destination sequenced distance vector nh tuyn vector khong cch tun t n ich Dynamic source routing nh tuyn ngun ng Dynamic MANET On-demand Frequency division multiple access a truy cp phn chia theo sng Identifcation Nhn dng 73

V Huy Cng- T3- K49

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc IEEE IN IP LAN MAC MANET MIP OLSR PDA QoS RPC SRC TCP TTL VANET WLAN Institute of electrical and electronics Hc vin k s in v in t engineers Intermediate Trung gian Internet protocol Local area network Mng cc b Media access control iu khin truy cp ng truyn Mobile ad hoc network Mng di ng khng dy ty bin Mobile IP Optimized Link State Routing nh tuyn trng thi lin kt ti u Personal digital assistant My tr l c nhn dng k thut s Quality of service Cht lng dch v Remote Procedure Call Source Ngun Transmission power control iu khin cng sut truyn Time to Live Thi gian sng Vehicular Ad Hoc Network Mng xe c ad hoc Wireless local area network Mng khng dy cc b

PH LC
M ngun chng trnh File omnetpp.ini [General] #debug-on-errors = true sim-time-limit = 300s seed-0-mt = 5 num-rngs = 2 network = inet.examples.adhoc.grid_aodv.Grid_movilidad cmdenv-express-mode = true tkenv-plugin-path = ../../../Etc/plugins #tkenv-default-run=1 description = "Aodv Simple test" V Huy Cng- T3- K49 74

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

**.vector-recording = false cmdenv-express-mode = true *.numHosts =25 *.nodeSeparation = 150 *.playgroundSizeX = 500 *.playgroundSizeY = 500 **.channelNumber = 0 **.numberOfChannels = 1 **.debug = true **.coreDebug = false **.channelNumber = 0 **.wlan.mgmt.frameCapacity = 10 # channel physical parameters *.channelcontrol.carrierFrequency = 2.4GHz *.channelcontrol.pMax = 2.0mW *.channelcontrol.sat = -110dBm *.channelcontrol.alpha = 2 *.channelcontrol.numChannels = 1 # udp apps (on) **.host[*].udpAppType="UDPBasicBurst" **.host[*].numUdpApps=1 **.host[0].udpApp[0].destAddresses ="random_name(host)" **.host[1].udpApp[0].destAddresses="random_name(host)" **.host[2].udpApp[0].destAddresses="random_name(host)" **.host[3].udpApp[0].destAddresses="random_name(host)" **.host[4].udpApp[0].destAddresses="random_name(host)"

**.host[*].udpApp[0].destAddresses=""

V Huy Cng- T3- K49

75

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc **.udpApp[0].localPort=1234 **.udpApp[0].destPort=1234 **.udpApp[0].messageLength=512B # Bytes **.udpApp[0].messageFreq = 0.25s **.udpApp[0].message_freq_jitter=uniform(-0.001s,0.001s,1) **.udpApp[0].burstDuration = 0s #uniform(1,4,1) **.udpApp[0].activeBurst=true # if false all packet to the same address, if true select new destination per burts **.udpApp[0].time_off = 0s # uniform(10,20,1)) **. udpApp[0].time_begin = 60s **.udpApp[0].limitDelay =20s **.udpApp[0].rand_generator=1 **.udpApp[0].time_end=0s

**.host*.mobilityType = "inet.mobility.NullMobility" **.host*.mobility.speed = 20mps #uniform(0mps,20mps) **.host*.mobility.updateInterval = 0.1s **.host*.mobility.scrollX = 50 **.host*.mobility.scrollY = 50 **.host*.mobility.nodeId = -1

# tcp apps (off) **.numTcpApps=0 **.tcpAppType="TelnetApp" # ip settings **.routingFile="" **.ip.procDelay=10us # **.IPForward=false # ARP configuration **.networkLayer.proxyARP = true # Host's is hardwired "false" **.arp.retryTimeout = 1s **.arp.retryCount = 3 **.arp.cacheTimeout = 100s

V Huy Cng- T3- K49

76

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc

# manet routing **.manetrouting.manetmanager.routingProtocol = "DYMO"# DSR/AODV/OLSR # nic settings **.wlan.mgmt.frameCapacity = 10 **.wlan.mac.address = "auto" **.wlan.mac.maxQueueSize = 14 **.wlan.mac.rtsThresholdBytes = 3000B **.wlan.mac.bitrate = 54Mbps **.wlan.mac.basicBitrate = 24Mbps # 24Mbps **.wlan.mac.retryLimit = 7 **.wlan.mac.cwMinData = 31 **.wlan.mac.cwMinBroadcast = 31 **.wlan.mac.opMode = 2 # 802.11g **.wlan.mac.slotTime = 9us # **.wlan.mac.AIFSN = 2 #DIFS # channel physical parameters *.channelcontrol.carrierFrequency = 2.4GHz *.channelcontrol.pMax = 2.0mW *.channelcontrol.sat = -110dBm *.channelcontrol.alpha = 2 *.channelcontrol.numChannels = 1 **.wlan.radio.transmitterPower = 2.0mW **.wlan.radio.pathLossAlpha = 2 **.wlan.radio.snirThreshold = 4dB # in dB **.wlan.radio.bitrate = 54Mbps **.wlan.radio.thermalNoise = -110dBm **.wlan.radio.sensitivity = -85dBm **.wlan.radio.phyOpMode = 2 #1/2 802.11b/802.11g-only **.wlan.radio.channelModel = 1 #1/2 rayleigh/awgn **.wlan.radio.berTableFile = "per_table_80211g_Trivellato.dat" **.broadCastDelay=uniform(0s,0.005s)

V Huy Cng- T3- K49

77

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc #/ parameters : DYMOUM **.no_path_acc_ = false **.reissue_rreq_ = false **.s_bit_ = false **.hello_ival_ = 0 **.MaxPktSec = 20 #// 10 **.promiscuous = false **.NetDiameter = 10 **.RouteTimeOut = 3000 **.RouteDeleteTimeOut = 3000*5 #//5*RouteTimeOut **.RREQWaitTime = 1000 **.RREQTries = 3 **.noRouteBehaviour = 1 # // parameters: AODVUU; **.log_to_file = false **.hello_jittering = true **.optimized_hellos = true **.expanding_ring_search = true **.local_repair = true **.rreq_gratuitous = true #**.debug = false **.rt_log_interval = 0 **.unidir_hack = 0 **.internet_gw_mode = 0 **.receive_n_hellos = 1 **.ratelimit = 1000 **.llfeedback = false# //1000 **.wait_on_reboot = 0 **.active_timeout = 6000 # // time in ms **.internet_gw_address = "0.0.0.0" # // parameters: DSRUU; **.PrintDebug = true **.FlushLinkCache = true **.PromiscOperation = false **.UseNetworkLayerAck = false

V Huy Cng- T3- K49

78

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc **.BroadCastJitter = 20 # 20 ms **.RouteCacheTimeout = 300 #300 seconds **.SendBufferTimeout = 300# //30 s **.SendBufferSize = -1 **.RequestTableSize = -1 **.RequestTableIds = -1 **.MaxRequestRexmt = -1 #// 16, **.MaxRequestPeriod = 10 #//10 SECONDS **.RequestPeriod = 500 #//500 MILLISECONDS **.NonpropRequestTimeout = 30# //30 MILLISECONDS **.RexmtBufferSize = -1 #//MAINT_BUF_MAX_LEN **.MaintHoldoffTime = 250# //250 MILLISECONDS **.MaxMaintRexmt = 2 # //2 **.TryPassiveAcks = true #//1 **.PassiveAckTimeout = 100# //100 MILLISECONDS **.GratReplyHoldOff = 1 #, //1 SECONDS **.MAX_SALVAGE_COUNT = 15 # //15 **.LifoSize = 20 **.PathCache = true **.ETX_Active = false **.ETXHelloInterval = 1 #, // Second **.ETXWindowNumHello = 10 **.ETXRetryBeforeFail = -1 **.RREPDestinationOnly = false **.RREQMaxVisit = 5 # // Max Number that a RREQ can be processes by a node #// Olsr **.Willingness = 3 **.Hello_ival = 2 **.Tc_ival = 5 **.Mid_ival = 5 **.use_mac = 0 #1 **.Mpr_algorithm = 1 **.routing_algorithm = 1 **.Link_quality = 2 **.Fish_eye = false **.Tc_redundancy = 3

V Huy Cng- T3- K49

79

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc **.Link_delay = true #//default false **.C_alpha = 0.2 #// DSDV **.manetroutingprotocol.hellomsgperiod_DSDV = 1 # //Period of DSDV hello message generation [seconds] **.manetroutingprotocol.manetroutingprotocol.timetolive_routing_entry = 5 # // ; [seconds] **.netmask = "255.255.0.0" # // **.MaxVariance_DSDV = 1 **.RNGseed_DSDV = 0

seed-0-mt = 1209575029 seed-1-mt = 449294716 **.host*.mobility.traceFile = "esce_10_no_pausa.1" File .awk BEGIN { sends = 0; receives = 0; sum_delay = 0; simulation = 0; numSent = 0; numReceived = 0; numReceivedOther = 0; routing =0; t = 0; } { # CALCULATE PACKET DELIVERY FRACTION if ($3 == "Total_send") { sends += $4; t++;} if ($3 == "Total_received") { receives += $4; } if ($3 == "sum_delay") { sum_delay += $4; } if ($3 == "simtime") { simulation += $4; } if ($3 == "numSent") { numSent += $4; } if ($3 == "numReceived") { numReceived += $4; } if ($3 == "Routing-overhead") { routing += $4; }

V Huy Cng- T3- K49

80

nh gi thng lng ca cc giao thc nh tuyn trong mng Ad hoc if ($3 == "numReceivedOther") { numReceivedOther += $4; } } END { printf("Totalsends(pkts) = %.8f\n",sends); printf("Totalreceives(pkts) = %.8f\n",receives); printf("mean_delay = %.8f\n",sum_delay/receives); printf("packet delivery ratio = %.8f\n",(receives)/(sends)); printf("simulation_time(s) = %.8f\n",simulation/t); printf("throughput(pkts/s) = %.8f\n",(receives/simulation)); printf("numSent= %.8f\n", numSent); printf("numReceived= %.8f\n", numReceived); printf("numReceivedOther=%.8f\n", numReceivedOther); printf("normalized-routing-overhead=%.8f\n", routing/sends); }

V Huy Cng- T3- K49

81