Está en la página 1de 84

n tt nghip i hc MC LC

Mc Lc

KT LUN.................................................................................................................67

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc

Danh Mc Hnh V

DANH MC HNH V
Hnh 1.1: MPLS v m hnh tham chiu OSI..........................................................1 Hnh 1.2: So snh gia chuyn tip IP v chuyn tip MPLS................................2 Hnh 1.3: Min MPLS................................................................................................3 Hnh 1.4: ng ln v ng xung LSR...............................................................3 Hnh 1.5: Lp chuyn tip tng ng trong MPLS......................4 Hnh 1.6: Ngn xp nhn.........................................................................................4 Hnh 1.7: ng chuyn mch nhn LSP.................................................................5 Hnh 1.8: Phn cp LSP trong MPLS........................................................................6 Hnh 1.9: Gi IP i qua mng MPLS.........................................................................6 Hnh 1.10: nh dng mt thc th trong ngn xp nhn MPLS..........................7 Hnh 1.11: Tiu shim c m vo gia tiu lp 2 v lp 3.................8 Hnh 1.12: Nhn trong ch ATM..................................................................8 Hnh 1.13: ng gi c nhn trn lin kt ATM.......................................................9 Hnh 1.14: Cu trc ca LER v transit-LSR............................................10 Hnh 1.15: Mt NHLFE.............................................................................................11 Hnh 1.16: Bn trong mt phng chuyn tip MPLS.............................................13 Hnh 1.17: nh tuyn rng buc.........................................................................14 Hnh 1.18: Phn phi nhn khng cn yu cu .................................................15 Hnh 1.19: Phn phi nhn gn kt Nhn-FEC..............................16 Hnh 1.20: Duy tr nhn t do..........................................................................16 Hnh 1.21: Duy tr nhn bo th....................................................................17 Hnh 1.22: iu khin c lp...................................................................................18 Hnh 1.23: iu khin tun t..................................................................................18 Hnh 1.24: Vng hot ng ca LDP.......................................................................18 Hnh 1.25: Trao i thng ip LDP.................................................................19 Hnh 1.26: LDP Hearder..........................................................................................20 Hnh 1.28: LDP ch iu khin theo yu cu.....................................................23 Hnh 1.29: Thit lp LSP v CR-LD.................................................................25 Hnh 1.30: Thit lp LSP vi RSVP-TE....................................................28 Hnh 1.31: Ni dung bn tin BGP Update....................................................30 Hnh 1.32: BGP phn phi nhn qua nhiu Autonomous System....31 Hnh 2.1: Nhiu lung cho mi lp lu lng.....................................36 Hnh 2.2: Hng i CQ..............................................................................................36 Hnh 2.3: Hng i PQ........................................................................................37 Hnh 2.4: Gii thut thng d.................................................................37 Hnh 2.5: Gii thut thng token.................................................................38 Hnh 2.6: M hnh xp chng.................................................................................39 Hnh 2.7: Bng thng kh dng ng vi tng mc u tin..................44 Hnh 2.8: Xem xt cc rng buc khng ch.........................................46 Hnh 2.9: Xem xt ti nguyn kh dng..................................................................47 Hnh 2.10: Chn ng tt nht...............................................................................47 Hnh 2.11: M hnh MAKAM.............................................................................50 Hnh 2.12: M hnh Haskin..............................................................................51 Hnh 2.13: M hnh Shortest-Dynamic......................................52 Hnh 2.14: M hnh Simple_Dynamic.....................................................53 Hnh 3.1: Tng quan v NS di gc ngi dng.......................................55 Hnh 3.2: Lung cc s kin cho file Tcl chy trong NS ..............................56 Hnh 3.3: Kin trc ca NS-2....................................................................................57 Hc vin cng ngh bu chnh vin thng i

n tt nghip i hc

Danh Mc Hnh V

Hnh 3.4: C++ v OTcl: S i ngu......................................................57 Hnh 3.5: TclCL hot ng nh lin kt gia A v B.................................58 Hnh 3.6: M hnh mng ...................................................................................59 Hnh 3.7: Lch trnh m phng ............................................................................60 Hnh 3.8: th Xgraph...............................................................................61 Hnh 3.9: Bo hiu thit lp ng lm vic v bo v..........................................62 Hnh 3.10: S ng lm vic ER=1_3_5_7_9.......................................................63 Hnh 3.11: Pht hin li ............................................................................................63 Hnh 3.12: Chuyn sang ng bo v....................................................................64 Hnh 3.13: Li c khi phc............................................................................64 Hnh 3.14: Chuyn lu lng tr li ng lm vic.............................................65 Hnh 3.15: Kt thc qu trnh truyn gi................................................................65

Hc vin cng ngh bu chnh vin thng

ii

n tt nghip i hc

Thut Ng Vit Tt

THUT NG VIT TT
ARP ATM BGP CLIP CR CR-LDP CR-LSP CSPF DiffServ ER FEC FR GMPLS IETF IP IPOA LAN LANE LDP LER LIB LIS LSFT LSP LSR MG MPLS NHRP Address Resolution Protocol Asynchronous Transfer Mode Border Gateway Protocol Classical IP Constrained Routing Constrained Routing - LDP Constrained Routing - LSP Constrained Shortest Path First Differentiated Service Explicit Routing Fowarding Equivalent Class Frame Relay Generalized Multiprotocol Label Switching Internet Engineering Task Force Internet Protocol IP over ATM Local Area Network LAN Emulation Label Distribution Protocol Label Edge Router Label Information Base Logical IP Subnet Label Switching Forwarding Table Label Switched Path Label Switch Router Media Gateway Multiprotocol Label Switching Next Hop Resolution Protocol Giao thc phn gii a ch Truyn dn khng ng b Giao thc cng ng bin IP trn ATM nh tuyn cng bc nh tuyn cng bc - LDP nh tuyn cng bc - LSP SPF cng bc Cc dch v c phn bit nh tuyn hin Lp chuyn tip tng ng Chuyn tip khung Chuyn mch nhn a giao thc tng qut. Nhm tc v k thut Internet Giao thc Internet IP trn ATM Mng cc b M phng LAN Giao thc phn b nhn B nh tuyn bin nhn C s thng tin nhn Mng con IP logic Bng chuyn tip nhn ng dn chuyn mch nhn B nh tuyn chuyn mch nhn Cng a phng tin Chuyn mch nhn a giao thc Giao thc phn gii chng k tip
i

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc

Thut Ng Vit Tt

OSPF PPP PSTN QoS RESV RFC RSVP SG SLA SNMP SONET SPF STM SVC TCP TGW TLV ToS TTL UDP VC VCI VNPT VP VPI VPN WAN WFQ

Open Shortest Path First Point to Point Protocol Public Switch Telephone Network Quality of Service Resevation Request For Comment Resource Resevation Protocol Signaling Gateway Service Level Agreement Simple Network Management Protocol Synchronous Optical Network Shortest Path First Synchronous Transmission Mode Signaling Virtual Circuit Transission Control Protocol Traffic Gateway Type-Leng-Value Type of Service Time To Live User Datagram Protocol Virtual Circuit Virtual Circuit Identifier Vietnam Post&Telecommunications Virtual Path Virtual Path Identifier Virtual Private Network Wide Area Network Weighted Fair Queuing

Giao thc ng i ngn nht u tin Giao thc im - im Mng thoi chuyn mch cng cng Cht lng dch v Bn tin dnh trc Yu cu kin Giao thc dnh trc ti nguyn Cng bo hiu Tho thun mc dch v Giao thc qun l mng n Mng truyn dn quang ng b ng i ngn nht u tin Ch truyn dn ng b Knh o bo hiu Giao thc iu khin truyn dn Cng lu lng Kiu-Chiu di-Gi tr Kiu dch v Thi gian sng Giao thc lc d liu Knh o Nhn dng knh o Tng cng ty BCVT Vit Nam ng o Nhn dng ng o Mng ring o Mng din rng Hng i cng bng ti trng

Hc vin cng ngh bu chnh vin thng

ii

n tt nghip i hc

M u

M U
S pht trin nhanh chng cc dch v IP v s bng n Internet dn n mt lot thay i trong nhn thc kinh doanh ca cc nh khai thc. Lu lng ln nht hin nay trn mng trc l lu lng IP. Giao thc IP thng tr ton b cc giao thc lp mng, h qu l tt c cc xu hng pht trin cng ngh lp di u h tr IP. Nhu cu th trng cp bch cho mng tc cao vi chi ph thp l c s cho mt lot cc cng ngh mi ra i, trong c MPLS. Nhng nm gn y l khong thi gian m cng ngh MPLS chng minh c tnh ng dng thc tin cc tnh nng vt tri ca n so vi cc cng ngh chuyn mch truyn thng khc nh ATM. Tp on bu chnh vin thng Vit Nam la chn IP/MPLS lm cng ngh cho lp truyn ti mng NGN ang trin khai trn phm vi ton quc. Mt trong nhng u im ln nht ca MPLS l kh nng thc hin k thut lu lng. y cng l i tng nghin cu chnh ca n tt nghip ny. ti c t chc thnh 3 chng vi cc ni dung chnh nh sau: Chng 1- Tng quan v chuyn mch nhn a giao thc: gii thiu tng quan cng ngh MPLS, cc khi nim c bn, kin trc chc nng v c ch hot ng ca MPLS, cc k thut nh tuyn c h tr bi MPLS, ch bo hiu v mt s giao thc bo hiu phn phi nhn ca MPLS. Chng 2- K thut lu lng trong MPLS v c ch bo v khi phc ng: Trnh by cc khi nim v mc tiu ca k thut lu lng, kh nng v cc c ch thc hin k thut lu lng ca MPLS. Ni dung tp trung vo vn nh x lu lng ln topology vt l, tc l tnh ton ng i tt nht qua mng ca lu lng sao cho mng hot ng hiu qu v tin cy nht. Cc vn bo v khi phc ng mt trong nhng nhim v ca k thut lu lng cng c trnh by trong chng ny. Chng 3- Xy dng chng trnh m phng MPLS-TE: Trnh by kt qu thc hin m phng MPLS-TE trn my tnh vi phn mm NS-2 lm r c ch thc hin k thut lu lng ca MPLS. M hnh bo v khi phc lu lng ca MPLS cng c m phng trong phn ny.

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc

M u

Em rt mong nhn c cc kin ng gp ca cc thy c hon thnh thm kin thc trong lnh vc ny. Qua y, em xin gi li cm n n TS Nguyn Tin Ban, gio vin hng dn gip em trong sut qu trnh thc hin n ny. H ni, thng 11 nm 2008 Sinh vin

Tin Thnh

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

CHNG I
TNG QUAN V CHUYN MCH NHN A GIAO THC 1.1 Gii thiu
MPLS l vit tt ca Muti-Protocol Label Switching. Thut ng Muti-Protocol nhn mnh rng cng ngh ny p dng cho c tt c cc giao thc lp mng ch khng phi ch ring cho IP. MPLS hot ng tt trn bt k cc giao thc lp lin kt no. y l mt cng ngh lai kt hp nhng c tnh tt nht ca nh tuyn lp 3 (Layer 3 routing) v chuyn mch lp 2 (Layer 2 swithching) (hnh 1.1). Trong mng chuyn mch knh, tnh thng minh ch yu tp trung mng li (core). Tt c nhng thit b thng minh u t trong mng li nh cc tng i toll, transit, MSCCc thit b km thng minh hn th t bn trong mng bin(egde), v d nh cc tng i ni hay, truy nhp. Trong mng gi IP, tnh thng minh cng a ra bin th mng cng hot ng tt. Tt c cc b nh tuyn u phi lm hai nhim v l nh tuyn v chuyn mch. y l u im nhng cng l nhc im ca IP. Quan im ca MPLS l tnh thng minh cng a ra bin th mng cng hot ng tt. L do l nhng thnh phn mng li phi chu ti rt cao. Thnh phn mng li nn c thng minh thp v nng lc chuyn ti cao. MPLS phn tch hai chc nng nh tuyn v chuyn mch: Cc b nh tuyn bin thc hin nh tuyn v gn nhn (label) cho gi. Cn cc b nh tuyn mng li ch tp trung lm nhim v chuyn tip gi vi tc cao da vo nhn. Tnh thng minh c y ra ngoi bin l mt trong nhng u im ln nht ca MPLS.

Hnh 1.1: MPLS v m hnh tham chiu OSI

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

MPLS c xem nh l mt cng ngh lp m (shim layer), n nm trn lp 2 nhng di lp 3 v vy i khi ngi ta cn gi l lp 2,5 (hnh 1.2). Nguyn l chung ca MPLS l tt c cc gi IP s c gn nhn (label) v chuyn tip theo mt ng dn LSP (Label Switch Path). Cc b nh tuyn trn ng dn ch cn c vo ni dung ca nhn thc hin quyt nh chuyn tip gi m khng cn phi kim tra tiu IP.

Hnh 1.2: So snh gia chuyn tip IP v chuyn tip MPLS

1.2 Cc khi nim c bn trong MPLS


1.2.1 Min MPLS RFC 3031 m t min MPLS l mt tp cc nt trong mng thc hin hot ng nh tuyn v chuyn tip MPLS. Mt min MPLS thng c qun l v iu khin bi mt nh qun tr. Min MPLS c chia thnh 2 phn: phn mng li (core) v phn mng bin (edge). Cc nt thuc min MPLS c gi l b nh tuyn chuyn mch nhn LSR (Label Switch Router). Cc nt phn mng li c gi l transit-LSR hay core-LSR (thng c gi tt l LSR). Cc nt bin c gi l b nh tuyn bin nhn LSR (Label Edge Router) (hnh 1.3).

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I
Label Switching Router(core LSR) Label Edge Router (LER)

Chng

Hnh 1.3: Min MPLS Nu mt LER l nt u tin trn ng i ca mt gi xuyn qua min MPLS th n c gi l LER li vo (ingress-LER), cn nu l nt cui cng th n c gi l LER li ra (ergress-LER). Lu l cc thut ng ny ch c p dng ty theo chiu ca lung lu lng trong mng, do vy mt LER c th l ingress-LER va l egress-LER ty theo cc lung lu lng ang xt nh hnh 1.4.
A l ng ln ca B B l ng xung ca A
V l ng ln ca C

C l ng xung ca B

Chiu lung gi

Hnh 1.4: ng ln v ng xung LSR Thut ng b nh tuyn ng ln LSR (LSR) v b nh tuyn ng xung LSR (downstream-LSR cng c dng, ph thuc vo chiu ca lung lu lng. Cc ti liu MPLS thng c dng k hiu Ru biu th cho upstream-LSR v dng k hiu Rd biu th cho downstream-LSR. 1.2.2 Lp chuyn tip tng ng Lp chuyn tip tng ng FEC (Forwarding Equitvalence Class) l mt tp cc gi c i x nh nhau bi mt LSR. Nh vy, FEC l mt nhm cc gi tin IP c chuyn tip trn cng mt ng chuyn mch nhn LSP, c i x theo cng mt cch thc v c th nh x vo mt nhn bi mt LSR cho d chng c th khc nhau v thng tin tiu lp mng. Hnh 1.5 cho thy cc x l ny.

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

Hnh 1.5: Lp chuyn tip tng ng trong MPLS 1.2.3 Nhn v ngn xp nhn RFC 3031 nh ngha nhn l mt b nhn dng c di ngn v c nh, mang theo ngha cc b dng nhn bit mt FEC. Nhn c dn ln mt gi bo cho LSR bit gi ny cn i u. Phn ni dung nhn c di 20 bit khng cu trc, nh vy s gi tr nhn c th c l 2^20 (hn mt triu gi tr). Gi tr nhn nh ngha ch mc (index) dng trong bng chuyn tip. Mt gi li c th c dn chng nhiu nhn, cc nhn ny cha trong mt ni gi l ngn xp nhn (label ngn xp). Ngn xp nhn l mt tp hp gm mt hoc nhiu thc th nhn t chc theo nguyn tc LIFO (hnh 1.6). Ti mi chng trong mng ch x l nhn hin hnh trn nh ngn xp. Chnh nhn ny s c LSR s dng chuyn tip gi.
nh ngn xp

Thc th ngn xp Thc th ngn xp

Mc d Mc d-1

Thc th ngn xp
y ngn xp

Mc 2 Mc 1

Thc th ngn xp Hnh 1.6: Ngn xp nhn

Nu gi tin cha c nhn th ngn xp nhn l rng ( su ca ngn xp nhn bng 0). Nu ngn xp c chiu su l d th mc 1 s l y ngn xp (bit S trong thc

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

th nhn t ln 1) v mc d s l nh ca ngn xp. Mt thc th nhn c th c t thm vo (push) hoc ly ra (pop) khi ngn xp. 1.2.4 Hon i nhn Hon i nhn (Label Swapping) l cch dng cc th tc chuyn tip gi. chuyn tip gi c nhn, LSR kim ra nhn trn nh ngn xp v dng nh x ILM (Incoming Label Map) nh x nhn ti mt thc th chuyn tip nhn NHLFE (Next Hop Label Forwarding Entry). S dng thng tin trong NHLFE, LSR xc nh ra ni chuyn tip gi v thc hin mt tc v trn ngn xp nhn. Ri n m ha ngn xp nhn mi vo gi v chuyn gi i. Chuyn tip gi cha c nhn cng tng t nhng xy ra ingress-LER. LER phi phn tch tiu lp mng xc nh FEC ri s dng nh x FTN (FEC-toNHLFE) nh x FEC vo mt NHLFE. 1.2.5 ng chuyn mch nhn LSP ng chuyn mch nhn LSP (Label Switched Path) l mt ng ni gia b nh tuyn li vo v b nh tuyn li ra, c thit lp bi cc nt MPLS chuyn cc gi i xuyn qua mng. ng dn ca mt LSP qua mng c nh ngha bi s chuyn i gi tr cc nhn cc LSR dc theo LSP bng cch dng th tc hon i nhn (hnh 1.7). Khi nim LSP tng t nh khi nim mch o (VC) trong ATM.

Hnh 1.7: ng chuyn mch nhn LSP Kin trc MPLS cho php phn cp cc LSP, tng t nh ATM s dng VPI v cc VCI to ra cc phn cp knh o (VC) nm trong ng o (VP). Tuy nhin ATM ch h tr 2 mc phn cp, trong khi vi MPLS th s mc phn cp cho php rt ln nh kh nng cha c nhiu thc th nhn trong ngn xp nhn. V l thuyt, gii hn s lng nhn trong ngn xp ph thuc gi tr MTU (Maximum Transfer Unit) ca cc giao thc lp lin kt c dng dc theo mt LSP.

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

Hnh 1.8: Phn cp LSP trong MPLS 1.2.6 Chuyn gi qua min MPLS Sau y l mt v d n gin minh ha qu trnh truyn gi tin IP i qua min MPLS (hnh 1.9). Gi tin IP khi i t ngoi mng vo trong min MPLS c b nh tuyn A ng vai tr l mt ingress-LER s gn nhn c gi tr l 6 cho gi IP ri chuyn tip n b nh tuyn B. B nh tuyn B da vo bng hon i nhn kim tra nhn ca gi tin. Gi tin thay i gi tr nhn mi l 3 v chuyn tip ti b nh tuyn C. Ti C, vic kim tra cng tng t nh B v s hon i nhn, gn cho gi tin mt nhn mi l 9 v tip tc c a n b nh tuyn D.

Hnh 1.9: Gi IP i qua mng MPLS

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

B nh tuyn D ng vai tr egress-LSR s kim tra trong bng hon i nhn v g b nhn 9 ra khi gi tin ri nh tuyn gi IP mt cch bnh thng i ra khi min MPLS. Vi kiu lm vic ny th cc LSR trung gian nh b nh tuyn B v C s khng phi thc hin kim tra ton b tiu IP ca gi tin m n ch vic kim tra cc gi tr ca nhn so vi nh tuyn IP truyn thng. ng i t b nh tuyn A n b nh tuyn D c gi l ng chuyn mch nhn LSP. 1.2.7 M ha ngn xp nhn Khi nhn c gn ln gi, bn thn gi tr nhn 20 bt s c m ha cng vi mt s thng tin cng thm ph tr trong qu trnh chuyn tip gi hnh thnh mt thc th nhn. Hnh 1.10 minh ha nh dng thc th nhn trong ngn xp nhn.

Hnh 1.10: nh dng mt thc th trong ngn xp nhn MPLS Nhm 32 bt hnh trn l mt thc th trong ngn xp nhn, trong phn gi tr nhn thc s ch c 20 bit. Tuy nhin ngi ta thng gi chung cho c thc th 32 bit ni trn l mt nhn. V vy khi tho lun v nhn cn phn bit l ang xem xt gi tr nhn 20 bit hay ni v thc th 32 bit trong ngn xp nhn. Phn thng tin 12 bit cng thm gm cc trng sau y:

EXP (mt s ti liu gi l CoS-Class of Service)-Gm 3 bt, c th l mt hm ca trng TOS (Type of Service) hoc Diffserv trong gi IP. a s cc nh sn xut s dng cc bit ny mang ch th QoS, thng l copy trc tip t cc bit TOS trong gi tin IP. Khi gi MPLS vo hng i, c th s dng cc bit EXP theo cch ging nh cc bit u tin trong IP.

S-Gm 1 bit, ch th y ca ngn xp nhn. Khi mt nhn nm y ngn xp nhn th bt S t ln 1, cn cc nhn khc c bit S t v 0. Bit S l phng tin xc nh y cu ngn xp nhn nm u.

TTL-Gm 8 bit, thng l copy trc tip t trng TTL ca tiu IP, c gim i 1 qua mi chng chn lp nh tuyn ging nh IP. Tuy nhin, cc bit TTL

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

cng c th c t khc TTL trong gi IP, thng dng khi nh khai thc mng mun che giu topology mng MPLS. MPLS c th hot ng cc ch : ch khung v ch t bo. 1.2.7.1 Ch khung Cc k thut lp 2 nh Ethernet, Token Ring, FDDI, PPP khng c trng no ph hp trong tiu ca khung c th mang nhn. V vy, ngn xp nhn s c cha trong tiu m (shim header). Tiu shim c m vo gia tiu lp lin kt v tiu lp mng, nh trong hnh 1.11. nh ngn xp nm lin sau tiu lp 2 v y ngn xp nm lin trc tiu lp mng.

Hnh 1.11: Tiu shim c m vo gia tiu lp 2 v lp 3 B nh tuyn gi khung phi c cch bo cho b nh tuyn nhn bit rng khung ny c cha tiu shim, cch thc ny khc nhau gia cc k thut lp 2. Ethernet s dng cp gi tr ethertype 0x8847 v 0x8848 ch th khung ang mang gi MPLS unicast v multicast tng ng. PPP s dng NCP (Network Control Program) sa i gi l MPLSCP (MPLS Control Protocol) v nh du tt c cc gi c cha tiu shim bng gi tr 0x8281 trong trng PPP Protocol. 1.2.7.2 Ch t bo

Hnh 1.12: Nhn trong ch ATM Ch t bo c dng khi ta c mt mng gm cc ATM-LSR (l cc chuyn mch ATM c h tr MPLS), trong n s dng cc giao thc phn phi nhn MPLS trao i thng tin VPI/VCI thay cho bo hiu ATM. Nhn c m ha trong trng gp VPI/VCI, trong VPI hoc VCI ca tiu t bo ATM (RFC 3035).
Hc vin cng ngh bu chnh vin thng 8

n tt nghip i hc I

Chng

T bo ATM gm 5 byte tiu v 48 byte trng ti. chuyn ti gi tin c kch thc ln hn 48 byte t lp trn a xung (v d gi IP), ATM phi chia gi tin thnh nhiu phn nh hn, vic ny gi l phn on (frafmentation). Qu trnh phn on do lp AAL (ATM Adaptation Layer) m trch. C th, AAL5 PDU s c chia thnh nhiu on 48 byte, mi on 48 byte ny c thm tiu 5 byte to ra mt t bo ATM.

Hnh 1.13: ng gi c nhn trn lin kt ATM Khi ng gi c nhn MPLS trn ATM, ton b ngn xp nhn c t trong AAL 5PDU. Gi tr thc s ca nhn nh c t trong trng VPI/VCI, hoc t trong ngn xp nhn phi cha gi tr 0 (coi nh thc th gi ch) v c b qua khi nhn. Thc th nh do cc nhn phi cha c trong AAL5 PDU v tiu ATM l m rng su ngn xp nhn. Khi cc t bo ATM i n cui LSP, n s c ti hp li. Nu c nhiu nhn trong ngn xp nhn, AAL5 PDU s b phn on ln na v nhn hin hnh trn nh ngn xp s c t vo trng VPI/VCI.

1.3 Cu trc trng chc nng MPLS


1.3.1 Kin trc mt nt MPLS Hnh 1.14 minh ha mt phng iu khin v chuyn tip ca LSR v LER. Mt phng iu khin c chc nng nh tuyn IP dng giao tip vi cc LSR, LER khc hoc cc b nh tuyn IP thng thng bng cc giao thc nh tuyn IP. Kt qu l mt c s thng tin nh tuyn RIB (Routing Information Base) c to lp gm cc thng tin miu t cc tuyn kh thi tm n cc tin t a ch IP. LER s s dng cc thng tin ny xy dng c s thng tin chuyn tip FIB (Forwarding Information Base) trong mt phng chuyn tip

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

Mt phng iu khin cn chc nng bo hiu MPLS dng giao tip vi cc LSR khc bng mt giao thc phn phi nhn. Kt qu mt c s thng tin nhn LIB (Label Informationn Base) gm cc thng tin lin quan n cc gn kt nhn c thng lng vi cc b nh tuyn MPLS khc. Thnh phn bo hiu MPLS nhn thng tin t chc nng nh tuyn IP v LIB xy dng c s thng tin chuyn tip LFIB (Label Forwarding Information Base) trong mt phng chuyn tip. Mt LER c th c chuyn tip cc gi tin IP, gn nhn vo gi (label push), hoc g nhn ra khi gi (label pop), trong khi mt transit-LSR ch c kh nng chuyn tip gi c nhn thm hoc b bt nhn.

Hnh 1.14: Cu trc ca LER v transit-LSR 1.3.2 Mt phng chuyn tip Mt phng chuyn tip MPLS chu trch nhim chuyn tip d liu ca ngi dng. N s dng LFIB thc hin chuyn tip cc gi c gn nhn cn c vo gi tr ca nhn nm trn nh ngn xp nhn. 1.3.2.1 C s thng tin chuyn tip nhn LFIB Trong mng IP, quyt nh chuyn tip gi c xc lp bng cch thc hin tra cu a ch ch trong bng FIB xc nh chng k hoc giao din ra. Trong mng MPLS, mi LSR duy tr mt bng LFIB ring r v tch bit vi FIB. Bng LFIB c hai loi thc th l ILM (incoming label map) v FTN (FEC-to-NHLFE). NHLFE (next hop label forwarding entry) l thc th con cha cc trng nh a ch chng k, cc tc v ngn xp nhn, giao din ra v thng tin tiu lp 2. ILM nh x mt nhn n mt hoc nhiu NHLFE. Nhn trong gi n s dng chn ra mt thc th ILM c th nhm xc dnh NHLFE. Cn FTN nh x mi FEC vo mt
Hc vin cng ngh bu chnh vin thng 10

n tt nghip i hc I

Chng

hoc nhiu NHLFE. Nh cc thc th FTN, gi cha c nhn c chuyn thnh gi c nhn. Nh vy, khi mt gi khng nhn thuc mt FEC i vo min MPLS, ingressLER s s dng mt thc th LFIB loi FTN chuyn gi khng nhn thnh gi c nhn. Sau , ti cc transit-LSR s dng mt thc th LFIB loi ILM hon i nhn vo nhn ra. Cui cng, ti engress-LER s dng mt thc th LFIB loi ILM g b nhn n v chuyn tip gi khng nhn n b nh tuyn k tip. 1.3.2.2 Thut ton chuyn tip nhn Cc nt MPLS s dng gi tr nhn trong cc gi n lm ch mc tra bng LFIB. Khi tm thy thc th tng ng vi nhn n, nt MPLS thay th nhn trong gi bng nhn ra v gi n i qua giao din ra n chng k c c t trong thc th con NHLFE. Nu thc th con c ch nh hng i ra, nt MPLS s t gi trn hng i ch nh. Trong trng hp nt MPLS duy tr mt LFIB ring cho mi giao din, n s dng LFIB ca giao din m gi n tra cu chuyn tip gi. Nt MPLS c th ly nh v c cc thng tin chuyn tip cn thit trong LFIB ch trong mt ln truy xut b nh, tc thc thi rt cao nh cc chip ASIC. 1.3.2.3 NHLFE NHLFE (Next Hop Label Forwarding Entry) l thc th con ca ILM hoc FTN, n cha cc thng tin sau:
1)

Chng chng k tip ca gi. Tc v s c tin hnh trn ngn xp nhn ca gi nh sau: Swap: Thay nhn nh ngn xp nhn bng mt nhn mi c Pop: Bc mt nhn ra khi ngn xp. Push: Chng thm mt nhn vo trong ngn xp nhn. Cng vo 3 ch Hot ng Nhn ra LSP ID ID vo Gi tr 138.43 Thay th 0.81 1 10 2 Cng ra

ch nh.
2) 3)

Nhn vo 0.54

Hnh 1.15: Mt NHLFE Ngoi ra, NHLFE cng c th cha nhng thng tin sau:
Hc vin cng ngh bu chnh vin thng 11

n tt nghip i hc I

Chng

ng gi lp lin kt d liu s dng khi truyn gi Cch thc m ha ngn xp nhn khi truyn gi. Bt k cc thng tin khc cn thit x l gi mt cch chnh xc.

1.3.3 Mt phng iu khin Nhim v ca cc giao thc trong mt phng iu khin l phn phi cc thng tin cn thit cho mi LER v LSR cu hnh bng FIB v LFIB. Trong mt giao thc nh tuyn s dng bo hiu, bng thng tin nh tuyn RIB hot ng kt hp vi mt giao thc bo hiu MPLS s dng bng thng tin nhn LIB phn phi cc nhn. Vic phn tch mt phng iu khin v mt phng chuyn tip cho php ci t mt giao thc iu khin MPLS trn mt ATM switch. Ti sao MPLS cn giao thc bo hiu, trong khi cc b nh tuyn IP c in ch cn nh tuyn IP? Mt l do quan trng phi dng giao thc bo hiu MPLS kt hp vi mt giao thc nh tuyn xut pht t s cn thit phi thc hin nh tuyn rng buc ca ng chuyn mch nhn MPLS.

1.4 Hot ng chuyn tip MPLS


1.4.1 Hot ng trong mt phng chuyn tip FEC l mt tp con cc gi cn c theo mt s thng tin trong tiu IP c dng bi FIB. Mt FEC c dng thng da theo lut longest prefix match trn a ch IP ch. V d: cc a ch IP so trng vi 16 bit u c dng a.b.x.x (trong x i din cho gi tr hp l bt k) c biu din l a.b/16 cho thc th FEC u tin trong bng FIB. FEC cn c th cn c b sung theo cc trng khc trong tiu IP nh ToS hay Diffserv. FIB s dng FEC xc nh ra giao tip i n chng k cho cc gi IP, cch thc hin ging nh cc b nh tuyn c in. Cho cc v d tng hot ng LFIB hnh 1.16. Phn ILM ca LFIB thao tc trn mt gi c nhn v nh x mt nhn vo (incoming label) ti mt tp cc thc th NHLFE. ILM c th hin trong hnh bi cc ct IN-IF v IN-LBL, nhng cng c th l mt bng ring r cho mt giao tip. FTN ca FIB nh x mt FEC ti mt tp hp gm mt hoc nhiu NHLFE. Nh v d trong hnh, nhn A c gn (push) ln cc gi IP thuc FEC d.e/16. Lu l ILM hoc FTN c th nh x ti nhiu NHLFE, chng hn dng trong cn bng ti.

Hc vin cng ngh bu chnh vin thng

12

n tt nghip i hc I

Chng

. Hnh 1.16: Bn trong mt phng chuyn tip MPLS 1.4.2 G nhn chng p cui PHP Mt ti u ha quan trng m MPLS h tr l trnh vic tra cu nhn (label loopkup) phi x l egress-LER trong trng hp mt gi i ln trn mt LSP m yu cu tra cu IP (IP Lookup) tip ngay sau . trong hnh trn 1.16, mt gi n c nhn A c g nhn (pop) v chuyn sang FIB tra cu tip trn tiu IP. trnh vic x l pht sinh thm ny, MPLS nh ngha mt tin trnh gi l g nhn trong chng p cui PHP (penultimate hop pop), trong b nh tuyn p cui trn LSP s g nhn thay v egress-LER phi lm vic . Nh vy ct gim c vic x l cc b nh tuyn cui cng trn LSP.

1.5 nh tuyn trong MPLS


MPLS h tr c hai k thut nh tuyn: nh tuyn tng chng (hop-by-hop) v nh tuyn rng buc (constrain-based routing). nh tuyn tng chng cho php mi nt nhn dng FEC v chn chng k tip cho mi FEC mt cch c lp, ging nh nh tuyn trong mng IP. Tuy nhin, nu mun trin khai k thut lu lng vi MPLS, bt buc phi s dng kiu nh tuyn rng buc. 1.5.1 nh tuyn rng buc nh tuyn rng buc l mt phng tin thc hin x l t ng ha k thut lu lng, khc phc c cc hn ch ca nh tuyn theo ch (destination-based routing). N xc nh cc tuyn khng ch da trn topolgy mng (thut ton chn ng ngn nht SPF) m cn s dng cc metric c th khc nh bng thng, tr, cost

Hc vin cng ngh bu chnh vin thng

13

n tt nghip i hc I

Chng

v bin ng tr. Gii thut chn ng c kh nng ti u ha theo mt hoc nhiu metric ny, thng thng ngi ta dng metric da trn s chng v bng thng. ng c chn c s chng nh nht nhng phi m bo bng thng kh dng trn tt c c chng lin kt, quyt nh c bn nh sau: chn ng ngn nht trong s tt c cc ng c bng thng kh dng tha mn yu cu.

Hnh 1.17: nh tuyn rng buc minh ha hot ng ca nh tuyn rng buc, xt cu trc mng con c kinh in nh hnh 1.17. Gi s rng nh tuyn rng buc s dng s chng (hopcount) v bng thng kh dng lm cc metric. Lu lng 600 kbps c nh tuyn trc tin, sau l lu lng 500 kbps v 200 kbps. C 3 loi lu lng u hng n cng mt li vo b nh tuyn. Ta thy rng :

V lu lng 600 kbps c nh tuyn trc nn n i theo ng ngn nht l R8-R2-R3-R4-R5. V bng thng kh dng l nh nhau trn tt c cc chng knh (1mb), nn lu lng 600 kbps chim 60% bng thng.

Sau , v bng thng kh dng ca ng ngn nht khng cho c 2 lu lng 600 kbps v 500 kbps, nn lu lng 500 kbps c nh tuyn i theo ng mi qua R6 v R7 mc d nhiu hn mt chng so vi ng c.

V lu lng 200 kbps tip theo, v vn cn bng thng kh dng trn ng ngn nht nn ng ny c chn chuyn lu lng 200 kbps. nh tuyn rng buc c 2 kiu offline v online. Kiu online cho php cc b nh tuyn tnh ng cho cc LSP bt k lc no. Trong kiu offline, mt server tnh ng cho cc LSP theo nh k (chu k c th c chn bi nh qun tr, thng l vi gi hoc vi ngy). Cc LSP c bo hiu thit lp theo cc ng c chn.

Hc vin cng ngh bu chnh vin thng

14

n tt nghip i hc I

Chng

1.5.2 nh tuyn tng minh nh tuyn tng minh (explicit routing) l mt tp con ca nh tuyn rng buc trong s rng buc l i tng tuyn tng minh ER. Tuyn tng minh ER l mt danh sch cc nt tru tng (abstract node) m mt ng chuyn mch nhn rng buc CR-LSP phi i qua. Nt tru tng c th l mt nt (a ch IP) hoc mt nhm nt. Nu ER ch quy nh mt nhm trong s cc nt m CR-LSP i qua th n c gi l tuyn tng minh th lng. Ngc li, nu ER quy nh ton b cc nt trn CR-LSP th c gi l tuyn tng minh nghim ngt. CR-LSP c m ha nh l mt chui cc ER-Hop (chng tng minh) cha trong mt s cu trc Type-Length-Value rng buc (constraint-based route TLV). Mi ER-Hop c th xc nh mt nhm cc nt. CR-LSP khi bao gm tt c cc nhm nt c xc nh theo th t xut hin trong cu trc TLV. 1.6 Cc ch bo hiu MPLS 1.6.1 Ch phn phi nhn MPLS cho php hai ch hot ng ca cc LSR phn phi cc nh x nhn, l phn phi khng cn yu cu v phn phi theo yu cu. 1.6.1.1 Phn phi nhn khng cn yu cu B nh tuyn ng xung LSR phn phi cc gn kt nhn n b nh tuyn ng ln LSR m khng cn c yu cu thc hin vic lin kt nhn. Nu b nh tuyn ng xung chnh l chng k i vi nh tuyn IP cho mt FEC c th th b nh tuyn ng ln LSR c th s dng kiu kt nhn ny chuyn tip cc gi trong FEC n b nh tuyn ng xung.

Hnh 1.18: Phn phi nhn khng cn yu cu 1.6.1.2 Phn phi nhn theo yu cu B nh tuyn ng ln LSR phi yu cu r rng mt gn kt nhn cho mt FEC c th th b nh tuyn ng xung mi phn phi. Trong phng thc ny,

Hc vin cng ngh bu chnh vin thng

15

n tt nghip i hc I

Chng

ng xung ca b nh tuyn khng nht thit phi l chng k i vi nh tuyn IP cho FEC , iu ny rt quan trng i vi cc LSP nh tuyn tng minh.

Hnh 1.19: Phn phi nhn gn kt Nhn-FEC 1.6.2 Ch duy tr nhn Mt b nh tuyn ng ln LSR c th nhn cc gn kt cho cng mt FEC X t nhiu b nh tuyn ng xung. C hai ch duy tr cc gn kt nhn nhn c l duy tr nhn t do (liberal label retention) v duy tr nhn bo th (consvervative label retention). 1.6.2.1 Duy tr nhn t do Pha b nh tuyn ng ln (LSR1) lu gi tt c cc gn kt nhn nhn c, bt chp vic b nh tuyn ng xung c phi l chng k i vi nh tuyn IP hay khng (hnh 1.20). u im chnh ca duy tr nhn t do l c th phn ng nhanh vi s thay i nh tuyn v cc gn kt nhn c sn. Nhc im l LSR phi duy tr nhiu gn kt nhn khng dng v c th gy ra lp nh tuyn tm thi khi thay i nh tuyn.

Hnh 1.20: Duy tr nhn t do

Hc vin cng ngh bu chnh vin thng

16

n tt nghip i hc I

Chng

1.6.2.2 Duy tr nhn bo th B nh tuyn ng ln LSR hy tt c cc gn kt nhn khc, ch gi li gn kt nhn gi t b nh tuyn ng xung ang l chng k hin hnh (hnh 1.21). Ch ny c u im l LSR ch cn duy tr s gn kt FEC-nhn t hn, nhng p ng chm khi thay i nh tuyn v gn kt nhn mi phi c yu cu v phn phi li. y l ch thch hp cho cc LSR ch h tr mt s lng nhn hn ch (nh cc chuyn mch ATM).

Hnh 1.21: Duy tr nhn bo th

1.6.3 Ch iu khin LSP Khi mt FEC ng vi mt tin t a ch c phn phi bi nh tuyn IP, vic thit lp mi kt hp gia cc gn kt nhn ti mt LSR c th thc hin theo hai cch sau y: 1.6.3.1 iu khin c lp Khi mi LSR nhn dng ra mt FEC th n quyt nh gn kt ngay mt nhn cho FEC v cng b lun gn kt cho cc i tc phn phi nhn (label distribution peer). iu ny tng t nh nh tuyn IP thng thng, mi b nh tuyn ra quyt nh c lp v ni cn chuyn gi i. iu khin c lp c u im l thit lp nhanh v vic kt nhn din ra song song gia nhiu cp LSR v dng lu lng c th bt u truyn m khng cn i cho tt c cc gn kt nhn thit lp xong.

Hc vin cng ngh bu chnh vin thng

17

n tt nghip i hc I

Chng

Hnh 1.22: iu khin c lp 1.6.3.2 iu khin tun t Mt b nh tuyn ng xung thc hin kt nhn cho mt FEC v thng bo gn kt ch nu n l LSR li ra hoc nu n nhn c mt gn kt nhn cho FEC t b nh tuyn hng ng xung ca n (hnh 1.23). Vic thit lp LSP tun t bt u LSR li ra v din ra ni tip theo hng ngc v LSR li vo. Cc LSP nh tuyn tng minh bt buc phi s dng kiu iu khin tun t v qu trnh phn phi nhn theo chui c th t s to ra thi gian tr trc khi dng lu lng i trn LSP c th bt u. Tuy nhin, iu khin tun t cng cp phng tin trnh lp v t c mc thu gom chc chn hn.

Hnh 1.23: iu khin tun t

1.7 Cc giao thc hot ng 1.7.1 Giao thc LDP


LDP (label distribution protocol) c chun ha trong RFC 3036, n c thit k thit lp v duy tr cc LSP nh tuyn khng rng buc. Vng hot ng ca LDP c th l gia cc LSR lng ging (neighbor) trc tip hoc gin tip (hnh 1.24)

Hnh 1.24: Vng hot ng ca LDP 1.7.1.1 Hot ng ca LDP LDP c 4 chc nng chnh l pht hin LSR lng ging (neighbor discovery), thit lp v duy tr phin, qung b nhn v thng bo. Tng ng vi cc chc nng trn, c 4 lp thng ip LDP sau y:
Hc vin cng ngh bu chnh vin thng 18

n tt nghip i hc I

Chng

Discovery: trao i nh k bn tin Hello nhm loan bo v kim tra mt LSR kt ni gin tip hoc trc tip. Session: thit lp, thng lng cc thng s cho vic khi to, duy tr v chm dt cc phin ngang hng LDP. Nhm ny bao gm bn tin Initialization ,KeepAlive.

Advertisement: to ra, thay i hoc xa cc nh x FEC ti nhn. Nhm ny bao gm bn tin Label Mapping, Label Withdrawal, Label Release, Label Request, Label Request Abort.

Notification: truyn t cc thng tin trng thi, li hoc cnh bo.

Cc thng ip Discovery c trao i trn UDP. Cc kiu thng ip cn li i hi phn pht tin cy nn dng TCP. Trng hp hai LSR c kt ni lp 2 trc tip th th tc pht hin neighbor trc tip nh sau: multicast. Mt LSR nh k gi i bn tin Hello ti cc cng UDP 646 a ch

Tt c cc LSR tip nhn bn tin Hello ny trn cng UDP. n mt thi im no LSR s bit c tt c cc LSR khc m n kt ni trc tip. Khi LSR nhn bit c a ch ca LSR khc bng c ch ny th n s thit lp kt ni TCP n LSR . Khi phin LDP c thit lp gia 2 LSR. Phin LDP l phin song hng nn mi LSR hai u kt ni u c th yu cu v gi lin kt nhn.

Hnh 1.25: Trao i thng ip LDP

Hc vin cng ngh bu chnh vin thng

19

n tt nghip i hc I

Chng

Trong trng hp hai LSR khng c kt ni lp 2 trc tip (neighbor gin tip) th LSR nh k gi bn tin Hello n cng UDP bit ti a ch IP xc nh c khai bo khi lp cu hnh. u nhn bn tin ny c th tr li li bng bn tin Hello khc v vic thit lp cc phin LDP c thc hin nh trn. 1.7.1.2 Cu trc thng ip LDP Trao i thng ip LDP thc hin bng cch gi cc LDP-PDU (Protocol Data Unit) thng ip qua cc phin LDP trn kt ni TCP. Mi LDP-PDU c th mang mt hoc nhiu thng ip, v cc thng ip ny khng nht thit phi c lin quan vi nhau. Mi PDU ca LDP bao gm mt tiu LDP v theo sau l mt hoc nhiu thng ip LDP. Phn tiu LDP c dng nh hnh 1.26:

Hnh 1.26: LDP Hearder PDU Length (2 octet): s nguyn ch chiu di ca PDU theo octet, khng tnh trng Version v PDU Length. LDP Identifier (6 octet): xc nh khng gian nhn c cp pht. Bn octet u l gi tr duy nht ton cc nhn dng LSR, nh a ch IP (b nh tuyn ID) c gn cho LSR. Hai octet sau xc nh mt khng gian nhn bn trong LSR. Hai octet ny c set v 0 cho khng gian nhn per-platform. Tt c cc thng ip LDP c cng format nh hnh 1.27:

Hnh 1.27: Format thng ip LDP

Hc vin cng ngh bu chnh vin thng

20

n tt nghip i hc I

Chng

Bit U: bit unknown, lun l 0 v c t LDP khng c kiu bn tin Unknown. Message Length : Chiu di ca cc trng sau Message Length tnh theo octet (gm Message ID, cc tham s bt buc v ty chn). Messafe ID i khi c dng lin kt mt s bn tin vi cc bn tin khc, v d mt bn tin p ng c cng Message ID vi bn tin yu cu tng ng. Cc tham s bt buc v ty chn ph thuc vo cc loi bn tin c gi, chng thng dng kiu m ha TLV (Type-Length-Value). Ni chung, mi th xut hin trong mt thng ip LDP c th c m ha kiu TLV, tuy nhin c t LDP khng phi lc no cng s dng lc TLV. 1.7.1.3 Cc bn tin LDP

Hello: c trao i trong sut qu trnh hot ng LDP nh trnh by

trn.

Initialization: c gi khi bt u mt phin LDP gia 2 LSR trao i cc tham s, cc ty chn cho phin. Cc tham s ny bao gm: Ch phn b nhn. Cc gi tr b nh thi Phm vi cc nhn s dng trong knh gia 2 LSR .

C 2 LSR u c th gi cc bn tin Initialization v LSR nhn s tr li bng KeepAlive nu cc tham s c chp nhn. Nu c mt tham s no khng c chp nhn th LSR tr li thng bo c li nu phin kt thc. o KeepAlive : c gi nh k khi khng cn bn tin no cn gi m bo cho mi thnh phn LDP bit rng thnh phn LDP khc ang hot ng tt. Trng hp khng xut hin bn tin KeepAlive hay mt s bn tin LDP khc trong khong thi gian nht nh th LSR s xc nh i tc LDP hng hoc kt ni c s c v phin LDP chm dt. o nhn.
o

Label Mapping : c s dng qung b gn kt gia FEC v Label Withdrawal : Thc hin qu trnh ngc li vi bn tin Label

Mapping. N c s dng xa b gn kt thc hin trong Label Mapping. Bn tin ny c s dng trong trng hp :

Hc vin cng ngh bu chnh vin thng

21

n tt nghip i hc I

Chng

Khi c s thay i trong bng nh tuyn (thay i tin t a ch), lc LSR khng cn nhn ra FEC ny na. trong FEC . o Thay i trong cu hnh LSR lm tm dng vic chuyn nhn cc gi Label Release : c s dng bi LSR khi nhn c chuyn i

nhn m n khng cn thit na. iu thng xy ra khi LSR gii phng nhn thy nt tip theo cho FEC khng phi l LSR qung b lin kt nhn/FEC .
o

Label Request : S dng trong ch hot ng gn nhn theo yu

cu, LSR s yu cu gn nhn LSR k cn pha ng xung bng bn tin ny.


o

Label Request Abort : Nu bn tin Label Request cn phi hy b

trc khi c chp nhn (do nt k tip trong FEC yu cu thay i), th LSR yu cu s loi b yu cu trc bng bn tin Label Request Abort. 1.7.1.4 LDP iu khin c lp v phn phi theo yu cu V d di y (hnh 1.28) minh ha vic s dng bn tin Label Request v Label Mapping. Trong cc ch cng b nhn theo yu cu v iu khin c lp. Trnh t thi gian trao i cc bn tin LDP gia cc i tc (peer) thit lp mt LSP t b nh tuyn li vo R1 qua R2 ri n b nh tuyn li ra R3 cho mt FEC c tin t a.b/16. R1 khi to tin trnh bng cch yu cu mt nhn cho FEC a.b/16 t chng k ca n R2. V s dng iu khin c lp nn R2 tr ngay mt nh x nhn v cho R1 trc khi R2 nhn c nh x nhn t pha ng xung l R3. C R2 v R3 p ng bng bn tin Label Mapping, kt qu l trong FIB ca R1 v LFB ca R2, R3 c cc thc th gn kt nhn hnh thnh nn ng chuyn mch nhn LSP.

Hc vin cng ngh bu chnh vin thng

22

n tt nghip i hc I

Chng

Hnh 1.28: LDP ch iu khin theo yu cu LDP cn h tr cc ch phn phi nhn khc. Khi cu hnh ch cng b khng cn yu cu (downstream unsolicited), cc b nh tuyn s khng dng bn tin Label Request. Nu iu khin tun t (ordered control) c cu hnh trn mi giao din, cc yu cu nhn s lm cho cc bn tin Label Mapping c tr v theo th t t R3 n R2, ri mi t R2 v R1. Tng qut, trong ch phn phi theo yu cu iu khin tun t, nh x nhn din ra u tin b nh tuyn li ra, ri sau ln lt ngc v n b nh tuyn li vo. 1.7.2 Giao thc CR-LDP CR-LDP (constrain-based routing LDP) l giao thc m rng t LDP (RFC 3212) nhm h tr c bit cho nh tuyn rng buc, k thut lu lng v cc hot ng d tr ti nguyn. Cc kh nng ca CR-LDP ty chn bao gm thng lng cc tham s lu lng nh cp pht bng thng, thit lp v cm gi quyn u tin. 1.7.2.1 M rng cho nh tuyn rng buc CR-LDP b sung thm cc i tng Type-Length-Value mi sau y :

Tuyn tng minh ER Chng tng minh ER-Hop Cc tham s lu lng S ln chim (Preemptions) Nhn din LSP (LSPID) Gim tuyn (Route Pinning)
23

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc I

Chng

Lp ti nguyn (Resource Class) CR-LSP FEC Mt s th tc mi cng c b sung h tr cc chc nng cn thit nh:

o o o

Bo hiu ng (Path Signalling) nh ngha cc tham s lu lng Qun l LSP ( quyn u tin, cam kt qun tr.)

CR-LDP s dng c ch gn nhn theo yu cu v iu khin tun t. Mt LSP c thit lp khi mt chui cc bn tin Label Request lan truyn t ingress-LSR n egress-LSR, nu ng c yu cu tha mn cc rng buc (v d nh bng thng kh dng), th cc nhn mi c cp pht v phn phi bi mt chui cc bn tin Label Mapping lan truyn ngc v ingress-LSR. Vic thit lp mt CR-LSP c th tht bi v nhiu l do khc nhau v cc li s c bo hiu bng bn tin Notification. 1.7.2.2 Thit lp mt CR-LSP thit lp mt LSP theo mt con ng nh trc, CR-LDP s dng i tng tuyn tng minh ER. ER c cha trong cc bn tin Label. Xt v d trong hnh 1.29. Gi s LSR A mun thit lp mt con ng tng minh l B-C-D. thc hin vic ny, LSR A xy dng i tng ER cha tun t 3 nt tru tng l LSR B, LSR C, LSR D. Mi nt c i din bng mt a ch IP tin t. LSR A sau c xy dng mt bn tin Label Request c cha i tng ER mi to. Khi bn tin c to xong, LSR A s xem xt nt tru tng u tin trong i tng ER l LSR B, tm kt ni n LSR B v gi bn tin Label Request trn kt ni. Khu LSR B nhn bn tin Label Request, LSR B nhn thy n l nt tru tng u tin trong i tng ER. LSR B sau tm kim nt tru tng k tip l LSR C v tm kt ni n LSR C. Sau LSR B thay i i tng ER v gi bn tin Label Request n LSR C, lc ny i tng ER ch gm LSR C v LSR D. Vic iu khin bn tin ny ti LSR cng tng t nh LSR B.

Hc vin cng ngh bu chnh vin thng

24

n tt nghip i hc I

Chng

Hnh 1.29: Thit lp LSP v CR-LD Khi bn tin n LSR D, LSR D nhn thy rng n l nt cui cng trong i tng ER. V vy, LSR D to nn mt bn tin Label Mapping v gi n n LSR C. Bn tin ny cp nht LFIB. Sau , LSR C gi bn tin Label Mapping n LSR B. Bn tin ny cng cha nhn m LSR C qung b. Vic iu khin bn tin Label Mapping LSR B hon ton tng t nh LSR C. Cui cng, LSR A nhn c bn tin v LSP c thit lp theo con ng nh tuyn tng minh cho trc mang thng tin v ti nguyn cn phi d tr. 1.7.2.3 Tin trnh d tr ti nguyn . Khi mt nt CD-LDP nhn c mt bn tin Label Request, n gi Admission

Control kim tra xem nt ny c cc ti nguyn c yu cu khng. Nu c ti nguyn kh dng, Admission Control d tr n bng cch cp nht bng Resource. Sau bn tin Label Request c chuyn tip n nt MPLS k sau. Khi nt CR-LDP nhn bn tin Label Mapping, n lu thng tin nhn v giao din vo bng LIB, lu thng tin CR-LDP c yu cu vo bng c s thng tin tuyn tng minh ERB (Explicit Route information Base). Ri n gi Resource Manager ta mt bng hng i phc v cho CR-LSP c yu cu, v lu Service ID ca n vo bng ERB. Cui cng n chuyn tip bn tin LSP Mapping ti nt MPLS k trc. 1.7.3 Giao thc RSVP-TE RSVP c mt s c ch cn thit thc hin bo hiu phn phi nhn nhm rng buc nh tuyn. IETF chuyn ha m rng k thut lu lng RSVP-TE, nh ngha cc ng dng ca RSVP-TE nh h trc phn phi nhn theo yu cu cp pht ti nguyn cho cc LSP nh tuyn tng minh.

Hc vin cng ngh bu chnh vin thng

25

n tt nghip i hc I

Chng

1.7.3.1 Cc bn tin thit lp d tr RSVP RSVP s dng khi nim d tr u nhn. Trc tin u gi pht ra mt bn tin PATH nhn din mt lung v cc c tnh lu lng ca n. Bn tin PATH cha mt session-ID, sender-template, label-request, sender-Tspec v ty chn l i tng tuyn tng minh ERO (explicit route object). Session-ID cha mt a ch IP ch i km mt nhn dng hm 16 bit (tunnel ID) nhn din mt ng hm LSP. Nh trnh by chng trc, ch c ingress-LSP mi cn bit v FEC c gn vo mt ng hm LSP. Do , khng ging nh LDP, FEC nh x vo ng hm LSP cng b nhn theo yu cu. Sender-template cha a ch IP ca u gi i km vi mt LSP ID c h tr phng thc make-before-breal khi thay i ng i ca mt ng hm LSP. c tnh lu lng ca Tspec s dng tc nh (peak rate), thng token (token bucket) nh ngha tc v kch thc bng pht, n v khng ch ti thiu v kch thc gi ti a. Khi bn tin PATH i n ch, bn nhn p ng bng mt bn tin RESV nu n ng khi tao vic gn kt nhn c yu cu trong bn tin PATH. Bn tin RESV c truyn v theo ng ngc chiu vi bn tin PATH bng cch dng thng tin chng k trc trong bn tin PATH. RESV cng cha cng sesion-ID nh bn tin PATH tng ng, i tng ghi tuyn ty chn (route record) v thng tin l thuc kiu d tr (reservation style). Kiu FF (fixed filter) c mt nhn v Tspec c n nh cho mi cp sender-receiver. Kiu SE (share explicit) n nh mt nhn khc nhau cho mi sender, nhng tt c chng ta phi p dng cng mt d tr lung r rng. i tng record-route ghi nhn tuyn ng thc t c chn bi LSP bt u t li ra dn ngc v li vo. N c th c mt b nh tuyn dng ghim mt tuyn tng minh th lng bng cch copy tuyn ghi c trong mt bn tin RESV sang i tng tuyn tng minh ERO trong mt bn tin PATH c gi theo chiu ngc li. 1.7.3.2 Cc bn Tear Down, Error v Hello ca RSVP-TE RSVP-TE nh ngha 2 bn tin dnh cho vic gii ta LSP l PATH TEAR v RESV TEAR. Hai bn tin ny c gi theo chiu ngc li bn tin PATH v RESV tng ng. Bn tin TEAR xa b bt k trng thi ci t lin quan n bn tin PATH hay RESV. Cc bn tin TEAR cng c th dng xa cc trng thi p ng cho mi li bc u tin trong hot ng nh tuyn. C cc bn tin thng bo li cho bn tin PATH v RESV cng nh bn tin RESV CONFIRMATION ty chn. Cc bn tin li cho bit c s vi phm chnh sch, m ha bn tin hoc mt s s c khc. V d, khi mt LSP thy rng n khng th h tr
Hc vin cng ngh bu chnh vin thng 26

n tt nghip i hc I

Chng

Tspec c t trong mt bn tin RESV, n s khng chuyn tip bn tin RESV v cho pha ng ln, thay vo n to ra mt bn tin RESVERR gi cho pha ng xung xa b n lc thit lp LSP. Tuyn tng minh v cc ty chn tuyn ghi ca RSVP-TE c mt s cc m li phc v cho vic debug. RFC 3209 nh ngha bn tin Hello ty chn cho RSVP-TE, n cho php mt LSR pht hin mt neighbor b li nhanh hn khi so vi RSVP lm mi tnh trng hoc pht hin li ng truyn bng mt giao thc nh tuyn IP. iu ny kh hu ch trong vic ti nh tuyn nhanh. 1.7.3.3 Thit lp tuyn tng minh iu khin tun t theo yu cu Hnh 1.30 v d vic trao i bn tin RSVP-TE s dng i tng tuyn tng minh ERO (expplicit route object) ci t mt LSP i qua mt con ng khng phi l ng ngn nht. B nh tuyn R1 xc nh rng n s n nh FEC a.b/16 cho mt ng hm LSP, v n tnh ra mt tuyn tng minh R4-R5-R3 i n chng k cho FEC . R1 khi to vic thit lp LSP ny bng cch pht ra mt bn tin PATH n R4 vi mt ERO, Tspec, sender template (c cha a ch ca sender) v mt i tng label request. Mi bn tin RESV lin quan n ng hm LSP ny u mang session-ID v filter-spec nguyn thy ca sender R1 gi mi tng quan vi nhau. Tip theo, R4 tip nhn yu cu ny v gi bn tin PATH n b nh tuyn k tip ghi trong ERO l R5. n lt mnh, R5 gi bn tin ny n li ra ca b nh tuyn R3. Ti ch n ca bn tin PATH, R3 xc nh rng lin kt chng R3-R5 c th h tr cho yu cu v l chng cui cng trn ng dn FEC a.b/16. R3 p ng bng bn tin RESV c cha ERO, Tspec ca dung lng d tr, mt filter spec tha mn bn gi, v gn mt nhn null ngm (implicit null) cho chng lin kt ny. Theo thi RFC 3031, nhn null l mt quy c c dng trong phn phi nhn cho php li ra ca b nh tuyn ( y l R3) bo hiu cho i tc ng ln ca n bit rng y l chng p cui (penulitmate hop) ca LSP, do vy cn g nhn nh ca ngn xp. Tip theo, R5 thu np bn tin RESV ngc v R1. n lc ny, ng LSP c thit lp xong v cc gi c nhn cho FEC a.b/16 c chuyn tip qua ng hm.

Hc vin cng ngh bu chnh vin thng

27

n tt nghip i hc I

Chng

Hnh 1.30: Thit lp LSP vi RSVP-TE Khc vi giao thc LDP, cc bn tin RSVP-TE khng mang FEC, v ch duy nht c R1 cn bit v nh x gia FEC v ng hm LSP. 1.7.3.4 Gim lng overhead lm ti RSVP RSVP l giao thc trng thi mm (soft-staste), tin trnh pht mt bn tin PATH v bn tin RESV hi p tng ng phi c nh k lm ti, thng khong 30s mt ln. Phng php lm ti ny phng cc bn tin b mt v trong trng hp nh tuyn tng chng s t ng chuyn d tr ti nguyn sang ng mi khi c bt k thay i nh tuyn IP. Tt nhin, vic x l dnh cho khi to cc bn tin PATH v RESV ln hn nhiu so vi vic lm ti trng thi mt bn tin nhn trc , tuy nhin vi mt s lng ln cc LSP th vic x l v lm ti c nh hng ng k n hiu nng. Mt cch gii quyt l tng chu k lm ti, nhng cng s lm tng tr t bo hiu khi mt bn tin. RFC 2961 c t mt gii php cho hn mc x l v vn tr bo hiu. C ch ny bao gm vic b gn bn tin gim ti x l, cng nh cc cch b nh tuyn d dng nhn dng mt bn tin khng thay i ln. Vic hi bo bn tin cng c b sung chuyn ti tin cy bn tin RSVP v x l trng hp mt cc bn tin PATH TEAR v RESV TEAR v hai bn tin ny khng c lm ti trong
Hc vin cng ngh bu chnh vin thng 28

n tt nghip i hc I

Chng

hot ng RSVP. Cui cng, gii php ny nh ngha mt bn tin tng kt lm ti trng thi m khng yu cu truyn ton b bn tin lm ti. Cc ci tin ny nhm lm gim lng overhead lm ti ca RSVP trong mng MPLS. 1.7.4 Giao thc BGP 1.7.4.1 BGPv4 v m rng cho MPLS BGPv4 (boder gateway protocol) l mt giao thc nh tuyn gn kt tp hp cc mng cung cp dch v trn internet. V n ch l giao thc s dng gia cc nh cung cp, RFC2017 m rng BGP h tr phn phi nhn MPLS c th thit lp cc LSP lin mng. BGP c mt tp thut ng ring. Mt khi nim quan trng l s AS (Autonomous System) duy nht, c nh ngha l mt tp hp b nh tuyn thc hin mt chnh sch nh tuyn ngoi thng nht c th nhn thy i vi b nh tuyn ca AS khc. BGP khng truyn cc thng tin topology ni gia cc AS, n ch cung cp cc thng tin v cc tin t a ch m c th tm n hoc i qu giang qua . S dng BGP gia cc b nh tuyn bin (border) ni trong mt AS c gi l BGP ni (iBGP), cn s dng BGP gia cc b nh tuyn trong cc AS khc nhau c goi l BGP ngoi (eBGP). BGP chy trn mt phin TCP v n cn tin cy, phn pht ng th t. N c 3 phin hot ng: thit lp phin, trao i bn tin cp nht, v chm dt phin. Trong thit lp phin, cc i tc BGP (BGP peer) trong cc AS ln cn trao i cc bn tin OPEN c cha AS number, mt gi tr keep-alive timeout, v cc tham s ty chn nh nhn thc. Cc BGP peer nh k trao i bn tin keep-alive, nu pht hin ht thi gian hiu lc s chm dt phin. Sau khi thit lp phin, cc BGP peer trao i cc bn tin UPDATE c cha cc tin t a ch c th n c hin hnh (reachability), c gi l NLRI (Network Layer Reachability Information). Sau khi trao i ng b khi to, cc thay i nh tuyn gia tng c lin lc bng bn tin UPDATE. Ni dung bn tin BGP UPDATE gm 3 phn (hnh 1.31): cc tuyn thu hi (withdrawn route), mt danh sch cc tin t a ch NRLI, v mt danh sch ty chn cc thuc tnh lin quan. Cc BGP peer to quyt nh chnh sch cc b khi xem xt cng b mt NLRI vi cc thuc tnh ng c ty chn hay thu hi thng co trc . Chnh sch thng dng l chn NLRI c tin t a ch c t so trng nht, chn mt ng c s chng AS t nht.

Hc vin cng ngh bu chnh vin thng

29

n tt nghip i hc I

Chng

Hnh 1.31: Ni dung bn tin BGP Update Khi bn tin UPDATE cha thng tin NLRI, mt s thuc tnh ng l bt buc trong khi mt s khc l ty chn. Cc thuc tnh ng bt buc l ORIGIN, ASPATH, v NEXT HOP. ORIGIN nhn din ngun gc ca NLRI, th d n c hc qua giao thc nh tuyn ni hay ngoi. AS-PATH lit k mt path-vector gm mt tp AS i qua n thi im hin ti (mt chui th t cc AS). V chiu di ca ASPATH thng l yu t quyt nh chn mt tuyn, nn BGP c gi l giao thc path-vector. Cc b nh tuyn s dng AS-PATH trnh lp bng cch khng chuyn tip cc thng co tuyn c cha s AS ca chng. NEXT-HOP nhn din a ch IP ca b nh tuyn bin cn dng tm n NLRI. BGP c mt tham s ty chn c th thc hin mt dng cn bngg ti: LOCALPREF v MED. LOCALPREF cho php AS u gi ch nh mt s u tin cho lu lng n t mt AS khc. RFC 2283 nh ngha cc m rng a giao thc cho BGP phn phi nhn MPLS nm trong mt phn ca NLRI. Cc BGP peer thng lng h tr cho kh nng ty chn ny vo lc thit lp phin. Th tc c bn l gi vic phn phi nhn theo kiu khng cn yu cu song song khi thc hin phn phi tuyn BGP. 1.7.4.2 Kt ni MPLS qua nhiu nh cng cp dch v BGP c th dng thit lp phn phi nhn cho cc LSP i xuyn qua cc mng ca nhiu nh cung cp khc nhau. Hnh 1.32 gm 3 h t tr l A,B v C. AS A cp pht cho khch hng tin t a ch (FEC) a.b/16. B nh tuyn C3 qung b nh nh mt NLRI cho AS-A v AS-B bng bn tin BGP UPDATE c cha next-hop v ASPATH. Bn tin UPDATE c gi bi C3 n A3 cn mng mt nh x t FEC a.b/16 sang nhn L. B nh tuyn A3 trong AS A thu thp tt c cc thng co ny trong bng RIB ca n, th d thng qua mt li cc phin iBGP hoc mt route

Hc vin cng ngh bu chnh vin thng

30

n tt nghip i hc I

Chng

reflector. Nhm tm cch tt nht chuyn tip cc gi n tin t a.b/16, A1 c th xc nh rng ng AS ngn nht l qua chng k A3 s dng nhn L. Nh nh tuyn ni v giao thc phn phi nhn ca mnh, b nh tuyn A1 cng bit rng tuyn tt nht n A3 l i qua A2 s dng nhn M. Kt qu l khi chuyn gi n tin t a.b/16, b nh tuyn A1 push nhn L ln gi ri push tip nhn M trn nh ngn xp. Nh vy, mt LSP c chui bn trong mt ng hm LSP khc. LSP1 bn ngoi ko di t A1 n A3. Trong khi , LSP2 ko di t AS A n AS C v c mt on chui bn trong LSP1

Hnh 1.32: BGP phn phi nhn qua nhiu Autonomous System

1.8 u im v ng dng ca MPLS


1.8.1 n gin ha chc nng chuyn tip MPLS s dng c ch chuyn tip cn c vo nhn c di c nh nn quyt nh chuyn tip c th xc nh ngay ch vi mt ln tra cu ch mc trong LFIB. C ch ny n gin v nhanh hn nhiu so vi gii thut longest prefix match dng trong chuyn tip gi datagram thng thng. 1.8.2 K thut lu lng

Hc vin cng ngh bu chnh vin thng

31

n tt nghip i hc I

Chng

u im ln nht ca MPLS l kh nng thc hin k thut lu lng (TE: traffic engineering), n m bo lu lng c nh tuyn i qua mt mng theo mt cch thc tin cy v hiu qu nht. K thut lu lng cho php cc ISP nh tuyn lu lng theo cch h c th cng cp dch v tt nht cho khch hng kha cnh thng lng v tr. MPLS-TE cho php lu lng c phn b hp l qu ton b h tng mng, ti u ha hiu sut s dng mng. y cng l i tng nghin cu chnh ca ti ny v s c trnh by k cc chng tip theo. 1.8.3 nh tuyn QoS t ngun nh tuyn QoS t ngun l mt c ch trong cc LSR c xc nh trc nt ngun (LSR li vo) da vo mt s thng tin v kh dng ti nguyn trong mng cng nh yu cu QoS ca lung lu lng. Ni cch khc, n l mt giao thc nh tuyn c m rng ch tiu chn ng bao gm cc tham s nh bng thng kh dng, vic s dng lin kt v ng dn end-to-end, chim dng ti nguyn ca nt, tr v bin ng tr. 1.8.4 Mng ring o VPN VPN l cho php khch hng thit lp mng ring ging nh thu knh ring nhng vi chi ph thp hn bng cch s dng h tng mng cng cng dng chung. Kin trc MPLS p ng tt c cc yu cu cn thit h tr VPN bng cch thit lp cc ng hm LSP s dng nh tuyn tng minh. Do , MPLS s dng cc ng hm LSP cho php nh khai thc cung cp dch v VPN theo cch tch hp trn cng h tng m h cng cp dch v Internet. Hn na, c ch xp chng nhn cho php cu hnh nhiu VPN lng nhau trn h tng mng. 1.8.5 Chuyn tip c phn cp Thay i ng k nht c MPLS a ra khng phi kin trc nh tuyn m l kin trc chuyn tip. S ci tin trong kin trc chuyn tip c tc ng ng k n kh nng cung cp chuyn tip phn cp. Chuyn tip phn cp cho php lng mt LSP vo trong mt LSP khc (xp chng nhn hay cn gi l iu khin gi a cp). Thc ra chuyn tip phn cp khng phi l k thut mi, ATM cung cp c ch chuyn tip 2 mc vi khi nim ng o (VP) v knh o (VC). Tuy nhin MPLS cho php cc LSP c lng vo nhau mt cch ty , cung cp iu khin gi a cp cho vic chuyn tip. 1.8.6 Kh nng m rng

Hc vin cng ngh bu chnh vin thng

32

n tt nghip i hc I

Chng

Chuyn mch nhn cung cp mt s tch bit ton din hn gia nh tuyn lin min (inter-domain) v nh tuyn ni min (intra-domain), iu ny ci thin ng k kh nng m rng ca cc tin trnh nh tuyn. Hn na, kh nng m rng ca MPLS cn nh vo FEC (thu gom lung), v xp chng nhn hp nht (merging) hoc lng nhau (nesting) cc LSP. Ngoi ra, nhiu LSP lin kt vi cc FEC khc nhau c th c trn vo cng mt LSP. S dng cc LSP lng nhau cng ci thin kh nng m rng ca MPLS. 1.9 Kt lun chng Chng I gii thiu cc vn c bn ca cng ngh chuyn mch nhn a giao thc:

Cc thut ng c bn trong MPLS: Min MPLS , lp chuyn tng ng FEC, ng chuyn mch nhn LSP, m ha ngn xp nhn.. Hot ng chuyn tip v nh tuyn trong MPLS: Hot ng trong mt phng chuyn tip ,nh tuyn rng buc, nh tuyn tng minh

Cc giao thc hot ng chuyn tip (LDP, CR-LDP, BGP) u nhc im v ng dng ca MPLS

Cc vn nu ra cho ta ci nhn tng quan v cng ngh MPLS ang c trin khai nhanh chng trong mng NGN ca Vit Nam.

Hc vin cng ngh bu chnh vin thng

33

n tt nghip i hc

Chng II

CHNG II
K THUT LU LNG TRONG MPLS V C CH BO V KHI PHC NG 2.1 Tng quan v k thut lu lng
K thut lu lng (Traffic Engineering) l qu trnh iu khin cch thc cc lung lu lng i qua mng sao cho ti u ha vic s dng ti nguyn v hiu nng ca mng. N ng dng cc nguyn l khoa hc cng ngh o lng, m hnh ha, c trng ha v iu khin lu lng nhm t c cc mc tiu khc nhau. Khi nim TE phn bit vi khi nim k thut mng (Network Engineering). K thut mng lin quan n vic thit k xy dng topology ca mng sao cho ph hp vi lu lng. 2.1.1 Cc mc tiu trin khai k thut lu lng 2.1.1.1 Phn loi Cc mc tiu trin khai k thut lu lng c th phn theo hai hng sau: Hng lu lng (traffic oriented) Hng ti nguyn (resource oriented)

Cc mc tiu hng dn lu lng lin quan n vic tng cng QoS cho cc lun lu lng. Trong m hnh n lp (dch v best-effort), cc mc tiu ny gm: gim thiu mt gi v tr, tng ti a thng lng v tun th cc hp ng mc dch v (SLA) Cc mc tiu hng lu lng b chn thng k (nh thay i tr gi nhnh, t l mt gi, tr truyn ti a) cng rt hu ch trong m hnh dch v phn bit (Diffserv). Cc mc tiu hng ti nguyn lin quan n vic ti u ha s dng ti nguyn. Bng thng l mt ti nguyn ct yu ca mng, do chc nng trng tm ca k thut lu lng l qun l hiu qu ti nguyn bng thng. 2.1.1.2 Bi ton nghn Nghn thng xy ra theo hai cch nh sau:

Khi bn thn cc ti nguyn mng khng cp cho ti yu cu.

Khi cc dng lu lng c nh x khng hiu qu ln cc ti nguyn, lm cho mt s tp con ti nguyn tr nn qu ti trong khi s khc nhn ri. C th gii quyt tc nghn bng cch:
34

Hc vin cng ngh bu chnh vin thng

n tt nghip i hc

Chng II

Tng dung lng hoc ng dng cc k thut iu khin tc nghn c

in (gii hn tc , iu khin lung, qun tr hng i, iu khin lch trnh) o qu. i tng gii quyt ca k thut lu lng l nghn ko di ch khng phi nghn nht thi do bng pht lu lng. 2.1.2 Cc lp dch v da trn nhu cu QoS v cc lp lu lng Lu lng c th c t chc xoay quanh mt khi nim goi l cc lp dch v (service classes). Cc lp lu lng ny c nh ngha theo nhng hot ng sau:

Dng k thut lu lng nu nghn l do cp pht ti nguyn cha hiu

Quan h ng b gia u pht v u thu: ch bin ng tr c th chp nhn

c mt kt ni.

Tc bit: c nh hay bin i Loi dch v: hng kt ni hay khng kt ni Cc hot ng iu khin lung. S th t cho thng tin ngi s dng Phn on v ti hp cc PDU (Protocol Data Unit)

2.1.3 Hng i lu lng Nhiu h thng (c bit l b nh tuyn) h tr mt s dng hng i thng dng sau: 2.1.3.1 Hng i FIFO Hng i FIFO (First in, First out) gi theo th t, gi n trc s c truyn trc. 2.1.3.2 Hng i WFQ Bng thng ri c chia cho cc hng i ty thuc vo trng s (weight) ca chng. Xt v d sau c hai lung lu lng A,B,..N v trng s ca chng c nh s nh hnh 2.1 trong : c bn lung (D,E,F,G) c trng s 5, c hai lung c trng s 4, cn cc trng s khc ch c mt lung .

Hc vin cng ngh bu chnh vin thng

35

n tt nghip i hc

Chng II

Hnh 2.1: Nhiu lung cho mi lp lu lng. 2.1.3.3 Hng i CQ CQ (Custom Queuing) cho php ngi dng ch ra phn trm bng thng kh dng cho mt giao thc c bit no . Ta c th nh ngha ti a n 16 hng i. Mi hng i c phc v mt cch tun t theo phng thc truyn phn trm lu lng trn mi hng i trc khi chuyn n hng i k (hnh 2.2).

Hnh 2.2: Hng i CQ 2.1.3.4 Hng i PQ (Priority Queuing) Tt c cc gi thuc lp c mc u tin cao hn s c truyn trc bt k gi no thuc lp c mc u tin thp hn. PQ cho php ngi qun l mng cu hnh bn
Hc vin cng ngh bu chnh vin thng 36

n tt nghip i hc

Chng II

thuc tnh lu lng l cao (high), thng thng (normal), trung bnh (medium) v thp (low). Lu lng n c gn vo mt trong 4 hng i (hnh 2.3).

Hnh 2.3: Hng i PQ 2.1.4 Gii thut thng r v thng token 2.1.4.1 Gii thut thng r (Leaky Bucket) M hnh thng r (hnh 2.4) c th c din t nh sau: bt chp tc nc c vo thng l bao nhiu, tc dng nc chy ra l khng i min l trong thng cn nc. Mt khi thng y, lng nc c thm vo s b trn v mt. Cc thng s cn ch trong m hnh thng r l kch thc ca thng v tc dng chy ra.

Hnh 2.4: Gii thut thng d

Hc vin cng ngh bu chnh vin thng

37

n tt nghip i hc

Chng II

M hnh trn c th p dng cho gi. Bt k lu lng ti c tc bin ng nh th no, lu lng ra u c tc khng i. 2.1.4.2 Gii thut thng token Thng token (Token Bucket) c kch thc l B, tc token chy vo thng khng i l p, ngha l trong mt giy s c thm p token mi chy vo thng. S lng token trong thng khng vt qu B hay ni cch khc, B l s lng token ti a trong thng. Khi c gi n, G l kch thc ca gi, gi c xem l ph hp khi lng token trong thng ln hn hay bng G, ng thi lng token trong thng c gim i G. Ngc li, khi token trong thng nh hn kch thc gi, gi c xem l vt mc hay khng hp l. Ty thuc vo cc chnh sch khc nhau m gi vt mc (hay khng hp l) c x l khc nhau. Gii thut thng token c th c dng trong vic sa dng lu lng (shaping) hay c ng dng trong vic thc thi khng ch (policing).

Hnh 2.5: Gii thut thng token Trong sa dng lu lng thut ton token cho php mt t bng pht ng ra, iu ny khng c thut ton thng r khi m tc ra l khng i. Nh vy, thng token cho p ng ra tt hn so vi thng r trong vic thc thi khng ch (policing).

Hc vin cng ngh bu chnh vin thng

38

n tt nghip i hc

Chng II

Trong sa dng lu lng, thut ton thng token c th c dng c lp hay c dng phi hp. 2.1.5 Gii php m hnh xp chng

Hnh 2.6: M hnh xp chng Mt cch tip cn ph bin b p cc thiu st ca cc giao thc IGP (interior gateway protocols ) l s dng mt hnh xp chng (nh IP over ATM hoc IP over FR). Tt c cc b nh tuyn l lp 3 c kt ni trc tip vi nhau bng mt li full-mesh cc mch o VC. K thut lu lng c thc hin lp 2 (ATM hoc FR). Tuy nhin, m hnh ny c nhiu nhc im sau y:

Tn km thm nhiu thit b (cc chuyn mch ATM hoc FR).

Qun l mng phc tp hn: Mng lp 2 c cc cng c qun l ring vi nhiu tc v h tr k thut lu lng. ng thi mng cc b nh tuyn lp 3vi giao thc IGP cng phi c qun l. Vic qun l 2 lp mng ny khng tch hp c. Pht sinh nhiu vn m rng i vi IGP do s lng qu ln cc neighbor khi kt ni full-mesh tn dng cc tin ch cung cp bi lp 2. Tn thm bng thng cho lng overhead ca ATM hoc FR (cell tax).

Khng h tr dch v phn bit (Diffserv). Mi dch v phn bit ca IP a xung (qua AAL5 ca ATM) u tr thnh best-effort 2.2 MPLS v k thut lu lng MPLS c ngha chin lc i vi k thut lu lng v n c th cung cp hu ht cc chc nng hin c m hnh xp chng nhng theo cch tch hp vi chi ph thp. iu quan trng l MPLS cn xut kh nng t ng ha cc chc nng k thut lu lng.
Hc vin cng ngh bu chnh vin thng 39

n tt nghip i hc

Chng II

2.2.1 Khi nim trung k lu lng MPLS gii thiu khi nim trung k lu lng thc hin cc mc tiu TE. Trung k lu lng l mt khi thu gom (aggregate) cc lung lu lng thuc cng lp, c t bn trong mt LSP. Trong mt s hon cnh c th ni lng nh ngha ny cho php trung k lu lng thu gom lu lng a lp.

Trong m hnh dch v n lp, mt trung kt lu lng c th ng gi ton b

lu lng gia mt b nh tuyn li vo v mt b nh tuyn li ra. Trong trng hp phc tp hn, lu lng ca cc lp dch v phn bit c n nh vo cc trung k lu lng ring bit vi cc c tnh khc nhau. Trung k lu lng l i tng c th nh tuyn (tng t nh ATM VC). Trung k lu lng phn bit vi LSP l ng cho trung k i xuyn qua.

Trong bi cnh hot ng, mt trung k lu lng c th chuyn t LSP ny sang mt LSP mi hoc nhiu trung k lu lng cng di chung trn mt LSP. Trung k lu lng l n hng.

2.2.2 th nghim suy th nghim suy (incluced graph) gn ging nh topology o trong m hnh xp chng. N c nh x trn mng vt l thng qua vic la chn cc LSP cho cc mng trung k lu lng. Mt th nghim suy gm mt nhm cc nt LSR c kt ni vi nhau bng LSP. Khi nim ny rt quan trng v bi ton qun l bng thng c bn trong mt min MPLS t ra chnh l lm th no nh x hiu qu th nghim suy trn topology mng vt l. th nghim suy c cng thc ha nh sau: t G = (V, E, C) l th m t topology vt l ca mng. Trong V l tp hp cc nt mng, E l tp hp cc ng lin kt, C l tp hp cc kh nng v rng buc cho E v V. Ta coi G l topology c s. t H = (U, F, D) l th MPLS nghim suy, trong U l tp con thuc V gm mt nhm LSR ti cc u ca LSP. F l tp hp cc yu cu v ch ti cho F. Nh vy, H l mt th trc tip ph thuc vo cc c tnh chuyn ti ca G. 2.2.3 Bi ton c bn ca k thut lu lng trn MPLS C ba vn c bn lin quan n k thut lu lng trn MPLS l:

Hc vin cng ngh bu chnh vin thng

40

n tt nghip i hc

Chng II

nh x cc gi ln cc lp chuyn tip tng ng (FEC). nh x cc FEC ln cc lp trung k lu lng (traffic trunk). nh x cc trung k lu lng ln topology mng vt l thng qua cc

LSP.

Cc phn sau ca chng s tp trung vo vn th ba, tc l tnh ton ng i tt nht qua mng cho cc trung k lu lng sao cho mng hot ng hiu qu v tin cy. y chnh l bi ton nh x th nghim suy H ln topology mng c s G. 2.3 Trung k lu lng v cc thuc tnh xy dng v duy tr trung k lu lng, ngi ta tm cch m hnh ha n bng cc tham s. Mt thuc tnh l mt tham s c gn v c nh hng n cc c trng hnh vi ca trung k lu lng. Cc thuc tnh c th c gn c th thng qua hnh ng qun tr hoc c gn ngm bi cc giao thc bn di khi cc gi c phn loi v nh x vo FEC ti li vo min MPLS. Thc t, mt trung k lu lng c th c trng ha bi:

Ingress-LSR v egress-LSR ca trung k lu lng Tp cc FEC c nh x vo trung k lu lng Mt tp cc thuc tnh nhm xc nh cc c trng hnh vi ca trung k.

Hai vn c bn c ngha c bit l: (1) Tham s ha cc trung k lu lng v (2) nhng quy lut sp t v duy tr ng dn cho cc trung k lu lng. 2.3.1 Cc hot ng c bn trn trung k lu lng L cc tin trnh khc nhau xy ra trong thi gian sng ca mt trung k lu lng:

Establish: To ra mt trung k lu lng bng cch quyt nh mt LSP, gn cc nhn MPLS v quan trng nht l gn ti nguyn trung k . Activate: Lm cho trung k lu lng bt u chuyn d liu bng cch dng mt s chc nng nh tuyn lu lng vo trung k. Deactivate: Lm cho trung k lu lng ngng chuyn d liu cng bng cch dng mt chc nng nh tuyn dng vic a lu lng vo trung k. Modify Attributes: Thay i cc c trng ca trung k lu lng, chng hn nh bng thng kh dng. Reroute: chn mt ng mi cho trung k lu lng (thng l do mt s s c trong mng hoc i khi khi phc xong s c).
Hc vin cng ngh bu chnh vin thng 41

n tt nghip i hc

Chng II

Destroy: Loi b hon ton mt trung k lu lng khi mng v thu hi tt c cc ti nguyn cp pht cho n. 2.3.2 Thuc tnh tham s lu lng Thuc tnh tham s lu lng (traffic parameter) c t bng thng i hi bi trung k lu lng cng vi cc c trng lu lng khc nh tc nh, tc trung bnh, kch thc bng pht cho php Di gc k thut lu lng, cc tham s lu lng rt quan trng v chng ch yu cu v ti nguyn ca trung k lu lng. 2.3.3 Thuc tnh la chn v qun l ng L cc tiu chun la chn v duy tr ng dn cho trung k lu lng. Con ng thc s c la chn xuyn qua mng c th c cu hnh bi nh iu hnh hoc c gn ng do mng da vo cc thng tin t IGP (nh IS-IS hoc OSPF). Cc thuc tnh c bn v cc c trng hnh vi lin quan n chn ng v qun l ng cho trung k lu lng c m t sau y : 2.3.3.1 ng tng minh c t qun tr ng tng minh c t qun tr cho mt trung k lu lng c cu hnh bi nh iu hnh. Mt ng gi l c t ton b nu ch ra cc chng yu cu gia hai im u cui. c t mt phn nu ch c mt tp con cc chng trung gian c ch th. Thuc tnh path preference rule l mt bin nh phn ch th ng tng minh c cu hnh l bt buc hay khng bt buc. 2.3.3.2 ng phn cp cc lut u tin cho a ng Trong mt s hon cnh thc t, kh nng ch nh cho mt tp hp cc ng tng minh c cho mt trung k lu lng v nh ngha phn cp cc quan h u tin gia cc ng. Khi thit lp ng, cc lut u tin c p dng chn ra ng thch hp t danh sch c. Trong cc tnh hung s c th cc lut u tin ny cng c dng chn mt ng thay th t danh sch c. 2.3.3.3 Thuc tnh Affinity lp ti nguyn Thuc tnh ny cho php operator p t cc chnh sch chn ng bng vic bao gm hay loi tr mt s lin kt no . Mi lin kt c tn mt thuc tnh lp ti nguyn (Resource-Class). Thuc tnh Affinity lp ti nguyn c dng chui nh bit sau: Affinity( 32-bit), Mask(32-bit)

Hc vin cng ngh bu chnh vin thng

42

n tt nghip i hc

Chng II

Mt n lp ti nguyn ch th cc bit no trong lp ti nguyn cn c kim tra. Lin kt c bao hm khi chn ng nu mi Affinity trng vi Resource-Class sau khi cng thc hin php AND vi mt n. Gi tr default ca mt n l 0x0000FFFF. 2.3.3.4 Thuc tnh thch ng Trong nhiu tnh hung cn thit phi thay i ng cc ng dn trung k lu lng p ng vi vic thay i trng thi mng (ch yu thay i ti nguyn kh dng). Qu trnh ny c gi l ti ti u ha (re-optimization). Thuc tnh thch ng (Adaptivity) cho bit mt trung k lu lng c ghp ti ti u ha hay khng. Nu ti ti u ha b cm th trung k lu lng coi nh c gim vo ng thit lp ca n v khng th ti nh tuyn (re-route) khi c s thay i trng thi mng. 2.3.4 Thuc tnh u tin/ln chim Thuc tnh u tin (Prioity/Preemption) c 8 mc (gim dn t 0 n 7) xc nh th t thc hin chn ng cho cc trung k lu lng. u tin cng rt quan trng khi trin khai c ch ln chim (preemption) v n c nh hng n th t t thin v. Mi trung k lu lng c gn mt gi tr u tin thit lp (setup priority) v mt gi tr u tin cm gi (holding priority). Khi thit lp trung k mi hoc ti nh tuyn, mt trung k c u tin thit lp cao s chn ln mt trung tuyn khc c u tin cm gi thp hn bt ra khi ng nu chng cnh tranh ti nguyn. Ngc li, vic thit lp mt trung k mi c th tht bi nu bng thng m n yu cu ang b chim bi cc trung k khc c u tin cm gi cao hn. 2.3.5 Thuc tnh n hi Thuc tnh n hi (Resilience) xc nh hnh vi ca trung k lu lng trong tnh hung xy ra s c theo c ch sau: Khng ti nh tuyn trung k lu lng. Ti nh tuyn qua mt ng kh thi c ti nguyn. Ti nh tuyn qua ng kh dng bt k chp nhn cc rng buc ti nguyn. T hp ca cc c ch ni trn.

2.3.6 Thuc tnh khng ch Thuc tnh khng ch (Policing) xc nh nhng hot ng c thc hin khi mt trung k lu lng khng tun th mc dch v c t cc tham s lu lng. N cho bit cch x l i vi lng traffic vt mc dch v (v d hy gi hay truyn

Hc vin cng ngh bu chnh vin thng

43

n tt nghip i hc

Chng II

theo kiu best-effort). Ni chung nn lun lun khng ch li vo ca mng cng bc tun th cc hp ng mc dch v v gim thiu vic khng ch bn trong li mng..

2.4 Tnh ton ng rng buc


2.4.1 Qung b cc thuc tnh ca lin kt B nh tuyn ti u ngun (head-end) ca mt trung k phi nm c thng tin thuc ti nguyn ca tt c cc lin kt trong mng tnh ton ng LSP. iu ny ch c th t c bng cch s dng cc giao thc nh tuyn Link-State (nh ISIS hay OSPE) v ch c kiu giao thc ny mi qung b thng tin v tt c cc lin kt n tt c cc b nh tuyn. V vy, OSPF v IS-IS c m rng h tr MPLS-TE: o o IS-IS c cc trng Type-Length-Value mi (kiu 22 TLV) nh km cc OSPF c cc nh ngha thng co Link-State mi (kiu 10 LSA). thng tin ny trong cc thng co PDU Link-State ca n.

Mt khi b nh tuyn u ngun nhn c cc thng co ny th n khng ch bit c topology mng m cn bit c cc thng tin ti nguyn kh dng ca tng lin kt. iu ny rt cn thit tnh ton cc ng tha mn cc i hi ca trung k lu lng.

Hnh 2.7: Bng thng kh dng ng vi tng mc u tin Cc giao thc IGP s qung b cc thuc tnh ti nguyn khi di cc iu kin hoc s kin no nh:

Khi lin kt thay i trng thi (v d up,down)

Khi lp ti nguyn ca lin kt thay i do ti cu hnh nhn cng hoc trong trng hp bng thng kh dng bin ng qua cc mc ngng t trc. Theo nh k (da vo mt timer), b nh tuyn s kim tra cc thuc tnh ti nguyn v qung b cp nht thng tin.
Hc vin cng ngh bu chnh vin thng 44

n tt nghip i hc

Chng II

Khi tham gia thit lp mt ng LSP nhng tht bi.

2.4.2 Tnh ton LSP rng buc LSP cho mt trung k lu lng c th khai bo tnh hoc tnh ton ng. Vic tnh ton s xem xet cc ti nguyn kh dng, cc thuc tnh lin kt v c cc trung k khc (v vy c gi l tnh ton ng rng buc). Kt qu ca vic tnh ton ny l tm ra mt chui cc a ch IP i din cho cc chng trn ng LSP gia u ngun v u ch ca trung k lu lng. Sau , thc hin bo hiu LSP v hon thnh vic thit lp ng bng giao thc bo hiu cho MPLS nh RSVP-TE. Tin trnh tnh ton ng u ngun lun c thc hin ti u ngun trung k lu lng v c kch hot do:

Mt trung k mi xut hin. Mt trung k ang tn ti nhng thit lp LSP tht bi. Ti ti u ha mt trung k ang tn ti.

2.4.3 Gii thut chn ng Vic chn ng cho mt trung k lu lng s dng trng s qun tr (TE cost) ca mi lin kt ring bit. Trng s qun tr ny mc nhin l metric IGP ca lin kt. Gii thut chn ng theo cc bc sau:

Ct b cc lin kt c resuorce-class b loi do php tnh Affinity ra khi Ct b cc lin kt khng c bng thng d tr theo yu cu ca trung k. Chy gii thut Dijktra tm ra ng c tng TE-cost nh nht trn phn Sau khi thc hin cc bc trn m vn cn nhiu ng ng c cho LSP

topology.

topoloy cn li. (nhiu ng c cng tng TE metric) th tiu chun th t chn la nh sau: ng c bng thng ti thiu cao nht ng c hop nh nht Chn la ngu nhin Khi LSP c tnh xong, RSVP c dng dnh trc bng thng thc s, phi cc nhn cho ng v hon thnh vic thit lp ng LSP

Hc vin cng ngh bu chnh vin thng

45

n tt nghip i hc

Chng II

2.4.4 V d v chn ng cho trung k lu lng Xt v d chn ng LSP cho mt trung k lu lng (tunnel) thit lp gia R1 (u ngun) v R6 (u ch) nh hnh 2.8. Yu cu ca trung k lu lng nh sau: Bng thng i hi mc u tin 3 l 30 Mbps Cc bit Affinity lp ti nguyn l 0010 vi mt n l 0011, tc l ch thc hin

kim tra trn hai bit thp. Lin kt R4-R3 cn c loi tr khi ng LSP, do vy chui bit resourceclass ca c t l 0011. Khi cc bit Affinity lp ti nguyn ca trung k lu lng c so snh vi cc bit resource-class l khng trng nn lin kt R3-R4 b loi (hnh 2.8).

Hnh 2.8: Xem xt cc rng buc khng ch Tham s tip theo c kim tra trong qu trnh tnh ton ng rng buc l TE cost (trng s qun tr) ca mi lin kt m ng hm kh nng i qua. Nu khng xt ti nguyn th ng R1-R4-R6 c tng cost thp nht l 30. Tt c cc ng kh thi khc u c tng cost cao hn. Khi ti nguyn c a vo tnh ton, thy rng trn ng ngn nht khng c bng thng tha mn cc i hi ca trung k lu lng (i hi 30 Mbps trong khi ch c 20 Mbps kh dng). Kt qu l R4-R6 cng b loi khi php tnh ng LSP.
Hc vin cng ngh bu chnh vin thng 46

n tt nghip i hc

Chng II

Hnh 2.9: Xem xt ti nguyn kh dng Sau khi loi b cc lin kt khng tha mn cc i hi ca trung k lu lng, kt qu c hai ng LSP l : R1-R2-R3-R6 v R1-R5-R6. C hai ng u khng c tng cost l 40, chn ng phi gii quyt bng lut tie-break (hnh 2.10).

Hnh 2.10: Chn ng tt nht. Trc tin bng thng ti thiu trn ng c so snh. Sau khi so snh, vn cn c hai ng v chng u cung cp t nht 50 Mbps bng thng. Tip theo, lut s hop nh nht trn ng LSP c p dng. V ng R1-R5-R6 c hop-count nh hn nn cui cng n c chn v qu trnh tnh ton rng buc kt thc. 2.4.5 Ti ti u ha Cc c trng v trng thi mng bin ng theo thi gian. V d cc ti nguyn mi tr nn kh dng, cc ti nguyn b li c knh hot, cc ti nguyn cp pht c thu hi li. Do vy, cc ng ca trung k lu lng c thit lp ti u
Hc vin cng ngh bu chnh vin thng 47

n tt nghip i hc

Chng II

trc c th khng cn ti u na. duy tr mng lun lun trng thi ti u nht, cc trung k lu lng phi c ti ti u ha (re-optimization). Ti ti u ha c thc hin theo chu k. Sau nhng khong thi gian nht nh, MPLS-TE thc hin kim tra ng ti u nht cho cc ng hm LSP. Nu xut hin ng cho LSP tt hn ng hin dng th:

B nh tuyn u ngun c gng bo hiu thip lp LSP mi tt hn. Nu thnh cng, thay ng LSP c bng ng LSP mi tt hn. Ti ti u ha phi khng gy ra sai hng dch v. thc hin iu ny, ng

LSP hin c phi c duy tr cho n khi LSP mi c thit lp xong v chuyn trung k lu lng t ng c sang ng mi. Sau , ng LSP c mi c gii ta. Khi nim ny gi l make before break.

2.5 Bo v v khi phc ng


Cc c ch bo v v khi phc ng trong MPLS cung cp mt dch v tin cy cho vic chuyn ti lu lng trong mng MPLS v ti nh tuyn lu lng qua mt ng chuyn mch nhn LSP. Trong phn ny, ta c mt khi nim sau:

ng lm vic: L ng chuyn ti trung k lu lng trc khi xy ra li.

y l ng c bo v bi c ch khi phc. ng khi phc: L ng m trung k lu lng s c ti nh tuyn sau

khi xy ra li, c thit lp bo v cho ng lm vic. PSL (Path Switch LSR): L LSR ng trc v tr li trn ng lm vic chu

trch nhim chuyn mch hoc ti to lu lng sang ng khi phc. PML (Path merge LSR): L LSR chu trch nhim nhn lu lng trn ng

khi phc v s: ti hp nht lu lng tr v ng lm vic, hoc chuyn lu lng ra khi min MPLS nu bn thn n l ch. POR (Point of Repair): POR l mt LSR chu trch nhim sa cha mt LSR, n

c th l mt PSL hoc PML ty theo c ch khi phc no c dng. FIS (Fault Indication Signal): L bn tin ch th c mt li xy ra trn ng lm

vic sa cha xong. FRS c chuyn tip cho ti khi n n c mt LSR m nhn vic tr li ng nguyn thy.

Hc vin cng ngh bu chnh vin thng

48

n tt nghip i hc

Chng II

2.5.1 Phn loi cc c ch bo v khi phc 2.5.1.1 Sa cha ton cc v sa cha cc b Sa cha ton cc l bo v khi c bt k s c v tr no trn ng lm vic. im sa cha POR ( y chnh l ingress-LSR) thng cch xa v tr li v thng c thng bo bng tn hiu FIS. Vic khi phc ng l end-to-end, trong ng lm vic v ng bo v tch ri nhau (disjoint) hon ton. Sa cha cc b nhm bo v khi s c lin kt hoc nt nhng khi phc nhanh hn do vic sa cha c thc hin cc b ti thit b pht hin s c. Nt nm k trc tip trc v tr li s ng vai tr PSL khi to cng tc khi phc. Sa cha cc b c th c thit lp theo hai trng hp:

Khi lc lin kt: bo v khi phc lin kt trn ng lm vic. Nu

mt li xy ra trn lin kt ny c khi phc s ni lin PSL v PML hai u lin kt li. ng khi phc v ng lm vic tch ri nhau i vi lin kt c bo v.

Khi phc nt: bo v nt trn ng lm vic. ng khi phc v

ng lm vic phi tch ri nhau i vi nt c bo v, hoc PLM l egress-LSP. 2.5.1.2 Ti nh tuyn v chuyn mch bo v i vi khi phc bng ti nh tuyn (re-router), ng khi phc c thit lp theo yu cu sau khi xy ra s c. Khi pht hin s c trn ng lm vic, mt LSR ng trc v tr li c vai tr l POR mi bt u bo hiu mt ng khi phc i vng qua im li v mi (merge) vo mt nt no nm sau im li trn ng lm vic. ng khi phc ny c th c tnh ton sn trc hoc tnh ton sau khi pht hin s c. Khi ng khi phc c thit lp xong, PSL bt u chuyn lu lng trn ng ny. Trong chuyn mch bo v th ng khi phc c tnh ton v thit lp trc khi xy ra s c trn ng lm vic. PLS c cu hnh chuyn mch lu lng sang ng khi phc ngay khi n bit c li trn ng lm vic (trc tip pht hin li hoc nh nhn c FIS). V ng khi phc thit lp trc nn chuyn mch bo v nhanh hn so vi khi phc bng ti nh tuyn.

2.5.2 M hnh Makam

Hc vin cng ngh bu chnh vin thng

49

n tt nghip i hc

Chng II

y l m hnh khi phc MPLS u tin c xut (hnh 2.11). N cung cp bo v ton cc cho mt ng LSP bng cch thit lp ng khi phc gia ingressLSR v egress-LSR. ng lm vic v khi phc tch ri nhau (disjoint) c v lin kt v nt. Khi pht hin li bt k v tr no trn ng lm vic, tn hiu FIS c dng chuyn thng bo li v ingress-LSR (PSL). Ingress-LSR s thc hin chuyn mch lu lng sang ng khi phc. M hnh ny h tr c cc ng khi phc thit lp sn (chuyn mch bo v ) v ng khi phc thit lp ng (ti nh tuyn).

Hnh 2.11: M hnh MAKAM u im: Ch cn mt ng d phng cho mi s c trn ng lm vic v ch cn mt LSR c chc nng lm PSL. Nhc im: M hnh ny c mt khong thi gian tr tn hiu FIS truyn ngc v ti PSL. Trong thi gian ny, lu lng trn ng lm vic b mt. 2.5.3 M hnh Haskin M hnh Haskin (Reverse Backup) khc phc c nhc im mt gi m hnh Makam (hnh 2.12). Ngay khi mt LSR pht hin s c trn ng lm vic, n chuyn hng lu lng n trn ng lm vic sang mt ng d phng o i ngc v PSL. Khi quay tr v n PSL, lu lng c chuyn sang ng khi phc ton cc. ng d phng o v ng khi phc phi thit lp sn nn cch ny tn km ti nguyn.

Hc vin cng ngh bu chnh vin thng

50

n tt nghip i hc

Chng II

Hnh 2.12: M hnh Haskin Mt ci tin khc cho php PSL chuyn trc tip lu lng sang ng khi phc ton cc ngay khi n thy ng d phng o c dng. Cc gi u tin trong phn lu lng c o chiu c tc dng nh tn hiu FIS. Cch ny ti u hn v ng i ca lu lng c bo v ngn hn. Tuy nhin trong thi gian u, lu lng mi chuyn i trn ng khi phc s trn ln vi phn lu lng c o chiu lm thay i th t gi ban u. 2.5.4 M hnh Hundessa M hnh Hundessa ging nh m hnh Haskin ci tin nhng khc phc c vn xo trn th t gi. Khi gi u tin quay tr v PSL trn ng d phng o c tc dng nh tn hiu FIS bo cho PSL bit c li. PSL nh du gi cui cng truyn ra ng lm vic (ang c li) bng cch t mt bit trong trng EXP nhn, sau ngng y gi ra ng li. Khi gi c nh du quay tr v PSL trn ng o, PSL mi tip tc chuyn cc gi mi trc tip ra ng khi phc. 2.5.5 M hnh Shortest-Dynamic

Hc vin cng ngh bu chnh vin thng

51

n tt nghip i hc

Chng II

Trong m hnh ny ch c ng lm vic c thit lp. Khi mt nt pht hin s c lin kt th n phi tnh ton ri bo hiu thit lp mt ng hm (hnh 2.13). LSP ngn nht i t n n nt pha bn kia lin kt s c v sau chuyn mch lu lng (bng cch xp chng nhn lun ng lm vic chui qua ng hm trnh li ny) .

Hnh 2.13: M hnh Shortest-Dynamic 2.5.6 M hnh Simple-Dynamic Ging nh Shortest-Dynamic, c ch ny cng l mt c ch cc b. Nt pht hin s c lin kt s chuyn mch lu lng. S khc nhau gia hai c ch ny l nt cui cng ca ng lm vic phi l PML. Sau , ng khi phc s l t nt pht hin s c n nt PML. Trong trng hp ny khng tnh ton trc ng LSP khi phc (hnh 2.14).

Hc vin cng ngh bu chnh vin thng

52

n tt nghip i hc

Chng II

Hnh 2.14: M hnh Simple_Dynamic 2.5.6 M hnh Simple-Static tng ny l ging c ch simple-dynamic, nhng vi ng khi phc c tnh ton trc khi xy ra li. 2.6. Kt lun Chng ny trnh by cc yu cu cho k thut lu lng qua MPLS. Bi ton c bn ca k thut lu lng MPLS l lm sao cho nh x th nghim suy (induced graph) ln trn topology vt l ca mng mt cch hiu qu nht. MPLS cng cung cp cc c ch bo v v khi phc lu lng lp MPLS mt cch tin cy .

Hc vin cng ngh bu chnh vin thng

53

n tt nghip i hc III

Chng

CHNG III
XY DNG CHNG TRNH M PHNG C CH BO V V KHI PHC NG TRONG MPLS S DNG NS2
3.1 Mi trng m phng NS2
NS-2 l chng trnh m phng mng theo phng php m phng cc s kin ri rc. NS-2 h tr m phng mng c dy v khng dy, TCP, UDP, cc giao thc truyn thng im - a im, cc phng php nh tuyn, ...vv. NS-2 vit bng C++ v ngn ng hng i tng Tcl (Otcl: Object Oriented Toll Command Language). So vi cc phn mm m phng mng khc. NS-2 c nhng u th sau: mm ny. pht trin. Nhn t pha ngi s dng, NS-2 l chng trnh bin dch m Otcl c lin kt ti th vin C++. Cc i tng c s nh TCP, CBR, c xy dng trong C+ +. u vo NS-2 l tp m lnh Otcl, u ra l tp tin m phng tin trnh theo yu cu c th hin trong tp lnh Otcl. Kt qu m phng c th quan st bng hnh nh m t trc quan vi ng dng Nam (the Network Animator), bng th (Xgraph, Trace graph) hoc c th c x l bng cc tp lnh tu chn. Vi cu trc ny, vic s dng NS-2 tr nn n gin hn nhiu so vi s dng trc tip C++ nhng vn c nhng tnh nng ca C++. NS-2 h tr cc tnh nng c bn ca mng IP, t c th pht trin NS-2 c m ngun m min ph. NS-2 c kin trc m, to iu kin cho vic m rng. NS-2 c pht trin t cc phn mm ni ting trn th gii nh REAL.

NEST nn c nhng im mnh v khc phc c nhng yu im ca cc phn

thm cc phn t mng. NS-2 c cu trc modul, rt thun tin cho vic nghin cu tm hiu v

Hc vin cng ngh bu chnh vin thng

54

n tt nghip i hc III

Chng

Vi nhng c im trn, NS-2 thc s l mt cng c phn mm hu ch cho vic hc tp, nghin cu mng thng tin, gip cho vic thc hnh mng tr nn hiu qu hn. 3.1.1 Kin trc NS2 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 3.1: Tng quan v NS di gc ngi dng Trong hnh 3.1, 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, ngi s dng lp trnh bng ngn ng kch bn OTcl. Ngi dng 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 traffic khi no bt u truyn v ngng truyn packet 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
Hc vin cng ngh bu chnh vin thng 55

n tt nghip i hc III

Chng

tr neighbour cho mt i tng ch n a ch ca i tng tng ng. M un 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 ngi dng 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: 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 3.2: Lung cc s kin cho file Tcl chy trong NS NAM Visual Simulation Tracing and Monitoring Simulation M phng o NAM M phng Ln vt v Gim st

3.1.2 C++ v OTcl Hnh 3.3 biu din kin trc chung ca NS. Ngi dng c th tng tng mnh ang ng gc tri di, thit k v chy cc m phng trong Tcl. Tcl dng cc i

Hc vin cng ngh bu chnh vin thng

56

n tt nghip i hc III

Chng

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.

Network Components TclCL OTcl Tcl C/C++ ns-2


Hnh 3.3: 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 3.4 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

Hnh 3.4: C++ v OTcl: S i ngu

Event Event Scheduler Scheduler

Hc vin cng ngh bu chnh vin thng

57

n tt nghip i hc III

Chng

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, kt ni bin v gi lnh.

Hnh 3.5: TclCL hot ng nh lin kt gia A v B Vy, ti sao NS li cn s dng n hai ngn ng? L do l 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 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. 3.2 Xy dng chng trnh m phng 3.2.1 Mc tiu m phng Cho trc mt topology mng gm 10 nt b nh tuyn nh trong hnh di y:

Hc vin cng ngh bu chnh vin thng

58

n tt nghip i hc III

Chng

Hnh 3.6: M hnh mng Cc ngun pht lu lng (src) u t ti nt 0 v cc ch nhn lu lng (sink) u t ti nt 0. Cc lin kt gia cc nt u l full-duplex vi thi gian tr l 30 ms v c bng thng nh sau :

Nt 0 Nt 1: 3M ; Nt 9 Nt 10: 3M Nt 1 Nt 2: 1M ; Nt 2 Nt 4:1M ; Nt 3 Nt 4: 1 M ; Nt 3 Nt 5: 1 Nt 1 Nt 3: 2 M ; Nt 4 Nt 7: 2 M ; Nt 4 Nt 7: 2 M ; Nt 5 Nt 7: 2

M ; Nt 5 Nt 7: 1M ; Nt 7 Nt 8: 1 M ; Nt 7 Nt 9: 1 M ; M Nt 0 v Nt 10 l b nh tuyn IP thng thng (R0 v R10). Cc nt t 1 n 9 l cc b nh tuyn c h tr MPLS (LSR1 n LSR9) to thnh mt min MPLS. C mt ngun lu lng (scr1) c to thnh v gn vo nt R0. Tng ng c 1 ch lu lng (sink1) gn vo nt R10. Ngun pht lung lu lng vi tc 0,8 Mbps, kch thc gi 600B. Mc tiu chng trnh m phng hng ti : 1.
2.

Thng tin m phng chung ca ton mng : bao nhiu gi c to ra , bao nhiu Theo di qu trnh thit lp ng lm vic, ng bo v v ti thit lp chng Biu din qu trnh m phng bng cc phn mm ng dng NS2 nh Nam,

gi c chuyn tip , bao nhiu gi b mt mt. ra sao. 3. XGRAPH 3.2.2 Thc hin v kt qu 3.2.2.1 M phng vi lch trnh qui nh trong script m phng

Hc vin cng ngh bu chnh vin thng

59

n tt nghip i hc III

Chng

1. 2.
3. 4. 5.

Thit lp ng lm vic: LSP_1100 (ER=1_3_5_7_9) Thit lp ng bo v ton cc: LSP_1200 (ER=1_2_4_6_8_9) Thi im 0,5s: Lung 1 (src1_sink1) bt u truyn n LSP_1100 Thi im 2,0s: Lin kt gia LSR5_LSR7 b t, n 3,5s th khi phc. Thi im 5,0s: Lung 1 ngng truyn.

Hnh 3.7: Lch trnh m phng 3.2.2.2 Biu din trn th XGRAPH T Xgraph (hnh 3.8) ta thy ti thi im LSR5-LSR7 b t (2,06s), LSR5 pht mt bn tin FIS v LSR1. Sau khi LSR1 nhn c thng ip ny, n s chuyn lung lu lng t ng lm vic sang ng bo v ton cc thit lp. Do thng ip thng bo phi mt mt khong thi gian mi n c LSR1 nn trong thi gian ny, cc gi vn cn c truyn trn ng dn c lin kt b hng v b mt gi ng thi phi mt 1 thi gian tr nht nh cc gi tin u tin trn ng thit lp bo v ton cc mi chuyn ti LSR10. Nn ta thy ti thi im 2s n 2.4s, lng bng thng gim t ngt ri tng li n nh nh c sau 1 khong thi gian

Hc vin cng ngh bu chnh vin thng

60

n tt nghip i hc III

Chng

Hnh 3.8: th Xgraph . Ti thi im 3.5s khi phc ng truyn lng bng thng tng t bin ri gim v n nh 0,8 Mb/s do tr gi tin trn ng thit lp bo v ton cc. R rng vic t l mt gi tin kh ln do mt s lng gi tin nht nh b mt mt trn ng lin kt hng do tr gi tin l nhc im c ch Makam. Nhc im ny c khc phc c ch Resever Backup. 3.2.2.3 Biu din NAM

Bo hiu thit lp ng lm vic v ng bo v ng thit lp LSP ER=1_3_5_7_9 ng bo v LSP ER =1_2_4_6_8_9.

Hc vin cng ngh bu chnh vin thng

61

n tt nghip i hc III

Chng

Hnh 3.9: Bo hiu thit lp ng lm vic v bo v o o o o Lung 1: BW=0.8M chy start = 0.5 stop = 5.0 s dng ER =1_3_5_7_9

Hc vin cng ngh bu chnh vin thng

62

n tt nghip i hc III

Chng

Hnh 3.10: S ng lm vic ER=1_3_5_7_9 Thi im 2,06s pht hin li trn ng lm vic LSP_1100. Chuyn sang ng bo v LSP_1200

Hnh 3.11: Pht hin li

Hc vin cng ngh bu chnh vin thng

63

n tt nghip i hc III

Chng

Hnh 3.12: Chuyn sang ng bo v Ti 3,5s li c khi phc Chuyn lu lng tr li ng lm vic LSP_1100

Hnh 3.13: Li c khi phc


Hc vin cng ngh bu chnh vin thng 64

n tt nghip i hc III

Chng

Hnh 3.14: Chuyn lu lng tr li ng lm vic

Ti 5,0 s kt thc qu trnh truyn gi 750 gi c truyn, mt 57 gi

Hnh 3.15: Kt thc qu trnh truyn gi

Hc vin cng ngh bu chnh vin thng

65

n tt nghip i hc III

Chng

3.3 Tng kt
Trong chng ny chng ta gii thiu v phn mm m phng NS2 v ng dng n vo k thut lu lng giao thc MPLS, c th l ta m phng thnh cng c ch bo v v thit lp ng. N gip ta hiu k v qu trnh thit lp ng truyn v thit lp bo v ra sao ng thi gip ta theo di c qu trnh truyn gi tin, mt mt gi v tr. Cc file Otcl Scripts thc hin bi ton m phng trnh by trong ph lc ca n ny.

Hc vin cng ngh bu chnh vin thng

66

n tt nghip i hc

Kt Lun

KT LUN
Vi nhng u im vt tri, MPLS c xem l cng ngh y ha hn trong tng lai nhm p ng nhu cu a dch v, a phng tin ca khch hng. Sau mt thi gian nghin cu, n gii quyt c mt s vn sau:

Tm hiu tng quan v cng ngh MPLS.

Nghin cu vn iu khin lu lng v bi ton iu khin lu lng trong MPLS. Xy dng chng trnh m phng c ch bo v v khi phc ng trong k thut lu lng MPLS Cc vn c nu ra trong n cho ta mt ci nhn tng quan hn v cng ngh MPLS. K thut iu khin lu lng s dng trong cng ngh MPLS gip gii quyt vn tc nghn mng nh nng cao hiu nng mng. Nghin cu iu khin lu lng trong MPLS l vn rt quan trng nhm m ra cc k thut mng nng cao hiu qu s dng mng trong tng lai. Cng vic nghin cu v cng ngh MPLS vn ang c cc t chc tip tc nghin cu, pht trin v hon thin tiu chun. Vic hon thin cc tiu chun c vai tr quan trng i vi cc nh sn xut thit b, cng nh cc nh cung cp mng nhm t c mt mng ti u nht. i vi c s h tng thng tin quc gia, vic trin khai cng ngh MPLS cn c nghin cu su hn pht huy nhng u im ca MPLS ng thi ph hp vi nhu cu th trng ca Vit Nam. Mt ln na xin gi li cm n chn thnh ti cc thy c gio gip em trong nhng nm thng hc tp ti trng. H ni, thng 11 nm 2008 Tin Thnh

Hc vin cng ngh bu chnh vin thng

67

n tt nghip i

Ti Liu Tham Kho

TI LIU THAM KHO


[1] Cng ngh MPLS TS Nguyn Tin Ban 2008

[2] Rosen, E., Viswanathan, A. and R. Callon, Multiprotocol Label Switching Architecture, RFC 3031. [3] L. Andersson, P. Doolan, N. Feldman, A. Fredette, B. Thomas, LDP Specification, RFC 3036. [4] MPLS Fundamentary ( Luc De Ghein- CisscoPress 2006)

[5] ATM & MPLS: Theory and Application ( Eric Osborne, Ajay SimhaCiscopress 2002) [6] D. Awduche, J. Malcolm, J. Agogbua, M. ODell, J. McManus Traffic Engineering in MPLS, RFC 2702. [7] Keping Long, Zhongshan Zhang, Shiduan Cheng, Load balancing algorithms in MPLS traffic engineering, High Performance Switching and Routing, 2001 IEEE Workshop on, 2001. [8] TS. Phng Vn Vn, KS. Mnh Quyt, Cng ngh chuyn mch nhn a giao thc MPLS, Nh xut bn Bu in, 2003. [9] Eric Osborne, Ajay Simha, Traffic Engineering with MPLS, Cissco Press, 2003. [10] Hong Trng Minh, Bi ging Cng ngh chuyn mch nhn a giao thc MPLS, Hc vin cng ngh bu chnh vin thng. [11] [12] Ns-manual http://www.isi.edu/nsnam/ns/ns-documentation.html MNS-Manual - http://flower.ce.cnu.ac.kr/~fog1/mns/.

Hc vin cng ngh bu chnh vin thng

68

n tt nghip i hc Lc

Ph

PH LC M ngun chng trnh m phng


# Tao ra mot doi tuong mo phong set ns [new Simulator] $ns rtproto LS # Tao file de xuat ket qua cho NAM set nf [open bai4.nam w] $ns namtrace-all $nf # Tao cac file de luu du lieu cho xgraph set f1 [open luong_1.tr w] set f2 [open luong_seq.tr w] # So do ket noi mang

1M 2M 1M # LSR2---------------LSR4------------------LSR6-------------------LSR8 # / / / / \ # / / / / \ # 1M / 1M / 1M / 1M / \ 2M # / / / / \ # / / / / \ # R0-----------LSR1----------------LSR3------------------LSR5----------------LSR 7----------LSR9---------R10 # 2M 1M 2M 1M

# Khai bao 2 nut IP (R0,R10) va 9 nut MPLS (LSR1 --> LSR9) set R0 [$ns node] foreach i "1 2 3 4 5 6 7 8 9" { set LSR$i [$ns mpls-node] set m LSR$i eval $$m color blue } set R10 [$ns node]

Hc vin cng ngh bu chnh vin thng

69

n tt nghip i hc Lc

Ph

# Khai bao lin kt: odes bw delay queue $ns duplex-link $R0 $LSR1 3Mb 10ms DropTail $ns duplex-link $LSR1 $LSR3 2Mb 30ms DropTail $ns duplex-link $LSR3 $LSR5 1Mb 30ms DropTail $ns duplex-link $LSR5 $LSR7 2Mb 30ms DropTail $ns duplex-link $LSR7 $LSR9 1Mb 30ms DropTail $ns duplex-link $LSR9 $R10 3Mb 10ms DropTail $ns duplex-link $LSR1 $LSR2 1Mb 30ms DropTail $ns duplex-link $LSR2 $LSR4 1Mb 30ms DropTail $ns duplex-link $LSR4 $LSR6 2Mb 30ms DropTail $ns duplex-link $LSR6 $LSR8 1Mb 30ms DropTail $ns duplex-link $LSR8 $LSR9 2Mb 30ms DropTail $ns duplex-link $LSR3 $LSR4 1Mb 30ms DropTail $ns duplex-link $LSR5 $LSR6 1Mb 30ms DropTail $ns duplex-link $LSR7 $LSR8 1Mb 30ms DropTail # Ve dang so do mang $ns duplex-link-op $R0 $LSR1 orient right $ns duplex-link-op $LSR1 $LSR3 orient right $ns duplex-link-op $LSR3 $LSR5 orient right $ns duplex-link-op $LSR5 $LSR7 orient right $ns duplex-link-op $LSR7 $LSR9 orient right $ns duplex-link-op $LSR9 $R10 orient right $ns duplex-link-op $LSR1 $LSR2 orient 0.333 $ns duplex-link-op $LSR2 $LSR4 orient right $ns duplex-link-op $LSR4 $LSR6 orient right $ns duplex-link-op $LSR6 $LSR8 orient right $ns duplex-link-op $LSR8 $LSR9 orient 1.667 $ns duplex-link-op $LSR3 $LSR4 orient 0.333 $ns duplex-link-op $LSR5 $LSR6 orient 0.333 $ns duplex-link-op $LSR7 $LSR8 orient 0.333 # Ghi chu $ns duplex-link-op $LSR1 $LSR3 label " 2M " $ns duplex-link-op $LSR3 $LSR5 label " 1M "
Hc vin cng ngh bu chnh vin thng 70

n tt nghip i hc Lc

Ph

$ns duplex-link-op $LSR5 $LSR7 label " 2M " $ns duplex-link-op $LSR7 $LSR9 label " 1M " $ns duplex-link-op $LSR1 $LSR2 label " 1M " $ns duplex-link-op $LSR2 $LSR4 label " 1M " $ns duplex-link-op $LSR4 $LSR6 label " 2M " $ns duplex-link-op $LSR6 $LSR8 label " 1M " $ns duplex-link-op $LSR8 $LSR9 label " 2M" $ns duplex-link-op $LSR3 $LSR4 label " 1M " $ns duplex-link-op $LSR5 $LSR6 label " 1M " $ns duplex-link-op $LSR7 $LSR8 label " 1M " $R0 label "Nguon" $R10 label "Dich" $LSR1 label "Ingress " $LSR9 label " Egress" # Cau hinh LDP agent tren tat ca cac nut MPLS $ns configure-ldp-on-all-mpls-nodes # Dat color cho cac ban tin LDP $ns ldp-request-color blue $ns ldp-mapping-color red $ns ldp-withdraw-color magenta $ns ldp-release-color orange $ns ldp-notification-color green #---------------------------------------------------------------------# Dinh nghia cac ham su dung trong chuong trinh chinh #---------------------------------------------------------------------# Tao mot procedure ghi nhan bang thong theo mot chu ki $time proc record {} { global sink1 f1 set ns [Simulator instance] # Dinh chu ki ghi nhan bang thong set time 0.1 # Lay so luong packet nhan duoc trong chu ky o moi sink
Hc vin cng ngh bu chnh vin thng 71

n tt nghip i hc Lc

Ph

set bw1 [$sink1 set bytes_] set now [$ns now] puts $f1 "$now [expr $bw1/$time*8/1000000]" # Reset gia tri bytes_ cua sink $sink1 set bytes_ 0 #Dinh thoi goi lai ham record sau chu ky $time $ns at [expr $now+$time] "record" } #---------------------------------------------------set prvseqnb -1 set seqerrnb 0 # Thu tuc ghi lai so packet nhan duoc dung thu tu proc seq-record {size rate ftime} { global prvseqnb seqerrnb sink1 f2 set ns [Simulator instance] # Dat chu ky thoi gian chay lai thu tuc nay set tsize [parse-bw $size] set trate [parse-bw $rate] set time [expr double($tsize)/double($trate)/8.0] set now [$ns now] # Tim so thu tu cua packet set revseqnb [$sink1 set expected_] if {$prvseqnb > $revseqnb} { incr seqerrnb 1 } # Ghi so thu tu cua packet vao file
Hc vin cng ngh bu chnh vin thng 72

n tt nghip i hc Lc

Ph

if {$prvseqnb != $revseqnb} { puts $f2 "$now [$sink1 set expected_]" set prvseqnb $revseqnb } # Dinh thoi goi lai ham seq-record if { [expr $now+$time] < $ftime } { $ns at [expr $now+$time] "seq-record $size $rate $ftime" } } #---------------------------------------------------# Ham tao mot nguon luu luong gan vao node voi sink, size goi, # burst, idle time, rate va colour cua luu luong proc attach-expoo-traffic { node sink size burst idle rate } { set ns [Simulator instance] set source [new Agent/CBR/UDP] $ns attach-agent $node $source set traffic [new Traffic/Expoo] $traffic set packet-size $size $traffic set burst-time $burst $traffic set idle-time $idle $traffic set rate $rate $source attach-traffic $traffic $ns connect $source $sink return $source } #---------------------------------------------------# Thu tuc sau thong bao ER/CR-LSP da thiet lap de thuc hien tac vu khac proc notify-erlsp-setup {node lspid} { global src1 src2 set ns [Simulator instance] set msg " [string range [$ns now] 0 3]s: Tunnel LSP_$lspid (Ingress=LSR[$node id]) da duoc thiet lap xong !" puts $msg
Hc vin cng ngh bu chnh vin thng 73

n tt nghip i hc Lc

Ph

$ns trace-annotate $msg set module [$node get-module "MPLS"] switch $lspid { 1100 { $module bind-flow-erlsp 10 100 $lspid } 1200 { $module reroute-lsp-binding 1100 $lspid } default { puts " Error!" exit 1 } } } proc notify-erlsp-fail {node status lspid tr} { set ns [Simulator instance] set module [$node get-module "MPLS"] if { [$node id] == 1 && $status=="BSNodeError" } { $module set-lib-error-for-lspid $lspid 1 set msg " [string range [$ns now] 0 3]s: Phat hien loi tren duong lam viec LSP_$lspid. Chuyen sang duong bao ve LSP_1200 !" } if { [$node id] == 1 && $status=="NodeRepair" } { $module set-lib-error-for-lspid $lspid -1 set msg " [string range [$ns now] 0 3]s: Loi da duoc khoi phuc. Chuyen luu luong tro lai duong lam viec LSP_$lspid !" } puts $msg $ns trace-annotate $msg }
Hc vin cng ngh bu chnh vin thng 74

n tt nghip i hc Lc

Ph

#---------------------------------------------------# Thu tuc xuat tong so packet nhan duoc o cac sink proc recv-pkts {} { global sink1 seqerrnb set ns [Simulator instance] set msg " Luong 1 da truyen [$sink1 set expected_] goi, mat [$sink1 set nlost_] goi, ti le mat goi la [string range [expr [$sink1 set nlost_]*100.0/[$sink1 set expected_]] 0 3] */*" puts $msg $ns trace-annotate $msg set msg " Tong so packet bi sai thu tu : $seqerrnb goi" puts $msg $ns trace-annotate $msg } #---------------------------------------------------# Thu tuc dong file va the hien ket qua khi ket thuc mo phong proc finish {} { global ns nf f1 f2 $ns flush-trace close $nf close $f1 close $f2 exec xgraph luong_1.tr -M -nb -bg white -fg black -zg black \ -geometry 500x250 -y "BW (Mbps)" -x "Time (sec)" \ -t "Bai 4: Khoi phuc duong theo co che Makam" -tf "helvetica-12" & exec xgraph luong_seq.tr -p -nl -nb -bg white -fg black -zg black \ -geometry 500x250 -y "Packet No." -x "Time (sec)" \ -t "Bai 4: Bieu do so thu tu packet theo thoi gian" -tf "helvetica-12" & exec nam -r 2ms bai4.nam & exit 0 } #----------------------------------------------------

Hc vin cng ngh bu chnh vin thng

75

n tt nghip i hc Lc

Ph

# Tao ra sink1 gan voi nut R10 (day la noi thu nhan traffic) set sink1 [new Agent/LossMonitor] $ns attach-agent $R10 $sink1 # Tao ra nguon luu luong src1 gan voi nut R0 bang cach # goi ham attach-expoo-traffic. Luong co packet_size=600, rate=0.8Mbps set src1 [attach-expoo-traffic $R0 $sink1 600B 0 0 0.8M ] $src1 set fid_ 100 $ns color 100 red # Cai dat co che khoi phuc: MAKAM $ns enable-reroute notify-prenegotiated [$LSR3 get-module "MPLS"] set-protection-lsp 0.7 0.01 1100 [$LSR5 get-module "MPLS"] set-protection-lsp 0.7 0.01 1100 [$LSR7 get-module "MPLS"] set-protection-lsp 0.7 0.01 1100 # Bat dau mo phong puts "\n BAI 4: KHOI PHUC DUONG BANG TAI DINH TUYEN TOAN CUC (MAKAM)\n" $ns at 0.00 "record" $ns at 0.00 "seq-record 600 800k 5.5" # Thiet lap LSP lam viec $ns at 0.15 "$ns trace-annotate {Bao hieu thiet lap duong lam viec: LSP_1100, ER=1_3_5_7_9 }" $ns at 0.15 "[$LSR1 get-module "MPLS"] setup-erlsp 9 1_3_5_7_9 1100" # Thiet lap LSP bao ve $ns at 0.15 "$ns trace-annotate {Bao hieu thiet lap duong bao ve: LSP_1200, ER=1_2_4_6_8_9 }" $ns at 0.15 "[$LSR1 get-module "MPLS"] setup-erlsp 9 1_2_4_6_8_9 1200" $ns at 0.50 "$ns trace-annotate {Luong 1: BW=0.8M (start=0.5 stop=5.0) su dung LSP_1100, ER=1_3_5_7_9 }"
Hc vin cng ngh bu chnh vin thng 76

n tt nghip i hc Lc

Ph

$ns at 0.50 "$src1 start" # Link giua LSR5 va LSR7 bi dut tu 2.0s, den 3.5s thi khoi phuc lai $ns rtmodel-at 2.0 down $LSR5 $LSR7 $ns rtmodel-at 3.5 up $LSR5 $LSR7 $ns at 5.0 "$src1 stop" $ns at 5.5 "recv-pkts" $ns at 5.5 "finish" $ns run

Hc vin cng ngh bu chnh vin thng

77