Đề tài Vấn đề năng lượng trong mạng Wireless sensor thực hiện nghiên cứu với mục đích để tìm hiểu các vấn đề liên quan tới năng lượng trong mạng Wireless Sensor, từ đó đưa ra các giải pháp tiết kiệm năng lượng trong mạng và tận dụng các nguồn năng lượng sạch trong tự nhiên. Mời các bạn cùng tham khảo.
Me GIAO DVC DAO T40 TRUONG DANI HQC THANG LONG o0o- ICHOA LUAN TOT NGHItP VAN DE NANG LIMNG TRONG 1VIANG WIRELESS SENSOR GIAO VIEN HUONG DAN: Tim HOANG TRQNG MINH SINH VIEN THIJC HIEN : NGUYEN HUNG CUONG MA SINH VIEN : A13570 CHUYEN NGANH : MANG MAY TiNH VA VIEN THONG HA NQI - 2013 MtJC LVC CHUONG TONG QUAN VE MANG CAM BIEN KHONG DAY 1.1 Gild thieu mong cam Min killing day 1.2 Nan tang ghat trim mgng 1.2.1 Mong Ad hoc khong day 1.2.2 Nen tang cong nghe 1.3 M8 to thing 1.3.1 MO to he thong tong qudt 1.12 He tang WISENET 1.4 T6ng quan ye Ian tree mgng 11 1.4.1 Ldp sing dung 13 1.4.2 Lop giao van 15 1.4.3 Lop aging 15 1.4.4 Lien kit lien mgng 16 1.4.5 Lop lien kit so lieu 16 1.4.6 Lap vat lir 19 1.5 Dec diim cfia mgng Wireless Sensor 19 1.5.1 Kich think vat ly nh6 va lieu thy tong salt tap 19 1.5.2 Hogt ddng diing thai vbi dd tap cao 20 1.5.3 KM nang lien kit vat ly va pan alp dieu khien bon chi 20 1.5.4 TInh da dgng thiit a va sit dung 1.5.5 Hogt Ong tin cdy 20 21 1.6 'Ong dgng cis mong Sensor 21 1.6.1 eing dung qudn sv 21 1.6.2 ling dung ve mot trtrang 23 1.6.3 ring dung y ti 24 1.6.4 ling dung gia dinh 24 1.6.5 Cdc sing dung thuang mot ;cat 25 CHUONG NANG LONG TRONG MANG WIRELESS SENSOR 2.1 Tinh dee the cilia mgng 2.1.1 Hon chi pan fling 27 27 27 2.1.2 Mai trudng hoot ?tang 28 2.1.3 Mai Mien truyin din 29 2.2 Sy Wu thy ning Ivgng 30 2.2.1 Nang luang cho nhiem vy cdm Min 31 22.2 Nang luang cho truyin thong 31 2.2.3 Nang Wang cho xu III 32 2.3 Cie giii phip fiat kiim ning hrqng 2.3.1 Gidi phdp djnh tuyin 2.4 Gild phip tray nh$p mai trwirng Irwin din 32 32 40 2.4.1 Quanli nguan cong suit 44 2.4.2 Tan dung ctic nguan ?tang ligmg ty nhien 48 CIlliONG GIOI THI$U PHAN MEM M6 PHONG NANG LUVNG CHO 51 MSNG WIRELESS SENSOR 3.1 Ma hlnh hol ma phang 51 3.2 M8 hinh npon fling Iwyng 51 3.3 Thiit Id plan mim ma phang myng Wireless Sensor 52 3.3.1 Phan ndm NS-2 52 3.3.1 Ca sa phdt triin mo phong man Sensor tren nkt NS-2 55 3.3.1 Cdc djnh clang mai NS-2 56 3.3.4 Thay dal NS-2 58 3.4 M8 phang mpg Wireless Sensor 60 14.1 Myc dinh mo phdng 60 3.4.2 Tiger hien ma pitting 61 14.1 Kit qua 64 3.4.4 Danh gid 67 10ET LUAN 69 TM lien tham khio 70 - DANH MVC CAC HINH ANH, BANG Hinh U M45 hInh then khai cic not Sensor Hinh 1.2 Cic Minh phin dm nut Sensor Hlnh 1.3 Su d6 he thong WISENET Hinh 1.4 TrInh to hoot Ong cia Server 10 Hinh 1.5 Cic thinh phin but Sensor 11 Hinh 1.6 Ngin xep giao thik mpg Sensor 12 Hinh 2.1 HiOu qui Wing luqng djnh tuyEn 33 Hlnh 2.2 VI du ye tap hqp sa lieu 35 fah 2.3 Giao thirc SPIN 37 Hinh 2.4 VI du ye truyen tin djnh Song 40 Minh 3.1 C&u tnic chucmg trInh NS-2 53 Hinh 3.2 Tinh dOi ngiu girm C++ vu Otcl 54 Hinh 3.3 Kien frac btong quan caa NS-2 54 Hinh 3.4 Cic giao thik dirge h6 trq NS-2 m8 phong mpg khong dAy 55 HInh 3.5 Ca s?; ziy dung m8 hinh mpg Sensor stir dung NS-2 56 HInh 3.6 HInh Anh me ti mang Sensor 58 Hlnh 3.7 Su d6 b6 sung vi chinh sit NS-2 59 Hinh 3.8 Kjch ban then khai twang Sensor m8 phong 60 Hinh 3.9 DO thi suy hao Ming luqng cis cic nut sensor 65 Hinh 3.10 D6 thi tic dO giam Ming lacing trung binh cia mang 66 Hinh 3.11 T6c de, giam fling luqng 67 Bing 1.1 T6ng quan ye lap mpg 16 Bing 1.2 Phin loui giao thirc MAC 17 Bing 2.1 Cic dii tin dinh cho cic img dung ISM 29 Bimg 2.2 T6rn tit ck giao they MAC cho mang Sensor 43 Bing 3.1 Suy hao Ming luqng cis cic nut sensor 65 Bing 3.2 T6c dO giim Ming limn 66 Bing 3.3 TOc dO giim Ming luqng trung binh cis mang 67 DANH MIJC WET TAT ADC Analogue/Digital converter BO chuyen dei tucmg to / so AODV Ad Hoc On-Demand DistanceVector Djnh tuyen dva vao chu8i chi htrang theo yeu ciu tom then API Application program interface HO giao tiep lap trinh ling thing ARC Adaptive transmitssion rate control Dieu khien tic dO truyen din thick Ong ARQ automatic repeat request Cu chi salt 16i Wing yeu au lap lei to dOng BER Bit error rate TS, le I8i bit CSMA Carrier sense multiple access Da truy nhap theo cam bien luu luang DSDV Destination-Sequenced Distance-Vector Djnh tuyen theo chu8i chi voi dich tuin to DSR Dynamic Source Routing Giao thirc dish tuyen nguin dung FDMA Frequency division multiple access Da truy nhap phan chic theo tin so FEC Forward error correction Ca the mks 18i truOc GPS Global Possition System He thong djnh vi tom ciu HTTP HyperText Tranffer Protocol Giao thin truyen sieu van ban ISM band Industrial, Scientific and Medical band Dili tin sa dung cho cac Ong dung c8ng nghiep, khoa hoc va y hoc LEACH Low energy adaptive clustering hierarchy Phan cep cum thfch ling WA nting luang thip MAC Medium access control Dieulchien truy nhap med twang truyen an MANET Mobile ad hoc network Mang di Ong ad hoc (tom died, !thong co cot so ting) ME Minimum energy Nang Itrang tieu tho cvc tieu MECN Minimum energy communication network Mon truyen thong voi tiling Wong cot tieu MH Minimum hop S6 busk nhby cuc tieu NAM Network AniMator M8 to mpg bing hinh anh dung NS-2 Network Simulator version Phin mem m8 phOng mang phien ban2 Otcl Object-oriented tool command language Ng8n ngit &in khien bing lenh hueng did tuvng PA Power available Mire 'ding lucmg hien tai QoS Quality of service Chit luvng djch vki REQ Request message Ban tin yeu cm RERR Route error packet G6i bao 18i tuyin RREP Route reply packet G61 dap img yeu cm tuyen RREQ Route request packet G61 yeu cilu tuyen Serial Radio Link - 232 Lien kit v8 tuyin n6i tiep theo chum RS-232 SAR Sequential assignment routing Djnh tuyin chi djnh lien tvc SMECN Small minimum energy communication network Mang truyin thong voi nang luqng cvc du loci nhe SMACS Self Organizing MAC for Sensor network Giao thin MAC tv t6 chirc cho mang sensor SMP Sensor management protocol Giao thirc quan 1S, sensor SPIN Sensor protocols for information via negotiation Clic giao thfrc thong tin sensor thong qua thda thufm SQDDP Sensor query and data dissemination protocol Giao Vic truy yin sensor vi 06 hien so lieu SQL Structure Query Language Ng8n net truy yin theo city tnic SQTL Sensor query and tasking language Ng8nngd truy van vi d#t nhiem Ai sensor SSF Scalable Simulation Framework Ca ciu m8 phang met rung TADAP Task assignment and data advertisement protocol Giao thik phin nhiem Ai vi quang se lieu TCP/IP Transmission Control Protocol/Internet Protocol Giao thirc dieu lchiin truyin din/giao that Internet TDMA Time division multiple access Da truy nh#p phan chia theo tit gian TORA Temporally Ordered Routing Algorithm Djnh tuyen bang thujt town dm duang turn ty theo thei gian WINS Wireless Integrated network sensors Mang cac thiet bj cam hien tich hqp thiit bj thu phit khong day WISENET Wireless SEnsor NETwork He thing mung sensor lchong day WISENET WLAN Wireless local area network Mang cvc b0 kW:mg day WSN Wireless sensor network Mang cam bits khong day Leg Nen EAU Trong nhitng am gin day sg phat then mph me mkt cling ngha th8ng tin, c8ng nghe vi mach dian tfr va van th6ng dac Wet la Iinh vtrc ver tuyen &I dem lei nhieu on dung m6i, cho phep chting ta c6 the de clang thu the') thong tin bit ky dieu kign va vOng dja ly Mo C6 nhieu phucmg pluip khac cho phep cluing ta thu the!) thong tin, de mang Wireless Sensor hien dang duqc dung phi bien teen ' the gaol va dang din xam nhap vao nutk ta C6 nhieu van de dat cho mang Wireless Sensor nhu van de &mg lugng, van di ding b0 sensor, van de mer rung mang Nang lugng luarn la Ott t6 quan tang dui bit ca cac loci mang V6i mpg Wireless Sensor tlnh dac the cua mang la hp chi vi phin cling va img dung luau yang dja If phtic tap nen van de tiling lugng cang tri len quan trying Truoc thgc to My, dugc su hiring din cua Thac sy Hoang Trang Minh, em da chgn di tai chuyen de: "Vin de ruing lugng mm Wireless Sensor" Muc dich cua chuyen de le tim hieu cic van di lien quan ten Wing lugng mpg Wireless Sensor, to di dua cac gbh phap tilt kiem sing Itnyng mang vi tan dung cac nguon ming lugng sach to nhien Chuyen de gim chuong: —Chuang I : Ting quan vi mang Wireless Sensor —Chuang II : Nang hiving mang Wireless Sensor —Chuang III : Phin mem m8 phing cho mpg Wireless Sensor Do han chi vi kiln thitc vi tiding luc nen chuyen dl khong Minh kW:4 thilu sot Mong dugc svr gip y cua thiy c8 va ban be Em xin chart cam an thiy girl() ThS Hoang Trying Minh da huOng din em vi chuyen man cling nhu phuong phap lam vies dl em co thl hoax) thank chuyen de HO net), 01 fining 07 nom 2013 Sinh vien Nguyin Hong Cu Ong Trang CHILICING TONG QUAN VE M4NG CAM BIEN KHONG DAY 1.1 Giai thieu mong aim Min Wiling dly Cac thiet bj cam bien (Sensor) duct kit noSi thinh mang, phOi hqp voi de thqc hien cac nhiem vp vii quy mo lem, duqc at nhieu by vong !grim cach mang h6a Rah Arc thu thap thong tin bit Id digu kien vi viing dja ly nio Mang cum hien kheong day (Wireless Sensor Network) bao gem mOt top hqp cac thiet bj calm bien sir dung cac lien ket khong day (v8 tuyin, hiong ngog hocquang hoc) phid hqp thuc hien cac nhiem vu cum bien phan tan ve doSi Wong muc tieu Mang nily the lien kit hvc tiep v6i nut quoin 1y ctia giam sit vien hay gian tiep thong qua mOt diem thu (Sink) va m8i hieing mang tong tang nhu Internet hay ye tinh Cac nut Sensor Ichong day c6 the dirge trier khai cho cac muc dich chuyen dung nhu giam sat vi an ninh; kiem tra m8i truing; too kheong gian thong minh; khko sit, chinh zac h6a ming nghiep; y th; Lqi the chit y611 ctia chung 11 kha clang trier khai hku nhu bit ki log hinh dja 15, nao, ke ca cac mid truing nguy hiem !thong the sir dung mang Sensor day truyen thOng dirge a Viec ket hop tic bO cam bien mang Wen nay a too Mien kha ging nu% cho ngubi Cie bO vi cam bien v6i bet th IS, gin voi cac thiet bi vo tuyen hoan town c6 the gin mOt kith thuac rat nh6 Chang the hog doing mOt m8i truing clay dac v6i Icha firing thc da cao Do d6, yeti mang cam hien Ichong day nay, ngtrin to da the khIm phi Sail hien Wong rat Iche thay truck day Ngay nay, cac mang cam bien kheong day dirge (mg dung nhieu linh vrc nhu cac ciu true chiong lai dja chin, nghien thu vi sinh v#t Wen, giam sat viec chuyen chi cac chit gay o nhigm, kiem tra he sinh thai vi m8i tiring sinh vet phirc 1.2 Nen tang phit trier mang Viec phift trien mang Wireless Sensor duct tren Ong nghe mang Ad hoc kW:mg day va dugc thuc diy bed hai yen t6 IA nhu ciu (mg dung va cac tien b0 cOng nghe 1.2.1 Along Ad hoc khang day Mang Ad hoc Meng day II kieu mang kheong c6 co s6 tang nen tang, dirge trier khai cho cac muc dich sit dung tam thei can thiet lop nhanh cheng, thu$n tien nhu de tim kiem vi thu hO, phut Ai lien lac cho cic thinh vien mOt cuOc hop,.v.v Mang Ad hoc kh8ng can can thinh phin co set tang nhu tong dui, tram thu phat gsfic hay bit Id mOt trung tam dieu khien nil° Tit cu cac nut di doing mang Ad hoc duct lien ket doing v6i mOt each tujr y, !dieing a5 bit Id sir dieu khien nao tir ben ngoai Tit ci cac nut deu the hog dung nhu mat bO djnh tuyen nha rung Trang tim vi 1r1 djnh tuyin tai the net khac mpg Ck giao thirc djnh My& mang Ad hoc c6 the chia thenh hai —Ccic giao that djnh tuyin theo being: mai nut mpg se tri va cap nh$t thong tin djnh tuyen tai mai nut mang khic; — Qic giao thus djnh tuyin theo yeu cdu• Viec djnh tuyen chi doge thin hien to yeu caw chuyen gai, nhe ca the tim dubng Hien to ben giao thin djnh tuyen doge sir dung mang Ad hoc: a) Dinh tuyen theo chu6i chi huerng vii dich Man ty Trong Dinh tuyen theo chuei chi Wing tied dich tuin to (Destination-Sequenced Distance-Vector - DSDV), mai tram di dOng deu c6 mat bang dint) tuyen de ghi the dich hien tai, s6 cac Were nhay de den dugc dich vi so this to doge gin cho not dich S6 the to dugc sir dung di phan biet the tuyen va nhu vay tranh dirge sir hinh the yang lap Cie tram djnh lc5r gin bang dinh tuyen ctia n6 cho the nut lan can cita n6 MOt tram ding giri bimg djnh tuyen neu mot thay del ding ke bang so vii Ian gdi Op nh$t cuoi cling dirge phut hien Nhu vOy, viec Op nh$t dirge thtrc hien ca theo then gian vi theo sr kien Cie bang dinh tuyin c6 the dugs giri Op nh$t theo hai each: chuyen toan b0 ("full dump") hay Op nh$t phen gia tang Theo each chuyen toan Ns, bang djnh thy& se doge gfri trgn vcn den the nut Ian On vi n6 c6 the bao gem rdau geoi tin Ngugc theo each cap Slot phin gia tang, chi nhemg mve ghi men elm bang djnh tuyen so vii lin cop nh$t cu6i ming mai dirge gfri di va phii visa mot gOi tin Kid mpg Wang dei 6n dinh, cic DM cap nh$t phen gia tang duce sir dung di trinh viec km lugng tang cao va viec chuyen toan b0 (full dump) it dugs sir dung han Trong the mang thay dei nhanh, se ltrung cac gOi Op nh$t phin gia tang c6 the trer len nit Ian nen_ vies chuyen tom b0 bang doge thgc hien thueng xuyen han b) Dinh tuyen bang thu$t toan tim throng tan ty theo then gian Dinh tuyen bang thu$t toan tim throng then qr theo then gian (Temporally Ordered Routing Algorithm - TORA) la mot giao thirc dinh tuyen tren ca so mot thu$t torn "dao lien ket" ("Link Reversal") NO dugc thief ke de tim cac tuyen dueng theo yeu eau, cung cap Mau tuyen tai mot &eh, thiet 1#p tuyen nhanh va giant tai mire ter thieu phan phy tai (overhead) bang thu$t toan khoanh yang cheng lai tic thay del ve hinh trang mpg c6 the say Viec tai uu djnh WA' (dm throng ngin nhat) doge coi la thin yeu vi viec djnh tuyen vii the duerng dal han dirge sir dung thuerng xuyen de trinh pha ► phu tai tim throng mai Trang kien khic Ca sa edit vies xAy dung ma hinh mpg Sensor NS-2 duce mirth hoa hinh 3.5 H'znh 3.5 Ca set xtiy dyng me hinh ?ming Sensor sti cling NS-2 M8 hinh trinh dien cim cac hien tugng NS-2 duce the djnh yeti the gen yang be dugc chuyen qua mOt kenh dugc chi djnh Pham vi anti huang elm hien tugng la tep hqp the nut c6 the nhen dirge the geti Phenom cluing ba tren kenh Met hinh se Man theo quing be bat cu kieu phat ve truyen nao (khOng gian to do, met Mt tia hay bang phi!, bao gem a ac au birth nut hien tugng Cie kieu phat phit sang theo Bang gen trim nhung the hinh clang khic cling c6 the c6 dugc bimg each thay doi pham vi cita cac geoi Phenon vi di chuyin mOt each thick hqp met tep cac not hien tugng phat cung kieu Viec phit quing ba the geti Phenom dugc hoan nha "giao thtic djnh tuyen Phenom", quitng ba cac g6i Phenom yeti tee xung the djnh Khi met gal Phenom dugc nhen ben mOt nut nen kenh Phenomenon (kenh hien tugng), mOt thong bio ve sit kien se dirge chuyen din ang dung Sensor ciut nut de 3.3.3 Cdc 4nh dgng mei NS-2 Gia sir c6 cac nut hien tugng (Phenomenon) kich host the nut Sensor, lira ltrgng cac flat Sensor tao mei !chi phat hien they hien tugng phv thuOc via chac niing ctia mang Vi dv, the mpg thiet ke de hieu chinh dfch bing hieu ung neng lugng se to nhieu Itru luvng Sensor den Sensor han mpg thiet ke de cung cep cho gitim sat vien the dli lieu chua qua xir ly Chirc Ming phv thuOc vio ung dung dm Sensor vi phu thuOc vio dee tinh luu lining ket hqp veri mpg dugc ma phong Del tugng vi chile neng dirge djnh nghta cac file sau: — Phenom / Phenom.cc, h: Chita giao thus djnh tuyen Phenom sit dung cho vies phat tin hieu ter the hien tugng No bao gem cac tham se cho tee dO xung vi kieu hien tugng (Bvi cabon, dOng dit manh, dung dit nhg, tiling On hay loci chung) Citc kieu doge at ten de nhen clang the nguen hien tugng file trace (deu m8 pheng) Tee dO xung 11 tham se nhit (Neu khien vier phat tin hieu tit mOt hien tugng; — Senso nets-NRL / Senso agent cc, h: djnh nghia the agent Sensor, the agent 11 diem cu6i, ncri cac g6i thuOc 16p mpg dirge tao vi phin tech, xti lg Cite Trang 56 nut Sensor sir dung mOt tic nhin Sensor lien kit den k'enh Phenomenon di dip nhen cic gin tin Phenom va sir dung mOt tic than TCP hay UDP de lien kit den kenh dui mpg ve tuyen de to the gin tin dirge pH di tir Ong dung Sensor Cic tic nlifin Sensor hoot ding nth mOt Ong din, qua d6 cic gei tin Phenom duqc nhan vi xii Ijr bid the img dung Sensor Cic tic nhan Sensor khong that su quan tam den nOi dung curt gin Phenom, n6 chi dun gian dinh diu the gel nhin duqc vi chuyin den Ong dung Sensor Agent duqc djnh nghia Sensor agent.cc; — Sensornets-NRL / Sensorapp.cc, h : img dung Sensor duce djnh nghia file tin dung miu nut vi tho the thong bio Sensor de chi nut timing Ong phit hien hien tuqng ( Wen m6i throng cio the dirge sir dung la: SILENT PHENOMENON, DISABLE_COLORS, MESG_SIZE va TRANSMIT FREQ) Cu the, not dang nhen gin Phenom, img dung thay d6i mau nut d6, kich thoat mOt bien tan cue "alarm" va giri mOt thong bio Sensor (MESG_SIZE byte) den nut sink (nut thu th$p sti lieu) cha kit n6i UDP, TCP sau m8i chu Ick la TRANSMIT FREQ gray 'Chi mOt nut kh8ng nhon duqc mOt Phenom packet thin gian char (SILENT PHENOMENON giay), thi mau nut tic ve mau xanh la cay Neu miu not dirge you au de bieu thi mire rang luqng thay vi tang thii canh bio Sensor thi img dung bj tit voi viec dit DISABLE COLOR; — Sensornets-NRL / Phenom_packet.h: File djnh nghia au tree gin Phenom CO kieu hien tuqng (CO, HEAVY - GEO, LIGHT - GEO, SOUND, and TEST - PHENOMENON) tuning img vOi cacbon monoxide (chit carbon monoxide CO), Heavy Seismic actyvity (dOng dit manh), Light Seismic activy (dung dit nhg), Audible Sound (Am thanh), sime Phenomenon (kieu chung) Cic kieu ce the duqc sir di,mg mli phOng yen nhieu nut hien tuqng vi c6 the dang nhen vi phAn biet Arai the hien tuqng khic ma net Sensor phit hien, bing cich thin vio file trace a Trang 57 Hinh 3.6 Binh cinh ma to mgng Sensor (theac lay tit zing dyng NAM NS-2) vai 25 trgm Sensor clupt Irian khai theo hinh lubi tren dien wiling, 20 nut Phenomenon (m6 to dam may gas-hien twang can cam Min) di &Ong va mgt tram thu dulp se; lieu (o goc tren ben pat) Cac nut am mau (mau do) M cac nut clang cam Bien clupt hien twang, Mc nut nhgt mau (mau xanh 10 cay) la cac nut khong quan sat tidy hien hem Ccic yang iron to ma" to viec ph& sang tin hieu mia cac nut Cac khoi nh6 mau den Lieu thl cac gai tin mgng 3.3.4 Thay dii NS - Hinh 3.7 sa cay NS - me rung m8 phang mpg Sensor yeti cac baS sung (nhanh ben phi° va hieu chinh (nhanh ben trai) Cac chinh sira NS-2 duce thttc hien cac file sau : — Trace / cmu-trace.cc, h: Lap CMUTrace duqc sir dung de in cac phAn quan ciut met gal via file trace VI phAn ma rung sir dung kieu gal mai cho cac hien tuqng nett can phii djnh dung gel tuong Ong file nay; — Tcl / lib / ns-lib.tcl: Thanh phAn trinh bay v1 ciu hinh nut duqc chi top lenh NS-2 Phan me rung sar dung kieu nut mai (cac nut Sensor va Phenomenon) Vi the, da them via met sof, diem via chtic nting djnh hinh not (node-configure) de pin) hop veri cac kieu nay; Trang 58 I .:2 rs ,:i H sensomets-NRU I ansoragantec ,hsenorp.c mac/ Mae-CC I — wirokose-phy.oe, I I tolAibl -I -I - h l phimomsch phonompacka ns-libid I ns-moblenodeld I —I narnsupp.t1 I trace/ LI cmu-traocce Hinh 3.7 So del by sung va chink stia NS-2 – – Tcl / lib / ns mobilenode.tcl: Trong NS-2, dung lugng sin co cho viec 1$p Mang kheang day da kenh ducm so dung de phat cac loci tin hieu hien tuqng ldllic Bing viec sa dung kenh rieng cho the hien tugng, to ce the m6 phing mai tnrtmg vat 15, rieng cho hIng loci hien Mpg nhu thgc M Nhu vay, clic nut Sensor cin giao dien: mOt vgi kenh 802.11 vit mOt veil kenh Phenom KM nang da giao dien ("Multi - homed") duqc ba xung nsmobilnode.tcl; Common / packet h: Mai g6i ns -2 ducc lien ket voi mOt kieu rieng thuOc vio giao thirc tucmg (mg nhu TCP, ARP, AODV, FTP, v.v V1 giao - - Trang 59 thirc phat tin hieu hien ttrqng la mai nen phai djnh nghia kieu gei ttrcmg (mg file tieu de packet.h; — Mac./ Wireless-phy.cc: ns -2 c6 g6m ma hinh nang luqng cho cac not kitting day duqc sir dung de nghien cuu lqi ich caa cac kg thu$t tri n8ng luqng khac Nhu vies nghi hoot dung hay tun dung ac m#t dO mpg t6i uu Ma hinh Om cac d#c tinh chi cac yeu au ding suit et cac gai phat va Sion hay tong thai r6i thin gian mpg kitting hoot dung tich cue Viet cam bien hien tuqng la mOt qua trinh c6 the tieu thu nang luqng toi St tic dO khac, nen day la vin de quan tong an xem xet Trong mac / Wireless-phy.cc cung cip kha nang chi Ong suit tieu thu cua ac nut cam bien cac hien tucmg Mat s6 sirs dui Mac duqc thot hien mac / mac.cc, tcl / lib / ns-namsupp.tcl va queue / priqueue.cc MOt se) sua chits thu toc djnh mau nut, b6 sung kieu gal Phenom vao tO chat NS-2 ducat thoc hien de dim gian hoa giao dien den kenh Phenomenon tren nut Sensor 3.4 Mo phong mgng Wireless Sensor Mpc dlnh me pitting Muc dich ctia phin ma phong la xem xot quan h'e gift hoot dOng caa node mong vbi nang luqng du frit cos n6 Ban diu, m6i nut Sensor duqc djnh ciu hinh voi mot khai nang luqng Vic djnh M6i nut Sensor thoc hien Sot hitnh dOng nhu nhan mOt tin hieu cam hien, thu hoiic phat cac gai tin va tuyin, xer 1S, tin ni0u, nguan nang luqng frit cult nut d6 se bj khiu tnY theo Ong suit duqc djnh nghia truck cho tong phin Khi nut Sensor khang c6 hanh dung nao, nang luqng se duqc khiu trir theo ding suit r6i (Idle power) d [ ® ® 0 10 IS O Hinh 3.8 Kjch ban Iran khai trufmg Sensor mo phong Trang 60 Mo pheng duqc thuc hien yeti cac mang Sensor duqc trien khai theo hinh lueri vuemg, ban d6 hinh vueong Khoang each gifra cic nut sensor la d, lchoang cach vo tuyen p dh de mOt nut c6 kha nAng phat cho nut lin IChoang anh huong cfm nut Phenomenom (hien tuqng muc tieu) la al Kieu hien tuqng muc lieu duqc chip la Carbon Monoxit (CO) duqc bieu dign btu% mOt nut Phenomenon don di chuyin mOt cach ngiu nhien truong Sensor SO luqng diem thu th#p se, lieu (Sink) la 1, duqc d#t tren bien cim throng Sensor Thang nAng luqng sfr dung ciu hinh node (trong phin node-configure): —rx Power.175 chi 175mW tieu thu cho viec nhan mOt &Si kich dunk bit 14; —lic Power 175 chi 175mW lieu thu cho viec phat mot gei kich thirfrc bit k9; —Sensor Power 000 00175 chi 1.75pW tieu thu Tilton gei quang ba Phenom; —Inctial Energy 0.5 chi tAng nAng luqng du tit la 0.5J (hay 0.5 W/s) 3.4.2 Thine hien mO Nang a) MA chuong trinh Cac tuS7 chop vi mai true:mg mang duqc khai bao nhu sau: set val(chan) Channel/WirelessChannel ;# Kieu kenh set val(prop) Propagation/TwoFtayGround ;# Kieu phat v8 tuyen set val(netif) Phy/WirelessPhy ;# Kik giao tiep m(mg set val(mac) Mac/802_11 ;# Kik MAC set val(PHENOMmac) Mac ;# Kieu MAC Phenomenon set val(ifq) Queue/DropTail/PriQueue ;# Kieu hang dqi set val(11) LL set val(ant) ;# Kieu lop lien ket s6 lieu Antenna/OmniAntenna ;# Kieu antent set val(ifqlen) 50 ;# s6 g6i cvc dal hang dqi set val(nn) 26 set val(rp) AODV ;# Giao they djnh tuyen set val(x) 451 ;# Chieu dai ban d6 (m) set val(y) 451 ;# Chi& rOng ban a (m) ;# T6ng seo nut Sensor va Sink set val(engmodel) EnergyModel set val(txPower) 0.175 ;# C8ng suit truyen (mW) set val(rxPower) 0.175 ;# C8ng suit nhin (mW) set val(sensePower) 0.00000175; ;# C8ng suit cam Men (mW) Trang 61 set val(idlePower) 0.0 set val(initeng) 0.5 ;# Cong suk khictu trb roi (mW) ;# Nang ltrqng ban du (J) MOt dap chuong trInh chinh: # Main Program # Khoi tao bier toan cuc set ns_ [new Simulator] set tracefd [open phenom I tr w] $ns trace-all $tracefd set namtrace [open phenoml nam w] $ns_ namtrace-all-wireless $namtrace $val(x) $val(y) Trong chuong trinh chinh di djnh ngliia ten File s6 lieu dau (Trace, NAM) vi thiet lop kiln kenh, giao thirc, nut Thiet 1#p tog dO cho cic not vi khai bao cic sv kien xiy thin gian m8 phang Sau dii c6 ma diu vio duqc luu file phenom.tcl ta bit du ch?y m8 phang bang lenh: nam phenom cua s6 X Sau chay xong ta ce the quan sit hinh lath bing img dung NAM ns-2 b) Phan tich kit qui Viec firth toan kat qui dva tren viec phan tich file Trace File Trace duqc djnh dang gam cic trubng co ban: [sv kin] [thbi gian] [s6 thin to nit] [mire Trace] [so this ter g6i] [Ideu gall [kich thubc goi][dia chi Mac][ning luqng can IC [kiln hien ttryng] Cic sv kien trubng sv kien gam r (nhon g6i), s (girl g6i), D (mit g6i), f (chuyen tiep g6i); truing thbi gian chi thbi diem xiy su kien; truing met Trace chi sr kien thuOc phom vi (mire dO) m8 phang nio (tic nhin (nhtr udp), 16p lien ket s6 lieu (MAC) hay mire vet ly, ) yth yeu eau tinh toan truing hqp niy, ta chi can quan dun tin trubng dau tien vi train fling luqng r 1.026254208 _7_ RTR AODV 48 [0 fffifIff 800] [energy 0.499860] — [8:255 -1:255 30 0] [0x2 1 [26 0] [8 4]] (REQUEST) Trang 62 r 1.026254343 _4_ RTR AODV 48 [0 fliffill 800] [energy 0.499860] — [8:255 -1:255 30 01 [0x71 [26 0] [8 4]] (REQUEST) r 1.026254343 _2_ RTR — AODV 48 [0 fIffffff 800] [energy 0.499860] - [8:255 -1:255 30 0] [0x2 1 [26 0] [8 4]] (REQUEST) _ _ r 1.026254346 14 RTR AODV 48 [0 fiffffff 800] [energy 0.499860] - [8:255 -1:255 30 0] [0x2 1 [26 0] [8 4]] (REQUEST) Dga vio file Trace chung ta c6 the thAy re thing lugng cim node mang se &in theo thin gian m8i node mang nhen, giri der lieu hok cam bien hien tugng Viec phan tich file trace dugc thgc hien qua hai buck: —Tich file trace: Ta se tich cac trutmg can thiet cho viec tinh toan ket qui; —Tinh kit qui: Dga vio cic tnrimg da titch tren, ta s>lr dung et throng di tinh kit qtui can thiet; Sau day la ck bu6c lien hinh cg the: —Tinh skr tieu hao Wing lugng cia citc node mang + Ding lenh sau cua s6 cygwinX di tich lay ck sg kien tai mOt node(trong trubng hqp la nodel) nthu nhan, giri gai, twang thin gian vi mirc nang lugng tuong img tai thin diem $ cat energy.tr I grep "_1_" I awk' { printf ("Vodt%f\r/os\t%s\t'Yos\t%ftn", $1, $2, $3, $4, $7, $14)} ' >energy_nodel.txt Sau lenh ta se tich dugc s6 lieu nim file energy nodel.txt gym truing Du& day la met doan file energy_nodel.txt: s s s r 1.068626 MAC AODV 0.493780 1.069666 _ 1_ _ 1_ RTR AODV 0.493640 1.070016 MAC AODV 0.493640 1.071847 _ 1_ MAC AODV 0.493360 r 1.071872 _ 1_ RTR AODV 0.493360 D 1.071978 _1_ MAC AODV 0.493220 + Sau c6 dugc file energy_nodel.txt ta sir thing lenh sau de Unit nang lugng can m8i node gfri hok nhan mOt gin der lieu: $ cat energy nodel txt awk' ( dif=o1d2-$2; if(difX)) printf ("%c\r/of\t%t\n", $1, $2, dif)) ' >energy_nodel_down.txI Sau lenh ta se tinh dugc so nang lugng cg the m6i nodel 'than hok gin (At lieu Cic s6 lieu dugc ghi vito file nlgiam_nodel.txt MOt doan file energy_nodel_down.txt Trang 63 r 1.027420 0.000280 r 1.028410 0.000140 s 1.029232 0.000140 r 1.035203 0.000840 r 1.036073 0.000140 s 1.036579 0.000140 Tucmg tir ta lam nhu v#y voi clic node kirk vi du v6i node ta dung lenh $ cat energy.tr I grep "_2_" I awk ' { printf ("Voc\VAM/os\t%s\t%s\t%fin", $1, $2, $3, $4, $7, $14)} ' >energy_node2.txt Vi lenh: $ cat energy_node2.txt awk ' { dif=old2-$2; if(dit>0) printf ("Voc\r/ot\r/ofin", $1, $2, dif)} ' >nlgiam_node2.Ixt - nth tetc dO gum Ming lugng; Tir cic file energy_node.txt ta co the tinh &Km thc dO giam nAng lugng cua nv3i node vi tong sing lugng cho viec giri der lieu vi tong nAng lugng cho viec nhon de' 114u + T6c dO gum nAng lugng = Vong Ming lugng tieu ton/ then gian ichio sit 3.4.3 Kit qud a) Sir ton hao nAng lugng Ta xet mOt mpg sensor Om 25 nut thrgc b6 tri deu mOt dien tich cd kich thuac 651x651(m2) Khi met dO mpg 11 60nut/11cm 0.019285 0.046183 0.003525 0.09376 0.162753 0.065298 0.033406 0.01526 0.112968 0.226932 0.056915 0.05568 0.002437 0.113328 0.22836 0.160718 0.02309 0.004672 0.026297 0.214777 0.139551 0.02305 0.00042 0.019622 0.182643 0.038426 0.046769 0.001325 0.108743 0.195263 0.109089 0.040506 0.018258 0.074516 0.242369 0.130553 0.021261 0.010534 0.071392 0.23374 0.074877 0.027988 0.013917 0.117594 0.234376 10 0.15393 0.023981 0.005717 0.038833 0.222461 11 0.047487 0.03308 0.000406 0.152266 0.233239 12 0.137623 0.034856 0.022823 0.049413 0.244715 13 0.074405 0.037263 0.005593 0.119159 023642 Trang 64 14 0.189775 0.028786 0.010324 0.017346 0.246231 15 0.164631 0.01053 0.006003 0.041165 0.222329 16 0.217707 0.00711 0.005957 0.230774 17 0.201076 0.031669 0.010278 0.015522 0.258545 18 0.133041 0.020647 0.010764 0.033383 0.197835 19 0.215369 0.01945 0.016523 0.008967 0.260309 20 0.220979 0.02205 0.00547 0.000409 0.248908 21 0.193351 0.022085 0 0.215436 22 0.163264 0.003814 0.076103 0.243181 23 0.21931 0.028433 0.002297 0.002453 0.252493 24 0.146921 0.020228 0.002425 0.021554 0.191128 25 0.040937 0.003478 0.002703 0.047118 Bang 3.1 Suy hao nong luring ctia c6c nut sensor Khio sit ay tiiu t6n tiling lirong cis ate nit sensor 0.3 0.25 e 0.2 13 i 03 0.15 m I5 si as c o 45 z tc- • • 0.05 • A • / i k ' , t ' it • i ■ i • : • • X / *I ii % L A A x \ Ti• veks-.11- - K •-• -.1c 'hi k I lie X.‘ •11 I al- -• 1/2 A i- I A2-ar!, -/ ii / • • t E 10 15 20 25 S6 tfiCr tkr nit -e- too krong nhan de Ilu - - is - - Pang bang la de Nu - - x - - Nang bong aim din - • a- • Pang Imp boo phIclo rnit 961 -II- The ning Wm lieu & Wink 3.9 DO' thj suy hao wring lux -mg ctia ccic nut sensor b) Ttic dO giam nang Ingng IN tang so nut mpg Trang 65 30 Trong phAn ta se khan sat toe de giam nAng lugng trung birth coa the net mang s6 nut sensor thay di kich thu6c mang co djnh 651x651(m2) 15 0.3187 0.8018702188 0.080187021876 25 0.1 02826000000 0.028260000000 37 0.04 0.1183298067 0.011832980669 58 0.01919 0.0438586242 0.004385862420 79 0.006 0.0090531975 0.000905319748 150 0.00166 0.0006454619 0.000064546188 240 0.0006 0.0000530490 0.000005304904 410 0.000174 0.0000086468 0.000000864676 585 0.0000778 0.0000018869 0.000000188685 715 0.0000572 0.0000009930 0.000000099299 900 0.0000285 0.0000002816 0.000000028160 1200 0.0000154 0.0000000685 0.000000006845 1400 0.000012 0.0000000146 0.000000001462 1612 0.0000074 0.0000000206 0.000000002061 Bang 3.2 roc giant ruing lugng Khio sit t6c il glim Ming luvng trung binh cis ming 0.09 0.08 -.- T6c 40 gam ning Wong -• 0.07 IS :=I 0.06 0.05 cm o-0.04 C 0.03 0.02 0.01 • 0.00 200 400 •• 600 • • • 800 1000 1200 1400 1600 1800 ii nut Sensor Hinh 3.10 DS thi teic dO giant ndng lugng trung binh ctia mang c) T6c de giitm Wing lugng mat dO man killing di Trong phAn ta se thay di s6 lugng nut sensor mpg dng th6i cling thay d6i dien tich khio sat de dam bio mot de mang la 60sensor/lkm Trang 66 15 0.2826 0.02826 25 37 0.285502 0.02855 0.285502 0.02855 58 0.317106 0.031711 79 150 0.123958 0.115942 0.012396 240 410 0.112774 0.011594 0.011277 0.008311 585 0.083108 0.071784 715 0.098671 900 1200 0.541801 0.009867 0.05418 0.138967 0.013897 1400 0.293757 0.029376 0.007178 Eking 3.3 T etc Pith); none ltrang truer binh mkt mane Khio it toe d$ glam 'sing harm COS mine 0.06 1-, -16eaeoWnoigwroI 0.05 I 0.01 200 400 600 800 1000 1200 1400 1600 86 net sensor Minh 3.11 Toe JO gam ring ItAmg 3.4.4 Mink gib Qua kit quit m8 pheong tren, ta thAy trei mOt mung c6 djnh Ming luqng cho viec nhin du lieu chum ti 10 Ion nhAt tiep den lit nAng ltrqng cho viec cam bien dft lieu va fling lucmg cho viec giri dtt li¢u chiem ti 10 thlp nh&t , dO nut sensor mang cling itnh hu?mg rAt nhieu toi viec tieu thy &Mg lutyng ctla cac nut mpg mit dO cling cao thi t6c dO gitun nang luong ctia cfic net sensor cling gam Dieu duqc giiti thich la cling suit phat cna clic nut sensor giitm Do d6 thiet ke mpg chimg ta phai het stem chi y tei met dt) nut mpg Trang 67 Khi mat mpg duqc gift c6 djnh thi sto nut sensor 131 la yeu t6 anh hulmg tai the de tieu this nang lugng etia cie nut sensor CO Moan chinh tang s6 nut sensor se inh lugng mph tai the de tieu thu nang lugng coa cac nut sensor —Khoting this !that: Dueri 100 nut, the dO tieu thy ruing Itumg birth Ma Me nut ((holing 0.28j/s day 11 met the dO giant trung birth —Khoting this hai: TO 100 den 700 nut, the dO giant nang lugng dm mang On djnh a mire thep khohng 0.1j/s —Khoang this ba: Tir 700 mit tr6 nen, My the dO giant Mktg hrgng etia cac Mt mang tang dot bien Qua day ta they xay sign mang khoitng this hai la dam bito flit kiem nang lugng nhit Tuy nhien trtemg hqp an trier khai met ph3m vi len thi ta len chqn set Mt sensor 16n hem 1200 Mt darn bio tiEt kiem v&i nang lugng a Trang 68 ICET LU4N Cic mang Sensor vai gii thinh thip, c6 Ming trien khai nhieu dieu kien dja ly h$u phirc tap, dkic biet la cic riling cOng tic vi chju duqc cac hu hang stir c6 QA dem l i mOt cuOc cich mpg virc cam bien vi thu thip thong tin Dieu dA mang lai nhieu lqi ich thiet thqc cho cuOc sting, cho sin )(wit vi cho khoa hqc Trong Wong lai, mpg Sensor c6 the se la mOt phuang tier can thiet vi thong dung nhu may tinh ci nhan vi dies thoai di dOng hien Trong Wang lai mang sensor hoin tom c6 the duqc ip dung nuac ta, da viec nghien ciru tim hieu cic vim de lien quan tai mpg la het sac can thiet Hien tai mang sensor QA duchy trien khai rOng, nhien chtmg van dang flip tuc duqc nghien ciru Do da viec n&n bit cic ding ngh'e mai vi cic gik phip phit trier mpg la het sac can Trang 69 TM lieu tham klulo —Web google.com —Anna Hie (University of Hawait at Manoa, Honolulu, USA), Wireless Sensor Network Designs, Nhi suit bin Jonh Wiley and Sons; —Edgar H Callaway, Wireless Sensor Network — Architectures and Protocol, NM suit ban CRC; —Dinh Van Dung (Vien khoa hpc ky thuat buu lien), Sensor Network Intallation Guide, Bin Pdf; —The Network Simulator - ns-2; —NRL's Sensor Network Extension to ns-2; —Ian Downard, SIMULATING SENSOR NETWORKS IN NS-2, Naval Research Laboratory Code 5523, 4555 Overlook Ave, Washington DC, 20375-5337; —http://nrIsensorsim.plitd.nrInavy.mil4 Q.Hao, D.J.Holding, Y.Peng, K.J.Blow (Aston university), "Energy Efficiency Design Challenge in Sensor Network: A survey" Trang 70 ... gian WINS Wireless Integrated network sensors Mang cac thiet bj cam hien tich hqp thiit bj thu phit khong day WISENET Wireless SEnsor NETwork He thing mung sensor lchong day WISENET WLAN Wireless. .. gim chuong: —Chuang I : Ting quan vi mang Wireless Sensor —Chuang II : Nang hiving mang Wireless Sensor —Chuang III : Phin mem m8 phing cho mpg Wireless Sensor Do han chi vi kiln thitc vi tiding... WIRELESS SENSOR 3.1 Ma hlnh hol ma phang 51 3.2 M8 hinh npon fling Iwyng 51 3.3 Thiit Id plan mim ma phang myng Wireless Sensor 52 3.3.1 Phan ndm NS-2 52 3.3.1 Ca sa phdt triin mo phong man Sensor