You are on page 1of 85

GVHD:Th.

s L Mnh Hi

Qun l cht lng dch v a phng tin

MC LC CHNG 1 : GII THIU V H THNG MNG CA CNG TY CHNG KHON NAM PHONG...4
I. M t h thng mng ca Cng ty chng khon Nam Phong..5 II. Vn t ra v gii php...7 III. Nhim v ca lun vn..8

CHNG 2 : TNG QUAN CHT LNG DCH V9


I. Gii thiu v cht lng dch v.10 II. Cc vn xy ra trong mng v s nh hng ca cht lng dch v...12 2.1. Cc vn trong vic truyn ti trn mng 12 2.2. Bng thng - Bandwidth .14 2.3. Thi gian tr - Delay ...............15 2.4. Tr khng ng b - Jitter ...17 2.5. Mt gi tin Packet loss .18 III. Kin trc c bn ca cht lng dch v ..20 3.1. Cc cp thc thi cht lng dch v trn mng (end to end)...21 3.2. M hnh Intserv (Integrated Service) ..23 3.3. M hnh DiffServ (Differentiated Service) .25 3.4. Phn loi v nh du .27 3.5. S phn loi Classification ...28 3.5.1. Class-Based Marking.29

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 1

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

3.5.2. Phn loi vi NBAR (Network-Based Application Recognition) 32 3.6. nh du Marking 33 3.6.1. Cc trng IP Header QoS Precedence v DSCP ..34 3.6.2. Chuyn tip m bo (Assured Forwarding).37 3.6.3. LAN Class of Service CoS .41 3.6.4. Mt vi trng nh du khc ...43 3.7. Cc cng c phn loi v nh du 44 3.7.1. Cu hnh theo Class Based Marking ......44 3.7.2. Network Based Application Recognition (NBAR).46

CHNG 3 : TC NGHN, CC CNG C QUN L, PHNG CHNG TC NGHN ..48


I. Tc nghn 49 II. C ch qun l tc nghn ...49 III. Khi nim hng i trong Cisco router ....50 3.1 Hng i phn cng v hng i phn mm ....51 3.2. Cc c ch hng i trn cng v trn sub-interface ..52 IV. Cc cng c hng i qun l s tc nghn mng ...53 4.1. FIFO 53 4.2. Priority Queuing (PQ) - Truyn thng c th t 54 4.3. Custom Queuing (CQ) - m bo bng thng ...55 4.4. Hng i theo trng s (Weighted Fair Queuing WFQ) .57 4.5 Class-Based WFQ (CBWFQ) ..63 SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 2

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

4.6. Low-Latency Queuing (LLQ) .65 4.7. Bng tm tt v cc cng c qun l tc nghn - Queuing ..67

CHNG 4 : M HNH V THC HIN...70


I. M hnh chnh ..72 II. Trin khai cht lng dch v trn m hnh thc nghim ..72 2.1. M hnh thc nghim....72 2.2. Cc bc trin khai...74 III. Kt qu thu c....76 KT QU T C V HNG PHT TRIN CA TI78 PH LC79 TI LIU THAM KHO...85

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 3

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

CHNG I GII THIU V H THNG MNG CA TNG CNG TY CHNG KHON NAM PHONG

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 4

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

I. M t h thng mng ca Cng ty chng khon Nam Phong:


H thng gm mng ca Cng ty chng khon Nam Phong ni vi mng ca cc chi nhnh ti cc tnh thnh trong nc. Ti mi chi nhnh v tr s chnh u c mt mng ring, trong mng ring ny gm c cc phng ban sau: Phng ban gim c. Phng mi gii. Phng u t. Phng t vn phn tch. Phng k ton. Phng tng hp. Phng th qu. Phng tin hc qun l d liu.

Ngoi ra ti tr s chnh cn c cc Server vi cc dch v nh WEB, EMAIL, FTP. S mng ca h thng:

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 5

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Hnh 1.1: S mng ca h thng V phn cng: - Server. Windows 2003 xy dng cc dch v FTP,EMAIL. C chc nng cho php ngi dng u cui truyn ti tp tin theo giao thc FTP, gi v nhn mail. Ngoi ra Server ti tr s chnh cn c xy dng thm dch v WEB ngi dng c th truy cp vo trang web ca cng ty. - Cc my trm . c dng chy cc ng dng. - Cc in thoi VoIP (u t thm trong tng lai). Dng lin lc gia cc chi nhnh vi tr s chnh. - Router v Switch. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 6

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

H thng s dng giao thc OSPF (Open Shortest Path First) lm giao thc nh tuyn v s dng giao thc ny trn tt c cc router trong h thng. V cc ng dng v d liu ca h thng trn: D liu ca h thng trn gm c: - Cc d liu v k ton, tng hp. - Cc loi ho n chng t. - Cc thng tin v khch hng. - D liu cn phi c backup t cc chi nhnh ln cc server tr s chnh vo mi ti. - Ti cc chi nhnh phi nhn c d liu t web server, file server, email server. - Ngoi ra, ti mi chi nhnh v tr s chnh s trang b in thoi ip lin lc vi nhau, mt h thng video conference phc v cho vic hi tho (c trang b trong tng lai). T ngun d liu trn ta nhn thy c cc ng dng chnh c s dng trong h thng l: - Phn mm h tr video conference. - Phn mm s dng in thoi ip (voice over ip). - H qun tr c s d liu sql.

II. Vn t ra v gii php:


Do phi x l mt s lng ln thng tin v d liu, vic truyn tp tin qua li gia cc chi nhnh vi tr s chnh, h thng thng gp phi cc vn nh thi gian p ng d liu ko di hn, d liu b time-out gy kh khn trong cng vic. Vic lin lc gia cc in thoi IP hay b ngt qung, m thanh chp chn, hnh nh

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 7

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

ca h thng video conference i khi b nhe, git, m thanh khng ng b vi hnh nh. gii quyt vn trn, ta c hai gii php chnh l: 1. Nng cp ton b h thng mng ca cng ty, lm tng bng thng. 2. p dng cc k thut ca Cht lng dch v vo h thng c sn. i vi gii php u tin, vic nng cp lm tng bng thng c th gii quyt c hu ht cc vn t ra nhng s gy lng ph v ta cha s dng ht ti nguyn mng ca h thng hin ti, nn vic nng cp l khng thc s cn thit. Xt n gii php hai, ta khng phi tn nhiu chi ph cho vic nng cp, v ta p dng cc k thut ny vo h thng c sn c th s dng c ht ti nguyn mng ca h thng.

III. Nhim v ca lun vn:


T cc d liu phn tch trn, ta chia thnh nhng nhm sau p dng k thut cht lng dch v vo h thng: - QoS p dng cho video conference. - QoS p dng cho voice over IP. - QoS p dng cho cc d liu phc v cho vic giao dch (trn h qun tr c s d liu SQL). - QoS p dng cho cc ng dng WEB,FTP. - QoS p dng cho mail. Sau khi p dng QoS thnh cng th h thng s m bo c cc cuc gi VoIP khng b ngt qung, hnh nh v m thanh ca h thng video conference c ng b, hnh nh khng b nhe, git, thi gian p ng d liu nhanh chng, kp thi, m bo thc hin tt cng vic.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 8

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

CHNG II TNG QUAN CHT LNG DCH V QUALITY OF SERVICE (QoS)

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 9

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

I. Gii thiu v cht lng dch v :


Vn cung cp cht lng dch v trn mng IP c quan tm t nhng nm 80 v pht trin mnh t u nhng nm 90 n nay. Cung cp cht lng dch v trn mng IP cho php m bo cht lng ca cc ng dng thi gian thc nh VoIP, Video Streaming v hn ch nghn mng. gii quyt vn trn, c hai gii php c bn. - Th nht l nng cp ti nguyn mng, nhng tn km v ch p ng c n mt gii hn no . - Th hai b sung c ch qun l, phn phi ti nguyn mng m bo cht lng dch v (QoS). IETF v IEEE a ra nhiu chun v lnh vc ny. Mt s nh cung cp thit b mng nh Cisco, Nortel, Extreme, h tr cht lng dch v trong cc b nh tuyn. Tuy nhin cho n nay, cc m hnh cht lng dch v vn ang trong giai on pht trin v hon thin. Vic p dng cc m hnh ny cn nhiu hn ch v mi ch dng li mc mng din rng (WAN). Cung cp cht lng dch v trn mng IP : Cung cp cht lng dch v thc cht l cung cp cc dch v chuyn tip khc nhau cho cc lu lng mng khc nhau. Trn mng IP hin nay, v c bn c hai loi lu lng l lu lng thi gian thc v lu lng d liu. Hai loi lu lng ny c c trng khc nhau do chng c yu cu khc nhau. Lu lng thi gian thc to ra bi cc ng dng thi gian thc nh video, voice,... yu cu tr nh, nhy cm vi s bin thin tr v cn c m bo mt lng bng thng ti thiu. Khi tr ln, bin thin tr khng n nh hoc bng thng di mc ti thiu s gy nh hng ln n cht lng ng dng. Trong khi , lu lng d liu to bi cc ng dng nh telnet, ftp, www, email , t b nh hng bi tr, bng thng v t nhy cm vi bin thin tr. tr ln c th lm gim hiu sut thc hin ng dng nhng d liu i n u s dng c. Lu lng d liu khng yu cu bng thng ti thiu nhng khi tng bng thng th lun nng cao c hiu sut SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 10

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

ng dng khc vi lu lng thi gian thc khi tng bng thng n mt mc no th hiu sut ca ng dng khng tng ln na. Lu lng thi gian thc v lu lng d liu cn c phn loi chi tit hn da trn s khc nhau v yu cu tr. nh gi cht lng dch v da trn cc tham s c trng l tr, t l mt gi cc lung lu lng v bng thng m chng nhn c. cung cp cht lng dch v, v nguyn tc c hai phng php: - S dng giao thc pht v cht lng dch v c ci t vo bn thn giao thc pht (tuy nhin giao thc IP lc pht trin khng ci t cht lng dch v) hoc s dng giao thc bo hiu, dnh ring ti nguyn (nh RSVP_Resource Reservation Protocol) kt hp vi giao thc truyn thng (nh IP). - Ci t vo cc phn t mng chuyn tip gi tin nh thit b chuyn mch hay b nh tuyn. Ci t cht lng dch v trn mng c th chia thnh ba hot ng: + Phn loi gi tin (classification). + Hng i gi tin (queuing). + Lp lch trnh gi tin (queuing v scheduling). Phn loi gi tin (classification): Gi tin c phn loi khi ti b nh tuyn, b nh tuyn phn cc gi tin vo cc lp khc nhau da trn mt tp cc quy tc (v d nh dng trng DS trong phn u ca gi tin IP, a ch ngun, a ch ch hay s hiu cng ...). Cc gi tin thuc cng mt lp sau c coi nh nhau ti giai on lp lch trnh gi tin. Hng i gi tin (queuing): L b m cha cc gi tin, mt b nh tuyn c th c nhiu hng i. B lp lch gi tin (queuing v scheduling): Quyt nh th t gi gi tin ra khi mng.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 11

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Qun l gi tin trong hng i (queuing) bao gm bn hot ng c bn: - Thm mt gi tin vo hng i tng ng vi n. - B gi tin khi hng i y. - Chuyn gi tin theo yu cu ca b lp lch trnh cho gi tin v xc nh trng thi ca hng i thc hin cc hot ng thch hp trnh trn hng i. - Lp lch gi tin (scheduling) l c ch xc nh th t gi gi tin ra khi mng. Hai khi nim qun l gi tin trong hng i v lp lch trnh gi tin ph thuc ln nhau, loi hng i s quyt nh cch gi tin c gi ra khi mng. Trn c s ba hot ng trn, cht lng dch v c th c ci t theo cc m hnh ty chn nhng thng thng ngi ta s dng cc m hnh chun do IETF a ra. l m hnh Dch v tch hp IntServe (Integrated Service) v m hnh Dch v phn bit DiffServ (Differentiated Service). Ngoi ra, bn thn giao thc IP cng cho php ngi dng xc nh loi dch v mong mun (tr ti thiu, bng thng ti a, tin cy ti a, .v.v...) thng qua ba bt u tin ca trng loi dch v ToS (Type of Service) trong phn u ca gi tin IP. Tuy nhin, m hnh ny t c s dng do n khng kim sot c chn mc u tin ca ngi dng.

II. Cc vn xy ra trong mng v s nh hng ca QoS: 2.1. Cc vn trong vic truyn ti trn mng:
Mi loi traffic c th cn n cc c tnh hot ng khc nhau trn mng. Mt ng dng truyn d liu th ch cn n dung lng ng truyn, nhng vic xy ra thi gian tr ca mt gi tin ring l th khng thnh vn , cc ng dng v giao dch cn n thi gian tr li thch hp. Cc cuc gi cn tr thch hp trong khi hi tho truyn hnh i hi c tr thch hp ln lng bng thng cao. Ngi dng c th than phin v cht lng ca cc ng dng ca h v c th iu lin quan ti h thng mng hoc cng c th l do cc nguyn nhn khc

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 12

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

nhng hu ht ngi s dng u cho rng mng c lin quan ti cc vn cht lng. Sau y l mt vi nh hng v cht lng ng dng: Loi Traffic Vn khi khng c QoS Voice - m thanh nghe rt kh hiu. - Ting b t qung. - S tr hon trong truyn thng lm cho vic giao tip kh khn, ngi gi khng bit bn kia ngng ni cha. - Cuc gi b ngt. Video - Hnh nh hin th bt thng, chuyn ng b git. - m thanh khng ng b vi hnh nh. - Chuyn ng b chm li. Data - D liu c truyn ti qu tr khng cn hu dng. - Thi gian truyn b gin on lm ngi dng tht vng v t b hoc thc hin li sau. Bng 2.1: Tm lc v vn khi khng c QoS QoS c gng ci tin cht lng ca mng. ci thin hiu sut mng v cc tnh nng ca QoS nh hng ti mng, QoS iu khin cc c tnh sau : - Bng thng - Bandwidth. - Thi gian tr - Delay. - Tr khng ng b - Jitter. - Mt gi tin - Packet loss. Kh khn pht sinh khi ci thin mt c tnh ca QoS th bn cnh s lm gim c tnh khc. Bng thng nh ngha cho dung lng ca ng truyn. S SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 13

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

dng cc cng c nn s lm gim bng thng cn cho vic truyn, nhng quy trnh nn to thm thi gian tr cho mi gi tin v s dng thm ti nguyn CPU. Jitter l mc bin i tr khc nhau gia cc gi tin nn n cn c gi l s tr khng ng b gia cc gi tin. Router c th hn ch jitter cho mt vi traffic nhng thng to thm delay v jitter cho cc dng traffic khc. Cc chc nng ca QoS c th tm ra cc li jitter, c th l cc chc nng sp xp hng i (queueing) c s u tin cc gi tin cn jitter thp. Hin tng mt gi tin c th xy ra do li trong vic truyn tin v cc c ch ca QoS khng th ci thin chng nhiu. Tuy nhin, cc gi tin b mt do vic ch i sp vo hng i truyn cn nhiu hn l do li truyn v cc tnh nng ca QoS c th gii quyt vic cc packet b mt.

2.2. Bng thng Bandwidth:


Bng thng l s lng bit trong mt giy c th gi trn ng truyn. Bng thng thng bng vi tc ca ng truyn vt l hay xung clock ca thit b kt ni . Trong vi trng hp n nh hn tc thc s ca ng lin kt. Cch tt nht ci thin bng thng l cung cp thm nhiu bng thng hn. Nu h thng c kh nng p ng iu th s ti u c cht lng ng truyn. Cc cng c QoS nng cao bng thng bng vic gim s lng bit cn truyn d liu bng cch dng cc cng c nn. Mt cng c khc ca QoS l CAC (Call Admission Control) quyt nh khi no mng chp nhn cuc gi thoi hay truyn hnh mi, nu n khng c chp nhn bi CAC do nhiu thng s trong c bng thng, th n s c ti nh tuyn tr li da vo VoIP thng qua PSTN ( Public-Switched Telephone Network ). Cc cng c sp xp (queueing) c th nh hng ti mt lng bng thng nht nh ty vo loi traffic nhn c. Cc cng c sp xp s to ra nhiu hng i v sau cc gi tin c a vo chng da vo gii thut lp danh mc (schedule). Gii thut thm vo mt tnh nng bo m lng bng thng ti thiu cho mt hng i c th.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 14

GVHD:Th.s L Mnh Hi Loi cng c QoS Nn Compression

Qun l cht lng dch v a phng tin S nh hng ln bandwidth Nn c trng header v d liu ti, gim thiu s lng bit cn truyn d liu.

Call Admission Control Gim ti cho mng bng cch t chi cc CAC Hng i Queuing cuc gi thoi v truyn hnh. C th c dng n nh bng thng ti thiu cho tng loi gi tin c th. Bng 2.2: Tm tt cng c QoS nh hng ln bandwidth

2.3. Thi gian tr - Delay:


Mi gi tin trong mng u c mt thi gian tr trong sut qu trnh chng c gi i v n c ch. Delay l hin tng xy ra thng xuyn trn mng. Trong vi trng hp delay nh n mc khng ng k, nhng chng c th s tr nn ln hn kh nng x l ca h thng. Mi dng delay khng ph thuc c th vo loi traffic no. Sau y l cc dng tr xy ra trong h thng mng: Dng tr Serialization nh ngha Ni xy ra delay

Thi gian t tt c cc bit ca Ng ra ca cc interface l. Ty thuc vo kch thc trn l. ng truyn T3

delay (c nh) mt frame trn ng truyn vt vt l; Khng nh hng frame v tc ng truyn vt (45Mbit/s) hay nhanh hn.

Propagation

Thi gian cn cho 1 bit i ngang Mi ng lin kt vt l. ny sang u kia. Da trn tc ng truyn trong mng ca nh sng trn ng truyn LAN v WAN vi khong

delay (c nh) qua ng truyn vt l t u Khng nh hng trn

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 15

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin cch ngn.

v di ca ng truyn.

Queuing delay Thi gian ch trong hng i Thng xy ra output (thay i) c chuyn i (output queuing), Interfaces. t xy ra hng hay ch c c hi lu thng i vo ca Router m xy trn ng truyn ti ch (input ra nhiu LAN switch. queuing). Forwarding/ Processing delay i) Thi gian cn khi nhn frame Trn mi thit b switching n, cho ti khi frame hay packet bao gm c router, Lan Frame v Relay ATM i. switches switches. Shaping delay (thay i) Tr hon vic truyn cc packet Bt c ni u m shaping trong shaping trnh vic mt c cu hnh thng l gi tin gia cc mng Frame trn cc router, khi gi cc Relay v ATM. packet ti mng Frame Relay hay ATM. Network delay Thi gian tr c to ra bi cc Bn trong mng ca nh (thay i) thnh phn chuyn i ca mng cung cp dch v. khi s dng mt dch v. V d nh l chuyn cc khung Frame Relay khi m n i qua mng Frame Relay. Bng 2.3: Cc dng tr xy ra trong h thng mng

(thay c a vo hng i chuyn switches,

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 16

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

2.4. Tr khng ng b - Jitter:


Cc gi tin lin tc c tr khc nhau s to ra jitter. Trong mng c nhiu b phn c tr khc nhau lun lun gy ra jitter v cu hi t ra l khi no jitter ln nh hng ti cc dch v. m thanh v hnh nh nhanh chng b gim cht lng khi jitter xy ra cn cc ng dng th chu li tt hn mc d nu c qu nhiu jitter s nh hng ti cc ng dng ang giao tip. Sau y l mt vi cng c c th lm gim Jitter ca QoS : Loi cng c QoS Sp xp Queuing S nh hng i vi Jitter Cho php sp xp cc packet sao cho cc packet nhy vi delay s ri hng i nhanh hn cc gi khc. Phn mnh v chn Link LFI phn cc packet ln thnh nhng mnh nh Fragmentation Interleaving Nn Compression Nn c header v d liu, gim s lng bit truyn. S dng t bng thng v hng i hn s gim delay mc d s to ra thi gian tr cho vic x l. Traffic shaping To ra delay mt cch gi to hn ch vic loi b packet trong mng Frame Relay v ATM. Bng 2.4: Mt vi cng c lm gim Jitter ca QoS and hn trc khi gi chng i.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 17

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

2.5. Mt gi tin Packet loss:


Router mt hay loi b (drop) packet do nhiu nguyn nhn m hu ht QoS khng lm g hn c. Mc d vy QoS c th gim thiu vic mt packet. Ngy nay, cc packet b mt do cc bit li l rt nh m ch yu l do hng i v b nh m qu y nn packet b loi b. V d mt hng i c kch thc 40 nhn c 50 packet lin tc nhau, khi 40 ch trong hng i y th 10 packet cui s b drop. Trong thc t c mt vi packet s c gi i trc khi nhn ht 50 packet nn s packet b mt s t hn 10 nhng cng l mt s ln. Mt vi dng d liu chu li mt packet cao hn cc loi khc. i vi d liu dng voice ch cn mt vi packet lin tc nhau b mt th s dn n b mt m thanh hon ton, ngc li web traffic th chu li tt do s dng TCP phc hi d liu.

40 3

Hnh 2.1: Packets cui cng s b drop theo c ch tail drop. Ngoi ra, phng php cung cp nhiu bng thng hn cng l mt gii php ngn chn mt packet, nhiu bng thng hn cho php truyn d liu nhanh hn, gim di hng i v s t b y hn do s gim c hin tng ct ui (tail drop) xy ra. Cng vi vic s dng mt b cng c gim nh hng ca vic mt SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 18

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

packet trong co h thng l Random Early Detection (RED), TCP dng phng php windowing gii hn lng d liu do ngi dng gi ti m khng cn phi tr li. Mi TCP window cho mi kt ni TCP khc nhau ln ln v co li ph thuc vo nhiu yu t. RED lm vic di s gi nh rng nu mt vi kt ni TCP c th lm windows ca nhng packet co li trc khi chng c a vo hng i xut th chng s c gi i vi kch thc nh hn v hng i s khng b lm y. Trong khong thi gian hng i cn trng th RED s khng thng bo cho ni gi TCP bit gim tc li bi v iu khng cn thit. RED ch loi b vi gi tin trc khi hng i tr nn y v bt u thc hin c ch ct ui tail-drop. Cc cng c sp xp s qun l pha u hng i cn cng c RED th qun l cui hng i. Bi v hu ht traffic u da trn giao thc TCP v TCP s lm chm vic gi cc packet bng cch gim kch thc window ca n sau khi packet trc b mt, RED gim ti cc packet i vo mng trc khi hng i b y. TCP s dng window qui nh bao nhiu d liu s c gi trc khi nhn c gi ACK phn hi. TCP thay i kch thc window mt cch t ng da vo mt vi yu t trong c s mt gi tin. Khi xy ra li, window s gim kch thc cn 50% kch thc window trc . Vi RED trc khi tail-drop xy ra, RED loi b mt vi packet, ch cn mt s kt ni b chm li m thi. Bng cch cho php ch vi TCP window gim kch thc do c th trnh c hin tng tail-drop v hu ht ngi dng s nhn c s tr li nhanh hn. Vi nhng kt ni TCP b RED loi b packet, thi gian tr li tm thi b gin on, iu ny vn tt hn l tt c user s cm thy mng b tc nghn. Cc cng c sp xp phc v cho nhiu nhim v khc nhau, trong c s hn ch mt packet. Bi v s tht thot packet xy ra khi hng i b y v do cc phng php sp xp hng i cung cp kh nng cu hnh m rng cho hng i nn lm cho hng i di hn gim s tht thot. Song thi gian tr do sp xp s tng ln. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 19

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Hng i FIFO kch thc ln nht 50

Hng i th nht kch thc 50 t mt gi tin,tng thi gian tr

Hng i th hai kch thc 5 mt nhiu gi tin, gim thi gian tr

Hnh 2.2: nh hng ca Queuing i vi Packet Loss V d trong hnh trn cho thy hng i FIFO c s dng. Vi cc traffic nhy cm vi tr th phi i sau 49 packet khc s khng tt. Tuy vy cc ng dng nhy vi loss nhng khng nhy vi delay th mt hng i di hn s tt hn. Trong trng hp ny ta phi t cc gi tin nhy cm vi delay sang mt hng i khc ring bit vi traffic nhy cm vi loss v c hai hng i ny s lm vic song song vi nhau.

III. Kin trc c bn ca QoS:


C 3 mng chnh thc thi QoS : - QoS bn trong mt mi trng mng n l (nh vic sp xp th t, lp cc danh mc c th t v cc cng c nh hnh truyn thng trn mng). - K thut truyn tn hiu iu phi QoS gia cc nhn t bn trong mng. - Chnh sch QoS, qun l, v cc tnh nng tnh ton iu khin v qun tr truyn thng gia cc node trong mng . SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 20

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Hnh 2.3: Ba thnh phn c bn ca QoS

3.1. Cc cp thc thi QoS trn mng (end to end):


Cp bc ca dch v c quyt nh bi kh nng ca QoS trong mng endto-end, c ngha l kh nng ca mng phn phi cc dch v cn thit cho vic truyn thng gia im ny vi im khc hay t mng ny ti mng khc trong mng. Cc dch v khc nhau c a vo mt b dng sp xp chnh xc cc cp bc ca QoS km theo cc m t c th nh : lm cch no qun l cht ch hot ng ca cc dch v bng cch n nh bng thng, thi gian tr, cc ph kin khng cn thit hay cc thuc tnh b mt. Ba cp bc c bn thc thi QoS trong mng end-to-end, c th c p dng cho mt h thng mng hn hp nh sau:

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 21

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

- Mng i hi kh nng ti a ca dch v (Best-Effort) : Mng loi ny i hi cc traffic c bn ca n (thng qua tt c cc dch v) lun c mt cht lng ti a nhng vi s kt ni khng m bo. - Mng i hi cc dch v vi kh nng khc nhau (Diff-Serv): Mng ny i hi mt s dch v truyn thng chnh yu vi kh nng thc thi cao hn cc dch v khc nh kh nng x l nhanh, bng thng trung bnh lun n nh, thi gian x l trung bnh thp, .... - Cc dch v c bo m (Int-Serv): Mng i hi phi bo m tuyt i ti nguyn ca mng dng ring cho mt s truyn thng c th. Cc yu t quyt nh loi dch v no thch hp thc thi trong mng : - Da vo cc ng dng hay cc vn cn c gii quyt ca khch hng. Mi mt trong ba dng p dng cho cc dch v trn u lin quan n cc dch v c th. iu ny khng tht s hp l khi trong thc t khch hng c nhng yu cu rt phc tp ng thi phi m bo cc dch v cho h (lc no cng thc hin tt cc yu cu ca h). Cc mng ti u ho cc kh nng ca dch v hay mng i hi kh nng khc nhau ca cc dch v c th p dng trong trng hp ny. - Nu tc chnh l vn cn c nng cp cho h thng ca khch hng, c mt cch rt n gin nng cp l p dng m hnh mng vi cc dch v cht lng tu thuc vo yu cu ca khch hng thay v m hnh mng ch nhm m bo cho cc dch v lun lun chy tt nhng tc v kh nng tng ng nhau. - Chi ph p dng cho m hnh m bo tt c cc dch v th cao hn l m hnh ch ch trng vo cc dch v trng yu. Di y l s p dng cho 3 m hnh mng ni trn :

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 22

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Best Effort (IP,IPX, AppleTalk)

Best-Effort Diff_Serv Int_Serv

Gii quyt cho cc kt ni IP Internet nhiu ni

Differented Services (Bussiness Traffic)


Intergrated Sevices (BW, Delay, Jitter)

Gii quyt cho cc ng dng cn c cung cp ti nguyn hot ng.


Gii quyt cc traffic quan trng.

Network Hnh 2.4: S p dng cho 3 m hnh mng Trong thc t ngi ta ch p dng mt trong 3 m hnh cho h thng mng ca h v ph bin l Diff-Serv v Int-Serv.

3.2. M hnh Intserv (Intergrated Service):


Mt vi ng dng nh l: thoi, hi ngh truyn hnh, ng dng giao tip thi gian thc,i hi bng thng c nh v dnh ring. Vo u nhng nm 1990 m hnh IntServ c gii thiu gii quyt vn cn bn trn mng IP ny. - Nguyn l cn bn ca m hnh IntServ l dnh ring ti nguyn mng (bng thng, tr) cho tng lung thng tin xuyn sut t ngun n ch. Ti nguyn ny c chim dng v khng c tn dng cho bt k mt lung thng tin no. Nu ti nguyn b chim dng m khng dng th hin tng lng ph ti nguyn s xy ra. V d ta dnh ring 2Mbps cho thoi th ch c gi tin thoi mi c th s dng ngun ti nguyn ny, mc d c khi khng c mt cuc gi no qua mng th ti nguyn ny vn c dnh ring v khng lung thng tin d liu no c th chim dng khong ti nguyn ny.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 23

GVHD:Th.s L Mnh Hi
Lung ti nguyn dnh ring cho thoi

Qun l cht lng dch v a phng tin


Lung ti nguyn dnh ring cho d liu

Lung ti nguyn dnh ring hi ngh truyn hnh

Hnh 2.5: M hnh tng qut ca c ch Intserv. - Mt c im na l m hnh IntServ m bo cht lng dch v theo lung (flow). Mt lung c xc nh bi cc tham s: a ch IP ngun, IP ch, cng ngun, cng ch.M hnh IntServe thng s dng giao thc RSVP (Resource Reservation Protocol) bo hiu. y l giao thc iu khin Internet c thit k ci t cht lng dch v trn mng IP. Nhng n cng khng nht thit phi s dng vi m hnh Intserv. Trong giao thc ny khi mt nt no gi d liu, n gi mt bn tin qua cc nt trung gian ti nt nhn, bn tin ny cha c im lu lng s gi, c im ca cc nt mng trn ng i. Nt nhn sau khi nhn c thng ip, cn c vo c im lu lng v c im ng i, s gi li mt thng ip ng k ti nguyn ti cc nt trung gian trn ng i . Nu vic ng k thnh cng, nt gi bt u truyn d liu. Nu khng, thng ip i n nt gi s bo li. - Khi mt lung c thit lp th tng ng vi 1 phin RSVP c thit lp, iu ny dn n mt hn ch l: i vi mng c lu lng cao nh mng ISP hoc cc t chc doanh nghip ln th s lng lung c th ln n hng trm ngn lung trong mt thi im v dn n hin tng lng ph ti nguyn do bandwidth SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 24

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

s dng thit lp knh RSVP ln rt nhiu (RSVP khng phi l lung thoi m ch l thng tin iu khin, bo hiu). - Hn ch ca m hnh IntServ vi h thng mng c s lng flow ln: Mc d IntServ l m hnh m bo cht lng dch v tuyt i t u cui n u cui (end-to-end), nhng n khng linh hot v kh nng m rng thp nn thng khng c la chn thc hin QoS trong mng c quy m ln. V vy m hnh IntServ ch thch hp cho nhng mng nh vi t lung lu lng.

3.3. M hnh DiffServ (Differentiated Service):


M hnh DiffServ c thit k khc phc nhng hn ch ca m hnh IntServ. M hnh DiffServ c kh nng linh hot cao v kh nng m rng ln. Thay v thc hin cht lng dch v xuyn sut v thng nht trn c ng truyn nh m hnh IntServ, m hnh DiffServ thc hin cht lng dch v ring l trn tng router, vi cch thc hin nh vy m hnh DiffServ khng cn phi tin hnh bo hiu theo tng lung nn tit kim bng thng v c kh nng m rng ln rt ph hp trong m hnh h thng mng ln. Nhng im ni tri trong vic qun l ti nguyn ca m hnh DiffServ c th hin : - M hnh DiffServ khng thc hin bo hiu, bt tay khi thit lp lung nn khng b mt bng thng cho phn bo hiu. - M hnh DiffServ thc hin qun l ti nguyn hiu qu do khng dnh ring ti nguyn cho bt k mt dch v no. Cc dch v c phn chia theo th t u tin, dch v no c u tin cao hn s c cung cp ti nguyn ch tt hn, khi khng c lu lng chy trn th ti nguyn li c tr v cho h thng v c s dng bi cc dch v khc.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 25

GVHD:Th.s L Mnh Hi Nguyn l hot ng :

Qun l cht lng dch v a phng tin

Nguyn l hot ng ca DiffServ c th din t nh sau: u tin cc gi tin c phn loi ra thnh nhiu nhm u tin t thp n cao ty theo c im ca tng dch v, thit b s tin hnh cung cp ti nguyn theo tng nhm, nhm no c th t cao hn th s c cung cp quyn c s dng ti nguyn u tin hn, ti nguyn s c cc nhm thp hn dng nu nhm trn khng s dng na. Tt c cc qu trnh ny s c thc hin ring l trn tng thit b.
Cc gi tin n ngu nhin Cc gi tin c nh du v phn bit theo nhm Cc gi tin c cung cp ti nguyn v u tin ph hp

Cc gi tin b loi b do vt qu ti nguyn

Gi tin video

Gi tin thoi

Gi tin d liu

Hnh 2.6: M hnh tng qut ca c ch DiffServ Gii php QoS theo m hnh DiffServ c thc hin qua nhng bc sau: nh du v phn loi gi tin. u tin cc gi tin s c nh du phn bit, sau c sp xp vo cc nhm (lp) ph hp. Vic nh du v xp lp s gip thc hin cc c ch QoS nhng bc sau: - Qun l tc nghn: C ch qun l tc nghn c thc hin trn cc giao din ca thit b mng. Khi gi tin n cc giao din ny, cc gi tin s c phn chia theo tng hng i c mc u tin khc nhau. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 26

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

- Trnh tc nghn: C ch loi b gi tin trc khi n c th gy ra hin tng tc nghn. - t ngng: C ch t ngng trn, ngng di cho bng thng, c th l bng thng s c m bo mt ngng di ti thiu v khi ln hn ngng trn th gi tin c th b loi b hay a vo hng i. - Nn Header: Header chim phn ln trong 1 gi tin nhng khng mang thng tin tht s, c ch nn header s gip tit kim c bng thng. - Phn mnh: Cc gi tin d liu thng c di ln, iu ny s gy tr v tc nghn. C ch phn mnh s phn cc gi tin ny thnh cc gi tin nh hn trnh tc nghn. Kt lun : T u nhc im v c im ca hai m hnh IntServ v DiffServ, ngi ta a ra phng php kt hp hai m hnh trn cung cp cht lng dch v cho mng trong m hnh DiffServ c s dng mng ng trc (backbone), m hnh IntServ c s dng trong mng truy nhp (access). Ngoi cc phng php trn, ngi ta cn s dng cng ngh chuyn mch nhn a giao thc (MPLS_Multiprotocol Label Switching) vi k thut kim sot lu lng (traffic engineering) cung cp cht lng dch v.

3.4. Phn loi v nh du:


QoS l kh nng cung cp cc mc x l khc nhau hng n cc lp lu lng ring. Trc khi cc ng dng hay cc k thut QoS c p dng, lu lng phi c nhn bit v sp xp vo trong cc lp khc nhau. Nhng lp khc nhau ny ca lu lng c gi l cc lp dch v trong thut ng QoS. Thit b mng s dng s phn loi nhn bit lu lng theo cc lp ring bit. S phn loi cng gip cho cc thit b quyt nh nhng packet no thuc v lp dch v no sau c th cho php chng thc hin nhng chc nng QoS ring bit cho tng loi dch v. Sau khi lu lng mng c sp xp, vic nh du c thc hin bng cch SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 27

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

gn th cho cc gi ring bit cc thit b mng khc c th thc hin cc chc nng QoS cho cc gi khi chng di chuyn thng qua mng. Cng c phn loi v nh du khng ch phn loi cc packet vo cc lp dch v m cn nh du chng trong cng mt lp vi cng gi tr trong trng header. Cc IP header, LAN trunking header, Framerelay header v ATM cell header u c t nht mt trng c th c dng cho tin trnh nh du QoS. iu ny gip cho cc cng c QoS khc phn loi cc gi tin bng cch phn tch cc bit c nh du s d dng hn.

3.5. S phn loi Classification:


Phn loi gi tin l mt phn quan trng trong cc chc nng ca QoS gip cho vic nhn bit v phn bit cc lung thng tin khc nhau trn mng. Phn loi c thc hin nhn dng lu lng v phn chia lu lng thnh cc lp khc nhau. phn loi gi, ta dng b m t lu lng phn chia cc gi trong phm vi cc nhm ring bit nh ngha cc gi . Mt s b m t c trng dng phn loi gi bao gm : b giao tip ng vo, u tin IP (IP Precedence), DSCP, a ch ngun hay a ch ch v cc ng dng. Sau khi cc gi c nh danh, chng c kh nng tin hnh cc chc nng QoS trn mng. Hu ht cc cng c phn loi v nh du u hot ng trn cc gi tin vo hoc ra khi interface no . V logic th n ging nh mt Access List nhng hot ng chnh l nh du cho php hay loi b gi tin. Chng hot ng theo phng thc sau : - Vi mi gi tin vo mt interface, nu n hp vi tiu chun 1, nh du mt field vi mt gi tr. - Nu gi tin khng ph hp, so snh tip vi tiu chun 2 sau nh du field khc vi mt gi tr khc. - Tip tc so snh cc gi cho ti khi chng ph hp vi tiu chun.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 28

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

- Nu gi tin khng ph hp vi tiu chun no, khng c mt x l no c th cho gi tin v n s c chuyn i nh th l khng c QoS tc ng. Vi vic s dng phn loi gi, ngi qun tr mng c th phn vng lu lng mng thnh nhiu mc u tin hay nhiu lp dch v. Khi b c t lu lng c s dng phn loi, lu lng ngun ng tham gia tha thun cc gii hn v mng s thc hin cc gii hn vi vic m bo v cht lng dch v. Cc k thut cht lng dch v khc nh gim st lu lng, nn dng lu lng v k thut hng i s dng b m t lu lng m bo gi ng tha thun. Vic phn loi nn c t bin mng.

3.5.1. Class-Based Marking:


CB Marking c th phn loi gi tin vo trong cc lp dch v bng cch phn tch cc frame, cell (dng cho ATM), packet v segment (cc bit c TCP hay UDP header nhng khng c datalink hay network header). CB Marking cng c th dng ACL(Access control list) nh du packet, vi packet c cho php t ACL. Di y l bng cc trng c th ph hp vi CB Marking trong router IOS dng ACL :

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 29

GVHD:Th.s L Mnh Hi Trng a ngun a ch IP ch ch Din gii

Qun l cht lng dch v a phng tin

IP Mt chui cc a ch ngun c th c match dng wildcard mask. Mt di cc a ch ch c th c match dng wildcard mask.

IP Precedence IP DSCP IP ToS

Cc gi tr ca IP Precedence nh mc u tin cho traffic. Dng DSCP theo gi tr thp phn. C th kim tra bit ToS c bt ln hay khng. Vi cc t kho : normal (0000), max-reliability (1000), max-throughput (0100), min-delay (0010) v min-monetary-cost (0001).

Cng TCP

C th kim tra cng ngun v ch, hay mt dy cc cng xem s hiu cng c ln hn hay nh hn mt s xc nh khng.

Thit lp TCP

Mc d khng hon ton hu dng trong phn loi QoS, ACL vn c th match tt c cc TCP segment sau khi khi gn segment dng cho vic thit lp kt ni.

UDP

C th kim tra cng ngun v ch, hay mt dy cc cng xem s hiu cng c ln hn hay nh hn mt s xc nh khng.

ICMP

Kim tra mt lng ln cc thng ip ICMP khc nhau v loi code (v d echo request v echo reply).

IGMP

Kim tra cc loi thng ip Internet Group Management Protocol. Bng 2.5: Cc trng c th so trng trong ACL m rng

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 30

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Mc d IP Precedence v DSCP c th c so trng vi ACL, n cng c th c i chiu trc tip vi CB Marking m khng cn dng ACL. Bng di lit k cc field c th match trc tip vi CB Marking : Trng a ch MAC ngun IP Precedence MPLS CoS Din gii CB Marking dng lnh match c th i chiu nhiu gi tr. CB Marking dng lnh match c th i chiu nhiu gi tr. CB Marking dng lnh match c th i chiu nhiu gi tr. Kim tra cc bit ISL/802.1P CoS n. C th i chiu nhiu gi tr bng mt lnh. Ch hp l trn ng Ethernet. a ch MAC ch Kim tra MAC ch. C th i chiu nhiu gi tr bng mt lnh. Input interface Kim tra input interface. C th i chiu nhiu gi tr bng mt lnh. IP DSCP Kim tra trng IP DSCP. C th i chiu nhiu gi tr bng mt lnh. Dy s cng UDP RTP dng s port UDP chn t 16,384 n 32,767. C th ca RTP i chiu mt b cc gi tr vi s port chn do RTP ch dng s port chn. QoS Group Loi NBAR protocol Trng QoS dng dn nhn gi tin bn trong router. c trnh by phn Network Based Application Recognition.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 31

GVHD:Th.s L Mnh Hi ng Citrix dng

Qun l cht lng dch v a phng tin

NBAR NBAR c th nhn ra cc loi ng dng Citrix khc nhau. CB Marking c th dng NBAR phn bit da trn nhng loi ng dng .

Tn host v chui NBAR cng c th so trng chui URL km vi tn host URL dng mt cu lnh thng thng. CB Marking c th dng NBAR so trng nhng chui cho vic phn loi. Bng 2.6: Cc trng so trng trc tip vi CB Marking

3.5.2. Phn loi vi NBAR (Network-Based Application Recognition):


CB Marking c th cu hnh tm kim nhiu trng trong hai bng trn phn loi gi tin trc tip. Tuy nhin n cng c th dng NBAR phn loi packet. NBAR cung cp cho router kh nng phn loi gi tin c bit l cc gi tin kh nhn dng. V d, mt vi ng dng dng cc cng c s hiu ng, cho nn lnh match cu hnh tnh tm kim mt cng UDP hay TCP c s c th s khng th phn loi traffic. NBAR c th tm kim bn trong UDP hay TCP header v tm n tn host, URL hay MIME trong cc HTTP request. S phn tch su vo bn trong ni dung ca gi tin ny cn c gi l deep packet inspection. NBAR cng c th tm trong cc header nhn bit thng tin ng dng c th. V d, NBAR cho php s nhn dng cc loi ng dng Citrix khc nhau, v cho php tm kim mt mng ca chui URL. Khi lnh match protocol c dng, CB Marking tm kim so trng cc giao thc c pht hin bi NBAR. Bt k NBAR c c s dng trong CB Marking hay khng n cng c th c s dng thu thp v bo co thng tin v cc gi tin i vo hay i ra mt interface. xem danh sch cc giao thc ang chy trn mt router m NBAR c kch hot cho mt hay nhiu interface, ta dng lnh show ip nbar protocol-discovery.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 32

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Trng

Din gii

RTP Audio i vi RTP dng s cng UDP chn t 16,384 n 32,767. S cng Video l s c dng bi RTCP cho vic iu khin traffic thoi. NBAR ch so trng s cng chn, do cho php s phn loi d liu m thanh vo trong mt lp dch v cn tn hiu voice th khng. ng dng NBAR NBAR c th nhn dng cc loi khc ng dng Citrix khc Citrix Tn host, nhau. chui NBAR cng c th i chiu cc chui URL, km theo tn host v loi MIME dng lnh n gin.

URL, loi MIME

ng dng ngang C th tm cc ng dng chia s file nh KaZaa, Morpheus, hng Grokster v Gnutella. Bng 2.7: Cc trng thng dng c th i chiu dng NBAR. Phin bn Cisco IOS 12.2(15)T v sau c thm vo Cisco NBAR Protocol Discovery (CNPD) MIB. Ta c th cu hnh NBAR, gim st thng k v cng c th cu hnh NBAR MIB gi cc trap n trm qun l khi cc protocol mi c pht hin trn mng. iu ny c ch cho c QoS v cc yu cu bo mt.

3.6. nh du Marking:
Hot ng nh du cho php cc thit b mng phn loi gi hay khung (frame) da vo b m t lu lng c trng. Mt s b m t lu lng c s dng nh du gi nh: lp dch v (CoS), DSCP, u tin IP, nhm QoS, chuyn mch nhn giao thc (MPLS). Vic nh du c s dng thit lp thng tin trong tiu gi lp 2 hay lp 3. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 33

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Vic nh du gi tin hay khung cng vic phn loi cho php thit b mng d dng phn bit cc gi hay khung c nh du. nh du l yu t hu dng v n cho php thit b mng d dng nhn dng cc gi hay khung theo cc lp c trng. Khi k thut QoS c th ng dng tng thch m bo ng n vi cc chnh sch qun tr QoS. nh du bao gm vic sp t mt vi bit bn trong mt lp data-link hay network header vi mc ch gip cho cc cng c QoS ca thit b khc c th phn loi da trn cc gi tr c nh du. Ta c th nh du mt s lng ln cc field tng ng cho tng yu cu c th. Mt vi field c s dng nhiu, nhng field khc th khng. Mt vi la chn trong vic nh du lm vic c vi tt c cc thit b trong mng cc b trong khi nhng ci khc ch dng trn nhng nn phn cng ch nh. V vic marking trn WAN cng vy. Phn di y s lit k mt danh sch cc trng header m ta dng cho marking bn cnh vic gii thch khi no hu dng nht trn mt field c th v khi no dng phn loi v nh du.

3.6.1 Cc trng IP Header QoS Precedence v DSCP:


Precedence v DSCP l hai trng c s dng nhiu nht nh du. Cc cng c QoS s dng chng bi v header ca gi tin IP tn ti mi ni trn mng. thit lp gi tr DSCP (Differentiated Services Code Point), v xem xt mi quan h gia DSCP v IP Precedence, ta cn phi bit r cc trng trong IP header. Sau y s trnh by chi tit DSCP v cc trng ca n. Differentiated Services Code Point (DSCP) Trong mi gi IP c cha mt byte gi l ToS (Type of Service). Su bits c ngha trong trng DiffServ (DS) c bit nh l trng phn bit dch v v c nh du bi mt mu bit c bit gi l DSCP dng ch ra cch thc mi b nh tuyn cn x l gi. Vi 6 bit c th to ra n 64 lp dch v. Tuy nhin, trong thc t ch c mt s lp dch v c trin khai. Gi tr IP Precedence (t c t 3 SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 34

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

bit c trng s ln nht trong trng ToS) c th c nh x n trng DSCP, va khp vi cc bit trong trng ny. Tp hp cc gi tin c cng gi tr DSCP, v di chuyn qua mng theo cng mt hng c gi l tp hp hnh vi (Behavior Aggregate - BA). PHB s thc hin cc chc nng ca n (hng i, phn lch, nh rt) cho bt k gi tin no thuc v mt BA. Hai bit sau khng dng trong trng DiffServ, khng xc nh trong kin trc trng DiffServ, hai bit ny by gi s dng bi Explicit Congestion Notification (ECN). Ti ni ra nhng gi tin phn loi mng v nh du chng vi th t IP hoc gi tr DSCP trong mt mng DiffServ. Nhng thit b mng khc nhau m DiffServ h tr s dng gi tr DSCP trong IP header chn mt PHB cho gi tin v cung cp QoS thch hp. Sau y s trnh by mt so snh gia ToS v trng DiffServ. ToS Byte P2 P1 P0 T2 T1 T0 CU1 CU2

Hnh 2.7: Th loi dch v - 3 bit u l th t IP (P2 n P0). - 2 bit tip theo tr hon, thng lng v tin cy (T2 n T1). - CU1 v CU0 hin ti khng s dng (Currently and Unused). DiffServ Field DS5 DS4 DS3 DS2 DS1 DS0 ECN ECN

Hnh 2.8: Trng Diffserv - 6 bit DSCP (DS5 n DS0) - 2 bit ECN Trng DiffServ chun ca gi Packet th nh du vi mt gi tr cng nh ngi nhn mt s x l chuyn tip hoc PHB, ti mi nt mng. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 35

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Mc nh DSCP l 000000. Ngi la chn class DSCP phi ch im ny cho tng thch vi th t IP. Khi thay i gia th t IP v DSCP, so khp n vi 3 bit u l quan trng. V d: IP Prece 5 (101) nh x cho IP DSCP 101 000 ToS Byte 1 0 1 T2 T1 T0 CU2 CU0

DiffServ Field 1 0 1 0 0 0 ECN ECN

S dng chun DiffServ tng t nh th t cc bit (cc bit quan trng DS5, DS4, DS3) thit lp u tin, nhng thm vo n lm r cc nh ngha, thng th tt qua vic sa ba bit tip theo trong DSCP. DiffServ t chc li v duy tr nhng mc th t ( vn xc nh bi 3 bit quan trng thuc DSCP) trong 3 loi (nhng mc th gii ngha chi tit hn).

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 36

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Mc th t 7 6 5 4 3 2 1 0

M t Lp lin kt v duy tr Routing Protocol S dng cho IP Routing Protocol Express Forwarding (EF) Class 4 Class 3 Class 2 Class 1 Best effort Bng 2.8: Xc nh cc mc th t trong Diffserv

Vi h thng ny, mt tht b dnh ring lu lng cho class u tin. Sau n phn bit v dnh ring cho cc class lu lng tng t, mang n kh nng Drop trong mng. Chun DiffServ th khng ch nh mt nh ngha chnh xc cho low medium v high kh nng Drop.

3.6.2. Chuyn tip m bo (Assured Forwarding)


Chuyn tip m bo (AF) PHB v m t n nh mt tim nng cho mt nh cung cp vng DS theo nhng mc khc nhau ca chuyn tip m bo dnh cho nhng packet IP nhn t mt khch khch hng vng DS. Chuyn tip m bo PHB mt s m bo s lng bng thng cho class mt chuyn tip m bo v cho php truy cp theo hng bng thng thm vo, nu c sn.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 37

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

l 4 class chuyn tip m bo, AF1x qua AF4x. Trong phm vi mi class, n th c kh nng Drop. c quyt nh trong chnh sch ca mng, nhng gi tin c th c chn cho mt PHB c bn vi yu cu thng lng, delay, jitter, loss hoc theo u tin cho truy cp n dch v mng. Class 1 n class 4 th cp bi nhng class AF. Bng sau y s cung cp DSCP ch nh class AF vi kh nng ca tng class. Bit DS5, DS4 v DS3 xc nh class; bit DS2 v DS1 ch nh kh nng Drop; bit DS0 th lun lun l 0. Drop Class 1 001010 Low AF11 DSCP 10 001100 Medium AF12 DSCP 12 001110 High AF13 DSCP 14 Class 2 010010 AF21 DSCP 18 010100 AF 22 DSCP 20 010110 AF23 DSCP 22 Class 3 011010 AF31 DSCP 26 011100 AF32 DSCP 28 011110 AF33 DSCP 30 Class 4 100010 AF41 DSCP 34 100100 AF42 DSCP 36 100110 AF43 DSCP 38

Bng 2.9: Xc nh cp DSCP ch nh class AF vi kh nng ca tng class.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 38

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Lp dch v Video (ClassVideo) Mission Critical Data (Class FTP) Transaction Data (Class DB) Bulk Data (Class Backup) Best-Effort Data (Class Http)

DSCP PHB CS4

DSCP value 40 (100 000)

IP Precedence 4

AF31

26 (011 010)

AF21

18 (010 010)

AF11

10 (001 010

Default

0 (000 000)

Bng 2.10: Phn loi lu lng tng Network.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 39

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

ch n mt nhm khc. Gi ti router k

Eth IP paket
ng n nhm l ra khi ng

HDLC IP paket
ng n nhm l ra khi ng Frame

FR IP paket
Gi thng ti PC2.

TR IP paket

Hnh 2.9: Cc header c s dng trn dng d liu c th. Trn hnh, gi tin IP n host PC2 xuyn sut mng trong khi cc data-link header ch tn ti khi frame bng qua gia host v router hay gia cc router. Ta c th nh du cc trng Precedence v DSCP vi bt k gi tr nh phn no vi c 3 hay 6 bit. Ta cp vn ny cc phn trc. Mt cch tm tt, cc gi tr Precedence phi c tng ln nh s lng hot ng QoS ngy cng nhiu. DSCP th khc ch trong mt vi PHB, s lng ln gi tr DSCP khng phi lun lun lm cho QoS tt hn.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 40

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Hai trng IP header trn khng cung cp tt c cc trng nh du QoS hin nay. n khi tt c cc giao thc lp 3 bn cnh IP s khng c dng na v trong tng lai tt c LAN switches s c kh nng xt IP headers bao gm IP DSCP v Precedence, v thc hin QoS da trn cc field . Cng nh vy cho n khi tt c cc thit b WAN bao gm Frame Relay v ATM switches s c th thc hin QoS da vo cc trng ging nh vy. Tht t hin nay tuy ngy cng c nhiu thit b c kh nng nh du v tc ng vi IP Precedence v DSCP nhng cn phi c mt thi gian di tt c cc thit b mng va c kh nng va c cu hnh s dng nhng field ny cho mc nh QoS. Th nn cc trng QoS Marking khc vn phi cn n.

3.6.3 LAN Class of Service CoS:


Nhiu LAN switches hin nay c th nh du v tc ng trn cc trng 3 bit Layer 2 c gi l CoS nm bn trong Ethernet header. CoS field ch tn ti bn trong Ethernet frame khi cc ng trunk 802.1Q v ISL c s dng. Ta c th s dng trng thit lp 8 gi tr nh phn khc nhau m c th dng cho chc nng phn loi ca cng c QoS nh IP Precedence v DSCP.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 41

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Frame Type

Cos

ISL Header

ISL Header (26 Bytes)

Original Frame

802.1Q/P Header

Dest.

Src

Ether Type

Tag

User Priority

VLAN ID

802.1Q Tag Field (2 Bytes) Hnh 2.10: Trng LAN CoS bn trong ISL v 802.1Q IP header. CoS tht t l hai trng khc nhau Mt field bn trong 802.1Q trunking header v mt ISL header. Chun IEEE 802.1Q dng 3 bit u trong 2 byte ca trng Tag Control gi l bit u tin ngi dng. c im ISL c quyn ca Cisco dng 3 bit cui t 1 byte ca trng User c tm thy trong ISL header. Vy khi no CoS c th c nh du v c dng phn loi? u tin ng trunk vi 802.1Q hay ISL phi c s dng. Th hai l gi tin phi c chuyn i bng Layer 3 switching. Sau khi CoS c to ra v phn b cho nhng nh du ch nh, router v switch c mt s cng c QoS c th tc ng vi nhng nh du . Cisco router nh du cc bit ca frame i ra khi Ethernet interface, sau cc cng c QoS ca router khc s hot ng da vo cc bit CoS c nh du trong cc frame n chng. Cc switch th nhiu loi c kh nng khc nhau v vic thit lp cc CoS bit v phn ng vi cc bit CoS trc . Chng h tr vic nh du vi CoS v c IP Precedence v DSCP. Cc LAN switch h tr cc tnh SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 42

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

nng QoS thc hin output queuing v i khi cng lm input queuing, chn la cc hng i da trn gi tr CoS.

3.6.4 Mt vi trng nh du khc:


Trong mng Frame Relay v ATM ta c th dng cc trng 1 bit nh du frame hay cell cho Layer 2 QoS. Mi trng 1 bit n ny ch a ra s nhn nh frame hay cell no c nhiu kh nng hn c th b drop so vi khi khng thit lp cc bit . Ni cch khc ta c th nh du bit, nhng QoS tool khc ch dng n trong vic drop frame hay cell thi. Frame Rely dng discard eligibility (DE) bit v ATM dng cell loss priority (CLP) bit. Khi mt thit b nh WAN switch nhn bit c s tc nghn, n cn phi loi b mt vi frame hay cell. Nu frame hay cell c thit lp DE v CLP bit, switch s chn loi b chng trc. iu ny ph thuc vo ngi qun l Frame Relay hay ATM switch quyt nh khi no n s thit lp cc bit DE, CLP v hot ng mt cch khc nhau. MPLS Experimental bits gm mt trng 3 bit ta dng nh x IP Precedence vo mt nhn MPLS. Cng vy, thay v ch n gin nh x IP Precedence cho trng MPLS Experimetal, ta c th thc hic CB Marking, phn loi v nh du theo cc bit MPLS Experimental c th. Vic ny gip cho MPLS router thc hin cc tnh nng ca QoS mt cch gin tip da trn trng IP Precedence nguyn thu bn trong gi tin IP c ng gi bi MPLS m khng phi m IP packet header v phn tch trng IP Precedence. Cui cng l trng QoS Group dng nh du ch tn ti bn trong router, c th c thit lp trn gi tin i trn kt cu Cisco gigabit switch router (GSR) hay edge services router (ESR). S x l QoS s c thc hin mt cch nhanh chng vi vic cu hnh GSR hay ESR nh du ny.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 43

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

3.7. Cc cng c phn loi v nh du: 3.7.1 Cu hnh theo Class Based Marking:
cu hnh theo CB Marking, thc hin theo cc bc sau : - Phn loi cc gi tin vo trong cc lp dch v bng lnh match bn trong MQC class map. - nh du cc gi tin trong mi lp dch v dng lnh set trong MQC policy map. - Kch hot CB Marking nh ngha trong policy map dng lnh MQC servicepolicy mt interface. Lnh Chc nng

Match [ip] precedence precedence- So trng Precedence trong gi tin Ipv4 khi value [precedence-value precedenc- tham s ip c thm vo. So trng gia value] cc gi tin Ipv4 v Ipv6 nu khng c [ip].

Match access-group {access-group | So trng mt ACL theo s hay tn. name access-group-name Match any Match class-map class-map-name So trng tt c cc gi tin. So trng theo mt class-map khc.

Match cos cos-value [cos-value cos- So trng mt gi tr CoS. value cos-value] Match address Match input-interface interface-name So trng mt interface vo. Trang 44 destination-address mac So trng a ch MAC ch.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Match ip dscp ip-dscp-value [ip-dscp- So trng DSCP trong gi tin Ipv4 khi value ip-dscp-value ip-dscp-value ip- tham s ip c thm vo. So trng gia dscp-value value] Match packet length {max maximum- So trng cc gi tin da vo di ngn length-value [min minimum-length- nht, di nht hay c hai. value] | min minimum-length-value [max maximum-length-value]} Match protocol protocol-name Match qos-group qos-group-value So trng loi giao thc NBAR . So trng mt QoS group. ip-dscp-value ip-dscp- cc gi tin Ipv4 v Ipv6 nu khng c [ip].

Match resource-address mac address- So trng mt a ch MAC ngun. destination Bng 2.11: Mt vi cu hnh lnh match trong CB Marking

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 45

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Lnh

Chc nng

Set [ip] precedence ip- nh du gi tr ca IP Precedence cho cc gi tin Ipv4 precedencep-value v Ipv6 nu tham s ip b b qua. Nu tham s ip c thm vo th ch thit lp cho gi tin Ipv4. Set [ip] dscp ip-dscp- nh du gi tr ca IP DSCP cho cc gi tin Ipv4 v value Ipv6 nu tham s ip b b qua. Nu tham s ip c thm vo th ch thit lp cho gi tin Ipv4. Set cos cos-value Set qos-group group-id nh du gi tr ca CoS. nh du gi tr ca QoS group.

Bng 2.12: Cc cu hnh lnh set trong CB Marking Lnh Show name Show policy-map interface-spec [ Lit k thng tin v hot ng ca policy map input | output ][class class-name] khi c kch hot ti mt interface. policy-map Chc nng policy-map- Lit k thng tin cu hnh v policy map.

Bng 2.13: Cc cu hnh lnh thc thi trong CB Marking.

3.7.2. Network-Based Application Recognition (NBAR):


CB Marking v nhng cng c thuc MQC khc c th dng NBAR phn loi traffic. Dng lnh class map ph match protocol MQC c th so trng cc giao thc c nhn bit bi NBAR. S kt ni gia NBAR v CB Marking hay cc cng c MQC khc u da trn lnh match protocol.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 46

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Lnh Ip nbar protocol-discovery

Chc nng Interface mode. Kch hot NBAR cho traffic ra v vo interface .

Ip nbar port-map protocol-name Global mode. Ni NBAR tm kim cc giao [tcp | udp] port-number thc s dng s cng khc vi nhng cng bit. Cng c th nh ngha s cng c dng cho gi tin t thit lp. Ip nbar pdlm pdlm-name Global mode. M rng danh sch cc giao thc nhn bit bi NBAR bng cch thm vo PDLMs. Snmp-server enable traps cnpd Global mode. Kch hot vic gi cc by NBAR . Show ip nbar protocol-discovery Lit k thng tin thng k cc giao thc pht [interface interface-spec] [stats hin c. Cc s thng k c th c lit k {byte-count | bit-rate | packet- theo interface, giao thc hay theo n giao thc count}] [{protocol protocol-name | u. top-n number}] Show ip nbar port-map [protocol- Lit k danh sch cc cng ang c dng bi name] cc giao thc c tm thy. Bng 2.14: Cc cu hnh lnh cu hnh cho NBAR

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 47

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

CHNG III TC NGHN CC CNG C QUN L, PHNG CHNG TC NGHN

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 48

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

I. Tc nghn:
Cc nguyn nhn gy tc nghn thng thng ri vo cc trng hp sau: - Nghn mng xy ra do lu lng vt mc gii hn dn n thiu khng gian b m, lm tng s hi t lu lng, tng s lu thng mng. Vic tng bng thng ng truyn l gii php khng h n gin gii quyt vn nghn trong mt s trng hp. Lu lng khng mong mun c th ph y hng i v gy ra tnh trng thiu bng thng cho cc lu lng thoi hay cc ngun lu lng c s tng tc. V th cc k thut qun l nghn trn nn tng Cisco IOS cung cp cho nh qun tr mng kh nng qun l hng i mm mt cch hiu qu v cp pht bng thng cn thit n cc ng dng c bit khi trng thi nghn tn ti. - Trc ht nghn c th xy ra khi tc ng truyn khng ph hp. Tc ng truyn khng ph hp ph bin khi lu lng di chuyn t mng c tc cao nh LAN (100 hay 1000 Mbps) sang cc ng truyn c tc thp nh ng WAN (1 hay 2 Mbps). S khng ph hp v tc cng ph bin trong mng LANLAN, khi lu lng di chuyn t mng LAN c tc 1000 Mbps sang mng LAN c tc ng truyn 100 Mbps. - Bn cnh mng cng c th b nghn ti ni tp trung lu lng mng. Trong mng WAN vic nghn xy ra khi nhiu trm xa cng gi v mt trm dch v trung tm. Trong mng LAN, nghn thng xy ra lp phn phi mng ni cc thit b lp truy xut khc nhau cng gi lu lng n b chuyn mch mc phn phi.

II. C ch qun l tc nghn:


C ch qun l nghn, cn c gi l c ch hng i (queuing), mun ch n cch thc m mt router hay mt switch qun l gi tin hay mt frame khi d liu ang ch i ra mt cng. Vi router, qu trnh ch i thng din ra khi tin trnh y gi tin IP hon tt. V vy, c ch hng i thng ch c xem xt l hng i ra. Cc LAN switch thng h tr c hng i vo v hng i ra, trong SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 49

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

hng i vo thng c dng nhn frame ang c truyn ra ng ra ca switch. Cng c trnh nghn mun ch n thut ton c dng khi quyt nh c hay khng v khi no th gi tin nn b loi b khi mt h thng hng i b qu ti. Cc cng c chng tc nghn da trn cc hot ng ca TCP thc hin gim s tc nghn. Hu ht Intenet ph bin l cc traffic dng TCP. Tc truyn thng TCP u b gim tc sau khi c s tht thot cc gi tin. Bng cch loi b mt s lng packet cc cng c chng tc nghn s lm cho cc traffic chm li v s tc nghn gim i.

III. Khi nim hng i trong Cisco router:


Cc router Cisco c th c cu hnh thc hin a vo hng i nhng gi tin ang ch thot ra khi mt cng. V d, nu mt router nhn mc lu lng 5Mbps trong vi giy lin tip v tt c cc lu lng cn i ra cng T1 (1.544Mbps), router s khng th truyn tt c cc lu lng . V vy, router s t tt c cc gi tin vo mt trong nhng hng i phn mm. Nhng hng i ny c th cu hnh v thng qua , ngi qun tr c th can thip nhng gi tin no c th k tip ri khi cng, nhng gi tin no c th loi b.

Hnh 3.1: Cc thnh phn ca Queuing

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 50

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

3.1 Hng i phn cng v hng i phn mm:


Khi nim ny d b b qua khi ta ni n cc chi tit bn di ca hng i cng v hng i mm trong mt cng vt l ca router. Cc hng i c to ra trn mt cng ca router bng cc cng c hng i l hng i mm v cc hng i ny c thc hin bng phn mm. Tuy nhin, khi c ch hng i x l n gi tin k tip trong hng i mm, gi tin ny khng c di chuyn trc tip ra cng vt l. Thay vo , router s di chuyn gi tin t hng i mm sang mt hng i nh bng phn cng FIFO. Cisco gi cc hng i ring bit cui cng ny l hng i truyn (transmit queue-TX queue) hoc vng trn hoc vng trn truyn (TX ring) ty thuc vo kiu router. Tng qut, cc hng i ny c gi l cc hng i phn cng. Cc hng i phn cng c cc c im sau y : Khi mt cng hon tt vic gi mt gi tin, gi tin k tip t hng i cng c th c m ha v gi ra cng m khng cn ngt CPU bng phn mm, gip m bo s dng y bng thng ca cng. - Lun lun dng c ch FIFO. - Khng th b nh hng bi cc cng c hng i QoS. - IOS t ng gim kch thc ca hng i phn cng n mt chiu di nh hn khi mt cng c hng i c dng. Cc hng i phn cng c chiu di ngn c ngha l cc gi tin c th kim sot bng cc phn mm hng i, cho php cc hng i mm kim sot cht ch hn lu lng i ra khi cng. Chc nng duy nht ca hng i phn cng m ta c th thao tc l chiu di ca hng i.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 51

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

3.2 Cc c ch hng i trn cng v trn sub-interface:


Cc cng c hng i ca IOS c th to v qun l cc hng i mm kt hp trong mt cng vt l v sau cc gi tin chy vo hng i phn cng. Thm vo , cc hng i phn mm c th c dng kt hp vi cng c nh dng lu lng shaping. Cc cng c nh dng lu lng (shaping) c th lm chm gi tin m bo rng mt nhm cc gi tin khng vt qu tc nh ngha. Khi lm chm gi tin, chc nng nh dng lu lng s xp hng cc gi, mc nh theo kiu FIFO. Ty thuc vo kiu cng c nh hnh lu lng c dng, cc hng i khc nhau c th c cu hnh qun l tr ca cc gi tin gy ra bi cng c shaping. Cisco IOS cung cp nhiu cng c hng i. Bng di y s tm tt cc c im chnh ca cc cng c hng i khc nhau : c tnh Phn loi nh ngha Xem xt gi tin a vo hng i ph hp.

Chnh sch loi b Cc lut c dng chn ra gi tin no s b loi b gi tin nh thi S hng i ti a khi hng i bt u y. C ch dng xc nh gi tin no s c gii phng. nh ngha s nhm lu lng.

S chiu di ti a S gi tin ti a trong mt hng i. ca hng i Bng 3.1: Cc c im ca hng i. Khi ta kho st cc c ch hng i, ta cn xem xt cch thc phn loi m c ch hng i ny dng, chnh sch loi b gi tin khi tt c cc hng i u y, phn nh thi c dng gii phng gi tin. Ta cng cn phn tch s hng i ti a c h tr trong mi c ch v chiu di ti a ca mi hng i. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 52

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

IV. Cc cng c hng i qun l s tc nghn mng:


C mt cch x l s trn thng tin (khi lng thng tin n vt qu dung lng ca ni nhn) l s dng mt thut ton da vo hng i sp xp cc traffic v sau xc nh vi phng php phn quyn u tin cho tng gi tin i ra ngoi. IOS ca Cisco h tr cc cng c nh sau: - First-in, first-out (FIFO) - Priority queuing (PQ) - Custom queuing (CQ) - Weighted fair queuing (WFQ) - Low Latency Queuing (LLQ) Mi thut ton hng i c thit k gii quyt mt vn c th cho vic truyn thng trn mng v c mt hiu qu c bit tng hiu sut ca mng.

4.1. FIFO:
Mt cch n gin nht, thut ton sp xp FIFO (da trn kh nng storeand-forward) thc hin vic lu tr cc gi tin khi mng b tc nghn v chuyn cc gi tin i khi mng thng. FIFO l thut ton sp xp truyn thng mc nh trong mt s trng hp, bi th khng cn phi cu hnh, nhng n c nhng hn ch nht nh. Hn ch ln nht l FIFO khng c s phn quyn u tin cho cc gi tin, khng c s tha thun bng thng truyn v khng c s ch nh v b m. N cng khng c s kim tra li cc thng tin b hng hay b mt. S tng nhanh ca cc ti nguyn truyn c th gy ra s chm tr khong mt thi gian di trong vic phn pht thi gian cho s giao tip gia cc ng dng trn mng v gy kh khn cho vic iu khin truyn thng ca mng cng nh vic truyn cc tn hiu cho cc thng ip. FIFO l thut ton u tin c thit k cho vic iu khin truyn thng trn mng, nhng i vi cc mng thng minh ngy nay i hi nhng thut ton tt hn cng nh l phc tp hn. IOS ca Cisco thit lp cc thut ton sp xp tt SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 53

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

hn ci thin cc hn ch ca FIFO. Ci tn First In, First Out cng ni ln cch thc chuyn gi tin ca n.

Hnh 3.2 Hot ng ca FIFO Trong queue c ba gi tin L1, L2, L3 theo th t th L1 c chuyn i trc v k tip l L2, L3.

4.2. Truyn thng c th t - Priority Queuing (PQ):


PQ m bo cc thng tin quan trng s c gii quyt mt cch nhanh nht ti mi ni n c s dng. Thut ton ny c thit k dnh cho cc traffic quan trng vi mt th t khc khe. Vic sp xp cc th t u tin rt phc tp: c th u tin theo tng giao thc (IP, IPX, Apple Talk), theo cc port n, kch thc ca packet, a ch ngun hay a ch ch vv... Trong thut ton PQ mi packet c n nh vo mt trong 4 cp u tin sp xp l: cao, trung bnh, thng thng v thp. Cc gi tin khng thuc v nhng tiu ch sp xp trn s c n nh u tin l thng thng. Nh s m t trong hnh di y, trong sut qu trnh truyn nhn, thut ton lun thc hin cho cc cng vic c u tin cao sau mi n cc quyn u tin thp hn.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 54

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Traffic n

Qu trnh xc lp u tin

Interface xut: + Ethernet + Frame Relay + ATM + Serial

Cc hng i ca cc lp truyn thng

Qun l b m trn Interface

Hnh 3.3 Phn loi v x l theo c ch u tin PQ rt hu ch cho vic giao tip gia cc traffic quan trng cn c u tin trn mng WAN. Gi s Cisco s dng thut ton PQ m bo cc bo co d liu v vic giao tip thng mi phi c truyn u tin n tr s sau mi n cc cng vic khc. Hin ti thut ton PQ s dng cu hnh tnh v bi th khng t ng cp nht cc thay i ca mng khi cn thit.

4.3. m bo bng thng - Custom Queuing (CQ):


CQ c thit k cho php nhiu ng dng hay nhiu t chc c th chia s thng tin ca mng vi cc ng dng khc bng lng bng thng nh cn thit v thi gian tr thch hp cho cc dch v . Trong nhng mi trng nh vy, bng thng phi c chia s cn xng gia cc ng dng v gia cc ngi dng. S dng cc c tnh ca thut ton CQ h tr bi Cisco c m bo v bng thng SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 55

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

ti nhng ni c th xy ra tc nghn, hay chc rng vic truyn thng gia cc ng dng s din ra ng vi bng thng ch nh v thit lp lng bng thng cn li ca mng cho nhng ng dng truyn thng khc. Cc yu cu ca khch hng c sp xp bng cch thit lp mt s lng c th khng gian, kch thc ca hng i vi mi lp ca cc gi d liu v sau x l cc gi thng tin theo thut ton round-robin.

Traffic n

- Phn loi theo Protocol (IP,IPX,AppleTalk, SNA ...). - t trn cng nhn traffic

Hnh 3.4: Phn loi v a gi tin vo hng i trong SNA Trong hnh trn, vic ng gi ca h thng SNA (System Network Architecture) cn m bo mt s lng nh cc dch v. Chng ta c th cung cp mt na bng thng sn c phc v cho vic truyn d liu ca h thng SNA, v n nh phn bng thng cn li cho cc giao thc khc nh IP hay IPX.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 56

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Thut ton sp xp bng cch t thng ip vo 1 trong 17 hng i (hng i 0 lu tr thng ip ca h thng nh kim tra keepalive lun sn sng gi update khi c kt ni, tn hiu ..vv..., v s l rng khi quyn u tin quan trng (cao nht). Router thc hin vic sp xp thng tin vo hng i t 1 n 16 nh thut ton round-robin, sp xp li tng byte cu hnh c m t mi hng i trong tng chu k. Tnh nng ny m bo rng khng c ng dng no (hay nhm ng dng c th no) c th hot ng cao hn kh nng m h thng cp pht cho chng khi ng truyn ang tnh trng qu ti. Ging nh PQ, CQ c cu hnh dng tnh v khng t ng cp nht li cc thay i ca mng.

4.4. Hng i theo trng s - Weighted Fair Queuing (WFQ):


WFQ khc vi PQ v CQ vi im. S khc bit ln nht l WFQ khng cho php ngi qun tr can thip vo qu trnh phn loi lu lng. WFQ t ng phn loi cc gi tin da trn thng tin v dng lu lng, trong tng dng s c t trong mt hng i ring l. Mt dng c nh ngha bao gm tt c cc gi tin c cng gi tr nh: + a ch IP ngun. + a ch IP ch. + Giao thc lp transport. + a ch cng ngun TCP hay UDP. + a ch cng ch TCP hay UDP. + Gi tr u tin ca gi tin IPP (IP Precedence). Bi v WFQ phn cc gi tin vo cc dng lu lng khc nhau v sau a cc dng ny vo trong nhng hng i khc nhau, router s c s hng i khc nhau. S hng i ny nhiu hn bt k cc cng c hng i khc (tc l cc cng c hng i khng x l theo dng lu lng). C ch nh thi ca WFQ dng cc thut ton hon ton khc vi cc thut ton ca cc cng c hng i khc im n SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 57

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

c th qun l mt s lng ln cc hng i. Tuy nhin, mc ch tng th ca WFQ l rt d hiu v c tm tt nh sau: - Cc dng c cng u tin IPP ca gi tin IP s c cp cng mt mc bng thng, bt chp c bao nhiu byte trong mi dng lu lng. - i vi nhng dng c nhng gi tr IPP khc nhau, cc dng c u tin IPP cao hn s c cp mt lng bng thng cao hn. - Kt qu l WFQ s u tin cho nhng dng c dung lng nh v c u tin cao. Gi s, nu WFQ ang qun l 10 hng i vi cc gi tr IPP bng nhau trn mt cng 128kbps, mi dng lu lng s nhn c khong bng thng bnh qun 12.8kbps. Cc hng i s lm cho nhng dng lu lng ln hn 12.8kbps, ngha l b tr (delay) nhiu hn. Cc dng c bng thng nh hn 12.8kbps s truyn i nhanh hn v trong trng hp cc hng i l trng th WFQ s cp phn bng thng d cho nhng hng i khc. Kt qu l cc dng lu lng thp s i qua, cn dng lu lng cao s b nh hng. Mc ch th hai ca WFQ l cung cp bng thng cho cc dng lu lng c u tin IPP cao. lm iu ny, cc dng c gn trng s da theo gi tr IPP + 1. Ni cch khc, cc dng c u tin IPP bng 7 s c bng thng nhiu hn tm ln so vi dng c u tin IPP bng 0, bi v (7+1)/(0+1)=8. Mt v d khc, nu so snh dng c u tin 3 vi u tin 0, t l bng thng c cp pht l (3+1)/(0+1)=4.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 58

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Queue truyn

Interface xut

Traffic n

Tin trnh WFQ da trn:

+ Yu cu ca QOS (IP Precedence hay DSCP) + Frame Relay FECN, BECN, DE. + Da trn bng thng hin ti

Hnh 3.5: M hnh hot ng ca thut ton WFQ Tin trnh nh thi WFQ t c mc ch cp pht bng thng, WFQ dng b nh thi kh n gin. B nh thi s ly gi tin c ch s tun t thp nht sequence number SN (cn gi l thi gian hon thnh finish time) khi n cn chuyn gi tin k tip n hng i phn cng. C ch WFQ s gn mi gi tin mt ch s tun t SN khi gi tin i vo hng i WFQ. Tin trnh gn ch s tun t SN cng l mt phn quan trng trong c ch nh thi ca WFQ. B nh thi WFQ s tnh ton ch s tun t SN da trn nhiu thng s ca dng lu lng, bao gm c chiu di v u tin IPP ca gi tin.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 59

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Cng thc tnh ch s tun t SN ca mt gi tin trong mt dng lu lng l nh sau: SN=ch s SN trc +(trng s weight*chiu di gi tin mi). Trong trng s c tnh nh sau: Weight=32384/(IP_Precedence+1) Cng thc trn c tham chiu n chiu di ca gi tin mi, trng s ca dng lu lng v gi tr SN trc . Bng cch xem xt chiu di gi tin, vic tnh ton s tun t SN c th dn n mt ch s SN rt cao cho nhng gi tin c kch thc ln v ch s tun t SN thp hn cho nhng gi tin c kch thc nh hn. Vi vic bao gm lun ch s tun t SN ca gi tin trc trong hng i, cng thc ny s tnh ra ch s SN ln hn cho nhng gi tin trong hng i c mt s lng ln gi tin. Bng cch gn trng s (IPP+1), cc gi tin c u tin IPP cao s c kt qu SN thp hn. Hnh di y s m t cch hai gi tin c gn hai ch s tun t nh th no. Tnh ton ch s tun t SN ca mt gi tin th d dng. Tuy nhin gi tin u tin trong mt dng lu lng no th khng c ch s tun t SN ca gi tin trc dng trong cng thc tnh ton trn. Cng thc m t rng ch s tun t SN ca gi tin cui cng c a vo hng i cng th c dng nh l ch s tun t SN cho dng mi theo sau.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 60

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin


Flow 1

Gi tin mi thuc lung 1 length 100, Precedence 0

SN ca gi tin trc ca lung 1

Precedence 0 c weight = 32348

SN = 1000 + 32,348*100 = 3,239,000

SN trc ca packet truyn i l 100

New flow: Flow 2 Gi tin mi thuc lung 2 length 500, Precedence 0

SN = 100 + 32,348*500 = 16,192,100

Hnh 3.6: Hnh m t cch tnh SN (Sequence Number). Sau khi cc ch s tun t SN c gn, cn li, cng vic chn gi tin no gii phng ca b nh thi tr nn n gin. N s ly gi tin c ch s SN thp nht gia tt c cc hng i. Chnh sch loi b gi tin ca WFQ, s hng i v chiu di hng i Trong hot ng ca router, mc d a cc lu lng vo cc hng i tng ng, nhng nu lu lng i qua router vn tip tc tng cao, bt buc router s phi tin hnh vic loi b bt gi tin gim bt nghn. WFQ dng tin trnh hai bc gi l loi b cui hng c b sung (modified tail drop) chn la khi no th loi b gi tin. Theo tn gi, tin trnh ny khc vi tin trnh loi b cui hng thng thng. - u tin, WFQ s xem xt gii hn tuyt i ca tt c cc gi tin trong hng i gia tt c cc hng i, gii hn ny gi l hold-queue limit. Nu mt gi tin n hng i v gii hn hold-queue ti, gi tin s b loi b. Quyt nh khng da trn mt hng duy nht nhng trn ton h thng hng i ca WFQ. Ni cch khc, gii hn hold-queue ny l mt ch s ton cc, c tnh ton tng th gia cc hng i WFQ. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 61

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

- Th hai l WFQ s xem xt chiu di ca mt hng i m trong nhng gi tin s c a vo. Trc khi a mt gi tin vo hng i, mc ngng congestive discard threshold (CDT) s c kim tra vi chiu di thc s ca hng i . Nu hng i l di hn CDT, mt gi tin s b loi b, nhng c th khng phi l nhng gi tin mi n. Gi tin c ch s tun t cao nht trong tt c cc hng i ca WFQ s b loi b.

Hnh 3.7: M t tin trnh loi b ca WFQ Nhng gi tin va n s i qua tin trnh ny, nhng trong mt nhnh ca thut ton, gi tin mi n s khng b loi b, thay vo , mt gi tin khc trong mt hng i khc s b loi b. Mt cch c bn, nu gi mi n cn phi i vo mt hng i vt qu CDT, WFQ s loi b gi tin c ch s tun t cao nht t bt k hng i no. Gi tr CDT phi gn bng bi s ca 2. IOS s khng chp nhn bt k gi tr no khc. WFQ c th c cu hnh dng ti a 4096 hng i, gi l dynamic queue. Mi khi c mt dng lu lng, router s to ra mt dynamic queue truyn dng lu lng trn. Khi x l xong mt dng lu lng, hng i s b hu. Thm vo , WFQ gi tm hng i n cho cc lu lng c to ra bi router. WFQ dng mt mc trng s rt thp cho cc hng i ny u tin cho cc cc lu lng ca h thng. Ngoi ra, c mt vi hng i trong s 4096 hng i c th c dng bi Resource Reservation Protocols (RSVP) gi bng thng. RSVP dng cc bo hiu SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 62

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

gi phn bng thng ti thiu cho nhng dng lu lng c bit trong mt h thng mng, da ch yu vo cc cng c hng i thc s hin thc c tnh nng gi bng thng. WFQ, CBWFQ, v LLQ h tr RSVP.

4.5. Class-Based WFQ (CBWFQ):


Cisco to ra CBWFQ v LLQ, s dng cc khi nim t PQ, CQ v WFQ v c thm vo vi c im khc. CBWFQ dnh ring bng thng cho tng hng i v dng khi nim WFQ cho cc gi tin trong lp mc nh. LLQ thm vo trong CBWFQ khi nim hng i u tin, nhng khng ging nh PQ, LLQ ngn cc hng i c u tin cao khi vic b ri vo trng thi cht. Thm vo , c CBWFQ v LLQ u dng c php tng qut ca MQC khi cu hnh, c ngha l n c cc tu chn phn loi mnh, bao gm c NBAR. CBWFQ v LLQ dng cu hnh tng t nhau, s khc nhau nm ch cu lnh bandwidth hay cu lnh priority c dng. Bi v cc hai cng c u dng MQC, c hai s dng class-map phn loi v dng policy map to ra mt tp hp cc nhm lu lng dng trn mt cng. Cc lp nh ngha trong policy map s dng mt hng i. Kt qu l, thut ng hng i v class thng thng dng qua li khi lm vic vi LLQ v CBWFQ. Ngha l, ta c th m ch n mt lp lu lng no bng c thut ng queue hay class. CBWFQ v LLQ h tr 64 hng i hoc classes. Chiu di hng i ti a c th thay i, vi gi tr ti a v chiu di mc nh thay i da theo kiu ca router v tng s b nh c dng. C hai u c mt hng i c bit gi l hng i mc nh. Hng i ny tn ti ngay c khi n khng c cu hnh. Nu mt gi tin khng thuc v nhm no c cu hnh trong mt policy map, IOS s t gi tin v hng mc nh. CBWFQ c th c cu hnh cho nhm mc nh.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 63

GVHD:Th.s L Mnh Hi Cu trc ca CBWFQ

Qun l cht lng dch v a phng tin

Hnh 3.8: M t hot ng ca class-based wfq (CBWFQ) - CBWFQ h tr nhiu lc class (tu thuc vo nn) phn loi traffic vo cc hng i FIFO tng ng vi n. - Tail drop l c ch loi b mc nh ca CBWFQ. Cc c im c bn CBWFQ B phn nh thi CBWFQ m bo mt t l ti thiu ca bng thng n tng hng i. Nu tt c cc hng i c mt s lng ln gi tin, mi hng i s nhn phn trm bng thng ngm nh bi cu hnh. Tuy nhin, nu mt vi hng i l trng v cc hng i ny khng c nhu cu bng thng trong mt khong thi gian ngn, bng thng c cp pht tng ng vi cc nhm lu lng khc.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 64

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

c im CBWFQ Phn loi Chnh sch loi b S hng i Chiu di hng i ti a

M t Phn loi da trn bt k tiu chun so trng no. Loi b gi tin cui hng i hay cho tng hng. 64 Thay i ty theo kiu router v b nh.

nh thi bn trong mt FIFO 36 hng, FIFO hay WFQ trn hng mc nh. hng i nh thi trn tt c cc Kt qu ca phn nh thi cung cp mt t l phn hng trm ca bng thng n tng hng i. Bng 3.2: M t c im ca CBWFQ

4.6. Low-Latency Queuing (LLQ):


Nu ch cn c theo tn gi, c ch hng i LLQ c v nh l cng c hng i tt nht c th. Nhng loi gi tin no khng mun b nh hng bi tr? i vi nhng ng dng cn tr thp, LLQ l chn la tt. LLQ tm kim v hnh ng ging nh CBWFQ trn hu ht mi phng din, ngoi tr yu t l LLQ cho php mt s hng i hot ng nh cc hng i c tr thp. LLQ nh thi cc hng i ny nh l cc hng i c u tin cao, ging nh PQ. Ni cch khc, LLQ lun c gng phc v cc gi tin trong nhng hng i ny trc. LLQ thnh thong c th dng trong mt s hnh thc khc nhau. Nu mt chnh sch policy map c t nht mt LLQ, chnh sch policy map c th xem nh ang hin thc LLQ, v hng i c gi l LLQ. Thnh thong, mt hng i LLQ cn c gi l PQ v c tnh hot ng ging PQ. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 65

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Khi LLQ thm vo mt hng i c tr thp vo c ch CBWFQ, n cng gip ngn nga hin tng hng i cht ca PQ. LLQ thc s khng ch hng i da trn bng thng c cu hnh. Thc s, mc bng thng cp cho mt hng i LLQ s va l mc bng thng m bo ti thiu, va l mc bng thng ti a. Kt qu l, cc gi tin c th c gii phng khi hng i c tr thp nhng s c vi gi tin b loi b ngn nga cc hng i khc ri vo trng thi cht v khng c x l. Hnh di y m t thut ton hot ng ca LLQ. Ch rng mc d c mt thnh phn chy theo thut ton PQ l c hin th, nhng thnh phn ny cng b khng ch v bng thng.

Hnh 3.9: M t thut ton hot ng ca LLQ SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 66

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

LLQ cho php nhiu hng i/class c cu hnh nh PQ. iu ny dn n cu hi Hng i no s c phc v trc?. Tht ra, LLQ thc s t cc gi tin t cc hng i LLQ vo mt hng i bn trong. V vy, cc gi tin trong cc hng i u tin khc nhau vn c phc v trc nhng gi tin trong cc hng i khng u tin, nhng n s c phc v da trn thi gian gi tin n trong bt k hng i u tin no. Vy ti sao li dng nhiu hng i u tin? Cu tr li l do cng c khng ch bng thng policing. Khi khng ch bng thng ca mt lp mt mc no v vi lp lu lng khc mc khc, ta s c nhiu mc hiu chnh khc nhau cho LLQ. V d nu hoch nh cho d liu video v voice, ta c th t cc loi d liu ny vo cc hng i LLQ ring bit v c hai loi d liu ny s c tr thp, ng thi ngn nga d liu video chim bng thng ca voice v ngc li.

4.7. Bng tm tt v cc cng c qun l tc nghn - Queuing:


Queuing cung cp kh nng sp xp li cc packet khi tc nghn xy ra. S dng ng cng c queuing l iu cn thit cho mt yu cu c th trong mng. so snh cc cng c queuing da vo cc yu t sau : - Kh nng phn loi, c th l cc trng header trong packet m c th so trng phn ra sp xp vo hng i c th. - S hng i ti a (c th gi l cc lp ti a). Nu ta phi phn bit bao nhiu loi traffic th ta cn by nhiu hng i. - Gii thut lp danh mc. Trong vi cng c queuing, Cisco t ra cc gii thut dng quyt nh packet no c a vo hng i no tip theo. Cc cng c khc th dng hiu ng mng li thut ton.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 67

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Sau y l bng so snh cc cng c sp xp vi s lng v chc nng khc nhau: Tool S lng Kh nng phn Hot ng v kt qu ca queues ti a Priority Queuing (PQ) Custom Queuing (CQ) 16 4 IP ACL. Giao din input. Phn mnh. IP ACL. Giao din input. Phn mnh. Dch v gii hn. Lun p ng cho hng i u tin cao trc cc hng i c u tin thp. Cung cp mt s lng bytes ty vo cu hnh trn mt queue, mt round-robin i qua queue . Kt qu : lng bng thng cho cc dch v khc nhau. Weighted Fair Queuing (WFQ) 4096 T ng, da vo lung d liu (a ch source, dest, s port, loi giao thc). Mi dng d liu dng queue khc nhau. Queue vi dung lng nh v u tin IP Precedence cao hn c dng nhiu dch v hn. loi thut ton.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 68

GVHD:Th.s L Mnh Hi Clased Based Weighted Fair Queuing (CBWFQ) 64 IP ACL. NBAR.

Qun l cht lng dch v a phng tin Gii thut lm vic khng c s dng. Da vo kt qu nh bng thng cho mi queue di ti.

Ging vi CB.

Low Latency Khng c Ging vi Queuing (LLQ) CBWFQ

LLQ l mt bin th ca CBWFQ s dng hng i u tin, lun c p ng tip theo nu packet ch i trong queue . N cng gi trt t traffic.

Bng 3.3: Bng so snh cc cng c qun l tc nghn

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 69

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

CHNG IV M HNH V THC HIN

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 70

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Trc khi tin hnh trin khai cht lng dch v trn m hnh thc nghim chng ti xin gii thiu v m hnh chnh s trin khai. M hnh bao gm hai chi nhnh chnh: - Chi nhnh H Ni gm mt Router kt ni vi tr s chnh TPHCM, mt Switch kt ni mng Lan, thit b Video, 1 tng i (PBX), 1 Server v mt PC. - Chi nhnh TPHCM cng gm mt Router kt ni vi chi nhnh H Ni, mt Switch kt ni mng Lan, thit b Video, 1 tng i (PBX), 1 Server v mt PC. Trc khi p dng k thut cht lng dch v vo m hnh ny th khi ta cng lc truyn nhiu lung d liu s c s tranh chp bng thng gia cc lung d liu vi nhau. Do nhng lu lng i hi lng bng thng ln nh lu lng thi gian thc (video, voice) s b tranh chp bng thng bi cc lung lu lung khc dn n tnh trng khng bng thng cn thit cho chng nn tn hiu ti ni nhn s b ngt qung lm cho hnh nh b nho, git, m thanh khng r rng, b ngt qung khc phc tnh trng , chng ti s p dng k thut cht lng dch v vo m hnh ny. Khi cng lc truyn nhiu lung d liu th nhng lu lng quan trng nh lu lng thi gian thc (Video, voice) khi truyn i m bo cht lng m thanh, hnh nh tt nht n ni nhn v nhng d liu nh FTP, HTTP cng c truyn i nhng truyn vi lng bng thng thp hn. Trong m hnh ny chng ti tin hnh truyn 2 lung d liu l : video v FTP. Kt qu thu c trc khi p dng k thut cht lng dch v v sau khi p dng k thut cht lng dch v s ln lt c trnh by bn di:

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 71

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

I. M hnh chnh:

Hnh 4.1: M hnh chnh

II. Trin khai cht lng dch v trn m hnh thc nghim: 2.1 M hnh thc nghim:

Hnh 4.2: M hnh thc nghim. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 72

GVHD:Th.s L Mnh Hi V mt thit b:

Qun l cht lng dch v a phng tin

- TP_HCM: IOS Cisco Router 7200, m phng trn phn mm GNS3. - TP_HN: IOS Cisco Router 7200, m phng trn phn mm GNS3. - Hai PC: mt lm Client truy cp Server ly ti nguyn v mt Server. V phn mm PC: - Server: + Dng Windows XP, chng trnh dng WinFTP Server. + Phn mm GNS3 dng gi lp router. + Phn mm VMWare 5.0 to my o (Client). - Client: + Dng Windows XP. + Chng trnh Total Commander kt ni ti FTP. + Chng trnh Netflow Analyzer hin th thng tin gi tin trn mng. Cu hnh cc thit b c a ch nh sau: - Router TP_HN: Interface s1/0 ni vi Interface s1/0 ca Router TP_HCM vi IP:192.168.16.1/24 + Fastethernet f2/0 ni vi Client (my o) a ch IP: 20.0.0.1/8. + Client t IP: 20.0.0.3/8 default gateway 20.0.0.1. - Router TP_HCM: Interface s1/0 ni vi Interface s1/0 ca Router TP_HN vi IP:192.168.16.2/24. - Ring Router TP_HCM cu hnh thm cc dng lnh h tr cho chng trnh Netflow hot ng (chi tit s c trnh by sau). + Fastethernet f2/0 ni vi Server a ch IP: 10.0.0.1/8. + Server t IP: 10.0.0.3/8 default gateway 10.0.0.1. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 73

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

2.2 Cc bc trin khai:


Bc 1: Xc nh d liu tn ti trong mng: Trong mng ca Cng ty chng khon Nam Phong c cc loi d liu sau: - Video Streaming (class Video). - FTP (class FTP). - H qun tr c s d liu SQL ( class DB). - Email, Web (class Http). Tham chiu vi bng 2.10 trn xc nh yu cu QoS cho cc lp trn. Ta s giao thc nh tuyn RIP cho m hnh trn.

Hnh 4.3:M hnh thc nghim p dng QoS. Bc 2: Thc hin phn loi v nh du d liu p dng QoS. Mun t c hiu qu cao cho mng ta phi cn nhc tht k nn p dng QoS Router no trn mng v p dng chnh sch tng ng cho tng giao din. Vi m hnh ny ta chn Router TP_HCM thc hin phn loi v nh du.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 74

GVHD:Th.s L Mnh Hi Ta phn loi d liu nh sau: - Class video-in - Class ftp-in - Class http-in

Qun l cht lng dch v a phng tin

y l cc lp vo cng f2/0 v sau ra cng s1/0 nh sau: - Class video-out - Class ftp-out - Class http-out. iu khin c cc class trn ta phi c hai chnh sch p dng cc k thut QoS. - Policy in: nh du cc class in (class vo). - Policy out: nh du cc class out (class ra). Bc 3: Sau khi ci t v cu hnh cho m hnh thc nghim trn phn mm gi lp GNS3, lu thnh file v c kt qu sau:

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 75

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

III. Kt qu thu c:
SO SNH BNG THNG TRC V SAU KHI P DNG QoS Bng thng ca mng trc khi p dng QoS (d liu video v FTP). Trc khi p dng QoS ta truyn song song hai ng dng (FTP v video) v thu c kt qu sau:

Hnh 4.4: Kt qu trc khi p dng QoS. Trong hnh trn ta thy lu lng FTP khi cha p dng QoS ln hn so vi lu lng video (TCP_App). Ta o c lu lng ca FTP l 824 Bytes v lu lng ca video (TCP_App) l 208 Bytes.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 76

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Bng thng ca mng sau khi p dng QoS (d liu video v FTP). Sau khi p dng QoS ta cng thc hin truyn song song hai ng dng (FTP v video) v thu c kt qu sau:

Hnh 4.5: Kt qu sau khi p dng QoS. Trong hnh trn ta thy lu lng FTP sau khi p dng QoS nh hn so vi lu lng video (TCP_App). Ta o c lu lng ca FTP l 332 Bytes v lu lng ca video (TCP_App) l 250.46 KB.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 77

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

KT QU T C V HNG PHT TRIN CA TI


Kt qu t c: Sau khi trin khai cht lng dch v thnh cng chng ti t c nhng kt qa sau: - iu khin c lu lng trn mng bng vic kim sot v ch nh bng thng cho tng ng dng trn mng v c th p dng ngay m hnh ny vo thc t. - To c hi th cho mng bng cch hn ch tc nghn v u tin nhng ng dng thi gian thc i hi v tr thp v bng thng cao nh (Video, Voice ). Nhng hn ch cn gp phi v hng pht trin ca ti: - Vic cu hnh ch nh bng thng, cu hnh phn lp, nh du gi tin v p dng cc chnh sch vo Router cn phc tp v mt nhiu thi gian. - Do thit b khng h tr vic phn class v nh du gi tin t ng nn khi s lng lu lng cn phn class qu nhiu th y l mt vn t ra. - V trong tng lai khi IPv6 c s dng vo thc t th vic cu hnh trn trong nn IPv4 khng cn hu dng na. Bi IPv6 s c cc trng IP v header khc vi IPV4 c th nh th no s nguyn cu sau. gii quyt vn trn em xin a ra cc gii php: - Mun trnh c s phc tp khi cn s phn class nhiu th cn phi c mt thit b chuyn dng cho vic phn class v nh du trc khi vo Router. - V trong tng lai khi IPv6 c s dng rng ri th s khc nhau gia cc trng IP v header trong IPv6 v Ipv4 chc chn s c cch gii quyt khc.

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 78

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Ph Lc
Sau y l chi tit cu hnh trn hai Router R0 v R1. - ROUTER HN: # Gn a ch IP cho cng Fastethernet2/0 HN(config)#int Fastethernet2/0 HN(config-int)#ip address 20.0.0.1 255.0.0.0 # Gn a ch IP cho cng s1/0 HN(config)#int s1/0 HN(config-int)#ip address 192.168.16.1 255.255.255.0 HN(config-int)#clock rate 500000 HN(config)#router rip HN(config-router)#network 192.168.16.1 HN(config-router)#network 20.0.0.0 HN(config-router)#exit HN(config)#exit HN#copy running-config startup-config ROUTER TPHCM:

# Gn a ch IP cho cng Fastethernet2/0 TPHCM(config)#int Fastethernet2/0 TPHCM(config-int)#ip address 10.0.0.1 255.0.0.0 # Gn a ch IP cho cng s1/0 TPHCM(config)#int s1/0 TPHCM(config-int)#ip address 192.168.16.2 255.255.255.0 SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 79

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

TPHCM(config-int)#clock rate 500000 TPHCM(config-if)#bandwidth 500 TPHCM(config-int)#exit TPHCM(config)#router rip TPHCM(config-router)#network 192.168.16.2 TPHCM(config-router)#network 10.0.0.0 TPHCM(config-router)#exit # Cu hnh cho phn mm Netflow Analyzer hot ng. TP_HCM(config)#ip flow-export destination 20.0.0.3 9996 TP_HCM(config)#ip flow-export source serial1/0 # Version m router h tr phi trng vi phn mm netflow h tr TP_HCM(config)#ip flow-export version 5 TP_HCM(config)#ip flow-cache timeout active 1 TP_HCM(config)#ip flow-cache timeout inactive 15 TP_HCM(config)#snmp-server ifindex persist TP_HCM(config)#int f2/0 TP_HCM(config-if)#ip route-cache flow TP_HCM(config)#int s1/0 TP_HCM(config-if)#ip route-cache flow TP_HCM# copy running-config startup-config #Cu hnh access list TPHCM(config)#access-list 100 permit tcp any any eq 80 TPHCM(config)#access-list 100 permit tcp any any eq 8080 SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 80

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Gi tin no truyn qua cng 80 hoc 8080 bng giao thc TCP s tha access-list 100 (l web v http). TPHCM(config)#access-list 101 permit tcp any any eq 20 TPHCM(config)#access-list 101 permit tcp any any eq 21 Gi tin no truyn qua cng 20 hoc 21 bng giao thc TCP s tha accesslist 101 (l FTP). TP_HCM(config)#access-list 102 permit icmp any any Dng lc gi icmp # Cu hnh phn loi cc class TPHCM(config)#class-map match-any ftp-in TPHCM(config-cmap)#match access-group 101 TPHCM(config-cmap)#exit Gi no ph hp vi access-list 101 s c sp vo lp ftp-in TPHCM(config)#class-map match-any http-in TPHCM(config-cmap)#match access-group 100 TPHCM(config-cmap)#exit Gi no ph hp vi access-list 100 s c sp vo lp http-in TPHCM(config)#class-map match-all video-in TPHCM(config-cmap)#match not class-map ftp-in TPHCM(config-cmap)#match not class-map http-in TPHCM(config-cmap)#match not access-group 102 TPHCM(config-cmap)#exit Gi tin no khng thuc class ftp-in, http-in, v khng tha access-list 102 s thuc class video-in. SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 81 (khai bo tn lp ftp)

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

# Cu hnh nh du gi tin i vo # Khai bo tn chnh sch l IN TPHCM(config)#policy-map IN TPHCM(config-pmap)#class video-in TPHCM(config-pmap-cmap)#set ip dscp CS4 TPHCM(config-pmap-cmap)#exit nh du gi tin thuc class Video c gi tr dscp = CS4 TPHCM(config-pmap)#class ftp-in TPHCM(config-pmap-cmap)#set ip dscp AF31 TPHCM(config-pmap-cmap)#exit nh du gi tin thuc class Video c gi tr dscp = AF31 TPHCM(config-pmap)#class http-in TPHCM(config-pmap-cmap)#set ip dscp AF21 TPHCM(config-pmap-cmap)#exit nh du gi tin thuc class Video c gi tr dscp = AF21 # Cu hnh nh du gi tin i ra TPHCM(config)#class-map match-any video-out TPHCM(config-cmap)#match ip dscp CS4 TPHCM(config-cmap)#exit Gi tin no c gi tr dscp = CS4 s thuc vo class video-out TPHCM(config)#class-map match-any ftp-out TPHCM(config-cmap)#match ip dscp AF31 TPHCM(config-cmap)#exit SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 82

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

Gi tin no c gi tr dscp = AF31 s thuc vo class ftp-out TPHCM(config)#class-map match-any http-out TPHCM(config-cmap)#match ip dscp AF21 TPHCM(config-cmap)#exit Gi tin no c gi tr dscp = AF21 s thuc vo class http-out # Ch nh bng thng cho cc class tng ng TPHCM(config)#policy-map OUT Khai bo tn chnh sch l OUT TPHCM(config-pmap)#class video-out TPHCM(config-pmap-cmap)#priority 350 TPHCM(config-pmap-cmap)#exit Class video-out c bng thng u tin l 350kbps, d liu class ny c u tin i trc v s dng LLQ (Low-Latency Queuing). TPHCM(config-pmap)#class ftp-out TPHCM(config-pmap-cmap)#bandwidth 10 // kch hot CBWFQ //cho LLQ hoat ng

TPHCM(config-pmap-cmap)#random-detect dscp-based Class ftp-out c cp bng thng l 10kbps, nu ng truyn cn trng th d liu thuc class ny s c php vt khi ban8ng thng ch nh. TPHCM(config-pmap-cmap)#exit TPHCM(config-pmap)#class http-out TPHCM(config-pmap-cmap)#bandwidth 10 // kch hot CBWFQ

TPHCM(config-pmap-cmap)#random-detect dscp-based Class http-out c cp bng thng l 10kbps, nu ng truyn cn trng SVTH: Nguyn Nht Khnh & Nguyn Minh Hi Trang 83

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

th d liu thuc class ny s c php vt khi ban8ng thng ch nh. TPHCM(config-pmap-cmap)#exit TPHCM(config-pmap)#class class-default TPHCM(config-pmap-cmap)#fair-queue TPHCM(config-pmap-cmap)#end gi tin khng thuc cc class ch nh s a vo class-default v s dng WFQ. # Sau khi cu hnh phn class v nh du ta cn phi ch nh cc Interface vic cu hnh c tc dng. TPHCM(config)#int Fastethernet0/0 TPHCM(config-int)#service-policy intput IN TPHCM(config)#int s0/0 TPHCM(config-int)#service-policy output OUT . // kch hot WFQ

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 84

GVHD:Th.s L Mnh Hi

Qun l cht lng dch v a phng tin

TI LIU THAM KHO


1. Cisco IOS Release 12_0 Quality of Service Solutions Configuration Guide 2. Cisco Press-IP Telephony Self-Study Cisco QoS Exam Certification Guide, Second Edition (2005) 3. CCIP_QoS2.0_Knet_HiRes Cc trang web tham kho: www.cisco.com www.vnpro.org www.en.wikipedia.org

SVTH: Nguyn Nht Khnh & Nguyn Minh Hi

Trang 85