Está en la página 1de 36

GVHD: TS.

L QUC CNG

HVTH: CAO NHT BNH

CHNG 4: M PHNG.
4.1 Mc ch ca vic m phng. Mng OBS c nhiu u im ng c quan tm tuy nhin mng OBS cha tht s c trin khai trong thc t do cn thc hin vic m phng nh gi nhng cht lng ca mng OBS. Mc tiu ca ti ny l tm hiu cht lng dch v (QoS) da trn nhng thng s c gi nh trc. M phng trong lun vn cng so snh v nh gi cht lng dch v v xc sut mt gi trong iu kin ti a vo mng khc nhau. Phn m phng s thc hin vic m phng mt mng chuyn mch quang chm OBS vi cc trng hp c cp trong chng III vi cc vn chnh nh sau: QoS da trn vic ng khi burst, QoS da trn vic xp lch knh truyn, QoS da trn vic bo hiu, QoS da trn vic gii quyt xung t. M phng c thc hin bng phn mm m phng OBS4NS chy trn nn ca phn mm m phng mng NS-2. M phng c thc hin tnh ton xc sut mt gi v tr vi cc ti lu lng khc nhau. Kt qu m phng s c a ra di dng th. 4.2 M hnh mng v cc thng s. M hnh mng m phng c da theo m hnh mng NSFNET (National Science Foundation Network) ca Hoa K vi 14 node mng. Vic s dng m hnh ny do mng OBS cha thc s c trin khai trong thc t, hn na mng NSFNET c s dng kh ph bin trong cc bi nghin cu v mng OBS ca cc tc gi. Vic la chn mt mng chun c cc nh nghin cu xut so snh kt qu l cn thit.

- 64 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.1 M hnh mng NSFNET Sau y l cc thng s chnh trong trong m phng: Cc node mng u l cc node kt hp. Lin kt l song hng vi mi hng c hai knh iu khin v hai knh d liu. Do mt lin kt c 8 bc sng quang. Cc gi n c kch thc c nh l 1250 byte. Tc truyn dn ca lin kt l 10Gbps. Thi gian chuyn mch l 10 s . Cng ngh chuyn mch ton quang c th da trn hai cng ngh l cng ngh chuyn mch gng vi thi gian chuyn mch hng ms v cng ngh chuyn mch bn dn vi thi gian chuyn mch vi s . Trng hp m phng ny tc gi gi s rng chuyn mch ton quang u l cc chuyn mch bn dn. Kch thc gi iu khin l c nh v bng 64byte. Thi gian x l gi iu khin l 2.5 s

4.3 Phn mm m phng mng ns-2 4.3.1 Gii thiu [17,18,5] Phn mm NS-2 l phn mm m phng mng iu khin s kin ring r hng i tng c pht trin ti UC Berkely, vit bng ngn ng C++

- 65 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

v Otcl. Ns-2 l phn mm m phng m ngun m hu ch cho vic nghin cu mng din rng (WAN) v mng local (LAN). Bn li ch ln nht ca Ns-2 l: Kh nng kim tra tnh n nh ca cc giao thc mng ang tn ti Kh nng nh gi cc giao thc mng mi trc khi a vo s dng Kh nng thc thi nhng m hnh mng ln m gn nh ta khng th thc thi c trong thc t Kh nng m phng nhiu loi mng khc nhau 4.3.2 Kin trc ca NS-2 NS thc thi cc giao thc mng nh Giao thc iu khin truyn ti (TCP) v Giao thc gi ngi dng (UDP); cc dch v ngun lu lng nh Giao thc truyn tp tin (FTP), Telnet, Web, Tc bit c nh (CBR) v Tc bit thay i (VBR) ; cc k thut qun l hng i nh Vo trc Ra trc (Drop Tail), D sm ngu nhin (RED) v CBQ; cc thut ton nh tuyn nh Dijkstra NS cng thc thi multicasting v vi giao thc lp iu khin truy cp ng truyn (MAC) i vi m phng LAN.

Hnh 4.2 Tng quan v NS di gc ngi dng OTcl Script Simulation Program OTcl NS Simulation Library Event Scheduler Objects Network Component Objects Kch bn OTcl Chng trnh M phng B bin dch Tcl m rng hng i tng Th vin M phng NS Cc i tng B lp lch S kin Cc i tng Thnh phn Mng

- 66 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Network Setup Helping Modules Cc m un Tr gip Thit lp Mng Plumbling Modules Simulation Results Analysis NAM Network Animator Cc m un Plumbling Cc kt qu M phng Phn tch Minh ha Mng NAM

Trong hnh trn, NS l B bin dch Tcl m rng hng i tng; bao gm cc i tng B lp lch S kin, cc i tng Thnh phn Mng v cc m un Tr gip Thit lp Mng (hay cc m un Plumbing). s dng NS-2, user lp trnh bng ngn ng kch bn OTcl. User c th thm cc m ngun Otcl vo NS-2 bng cch vit cc lp i tng mi trong OTcl. Nhng lp ny khi s c bin dch cng vi m ngun gc. Kch bn OTcl c th thc hin nhng vic sau: Khi to B lp lch S kin Thit lp M hnh mng dng cc i tng thnh phn Mng Bo cho ngun lu lng khi no bt u truyn v ngng truyn gi trong b lp lch s kin Thut ng plumbing c dng ch vic thit lp mng, v thit lp mt mng ngha l xy dng cc ng d liu gia cc i tng mng bng cch thit lp con tr neighbour cho mt i tng ch n a ch ca i tng tng ng. Module plumbing OTcl trong thc t thc hin vic trn rt n gin. Plumbing lm nn sc mnh ca NS. Thnh phn ln khc ca NS bn cnh cc i tng Thnh phn Mng l B lp lch S kin. B lp lch S kin trong NS-2 thc hin nhng vic sau: T chc B nh thi M phng Hu cc s kin trong hng i s kin Triu gi cc Thnh phn Mng trong m phng Ph thuc vo mc ch ca user i vi kch bn m phng OTcl m kt qu m phng c th c lu tr nh file trace. nh dng file trace s c ti vo trong cc ng dng khc thc hin phn tch:

- 67 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

File nam trace (file.nam) c dng cho cng c Minh ha mng NAM File Trace (file.tr) c dng cho cng c Ln vt v Gim st M phng XGRAPH hay TRACEGRAPH

Hnh 4.3Lung cc s kin cho file Tcl chy trong NS NAM Visual Simulation Tracing and Monitoring Simulation C++ v OTcl Hnh sau biu din kin trc chung ca NS. User c th tng tng mnh ang ng gc tri di, thit k v chy cc m phng trong Tcl. Tcl dng cc i tng m phng trong OTcl. Cc i tng B lp lch S kin v hu ht cc i tng Thnh phn Mng thc thi bng C++ v sn c cho OTcl qua mt lin kt OTcl. Lin kt OTcl ny c thc thi dng TclCL. Tt c lm nn NS, b bin dch Tcl m rng hng i tng v cc th vin m phng mng. M phng o NAM M phng Ln vt v Gim st

- 68 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.4 Kin trc ca NS-2 NS s dng hai ngn ng lp trnh: Ngn ng kch bn (Tcl Tool Command Language, c l tickle) v Ngn ng lp trnh h thng (C/C++) NS l tng bin dch Tcl chy cc kch bn Tcl Bng cch s dng C++/OTcl, b m phng mng phi hon ton l hng i tng Hnh sau ch ra cc i tng C++ c lin kt OTcl. Khi , nu chng to nn mt phn cp th cc i tng OTcl cng c mt phn cp tng ng nh vy.

- 69 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.5 C++ v OTcl: S i ngu TclCL l ngn ng c s dng cung cp lin kt gia C++ v OTcl. Cc kch bn Tcl/OTcl c vit thit lp v cu hnh topology ca mng. TclCL cung cp lin kt gia phn cp lp, khi to i tng, ni kt bin v gi lnh.

Hnh 4.6 TclCL hot ng nh lin kt gia A v B Vic s dng hai ngn ng v B m phng cn thc hin hai vic khc nhau. Mt mt l v cc m phng cho cc giao thc yu cu mt ngn ng lp trnh h thng c th tnh ton mt cch hiu qu cc byte, cc tiu packet v cc

- 70 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

thut ton thc thi ang chy trn mt tp d liu ln. Vi tc v ny, run-time speed (tc thi gian chy thc) l quan trng trong khi turn-around time (thi gian thay i) th t quan trng hn. Turn-around time bao gm thi gian chy m phng, thi gian tm li, thi gian sa li, thi gian bin dch li v thi gian chy li. Mt khc, khi nghin cu mng th rt cn quan tm n cc tham s v cc cu hnh c thay i nhng khng ng k, hay quan tm n cc scenario (tnh hung) cn khm ph tht nhanh chng. Trong tc v ny th iteration time (thi gian lp li, tc l thi gian hay i m hnh v chy li) l quan trng hn. V cu hnh ch chy mt ln lc bt u m phng nn run-time trong tc v ny r rng km quan trng hn. Dng C++ : M phng giao thc chi tit yu cu ngn ng lp trnh h thng Thao tc trn byte, x l gi, thc thi thut ton Tc thi gian thc l quan trng nht Thc hin bt k vic g m cn phi x l tng packet ca mt lung. Thay i hnh vi ca lp C++ ang tn ti theo nhng hng khng c lng trc. V dng OTcl : M phng nhng thng s hay cu hnh thay i Tham d nhanh mt s tnh hung Thi gian tng tc (thay i m hnh hay chy li) l quan trng Cu hnh, thit lp hay nhng g ch lm mt ln. Thc hin nhng ci ta mun bng cch thao tc trn cc i tng C++ ang tn ti. V d nh cc link l nhng i tng OTcl lin kt cc m un delay (tr hon), queueing (hng i) v possibly loss (kh nng mt mt). Cn nu mun thc hin nhng vic chuyn nghip hn th cn phi to ra i tng C++ mi.

- 71 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hu ht nh tuyn c vit bng OTcl (d thut ton Dijkstra li vit bng C++). M phng HTTP c tng lung bt u ti OTcl nhng vic x l tng gi li c vit bng C++. Phng php ny chy tt cho n khi c n 100 lung bt u thi gian m phng mi giy. Ni chung, nu phi triu gi Tcl nhiu ln mi giy th c l nn chuyn sang C++. V phng din m ngun, NS-2 c vit vi 100k dng m lnh C++, 70k dng m Tcl v 20k dng ti liu. 4.3.3 Cc c tnh ca NS-2 NS-2 thc thi nhng tnh nng sau: Cc k thut qun l hng i Router nh DropTail, RED, CBQ, Multicasting M phng mng khng dy c pht trin bi Sun Microsystems + UC Berkeley (D n Daedalus) Thuc mt t (di ng, adhoc, GPRS, WLAN, BLUETOOTH), v tinh Chun IEEE 802.11 c th c m phng, cc giao thc Mobile-IP v adhoc nh DSR, TORA, DSDV v AODV Hnh vi ngun traffic www, CBR, VBR Cc agent truyn ti UDP, TCP nh tuyn Lung packet M hnh mng Cc ng dng Telnet, FTP, Ping Cc packet tracing trn tt c cc link v trn cc link xc nh

- 72 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

4.4 Phn mm m phng mng quang OBS4NS 4.4.1 Gii thiu. Ns-2 kh y cho vic m phng mng thng thng, tuy nhin li t h tr cho lp quang v m phng mng OBS v trong OBS cc burst d liu c chuyn mch ton quang, khng b delay hay x l ti cc node mng. V l do , phn mm m rng OBS4NS chy trn nn NS-2 c xy dng gii quyt vn m phng mng ton quang. Phn mm m phng mng OBS4NS c cc tc gi trng i hc Vigo-Ty Ban Nha xy dng v pht trin phn ln cc chc nng phc v tng i y cho m phng mt mng OBS hon chnh. Phn mm OBS4NS c kh nng: - To cc node bin, node li v node kt hp - To cc lin kt WDM. - Thc hin qu trnh ng khi. - Thc hin nh tuyn. - Thc hin vic gii quyt xung t bng b m, chuyn hng v phn on burst. - Thc hin vic lp lch knh truyn LAUC, LAUC-VF,.. 4.4.2 Cc module trong OBS4NS. Phn mm OBS4NS c xy dng t cc module sau: Module to node mng (ObsNode) Cc node trong mng OBS bao gm node bin v node li. Phn mm ny cng xy dng mt module to cc node ny trong mng, cc node mng trong phn mm ny l node unicast khng h tr node multicast. - Node bin Ng vo ca node bin l lu lng ly t module to lu lng. Cc thng s ca lu lng tu thuc vo lu lng a vo. Gi tr ng ra ca node bin l cc burst d liu, gi iu khin, thng tin v ng i ngn nht, bc sng cho gi iu khin v burst d liu.

- 73 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh di y m t kin trc ca node bin v node li trong OBS4NS. Hnh v cho thy nhng phn ging nhau trong khi xy dng i tng m phng l c node bin v node li u s dng chung thnh phn to kt ni (Connector/ObsLink) v s dng bin entry_ xc nh li vo. Phn khc nhau gia node bin v node li l node bin c phn giao din lp MAC cn node li c chuyn mch quang khi (Classifier/ObsSwitch)

Hnh 4.7 Giao din lp MAC Giao din n lp MAC l thnh phn c bn ca node bin c nhim v nhn lu lng t khi to lu lng (lu lng c to ra bng mt s module trong NS-2). N phn loi gi n theo ch n (Classifier/Addr) v theo lp dch v (Classifier/CoS). K n b ng khi (Agent/Burstifier) c chc nng tp trung cc gi tin lp cao vo b m ri to thnh burst d liu cng vi vic pht gi iu khin. Cui cng l b lp lch knh truyn (ChannelScheduler) chn mt bc sng thch hp cho burst d liu ng ra. Node bin ch c b gii ng khi (Agent/Deburstifier) tch cc gi tin t burst d liu nhn c.

- 74 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Thnh phn quan trng nht ca giao din lp MAC l b ng khi (Agent/Burstifier). Cc bin s cho b ng khi quyt nh vic ng khi nh th no: MaxDBsize_ : ng khi theo tiu chun v dung lng ti a. Max_packets_ : ng khi theo tiu chun v s lng gi ti a trong burst. Time_out_ : ng khi theo tiu chun thi gian ti a. Np_ : s lng gi trong mt burst thc t c pht i. Size_ : dung lng thc t c pht i.

Hnh 4.8 Giao din lp MAC Khi mt burst d liu c a vo mng, mt gi iu khin c to ra cho burst ny. Gi iu khin ny c gi vo mng ngay tc khc cn burst d liu phi i trong b m mt khong thi gian b mi c pht i. Thi gian b c tnh nh sau:

Toffset ,i = max(TBHPproc )(n + 1) + Tswitch + (Toffset ,i 1 + TTx ,i 1 ) + Textra

- 75 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Vi n: s bc nhy t ngun n ch. i: mc u tin dch v.


max(T BHPproc)

: thi gian x l gi iu khin ti mi node. Nu chng ta gi


max(T BHPproc)

s rng thi gian x l gi iu khin cc i ti mi node l bng nhau k c node ngun th tng thi gian x l gi iu khin l (n+1)

Tswitch : thi gian chuyn mch ti mi node trung gian Toffset ,i 1 TTx ,i 1

: thi gian offset time ca burst c mc u tin cao hn.

: thi gian truyn burst c mc u tin cao hn ti a. iu ny to ra

s cch ly 100% gia cc lp dch v. - Textra : l thi gian pht sinh do cc tnh hung khc v c tnh nh say:
Textra = max(TBHPproc )ndefl + TBHPqueue + Trandom + ndefl

: l s ln chuyn hng ti a ca mt burst theo mt phng thc

chng loop.
TBHPqueue

: l thi gian gi iu khin cn phi cha trong hng i.

: l khong thi gian rt nh, l khong thi gian bo v, cho php chuyn

mch chuyn t trng thi hot ng sang trng thi cu hnh li.
Trandom : l khong thi gian c to ngu nhin trong mt khong no

ng vai tr mt thng s ngu nhin no trong mng. Max_bhp_queue_time_: bin ny cho php ci t
TBHPqueue

Extra_random_time_: bin ny cho php ci t Trandom


T Extra_fixed_time_: bin ny gii hn s bin i Trandom v Tx ,i 1

Equal_offset_: cho php gi tr offset time ca cc lp dch v khc nhau bng nhau.

- 76 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Bhp_struct_map_: cho php gi iu khin c th sa li khi thng tin v burst trn ng truyn b thay i (v d nh burst b rt mt phn). Bhp_size_: bin thit lp kch thc gi iu khin. Segmentation_: cho php phn on burst trong min in. Max_segmentation_: s lng on ln nht trong mt burst. Min_segmentation_size_: kch thc ti thiu ca mi on. Stats_ : cho php gi chc nng thng k.

Hnh 4.9 Thi gian offset - Node li Thnh phn ch yu ca node li l n v iu khin chuyn mch SCU v ma trn chuyn mch quang OXC. Cc thnh phn ny thuc lp Classifier/ObsSwitch

- 77 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Ng ra

SCU BHP

DB OXC

(Classifier/ObsSwitch)

Hnh 4.10 Node li trong OBS4NS Chng trnh xy dng SCU vi cc bin s sau: Bhp_proc_time_: thi gian x l gi iu khin. Channel_schedule_: chn la loi lp lch knh truyn. Multipath_: cho php chn la nhiu ng i hay khng. Deflection_ : cho php SCU cu hnh cho OXC chuyn hng burst trong vic gii quyt xung t. Segmentation_: cho php SCU cu hnh cho OXC phn on burst trong vic gii quyt xung t. Max_segmentation_size_: kch thc nh nht cho mi on. Switch_time_: thi gian chuyn mch ca ma trn chuyn mch quang.

- 78 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

- Node kt hp Ngoi node bin v node li vi cc chc nng ring bit, phn mm cn xy dng mt node kt hp bao gm c chc nng node bin ln chc nng node li.
Node kt hp Agent

Agent (Classifier/TypeSwitch) Agent IP Ng vo Giao din kt ni n lp MAC Gii a hp (Classifier/Port)

OBS Node li OBS

(Connector/ObsLink)

Ng ra

Ng ra

Hnh 4.11 Node kt hp T hnh ta thy node kt hp c th x l hai loi lu lng IP v burst d liu. Classifier/TypeSwitch c nhim v xt xem lu lng n l IP hay l burst, t a ra quyt nh lu lng ny x l phn no (node li hay node bin). Cc thng s lin quan khc c cu hnh ging nh cu hnh i vi node bin v cu hnh i vi node li. Module to lin kt trong mng (Connector/ObsLink) Do lin kt trong mng OBS l cc lin kt WDM nn trong xy dng chng trnh cng c chc nng to lin kt WDM. Lin kt WDM trong chng trnh to nn cc bin s sau: ndc_: s knh d liu. ncc_: s knh iu khin.

- 79 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

dc_bandwidth_: bng thng knh d liu. cc_bandwidth_: bng thng knh iu khin. delay_: tr lan truyn trn mi lin kt. Module n v truyn dn trong mng (ObsPacket) Hai n v truyn dn trong mng l gi iu khin OBS_BHP v burst d liu OBS_DB, burst d liu trong OBS4NS khng phi l mt gi c th nh trong NS-2, chng trnh m phng ch xt hai gi tr v im bt u DB_START v kt thc DB_END ca mi burst. C th trong chng trnh hai gi tr ny l hai bin NULL, iu ny lm cho vic x l burst d liu nhanh hn v thch hp cho vic x l ca my tnh. OBS_BHP: chng trnh s to ra gi iu khin vi cc thng s sau: Id_: bin s nhn din mi gi BHP. Db_start_time_: thi im bt u ca burst. Db_end_time_: thi im kt thc ca burst. Channel_: gi BHP ny s a n knh no. Ttl_: thi gian sng ca gi BHP. Offset_obs_bhp_: thng s v thi gian b. Stats_: bin gi module thng k. Id_ Db_start_time_ Db_end_time_ Channel_ Ttl_ Offset_obs_bhp_ Stats_

OBS_DB: Chng trnh to ra burst d liu vi cc thng s sau: Type_: cho bit l DB_START hay DB_END. Id_: s nhn din burst, cng ch s vi OBS_BHP tng ng. Src_: a ch node ngun. Dst_: a ch node ch. Channel_: burst ny s c a ln knh no. Stats_: bin gi module thng k.

- 80 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Phn Dbpayload i din cho phn d liu ca burst c pht i bao gm 3 bin s lin quan: Np_: s gi tin thc t trong mt burst. Size_: kch thc thc t ca burst Number_DB_: s lng on trong mt burst d liu trong trng hp ng khi kiu phn on. Module lp lch knh truyn (ChannelScheduler) Khi mt burst d liu c to ra hoc khi n i qua cc node trung gian, n cn c sp xp n mt bc sng no ng ra. Ba phng thc lp lch c nhiu nh nghin cu quan tm nht c xy dng trong OBS4NS l: FFUC, LAUC v LAUC-VF. ChannelScheduler/FFUC: Thut gii lp lch knh l FFUC. ChannelScheduler/LAUC: Thut gii lp lch knh truyn l LAUC. ChannelScheduler/LAU_VF: Thut gii lp lch knh truyn l LAUC-VF. Module nh tuyn (ObsRoute) OBS4NS tnh ton ng i da trn gii thut ng i ngn nht SPF. Mi node mng cng vi cc lin kt to ra mt topo mng. Sau mi node mng s lu tr mt bng cc node ln cn ca n. Vic tnh ton ng i ngn nht t node ny n node kia ban u da vo s chng tm ng i ngn nht. Nu nh vic tm ng i da vo s bc nhy tm c nhiu hn mt con ng n ch th con ng ngn nht c chn chnh l con ng c tr lan truyn nh nht. Module thng k (stats)

- 81 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Trong phn mm OBS4NS burst d liu khng phi l mt gi c th nh trong NS-2, chng trnh ch m phng hai gi tr thi im bt u v kt thc mi burst, do khng th a ra kt qu bng file trace nh NS-2. Phn mm OBS4NS h tr vic theo di kt qu bng mt module thng k. Cc bin trong hm thng k ny gm: Get-global-stats-collector: Dng thng k tt c cc gi i vo h thng. Get-flow-stats-collector:Dng thng k tt c cc gi i vo theo tng lung ring r 4.5 Cc trng hp thc hin m phng. TRNG HP 1: QoS da trn vic thay i cc thng s ng gi. [20,1]: Vic thc hin vic so snh cc thng s ng gi khc nhau c thc hin di tiu chun drop policy (DP) v phn mnh gii quyt xung t (SDP). Hai tiu chun ny c cp n trong chng II. Mt ngng vi hai mc u tin: Trong phn ny chng ta gi s mng mang hai lp lu lng chy trn hai lp dch v vi hai mc u tin khc nhau: lp 1 c mc u tin thp, lp 2 c mc u tin cao, tc gp i lp 1. Vic thit lp mt thng s ngng cho tt c cc burst d liu trong mng ln lt l:100, 150, 300 gi trong burst. Chng ta s nh gi kh nng mt gi ca cc ti a vo mng vi cc thng s ngng khc nhau. TRNG HP 2: QoS da trn vic thay i cc tiu chun xp lch knh. [10]: Vic thc hin m phng nh gi QoS da trn vic thay i cc tiu chun xp lch knh vi s dng tiu chun drop policy v phn mnh gii quyt xung t vi mt ngng ng gi c nh. Mng OBS m phng mang hai lp dch v. - M phng mng OBS vi tiu chun xp lch knh LAUC. - M phng mng OBS vi tiu chun xp lch knh FFUC. - M phng mng OBS vi tiu chun xp lch knh LAUCVF. TRNG HP 3: QoS da trn vic gii quyt xung t.[1]: trng hp ny s thc hin m phng mng OBS mang hai lp traffic vi hai mc u tin khc nhau. Cc tiu chun gii quyt xung t c s dng l DP, SDP, DFSDP,

- 82 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

DFDP, SFDP. Chng ta s nh gi kt qu da trn kh nng mt gi ca lu lng a vo mng vi mt ngng ng gi c nh. TRNG HP 4: QoS da trn tn hiu u tin: Vic m phng s thc hin trn mng OBS vi hai tn hiu c s dng l JET v JIT. Chng ta cng s nh gi kt qu da trn kh nng mt gi vi cc mc lu lng khc nhau. TRNG HP 5: Trng hp ny cp n tr do chuyn mch OBS gy ra. Trng hp ny xt n 3 tnh hung: - Tnh hung th nht: mng chuyn mch quang chm OBS c hai lp dch v, lp dch v th nht c u tin thp hn lp th hai, lp lch knh truyn LAUCVF, gii quyt xung t DP, ngng 100. - Tnh hung th hai: mng chuyn mch quang chm OBS c hai lp dch v, lp dch v th nht c u tin thp th hai, lp lch knh truyn LAUCVF, gii quyt xung t SDP, ngng 100. - Tnh hung th ba: mng chuyn mch quang chm OBS c hai lp dch v, lp th nht c u tin thp hn lp th hai, s dng giao thc bo hiu JET, lp lch knh truyn LAUCVF, ngng 100. 4.6 Xy dng kch bn m phng. 4.6.1 Lu xy dng kch bn m phng.

- 83 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Bt u

Ly ngun cho m phng

To m hnh mng NSFNET

Thit lp cc thng s mng

Khi to cc bin

Thit lp cc thng s SCU gii quyt xung t

a lu lng vo mng trn mi cp node ng S gi gi <= 1000000 gi Sai Kt thc lu lng

Thu thp kt qu

Kt thc

Hnh 4.12 Lu m phng

- 84 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

4.6.2 Cc bc thc hin m phng. Ly ngun Phn mm m phng OBS4NS xy dng tng i y cc th vin cn thit cho vic m phng mt mng quang, chng ta gi li cc ngun cn thit cho vic m phng bng cch tr ng dn n cc th vin nh sau: Source {ng dn n th mc obs4ns-3.4}/tcl/lib/ns-obs-lib.tcl Source {ng dn n th mc obs4ns-3.4}/tcl/lib/ns-obs-node.tcl Source {ng dn n th mc obs4ns-3.4}/tcl/lib/ns-obs-link.tcl Source {ng dn n th mc obs4ns-3.4}/tcl/lib/ns-obs-stats.tcl Source {ng dn n th mc obs4ns-3.4}/tcl/lib/ns-obs-defaults.tcl Khi to cc bin Khai bo cc bin c nh ngha bn ngoi kch bn m phng a ti vo mng. Bin load thay i t 0,1 (Erlang) n 1 (Erlang). i vi mi loi lu lng thi im pht gi u tin ph thuc vo hm ngu nhin. Hm ngu nhin ny to ra mt s ngu nhin da vo bin seed. Set load [lindex $argv 0] // a ti vo mng Set opt(seed) [lindex $argv] // Khi to cc s ngu nhin. To i tng m phng mi. Set ns [new Simulator] To cc node mng. Nh cp trong chng 2, mt mng OBS gm c cc node bin, node li v node kt hp. Phn mm OBS4NS-3.4 h tr vic xy dng cc node mng nh sau: Set c($i) [$ns ObsCoreNode $ncc $ndc ChannelScheduler/$stype CoS] // Khi to cc node li Set e($i) [$ns ObsEdgeNode $ncc $ndc ChannelScheduler/$stype CoS] // Khi to node bin. Set h($i) [$ns ObsHybridNode $ncc $ndc ChannelScheduler/$stype CoS] // Khi to cc node kt hp

- 85 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Trong : ChannelScheduler/$stype: loi lp lch knh truyn. Ndc: s lng knh d liu ng ra ca mi node. Ncc: s knh iu khin ng ra ca mi node. CoS: s mc dch v. To cc lin kt trong mng. Sau khi to cc node mng bc tip theo chng ta s xy dng cc lin kt trong mng to nn mt topology mng hon chnh. Cu lnh to lin kt song hng gia hai node mng c dng nh sau: $ns duplex-obs-link $c($i) $c($j) $ncc $ndc $d ChannelScheduler/$stype Trong : C($i): node th i C($j): node th j d: khong cch gia node th i v node th j, n v km. duplex-obs-link: lin kt l song hng. Dng lnh $ns compile-obs hon tt vic lin kt gia cc node mng. Thit lp cc thng s mng. m phng hot ng ca mng OBS, chng ta s thit lp cc thng s mng theo cc gi nh ban u. Cc thng s cn thit lp l bng thng lin kt, cc thng s ng khi (burst assembly), cc thng s b kt ni quang cho OXC, cc thng s iu khin chuyn mch SCU. Connector/ObsLink dc_bandwidth Connector/ObsLink cc_bandwidth khin. Agent/Burstifier set max_db_size_ [expr 1250*$number] Agent/Burstifer set timeout_ Agent/OXC switch_time Agent/Burstifier set bhp_size_ // ng khi theo kch thc ti a vi number l s lng gi tin trong mt burst. // ng khi theo tiu chun thi gian. // thit lp kch thc gi iu khin. // thit lp thi gian chuyn mch. // thit lpbng thng knh d liu. // thit lp bng thng knh iu

- 86 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Agent/SCU max_bhp_proc_time // thit lp thi gian x l gi iu khin. Agent/Burstifier set max_segmentations_ a khi phn on mt burst. Agent/Burstifier set min_segmentable_size_ nht ca mi on. Agent/Burstifier set segmentation_ // thit lp cc thng s cho php gii quyt xung t trong b ng khi bng phn on burst. Agent/SCU set signalling_ // thit lp k thut bo hiu. y l phn quan trng nht trong vic m phng, vic xc lp cc thng s ca b kt ni quang cho OXC v cc thng s iu khin chuyn mch SCU quyt nh vic thay i cc thng s QoS trn mng. a lu lng vo mng. Bc tip theo l a ti vo mng vi lu lng a vo mng theo phn b Poisson: Set rate [expr $load*$ndc*$n_link*[Connector/ObsLink dc_bandwidth]/$n_app] // Tc ca mi lung lu lng c tnh ra t ti a vo mng. Set Poi($i$j) [new Application/Traffic/Poisson] // To lu lng theo phn b Poisson. $Poi($i$j) set rate_ $rate // Gn tc cho lu lng. $Poi($i$j) set packetSize_ // Gn kch thc gi. Set udp($i$j) [$c($i) set burstifier_([$c($j) id]:QoS) // To udp gn lu lng vi QoS l th t lp dch v. $Poi($i$j) attach-agent $udp($i$j) // t lu lng trn tt c cc cp node. $udp($i$j) set-traffic-generator $Poi($i$j) $ns at 0.0 $udp($i$j) start // thit lp kch thc nh // thit lp s lng on ti

- 87 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

// cho php bt u chy lu lng khi mi bt u chy m phng. Kt thc lu lng. M phng c gi s s kt thc khi s gi pht i vo mng t n con s nh mong mun. Phn mm OBS4NS ch xc nh cc bin s u vo v u ra nn trong phn ny phi gi chc nng thng k thc hin vic m gi set sc [$ns get-global-stats-collector k] // khi to bin sc ghi nhn cc s kin, k l s th t ca lp dch v $sc set-counter-convergence IP_IND 1000000 // m phng kt thc khi d liu c a vo mng t n mc 1 triu gi. Stats stop-command stop // gi hm stop kt thc m phng. $ns at [RouteLogic/ObsRoute transit_time] $ns enable-stats // cho php gi chc nng thng k trong thi gian thc hin m phng. Hm stop c to ra nh sau: Proc stop {} { Global ns udp $ns at-now $udp($i$j$k) stop // Kt thc pht burst Set now [$ns now] $ns at [expr $now +0.2] finish // ch 0.2s sau khi cc burst n ch ri mi kt thc m phng Kt thc m phng v ly kt qu. Sau khi kt thc m phng, s thu thp kt qu v ghi kt qu ny vo mt file text. To hm finish nh sau: Proc finish {} { Global ns sc Set ip_snd [expr [$sc get-counter-value IP_SND]] // ly s lng gi c pht i.

- 88 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Set ip_rcv [expr [$sc get-counter-value IP_RCV]] // ly s lng gi nhn c. Set ip_drop [expr $ip_snd - $ip_rcv] // tnh s lng gi b rt. Set ip_p [expr 1.0*$ip_p/$ip_snd] // tnh xc sut mt gi. Set file [open results.txt a] // khi to mt file ghi kt qu. Puts $file $ip_p // ghi kt qu xc sut mt gi vo mt file Exit 0 } Bt u chy m phng. Bt u chy m phng bng lnh: $ns 4.7 Kt qu m phng. Cc s liu t vic chy m phng c biu din di dng th. Nhng th ny c v bng phn mm matlab 6.5. TRNG HP 1: QoS da trn cc thng s ngng ng khi (burst assembly). Vic m phng ly 3 mc ngng l 100, 150, 300 trn hai lp dch v, vi hai tc khac nhau. Lp dch v th nht c u tin thp, lp dch v th hai c tc gp i lp th nht v c u tin cao. Tiu chun gii quyt xung t l drop policy (DP) v Phn mnh gii quyt xung t (SDP), giao thc bo hiu l JET.

- 89 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.13 Kt qu m phng da trn cc thng s ng khi 100, 150, 300 v gii quyt xung t da trn tiu chun DP.

- 90 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.14 Kt qu m phng da trn cc thng s ng khi 100, 150, 300 v gii quyt xung t da trn tiu chun SDP. Nhng kt qu trn cho thy rng trong c hai trng hp DP v SDP cho nhng kt qu sau: - Thng s ng khi cng ln kh nng mt gi cng cao. - Lu lng a vo cng cao kh nng mt gi cng ln. - Burst c u tin cao t mt gi hn so vi burst c u tin thp. Trng hp ng khi vi tiu chun SDP cho mt gi thp hn trong trng hp ng khi theo tiu chun DP. TRNG HP 2: QoS da trn cc thng s xp lch knh. Vic m phng thc hin trn hai lp dch v vi hai mc u tin khc nhau da trn tiu chun lp lch knh l FFUC, LAUC, LAUCVF vi ngng l 100 gi. Hai tiu chun gii quyt xung t l SDP v DP, giao thc bo hiu l JET.

- 91 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.15 Kt qu m phng da trn cc thng s xp lch knh FFUC, LAUC, LAUCVF v gii quyt xung t da trn tiu chun DP.

- 92 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.16 Kt qu m phng da trn cc thng s xp lch knh FFUC, LAUC, LAUCVF v gii quyt xung t da trn tiu chun SDP. Trong cc trng hp trn cho cc kt qu sau: - Tiu chun lp lch knh LAUCVF cho mt gi thp nht. - Lu lng a vo cng ln kh nng mt gi cng ln. - Lp dch v c u tin cao cho mt gi thp hn rt nhiu so vi lp dch v c u tin thp. - Tiu chun gii quyt xung t SDP cho mt gi t hn so vi DP. TRNG HP 3: QoS da trn vic thay i cc tiu chun gii quyt xung t. Cc tiu chun gii quyt xung t ln lt l: DP, SDP, DDP, SDDP, DSDP. Ngng ng khi l 100, tiu chun lp lch knh l LAUCVF, giao thc bo hiu l JET.

- 93 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.17 Kt qu m phng da trn cc tiu chun gii quyt xung t. Cc m phng trn cho nhng kt qu sau: - Hai tiu chun gii quyt xung t DSDP v SDDP cho kh nng mt gi thp. - Ti a vo mng cng cao kh nng mt gi cng cao. - Lp dch v c u tin cao kh nng mt gi thp hn lp dch v c u tin thp. TRNG HP 4: QoS da trn cc thng s bo hiu. M phng s dng hai giao thc bo hiu l JET v JIT vi hai lp dch v khc c mc u tin khc nhau, ngng ng khi l 100, tiu chun gii quyt xung t l DP v SDP.

- 94 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.18 Kt qu m phng da trn thng s bo hiu vi tiu chun gii quyt xung t DP.

- 95 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.19 Kt qu m phng da trn cc thng s bo hiu vi tiu chun gii quyt xung t SDP. Cc m phng trn cho cc kt qu: - JET cho mt gi thp hn JIT. - Ti a vo mng cng ln kh nng mt gi cng thp. - Lp dch v c u tin cao t mt gi hn lp dch v c u tin thp. - Tiu chun SDP cho mt gi t hn so vi DP.

- 96 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

TRNG HP 5: Xem xt tr trung bnh do chuyn mch quang chm gy ra.

Hnh 4.20 : Delay trn mng OBS vi hai lp dch v, lp lch knh tryn LAUCVF, gii quyt xung t DP, ngng 100

- 97 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.21: Delay trn mng OBS vi hai lp dch v, lp lch knh tryn LAUCVF, gii quyt xung t SDP, ngng 100

- 98 -

GVHD: TS. L QUC CNG

HVTH: CAO NHT BNH

Hnh 4.22: Delay trn mng OBS vi hai lp dch v, lp lch knh tryn LAUCVF, ngng 100, giao thc bo hiu JET Nhn xt: Trong c ba trng hp trn cho thy nhng lp c u tin cao hn cho tr trung bnh t hn. Lu lng a vo mng cng cao tr trung bnh cng gim xung. K thut bo hiu JET v JIT c tr gn ging nhau nhng JET c tr thp hn so vi JIT do phng php ng k tr hon, gii phng bng thng tt hn. SDDP cho tr cao hn so vi DP v cn nhiu thi gian x l hn.

- 99 -