Bao Cao Co So Truyen So Lieu(1)

  • Published on
    05-Dec-2014

  • View
    66

  • Download
    9

Embed Size (px)

DESCRIPTION

kk

Transcript

<p>1MCLC1.Yu cu bi tp lon...................................................................................................................22.Nhim vu cua tung sinh vin trong nhm .................................................................................33.Co so l thuyt .........................................................................................................................43.1 Hng doi v dc dim........................................................................................................43.2 . Hng doi M/M/1/K v cc tham s ..................................................................................54.M phong hng doi trong NS2 .................................................................................................74.1.Gioi thiu v cng cu m phong NS2 ................................................................................74.2.Kich ban m phong ...........................................................................................................84.3.Tnh ton cc tham s cua h thng sau khi m phong .......................................................84.3.1.Tnh xc sut mt gi ....................................................................................................84.3.2.Tnh thoi gian trung bnh mt yu cu nm trong hng doi T..........................................94.3.3.Tnh s yu cu trung bnh trong hng doi ......................................................................94.3.4.Tnh ton thoi gian trung bnh mt yu cu nm trong h thng .....................................94.3.5.Tnh s yu cu trung bnh trong h thng .................................................................... 104.4.Kt qua m phong ........................................................................................................... 104.4.1.M phong Ln thu nht ................................................................................................ 104.4.2.M phong ln thu hai ................................................................................................... 134.4.3.M phong ln thu ba .................................................................................................... 165. Nhn xt v kt lun .............................................................................................................. 19Ti liu tham khao: ................................................................................................................... 20</p> <p>Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com21.Yucubi tqplnBi S 3: Do hiu nng cua hng di M/M/1/K KCho hng doi don M/M/1/K nhu hnh v .3.1 Su dung kin thuc hng doi d hoc d tnh xc sut gi li Pe,N,Nq,T,Tq.Cc tham s hng doi nhu sau:tc d trung bnh cua gi dn hng doi l =120gi/s; tai p=0,9;d di hng doi K=6.3.2 Dng NS-2 thit lp mt kich ban m phong cho hng doi voi cc thams d cho trong 3.1Tnh cc tham s hiu nng nhu trn voi thoi gian chay m phong200s.V d thi tc d mt gi e(t) ( tnh bng gi/s) v d di hng doi tucthoi nq(t)So snh v kt lun so voi kt qua tnh ton trong 3.1.3.3 Tuong tu nhu 3.2, tuy nhin voi tham s p=1.3.4 Tuong tu nhu 3.2 voi K=10.C kt lun g v cc kt qua thu duoc? Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com32.Nhimv catngsinhvintrongnhm - Nguyn Duc Nam :Vit code m phong NS2 trong file demo.tcl+Tao nt,s hng doi+Tao tin trnh toi Poisson voi tc d +Tao server phuc vu Poisson voi tc d +Thit lp cc tham s cho hng doi - Nguyn Khc Thi : Vit code xu l cc trace-file (.awk) +Tnh s yu cu trung bnh trong h thng.+Tnh s yu cu trung bnh trong hng doi+Tnh xc sut li gi+Tnh thoi gian mt yu cu nm trong hng doi+Tnh thoi gian mt yu cu nm trong h thng - Bi Dnh Dung :+Tnh ton cc tham s cua hng doi trn l thuyt+V d thi tc d mt gi e(t) v d thi d di hng doi tuc thoi nq(t)+Thay cc tham s m phong v dua ra nhn xt</p> <p>Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com43.Co s lthuyt3.1Hng di v d}c dimTrong bt cu mt h thng no th khch hng di dn cc dim cung cp dich vu vroi khoi h thng khi dich vu d duoc cung cp.V d:Cc h thng din thoai: khi s luong lon khch hng quay s d kt ni dn mttrong nhung duong ra huu han cua tng di.Trong mang my tnh: khi m gi tin duoc chuyn tu ngun toi dch v di qua mts luong cc nt trung gian. H thng hng doi xut hin tai mi nt o qu trnhluu tam thng tin tai b dm.H thng my tnh: khi cc cng vic tnh ton v tuyn lm vic cua h thng yucu dich vu tu b xu l trung tm v tu cc ngun khc.Nhung tnh hung ny duoc din ta bng hnh v sau:Hnh 0-1 M hnh chung cua h thong hng doiNguoi ta m ta tin trnh dn v tin trnh phuc vu nhu th no?-H thng c bao nhiu server?-C bao nhiu vi tr doi trong hng doi?-C bt ky quy tc ni b dc bit no khng (yu cu dich vu, muc d uu tin, hthng cn ri khng)?D}c dim cua h thng hng di-Miu ta cua tin trnh dn (phn bo khoang thoi gian dn)-Miu ta cua tin trnh phuc vu (phn bo thoi gian phuc vu)-So luong server-So luong cc vi tr doiClick to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com5-Cc quy tc hng doi dc bit:Quy tc phuc vu (FCFS, LCFS, RANDOM)Thoi gian ri (phn b thoi gian ri, khi m thoi gian ri bt du )Muc d uu tinNhung lut khcJoi mot mang cu th cua hng doi gomc cc thng tin sau:Su kt hop giua cc hng doi-Chin luoc dinh tuyn:Xc dinh (Deterministic)Dua vo mt lopThng k-Xu l nghn mang (khi b dm tai dch bi dy)S luong khch hng bi suy giamHng doi gc bi nghnTi dinh tuyn3.2.Hngdi M/ M/ 1/ KvccthamsHnh 3.3 M hnh hng doi M/M/1/KHng doi M/M/1/K l hng doi c tin trnh toi v tin trnh phuc vu tun theophn b Poisson, mt server v c dung luong h thng l K. Voi cc tham s d cho truoc cua hng doi M/M/1/K :- Dung luong h thng :K - Tc d trung bnh cua gi toi hng doi : - Tai : Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com6 - Tc d phuc vu trung bnh cua h thng : </p> <p> Ta c th tnh duoc:- Xc sut mt gi :111e BkP Pk</p> <p>- S yu cu trung bnh trong h thng :1( 1)111kN kk </p> <p> - S yu cu trung bnh trong hng doi :1111kkNqk </p> <p> - Thoi gian mt yu cu phai doi trong h thng:(1 )BNTP </p> <p>- Thoi gian mt yu cu phai doi trong hng doi :(1 )BNqTqP </p> <p>Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com74.Mphnghngdi trongNS24.1.Gii thiuv cngc mphngNS2 Hin nay, cc h thng mang ngy cng phuc tap, di hoi phai dp ung duoc voinhiu loai dich vu khc nhau, voi tc d dich vu khc nhau, luu luong cc gi tintrn duong truyn khng ngung tng ln, nhiu lc dn dn tc nghn. V vy, vicsu dung phuong php giai tch cng tro nn phuc tap trong tnh ton cc di tuongngu nhin, dng thoi kh c nhung m hnh thuc t d do thuc nghim nn vicsu dung cc h thng m phong my tnh tro nn thun loi hon nhiu. Phuong php m phong l su dung chuong trnh phn mm xy dung cc dituong trong mang dua theo Topology mang d duoc thit k. Thit lp bang hoatdng cho tung node mang, thit lp cc thng s duong truyn, thoi gian truyn.\ NS2 l phn mm m phong mang diu khin su kin ring r huong di tuong,duoc pht trin tai UC Berkely, vit bng ngn ngu C++v OTcl. NS-2 l phnmm m ngun mo c sn cho ca nn Windows 32 v Linux.NS thuc thi cc giaothuc mang nhu Giao thuc diu khin truyn tai (TCP) v Giao thuc gi nguoi dng(UDP); cc dich vu ngun luu luong nhu Giao thuc truyn tp tin (FTP), Telnet,Web, Tc d bit c dinh (CBR) v Tc d bit thay di (VBR) ; cc k thut quanl hng doi nhu Vo truoc Ra truoc (Drop Tail), D som ngu nhin (RED) vCBQ; cc thut ton dinh tuyn nhu DijkstraHnh 1: Tng quan v NS dui gc d ngui dngClick to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com8 OTcl Script Kich ban OTcl Simulation Program Chuong trnh M phng OTcl B bin dich Tcl mo rng huong di tuong NS Simulation Library Thu vin M phong NS Event Scheduler Objects Cc di tuong B lp lich Su kin Network Component Objects Cc di tuong Thnh phn Mang Network Setup Helping Modules Cc m dun Tro gip Thit lp Mang Plumbling Modules Cc m dun Plumbling Simulation Results Cc kt qua M phong Analysis Phn tch NAM Network Animator Minh hoa Mang NAM4.2.K]chbnmphngTrong d ti ny, nhm s m phong hng doi M/M/1/K voi 2 nt n1 v n2. N1 lngun pht voi giao thuc UDP. N2 l dch nhn du liu Null.Giua n1 v n2 truyn don cng voi dung luong duong truyn 100kb, hng doi kiuDroptail. Voi cc tham s cua hng doi v , chng ta suy ra d m phong hngdoi trn ngun pht phai pht cc gi voi thoi gian giua 2 gi lin tip l bin tuntheo hm mu voi gi tri trung bnh 1/ v d lon gi pht trung bnh 100000/8(byte). Code m phong duoc vit trong file demo.tcl. Sau khi chay file kich ban mphong, chuong trnh s xut ra cc file ghi lai tham s v qu trnh m phong:- out.tr - ghi lai tham s cua mt gi tin4.3.Tnhtonccthams cah thngsaukhi mphng4.3.1.Tnh xcsutmtgi Thut ton tnh xc sut mt gi duoc luu trong file loss.awkPe = tng s g bi mttng s g tun dD tnh xc sut ny ta s su dung dng lnh:Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com9awk -f loss.awk out.tr4.3.2.Tnhthi giantrungbnhmtyucunmtronghngdi TD tnh s yu cu trung bnh trong h thng,ta cn xut ra cc thng s thoigian cua tung packet trong hng doi nhu thoi gian vo,thoi gian ra khoi hngdoi,thoi gian luu lai trong hng doiThut ton tnh s thoi gian trung bnh mt yu cu nm trong hng doiduoc luu trong file timequeue.awkT=tng tho gun Iuu Ia tong hng dos g tn tun duocD tnh thoi gian ny ta chay dng lnh:awk -f timequeue.awk out.tr4.3.3.Tnhs yucutrungbnhtronghngdi Sau khi tnh duoc tng thoi gian gi tin luu lai trong h thng,ta s tnh duocs yu cu trung bnh trong h thng theo thut ton:N =tng tho gun Iuu Ia tong hng dotho gun m phongduoc luu trong trong file numbercustomerqueue.awkD tnh s yu cu trung bnh trong hng doi ta chay dng lnh:awk f numbercustomerqueue.awk out.tr4.3.4.Tnhtonthi giantrungbnhmtyucunmtrongh thngD tnh thoi gian trung bnh mt yu cu nm trong h thng ta cn xut racc thng s thoi gian cua tung packet trong h thng nhu thoi gian vo,thoi gianra khoi h thng v thoi gian luu lai trong h thng.Thut ton tnh thoi gian trung bnh mt yu cu nm trong h thng duocluu trong file timesystem.awk Ts =tng tho gun Iuu Ia tong h thngs g tn tun duocD tnh xc sut ny ta chay dng lnh:awk -f timesystem.awk out.trClick to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com104.3.5.Tnhs yucutrungbnhtrongh thngSau khi tnh duoc tng thoi gian gi tin luu lai trong h thng,ta s tnh duocs yu cu trung bnh trong h thng theo thut ton:N =tng tho gun Iuu Ia tong h thngtho gun m phongduoc luu trong trong file numbercustomersystem.awkD tnh s yu cu trung bnh trong hng doi ta chay dng lnh:awk f numbercustomersystem.awk out.tr4.4.Ktqu mphng4.4.1.MphngLnth nhtCc tham s su dung: =120 (gi / ), 0.9, K =10 s 4.4.1.1.Theo l thuyt- Xc sut mt gi :671 1 0.90.9 0.101811 0.91e BkP Pk</p> <p>- S yu cu trung bnh trong h thng :7710.9 0.9( 1) 7. 2.5811 1 0.9 1 0.91kN kk </p> <p>(gi)- S yu cu trung bnh trong hng doi :770.910.9 6 0.91.7711 1 0.9 1 0.91kk xNqk </p> <p>(gi)- Thoi gian trung bnh mt yu cu phai doi trong h thng:Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com112.580.0234( )(1 )(1 0.0839).120BNT sP </p> <p> - Thoi gian trung bnh mt yu cu phai doi trong hng doi :1.770.0161( )(1 ) (1 0.0839).120BNqT sqP 4.4.1.2.Theo kt qua m phong: - Xc sut mt gi :Pe=0.0989 =9.89% - S yu cu trung bnh trong h thng : N=2.542(gi) - S yu cu trung bnh trong hng doi : Nq=1.738(gi) - Thoi gian trung bnh mt yu cu phai doi trong h thng: T =0.0236(s) - Thoi gian trung bnh mt yu cu phai doi trong hng doi : Tq =0.0161(s)L thuyt M phong 200 s Sai sPe0.1018 0.0989 2.84%N (gi/s) 2.58 2.542 1.47%Nq( gi/s) 1.77 1.739 1.75%T(s) 0.0234 0.0236 0.85%Tq(s) 0.0161 0.0161 0%Nhn xt :Kt qua m phong so voi kt qua l thuyt sai khc khng qu nhiu dothoi gian m phong kh lon. Dc bit voi thoi gian trung bnh mt yu cu phai doitrong hng doi hu nhu khng c sai s.4.4.1.3.Hnh vClick to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com12Hnh 2 :tc d mt gi theo thoi gian e(t)Hnh 3:D di hng doi theo thoi gian nq(t)Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com134.4.2.Mphnglnth hai Cc tham s =120 (gi / ), 1, K =6 s .4.4.2.1.Theo l thuyt- Xc sut mt gi:1 10.14281 6 1PeK - S yu cu trung bnh trong h thng :632 2KN (gi)- S yu cu trung bnh trong hng doi :2 22.5712*( 1) 2*(6 1)6 KNqK (gi)- Thoi gian mt yu cu phai doi trong h thng30.0291( )(1 0.1428).120 (1 )NT sPe - Thoi gian mt yu cu phai doi trong hng doi2.5710.0249( )(1 0.1428).120(1 )NqT sqPk </p> <p>4.4.2.2.Theo m phong - Xc sut mt gi :Pe =0.1376=13.76% - S yu cu trung bnh trong h thng : N=2.933(gi) - S yu cu trung bnh trong hng doi : Nq=2.083(gi) - Thoi gian trung bnh mt yu cu phai doi trong h thng: T =0.0284(s)Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com14 - Thoi gian trung bnh mt yu cu phai doi trong hng doi : Tq =0.0202(s)L thuyt M phong 200 s Sai sPe0.1428 0.1376 3.64%N (gi/s) 3 2.933 2.23%Nq( gi/s) 2.571 2.083 18.9%T(s) 0.0291 0.0283 2.75%Tq(s) 0.0249 0.0202 0.47%Nhn xt:Tai cua h thng 1 nghia l tc d toi bng tc d phuc vu cua server.So voiln thu nht,tc d phuc vu cua server giam do d xc sut mt gi s tng ln(0.1428 so voi 0.1018),thoi gian mt yu cu nm trong h thng v hng doi cungtng theo.O ln m phong thu hai ny,sai s so voi l thuyt nhn chung l sai khckhng dng k,ngoai tru Nq .4.4.2.3.Hnh vClick to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com15Hnh 4:Tc d mt gi theo thoi gian e(t)Hnh 5 :D di hng doi theo thoi gian Nq(t)Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com164.4.3.Mphnglnth baCc tham s =120 (gi / ), 0.9, K =10 s 4.4.3.1.Theo l thuyt- Xc sut mt gi :10111 1 0.90.9 0.050811 0.91e BkP Pk</p> <p>- S yu cu trung bnh trong h thng :111110.9 0.9( 1) 11. 3.96911 1 0.9 1 0.91kN kk </p> <p>(gi)- S yu cu trung bnh trong hng doi :11110.910.9 10 0.93.11511 1 0.9 1 0.91kk xNqk </p> <p>(gi)- Thoi gian trung bnh mt yu cu phai doi trong h thng:3.9690.0348( )(1 )(1 0.0508).120BNT sP </p> <p> - Thoi gian trung bnh mt yu cu phai doi trong hng doi :3.1150.0273( )(1 ) (1 0.0508).120BNqT sqP 4.4.3.2.Theo m phong - Xc sut mt gi :Pe=0.0492 =4.92% - S yu cu trung bnh trong h thng : N=3.847(gi)Click to buy NOW!PDF-XChangewww.doc u-t r ack.comClick to buy NOW!PDF-XChangewww.doc u-t r ack.com17 - S yu cu trung bnh trong hng doi : Nq=2.999(gi) - Thoi gian trung bnh mt yu cu phai doi trong h thng: T =0.0339(s) - Thoi gian trung bnh mt yu cu phai doi trong hng doi : Tq =0.0264(s)L thuyt M phong 200 s Sai sPe0.0508 0.0492 3.14%N (gi/s) 3.969 3.847 3.07%Nq( gi/s) 3.115 2.999 3.72%T(s) 0.0348 0.0339 2.58%Tq(s) 0.0273 0.0264 3.29%Nhn xt:Khi thay tham s K =10,nghia l chiu di hng doi tng ln,lc d xc sut mtgi giam dng k so voi 2 ln truoc khi K=6. Di lai,s yu cu nm tro...</p>