Está en la página 1de 7

[Text] Qos Dnh cho LAN !

- Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

Hc Bng S Nghip

Microsoft

Cisco

Lch khai ging

ng k hc K danh Mt m

Cu hi Ghi Nh?

Din n hc vin NetPro > Cc cng ngh mng ng dng thc tin > Voice > Quality of Service

[Text] Qos Dnh cho LAN !


ng K Lch Bi Trong Ngy

Tm Kim

Quality of Service Cht lng dch v

HC H TI NETPRO ACADEMY CHI PH = 0


iu Chnh 12-31-2008, 11:53 AM Xp Bi #1 Tham gia t: Dec 2008 Bi Gi: 2 Thanks: 0 Thanked 6 Times in 1 Post

chidd
Thnh vin mi Qos Dnh cho LAN !

Cho mi ngi ! Chng ta thng quan tm n vic lm QoS trn h thng WAN, nhng nh vy c th l cha . Gii php QoS tt nht nn c thc hin theo dng "End-to-End QoS", iu ny ngha l QoS ngay t khi gi tin xut pht t cng switch u cui. Bi vit di y hi vng s gip cc bn hiu hn v gii php End-to-End, hi vng sau bi ny anh em s b xung thm phn QoS trn WAN .v.v.v. Switch nhn bit cc gi tr DSCP, CoS thng qua vic nh x cc gi tr ny vo h thng DSCP ca ring n (hay cn gi l internal DSCP). Switch phn bit cc gi tin sau a ra cc quyt nh u da trn gi tr internal DSCP ny. y chnh l im khc bit gia QoS ca h thng Router v QoS ca h thng Switch. Ly v d, khi Router gi mt gi tin c m DSCP dng af21(18) chng hn, nhng vi Switch, n khng cn hiu gi tr af21 l g, khi vo ti Switch n lp tc a vo bng so snh DSCP-to-CoS v c kt qa l gi tr CoS l 3. Xong. Sau vi CoS l 3 ny n s c phn b vo Queue no, v c truyn ra sao, hehe, xin vui lng xem on di. 1. Classification & Marking: 1.1 Internal DSCP and Mapping Table Switch s dng gi tr internal DSCP ca n phn loi v nh du cc loi gi tin khc nhau. Chnh v vy d gi tr nhn c t ngun c set vi gi tr bt k, khi ti Switch n s t ng chuyn i gi tr ny thnh gi tr internal DSCP ca n. Mc nh Switch xy dng mt bng nh x ny ri. Tuy nhin trong mt s trng hp chng ta cn s dng ng dng c bit, do vy vic s dng bng nh x ny khng c hiu qu, mnh s cn phi thay i sao cho ph hp nht. Lnh thay i s nh sau: o thay i gi tr CoS nhn c g lnh: Switch(config)#mls qos map cos-dscp {DSCP-list} V du: Switch(config)#mls qos map cos-dscp 0 8 16 20 30 40 50 60 Vi vic nh x th ny ta s c: CoS 0 tng ng vi internal DSCP l 0 CoS 1 tng ng vi internal DSCP l 8 CoS 2 tng ng vi internal DSCP l 16 CoS 3 tng ng vi internal DSCP l 20 CoS 4 tng ng vi internal DSCP l 30 CoS 5 tng ng vi internal DSCP l 40 CoS 6 tng ng vi internal DSCP l 50 CoS 7 tng ng vi internal DSCP l 60 o thay i gi tr IP Precedence nhn c, g lnh: Switch(config)#mls qos map ip-prec-dscp {DSCP-list} V du: Switch(config)#mls qos map ip-prec-dscp 0 8 16 20 30 40 50 60 Vi vic nh x th ny ta s c: IP Precedence 0 tng ng vi internal DSCP l 0 IP Precedence 1 tng ng vi internal DSCP l 8 IP Precedence 2 tng ng vi internal DSCP l 16 IP Precedence 3 tng ng vi internal DSCP l 20 IP Precedence 4 tng ng vi internal DSCP l 30 IP Precedence 5 tng ng vi internal DSCP l 40 IP Precedence 6 tng ng vi internal DSCP l 50 IP Precedence 7 tng ng vi internal DSCP l 60 1.2 Ingress Port CoS configuration: Trn Switch chng ta c kh nng gn tnh mt gi tr CoS vo cng. Ly v d, chng ta c cu hnh nh sau: Switch(config-if)#switchport access vlan 20 <---------- Tagged frames Switch(config-if)#switchport voice vlan 150 <----------- Untagged frames

1 of 7

8/22/2011 21:30

[Text] Qos Dnh cho LAN ! - Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

Switch(config-if)#mls qos trust cos Switch(config-if)#mls qos cos 5 Vi lnh nh trn, cc gi tin thuc vlan 20 (l dng tagged frames) s c n mt gi tr CoS l tu (c l l ph thuc vo gi tr CoS m ng dng thit lp khi i vo cng ), v CoS dnh cho Vlan Voice l 5 (mls qos cos 5). Nu lnh ny khng c cu hnh th mc nh VLAN Voice s c gi tr CoS l 0. Switch(config-if)#switchport access vlan 20 <---------- Tagged frames Switch(config-if)#switchport voice vlan 150 <----------- Untagged frames Switch(config-if)#mls qos trust cos Switch(config-if)#mls qos cos 5 Switch(config-if)#mls qos cos override Vi lnh mls qos cos override di cng, th ton b cc gi tn thuc VLAN 20 s c gn ln gi tr CoS l 5. 1.3 Trust (CoS, DSCP, IP Phone, Voce, VLAN) Trong phn trc ta thy khi nim Trust. Vy Trust l g ? Trust l tin cy. Vng chnh xc l tin cy. Khi mt cng cu hnh lnh mls qos trust cos/dscp/ip precedenc th c ngha l gi tr cos/dscp/ip precedence khi i vo cng l bao nhiu s c gi nguyn, v ngay lp tc c nh x vi bng internal DSCP. Chnh v vic s dng c ch Trust nh vy s m bao c tnh ng nht v gi tr CoS/DSCP/IP Precedence trong mt QoS Domain. Lnh cu hnh cng n gin thi: o Vi CoS dng lnh: Switch(config-if)# mls qos trust cos o Vi DSCP dng lnh: Switch(config-if)#mls qos trust dscp o Vi IP Precedence dng lnh: Switch(config-if)#mls qos trust ip-precedence o Vi IP Phone dng lnh: Switch(config-if)#mls qos trust device cisco-phone 1.4 Classification based on Access List Vic s dng Access-list phn loi th n gin qu, thc ra l cc s dng MQC phn loi thi. Cch s dng s th ny: Bc 1 : To Access-List access-list 100 permit ip any any Bc 2: To mt Class-map class-map ANY match access-group 100 Bc 3: To mt Policy-map: policy-map TEST class ANY trust Bc 4: Gn vo Interface interface f0/1 service-policy input TEST C n gin nh vy thi. 1.5 Ingress DSCP Mutation mt s tnh hung m chng ta ghp gia hai domain c cu hnh QoS khc nhau li thnh mt th s xy ra trng hp, cng mt loi ng dng nhng c ghn mt gi tr internal DSCP khc nhau. Chnh v vy, Ingress DSCP Mutation ra i gii quyt vn ny. Gi s chng ta c Switch-A thuc Cty SaoBacau kt ni vi Switch-B ni vi Cty NetPro. Do k s ca hai bn cu hnh QoS trn cc Switch ny ri nn khi trunk hai switch ny li xy ra tnh trng, v d gi tin FTP ca bn Switch-A c gn gi tr internal DSCP l 14, trong khi cng l gi tin FTP nhng vi Switch-B li c gn gi tr DSCP l 20. Chnh v khng c s thng nht ny nn khi gi tin FTP Switch-A sang Switch-B m ko c s chuyn i (hay convert) no gy cho Switch-B a ra cc quyt nh sai lm. Vi Ingress DSCP Mutation khi gi tin FTP Switch-A gi sang Switch-B n s c chuyn i t internal DSCP 14 sang internal DSCP 20. Cch cu hnh s nh sau: Bc1: Switch(config)#mls qos map dscp-mutation {dscp_name} {in_dscp_list} to {out_dscp} Bc 2: Switch(config-if)#mls qos trust dscp Bc 3: Switch(config-if)#mls qos dscp-mutation {dscp_name} V d: Switch-B(config)#mls qos map dscp-mutation 11_increase_20 11 12 to 20 Switch-B(config-if)#mls qos trust dscp Switch-B(config-if)#mls qos dscp-mutation 11_increase_20 v d ny, chng ta lm php chuyn i t gi tr internal DSCP 11 v 12 ca Switch-B khi sang Switch-A s tr thnh gi tr internal DSCP l 20. 2. Policing: 2.1 Class-map and Policy Map Thc ra ci ny ch vic thm vo mt lnh trong Policy-map nh sau: Switch(config-policy)#police {rate} {burst-size} exceed-action {drop|mark-down} V d: Switch(config-policy)#police 10000 8000 exceed-action drop v d ny, ta s hn ch port mc l 10Mbps thi. Ngoi ra gi tr burst-size m bo cho Switch lc no cng c token trong bucket cho qu trnh truyn. Gi tr Burst-size ny c tnh bng cng thc: Burst-size=2*RTT*(Rate) (tron RTT l Round Trip Time, gi tr mc nh l 100ms) 2.2 Ingress and Egress Policing: Tiu l c Ingress v Egress Policing nhng trn thc t ch s dng gi tr Ingress Policing thi. Phn ny cng khng quan trong lm. 2.3 Individual and Aggregate Policing Ta c th to ra cc policy ring cho tng class hoc c th s dng ng thi mt police cho nhiu clas khc nhau. Vi individual policing: ta cu hnh mt lnh police trong policy map Vi Aggregate Policing, ta cu hnh nh sau: Bc 1: Switch(config)#mls qos aggreage-policer{policer-name}{Rate} {Burst} exceed-action {transmit|drop|policed-dscp-transmit} Bc 2:Vo trong Policy-map: Switch(config-policy)#class CLASS-1 Switch(config-policy-class)#police aggregate {policer-name} Switch(config-policy)#class CLASS-2 Switch(config-policy-class)#police aggregate {policer-name} Switch(config-policy)#class CLASS-3 Switch(config-policy-class)#police aggregate {policer-name} Bc 3: Gn vo Interface Switch(config-if)# service-policy input TEST Tuy nhin trong mc ny ta cn phi nh phn Policed-dscp-transmit, hay cn gi l mark-down. Mark-down c ngha l ta s chuyn i gi tr DSCP ca class thnh mt gi tr khc. Trong Switch c bng nh x cc ga tr ny ri, tuy nhin chng ta c th thay i gi tr bng cch sa i cc gi tr mc nh nh sau: Switch(config)#mls qos map policed-dscp {dscp-list} to {mark-down-dscp}

2 of 7

8/22/2011 21:30

[Text] Qos Dnh cho LAN ! - Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

2.4 Port-Based, VLAN-based, Per-port Per-Vlan Policing: Phn ny mnh s ch a ra mt v d v cc cu hnh thi: Bc 1: Kch hot tnh nng QoS trn Switch Switch(config)#mls qos Bc 2: cu hnh Access-list: Switch(config)#access-list 100 permit host A host B Bc 3: Cu hnh class-map Switch(config)#class-map match-any VLAN Switch(config-cl-map)#match access-group 100 Switch(config-cl-map)#match ip precedence 5 Switch(config-cl-map)#match ip dscp 35 Bc 4 (Option): Cu hnh Nested class-map Switch(config)#class-map match-all VLAN_LIST Switch(config-cl-map)#match vlan 2 50-60 Switch(config-cl-map)#match class-map VLAN Bc 5: To mt policy-map Swtich(config)#policy-map POLICY Swtich(config-policy)#class VLAN_LIST Swtich(config-policy-class)#set ip dscp 22 Bc 6: Gn vo Interface Switch(config-if)#service-policy input POLICY 3. Congestion Management & Congestion Avoidance: 3.1 Congestion Management: 3.1.1 DSCP-to-CoS Mapping Nh mnh ni phn trc, Switch s dng gi tr internal DSCP ca chnh n phn loi gia cc loi gi tin khc nhau. Tuy nhin, ngay t khi vo ti Switch n b phn loi v nh du ri sau b Police ri nn rt nhiu kh nng gi tin u vo c nhiu thay i. Chnh v vy, trc khi c chuyn ti Transmit Queue th gi tin ny phi c cp nht nhng thay i . V cp nht nhng thay i ny chnh l vai tr cu DSCP-to-CoS mapping. y chnh l mt bng nh x gia internal DSCP ra gi tr CoS trc khi chuyn ti node tip theo. V mc nh Switch c sn bng ny ri, tuy nhin, khi c yu cu chng ta hon ton c th thay i sao cho ph hp nht vi gi tr mong mun. cu hnh, chng ta s dng lnh sau: SW(config)#mls qos map dscp-cos {dscp-list} to {CoS} VD:SW(config)# mls qos map dscp-cos 30 31 32 33 to 2 v d ny, ta nh x cc gi tr internal DSCP 30 31 32 33 ra gi tr CoS l 2 gi vo Transmit Queue 3.1.2 CoS-to-Transmit Queue Mapping: th sau khi cp nht c cc thay i t internal DSCP ra CoS th gi tr ny c a vo Transmit Queue. Mnh cng phi nhc thm v ci Transmit queue ny l ci g ch? Transmit Queue chnh l Queue cho cc gi tin trc khi n c truyn ra khi Switch. Transmit queue ny chia ra thnh 4 loi Queue khc nhau l : Queue 1, Queue 2, Queue 3, v Queue 4. (Vi dng Switch 3550 th Queue 4 chnh l Queue u tin, cn vi dng Sw 3560 th Queue 1 mi chnh l Queue u tin). V mt c im ch na l cc Queue ny ch hiu c gi tr CoS thi, chnh v vy nn ta mi c mt bc l phi s dng c ch nh x t internal DSCP ra CoS. Ta c th tm lc cc bc nh sau (tnh t lc gi tin vo ti switch cho ti lc gi tin ra khi Switch) Bc 1: Switch nhn c 1 gi tn vo Bc 2: Da vo thng tin cu hnh, Switch phn loi gi tin ny thuc vo gi tr internal DSCP no Bc 3: Tip theo, Switch tip tc cp nht nhng thay i, ri sau a ra gi tr cui cng. Gi tr ny chnh l gi tr CoS sau khi s dng c ch chuyn i t internal DSCP thnh CoS Bc 4: T gi tr CoS ny, gi tin c a vo mt trong 4 Queue da trn bng nh x gi tr CoS-to-Transmit Queue. (ngoi ra c th km theo mt s c ch chng nghn na) Bc 5: Bc cui cng chnh l truyn gi tin ny ra khi cc Queue thng qua Strict-Priority Queuing hoc WRR (vi Switch 3550) hoc SRR (vi Switch 3560) cu hnh phan loi tng gi tr CoS tng ng vi tng Queue ta c th cu hnh nh sau: Switch(config)#wrr-queue cos-map {queue-id} {cos0 cos1 ... cos7} Switch(config)#wrr-queue cos-map 1 0 1 2 3 Switch(config)#wrr-queue cos-map 2 4 Switch(config)#wrr-queue cos-map 3 5 6 Switch(config)#wrr-queue cos-map 4 7 Gii thch: Trn y chnh l cc cu hnh dnh cho dng Switch 3550, cu hnh ny chng ta nh x gi tr 0 1 2 3 vo Queue 1, gi tr 4 vo Queue 2, gi tr 5 6 vo Queue 3, gi tr 7 vo Queue 4. Di y l cch cu hnh cho dng Switch 3560: Switch(config)#mls qos srr-queue output cos-map {queue-id} {cos0 cos1 .. cos 7} Switch(config)#mls qos srr-queue output cos-map 1 0 2 3 Switch(config)#mls qos srr-queue output cos-map 2 1 4 Switch(config)#mls qos srr-queue output cos-map 3 5 Switch(config)#mls qos srr-queue output cos-map 4 6 7 Gii thch: y chng ta cu hnh nh x gi tr Cos 0 2 3 vo Queue 1, gi tr Cos 1 4 vo Queue 2, gi tr Cos 5 vo Queue 3 v gi tr Cos 6 7 vo Queue 4 Ch : Ring vi dng Switch 3560, chng ta phi ch phn cu hnh nh x ny v n cn c kh nng to c input v output queue. Mnh s phn tch k hn. 3.1.3 Strict-Priority Scheduling: Nh phn tch phn trc, dng Switch 3550 ngi ta thng dng Queue 4 cho Strict-Priority cn dng Switch 3560 th ngi ta s dng Queue 1 cho Strict-Priority. y, coi nh mi ngi bit c Strict-Priority l g ri, nn mnh khng phn tch su. c im ny (theo mnh) cng l mt ci hay nhng cng chnh l mt ci gi v c c im ging ht nh Priority Queuing ca Router. iu ny c ngha l Swith lun u tin cc gi tin thuc Queue 4 (Vi Switch 3550) trc khi u tin cc gi tin thuc Queue 1, 2 v 3. iu ny s dn ti mt vn l nu lc no Queue 4 cng c gi tin th sao ? Cu tr li chnh l: Queue 4 s chim ht bng thng ca cng v cc gi tin thuc queue 1, 2 v 3 s b drop. khng hay t no. Nh vy, thng thng ngi ta t s dng, v nu c s dng th nn dng cho Voice. Hoc mi hn, ngi ta c th kt hp vi c ch trnh nghn hn ch vic chim ht bng thng trn cng ny. cu hnh c im ny, chng ta phi vo cng no cn v nh lnh ny: Switch(config-if)#priority-queue out 3.1.4 Weighted Round Robin Scheduling(wrr-queue): y chnh l c im qun l nghn ca dng switch 3550 hay ni cch khc, mc nh Switch 3550 s dng WRR qun l nghn. c ch WRR ny ngi ta thit lp cc thng s Weight mc nh tng ng vi tng Transmit Queue. Tuy nhin, chng ta hon ton c th thay i cc tham s Weight ny m bo c nhng yu cu c bit. Vy lm sao tnh c cc tham s Weight ny? n gin thi, ta c cng

3 of 7

8/22/2011 21:30

[Text] Qos Dnh cho LAN ! - Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

thc: n=(W/S)xB W: l gi tr Weight ca tng Queue S: l tng gi tr ca 4 Queue B: Bng thng ca interface n: Bng thng dnh cho Queue. Ly v d nh sau: Trn cng Gigabit Ethernet c cc tham s Weight cho cc Queue 1 , 2 , 3, 4 nh sau: 50 50 100 200. Chng ta s da vo cng thc tnh c chnh xc bandwidth cho mi queue nh sau: Bandwidth ca Queue 1: n = (50/400)*1000 = 125Mbps Bandwidth ca Queue 2: n = (50/400)*1000 = 125 Mbps Bandwidth ca Queue 3: n = (100/400)*1000 = 250 Mbps Bandwidth cuar Queue 4: n = (200/400)*1000 = 500 Mbps Nh vy ta s c nhng gi tin no thuc Queue 1 s c 125Mbps bng thng truyn, nhng gi tin no thuc Queue 2 s c 125 Mbps bng thng truyn, nhng gi tin no thuc Queue 3 s c 250Mpbs bng thng truyn , v nhng gi tin no thuc Queue 4 s c 500 Mbps truyn. Vi vic phn ra thnh cc gi tr Weight nh vy s m bo c Queue 4 khng chim ht ton b bng thng ca cng. Vy lnh cu hnh cc gi tr Weight ny s nh sau: Switch(config)#wrr-queue bandwidth {weight 1} {weight 2} {weight 3} {weight 4} Cc gi tr ny s tng ng vi tng Queue. VD: Switch (config)#wrr-queue bandwidth 10 20 30 40 y l lnh cu hnh Weight trn cng FastEthernet. Vi Queue 1 chim 10 Mbps, Queue 2 chim 20 Mbps, Queue 3 chim 30 Mbps, v Queue 4 chim 40 Mbps. 3.1.5 Shared/Shaped Round Robin Scheduling (srr-queue) Switch 3550 v Switch 3560 u c c ch chng nghn cho d liu vo v d liu ra bng cch s dng Queue v c phn loi nh sau: Ingress Queue (dnh cho d liu vo) Egress Queue (dnh cho d liu ra) Vi Egress Queue th c hai loi Switch 3550 v 3560 u h tr 4 Queue, nhng vi Ingress Queue th dng 3550 ch h tr 01 Queue v s dng c ch FIFO cho Queue ny, trong khi dng Switch 3560 li s dng 02 Queue vi c ch l Shared. Mt trong hai Queue ca Ingress c th cu hnh l priority queue. im khc bit gia dng Switch 3550 v Switch 3560 chnh l c ch ny. Vi Switch 3560 th Ingress Queue v Egress Queue u c x l bi SRR (Shared Round Robin) iu khin t l s gi c gi. Khi thc hin Ingress Queue, SRR s dng c ch Sharing xc nh bng thng cho gi ph thuc vo gi tr Weight cu hnh. Ci ny tng i ging vi CBWFQ. gn gi tr vo tng Ingress Queue chng ta s dng lnh nh sau: cu hnh t l chia ingress buffer thnh 02 queue ta s dng lnh SW3560(config)#mls qos srr-queue input buffer {percentage1} {percentage2} V d: Switch 3560(config)#mls qos srr-queue input buffer 30 70 v d ny, Switch s dnh ra 30% buffer cho Ingress Queue 1 trc khi n drop gi tin, trong khi n s dnh ti 70% buffer cho Ingress Queue 2. Sau khi ch ra c hn mc buffer cho tng queue, chng ta cn phi quan tm ti bao nhiu bng thng cho tng Queue: SW3560(config)#mls qos srr-queue input bandwidth {weight1} {weight2} V d: Switch3560(config)#mls qos srr-queue input bandwidth 4 4 v d ny, chng ta cu hnh m bo cho tng queue s c 40% bng thng cho vic tip nhn v truyn. Vi s lng bng thng cu hnh, chng ta cn quan tm ti t l m ti ngng Switch s t ng Drop cc gi tin. y chnh l khi nim Weight Tai Drop. SW3560(config)#mls qos srr-queue input threshold {threshold-id1} {threshold-percentage1} {threshold-id2} {threshold-percentage2} V d: Switch3560(config)#mls qos srr-queue input threshold 1 60 2 70 v d ny, gi tin thuc vo ngng th nht s bt u Drop khi Ingress Queue t ti 60% trong khi , khi gi tin thuc vo ngng th hai th phi 70% Queue th n mi bt u b drop. Xem tip phn di c ci nhn r hn v khi nim Drop ny. V cui cng chnh l nh x cc gi tr internal DSCP/CoS vo tng Queue SW3560(config)#mls qos srr-queue input dscp-map queue {queue-id} threshold {threshold-id} {dscp-list} SW3560(config)#mls qos srr-queue input cos-map queue {queue-id} threshold {threshold-id} {dscp-list} V du: SW3560(config)#mls qos srr-queue input dscp-map queue 1 threshold 1 22 23 24 SW3560(config)#mls qos srr-queue input dscp-map queue 1 threshold 2 25 26 27 v d ny chng ta gn 6 gi tr internal DSCP vo Ingress Queue 1, trong gi tr internal DSCP 22 23 24 s thuc threshold l 1 (tng ng vi 60% Queue l bt u drop) v gi tr internal DSCP 25 26 27 s thuc threshold 2 (tng ng vi 70% Queue mi bt u drop) V Egress Queue, ci ny tng i ging vi Transmit Queue Switch 3550. l u c 04 Queue (vi Queue 1 thng l priority) u da trn gi tr CoS a vo tng Queue Ngoi ra dng Switch 3560 cn h tr thm mt c ch kh c bit na l Shape mode. iu ny c ngha l Egress Queue, Switch 3560 c th chy ng thi c 02 SRR mode l Shared/Shape. Cch cu hnh cng tng t nh Ingress Queue: Bc 1: SW3560(config)#mls qos srr-queue output dscp-map queue {queue-id} threshold {threshold-id} {dscp-list} Bc 2: Vo Interface cu hnh Shape hoc Share, hoc Limit Switch3560(config-if)#srr-queue bandwidth (shape|share|limit) Cc im cn lu : - Mt im cn lu l khi cu hnh bandwidth dng Share mode, th gi tr ny s override gi tr Shape mode - Switch 3560 c 02 queue-set, mc nh Queue-Set l 1, ci ny tng ng vi ton b Interface trn Switch. Nu mun thay i mt interface no ra Queue-set 2 th ta phi vo interface ri gn gi tr queue-set l 2. Cn mun thay i gi tr Queue-set th ta phi ra ngoi mode config cu hnh VD: Switch3560(config)# int f0/1 Switch3560(config-if)# queue-set 2 Switch3560(config)#mls qos srr-quere output buffer { percentage1} {percentage2} Switch3560(config)#mls qos srr-quere output threshold { threshold-id1} {percentage1} {threshold-id2} {percentage2} 3.2 Congestion Avoidance: V c ch chng nghn, Switch 3550 chia ra lm hai phng n chng nghn cho tng loi cng khc nhau. Vi cng Gigabit Ethernet, Switch 3550 s dng 03 c ch chng nghn nh sau:

4 of 7

8/22/2011 21:30

[Text] Qos Dnh cho LAN ! - Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

Tail-Drop Threshold WRED Drop Threshold Transmit Queue Manipulation Trong khi vi cng FastEthernet, Switch 3550 ch s dng 01 c ch chng nghn l: Minimum Reserve Level Ta s i vo phn tch tng c ch chng nghn 3.2.1 Tail-Drop Threshold: Vi c ch chng nghn dng Tail-Drop, ngi ta s dng 02 ngng (hay cn gi l hn mc) l Threshold_1 v Threshold_2. Th tng tng xem, chng ta phn loi v a vo Transmit Queue 02 loi gi tin l Voice v FTP. C hai loi gi tin ny u c s dng mc u tin nh nhau, iu ny c th hiu l nu hai gi tin ny sau khi c phn loi v nh du s c a vo Queue 4. Tuy nhin gia 02 loi gi tin ny chng ta thy rng, gi tin Voice l dng Real-Time cn gi tin ca FTP l dng thng thng, vy d sao th cng phi m bo gi tin ca Voice c thng sut hn trnh jitter. Khi ngi ta s ngh n vic phi s dng Threshold, chng ta s nh ngha FTP s c Threshold_1 l 30%, trong khi Voice s c Threshold_2 l 100%. iu ny c ngha l, khi nghn bt u xy ra vi Queue 4 th c ln ti 30% dung lng ca Queue gi tin FTP s b drop, trong khi khi dung lng ca Queue 4 ln ti 100% th gi tin ca Voice mi bt u b drop. v d trn gip chng ta hiu c rng ti sao li cn ti 02 Threshold. Nu bn l ngi t m, bn c th t cu hi l ti sao khng sinh ra nhiu Threshold vo ? Oh, hay lm, nu bn hiu tht k bn s bit c ti sao ch cn c 02 threshold. cu hnh threshold, trn Switch chng ta s cu hnh nh sau: Bc 1: Switch(config)#wrr-queue threshold {queue-id} {threshold_percentage1} {threshold_percentage2} Bc 2: Switch(config-if)#wrr-queue dscp-map {threshold-id} {dscp1 .. dscp8} V d: Switch(config)#wrr-queue threshold 4 30 70 Switch(config-if)#wrr-queue dscp-map 1 40 41 42 43 Switch(config-if)#wrr-queue dscp-map 2 50 51 52 53 v d trn ta thy rng, Queue 4 s t ra 2 hng mc drop gi tn. Hng mc th nht l khi gi tin chim 30% ca Queue 4, n s bt u drop. Hng mc th 2 xy ra khi gi tin chim 70% ca Queue 4, th gi tn loi s b drop. y ta thy rng, trong Queue 4 c nhng gi tin nh c nh s internal DSCP nh sau : 40 41 42 43 50 51 52 53. Trong khi m dung lng ca Queue 4 ln 30% th cc gi tin c m 40 41 42 43 s bt u b drop, trong khi phi ln ti 70% ca Queue 4 th gi tin c m 50 51 52 53 mi b drop. Nu ch ra, bn c th t cu hi l ti sao vo Queue ri li cn gi tr internal DSCP na, phn trc chng ta ni rng Queue ch hiu c CoS thi m. Thc ra ci ny th chnh mnh cng khng hu r lm, nhng vi mnh l chnh m Cisco s dng internal DSCP y tng thm tnh linh hot khi la trn gi tr Drop, v nu ch da vo CoS th n qu n gin( c 8 CoS thi m). 3.2.2 WRED Drop threshold: Nu l ngi phn tch su v c kinh nghim v QoS th bn nhn thy rng vic s dng Tail-Drop s nh hng rt nhiu ti qu trnh truyn gi tin. Vi Tail-drop khi gi tin n ng ngng c cu hnh, tail-drop s ng lot drop ngay lp tc gi tin m bo n khng vt qua ngng c cu hnh. Vi c ch UDP th khng sao, nhng vi TCP th l mt vn . Khi gi tin b drop th v nguyn tc TCP s phi gi li, nu s lng t th khng sao, nhng khi s lng gi tin b drop ln cao th s nh hng rt nhiu ti s lng gi tin c gi i, v khi TCP s phi gim chm li t l truyn. gii quyt cc vn lin quan ti tail-drop ngi ta s dng c ch WRED to mt ngng khc. Ngng ny c gi tr nh khng lm trn queue. Khi s lng gi tin trong Queue t ti mc ny, n s c RANDOM drop. Qu trnh random drop ny s tng dn ti khi y queue (y queue th tt nhin l tail-drop ri). Vic drop ngu nhin ny s gim thiu qu trnh retransmission ca TCP/IP nh vy s m bo c s lng gi tin c gi i c nhiu hn. Tt nhin, nu l ngi qun tr mng, bn s c nhng la chn ph hp khi no th nn dng Tail-Drop threshold v khi no th nn dng WRED Drop threshold. Cch cu hnh WRED drop threshold cng tng i ging tail-drop Bc 1: Switch(config)#wrr-queue random-detect max-threshold {queue-id} {threshold_percentage1} {threshold_percentage2} Bc 2: Switch(config-if)#wrr-queue dscp-map {threshold-id} {dscp1...dscp8} V d: Switch(config)#wrr-queue random-detect max-threshold 3 50 100 Switch(config-if)#wrr-queue dscp-map 1 31 33 35 Switch(config-if)#wrr-queue dscp-map 2 32 34 36 Phn tch: y chng ta khai bo 50% l ngng bt u RANDOM drop cho Queue 3 v 100% l ngng_2 bt u RANDOM drop cho Queue 3. Vi cc gi tin c gi tr internal DSCP 31 33 35 s bt u RANDOM drop khi chim 50% dung lng ca Queue 3 v cc gi tin c gi tr internal DSCP 32 34 36 s RANDOM drop khi dung lng ca Queue 3 ln 100%. 3.2.3 Transmit Queue Size: Mc nh cc Switch 3550 s chia u dung lng cho tng Queue, iu ny c ngha l mi Queue s chim 25%, 4 Queue l 100%. V mt gi tr mc nh khc na l tng s gi tin trong 4 queue ti mt thi im ti a l 4096 packets, tng ng vi 1024 gi tin trn tng Queue. Tuy nhin, mt s hon cnh s lng gi tin u nhau trong tng Queue l khng cn thit, v d nh dung lng ca Queue dnh cho Voice th ko cn nhiu, trong khi dung lng ca Queue dnh cho FTP th li cn nhiu. Chnh v vy, ngi ta phi s dng c ch thm/bt iu chnh dung lng ca tng Queue sao cho ph hp nht. V tm ra gi tr cho tng Queue ngi ta s dng cng thc: n=(W/S)*Q W: biu din gi tr Weight ca WRR S: tng gi tr Weight ca Queue Q: Tng gi tr ca ton b cc Queue n: Kch c ca tng Queue Nh vy, nu ta khai bo gi tr Weight ca tng Queue ln lt nh sau: 10 20 30 40. Th ta s c kch c ca tng queue nh sau: S packet trong Queue 1 s l: 10/100*4096 = 410 gi tin S packet trong Queue 2 s l: 20/100*4096 = 820 gi tin S packet trong Queue 3 s l: 30/100*4096 =1228 gi tin S packet trong Queue 4 s l: 40/100*4096 = 1638 gi tin. Cch cu hnh cho Queue Size s nh sau: Switch(config-if)#wrr-queue queue-limit weight1 weight2 weight3 weight4 VD: Switch(config-if)#wrr-queue queue-limit 10 20 30 40 3.2.4 Minimum Bufer Size ( hay Minimum Reserve Level) ca cng FastEthernet: C ch chng nghn ca cng FastEthernet kh n gin ch dng mc l thit lp c ch ti thiu cho tng Buffer trn cng. Tuy nhin tng cng thm kh nng linh hot khi thit lp Buffer trn tng cng FastEthernet ngi ta chia thnh tng 8 mc Buffer khc nhau (trong khi ta ch co 4 Queue). iu ny c ngha l trn cng f0/1 ta c th thit lp Queue 1 tng ng vi Buffer mc 3, tuy nhin trn cng f0/2 ta li thit lp cho Queue 1 tng ng vi Buffer mc 5. y chnh l cch tng ln kh nng linh hot khi iu chnh cc mc khc nhau cho tng cng tng ng vi 4 queues. cu hnh c ch chng nghn ny cho cng FastEthernet chng ta lm nh sau: Bc 1: Switch(config)#mls qos min-reserve {min-reserve-level} {buffer-size}

5 of 7

8/22/2011 21:30

[Text] Qos Dnh cho LAN ! - Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

Bc 2: Switch (config-if)#wrr-queue min-reserve {queue-id} {min-reserve-level} V du: Switch(config)#mls qos min-reserve 1 170 Switch(config)#mls qos min-reserve 2 20 Switch(config)#mls qos min-reserve 3 30 Switch(config)#mls qos min-reserve 4 60 Switch(config)#mls qos min-reserve 5 100 Switch(config)#mls qos min-reserve 6 110 Switch(config)#mls qos min-reserve 7 120 Switch(config)#mls qos min-reserve 8 70 interface f0/1 wrr-queue min-reserve 1 3 wrr-queue min-reserve 2 5 wrr-queue min-reserve 3 7 wrr-queue min-reserve 4 8 interface f0/2 wrr-queue min-reserve 1 4 wrr-queue min-reserve 2 2 wrr-queue min-reserve 3 1 wrr-queue min-reserve 4 6 Gii thch: y chng ta thit lp mc buffer ti thiu cho cng fastethernet nh sau, Mc 1 buffer c 170 gi (packet), mc 2 buffer c 20 gi, mc 3 buffer c 30 gi, mc 4 buffer c 60 gi, mc 5 buffer c 100 gi, mc 6 buffer c 110 gi, mc 7 buffer c 120 gi, mc 8 buffer c 70 gi. Sau khi chng ta thit lp c cc mc nh vy, vi tng interface ta s gn cc mc khc nhau. Interface f0/1, Queue 1 tng ng vi mc buffer l 3, tc l Queue 1 c th buffer c 30 gi tin, tuy nhin trong interface f0/2, Queue1 tng ng vi mc buffer l 4, c ngha l Queue 1 ch c th buffer c 60 gi tin.

<Bi ny mnh t vit li lc lc c xong quyn Catalyst QoS in Campus Network>. Vit t lu lm ri, khng bit lc mnh hiu c ng khng na, anh em cng ng gp v sa nhng li sai nh. Chc vui Chidd

The Following 6 Users Say Thank You to chidd For This Useful Post: ChuNhoc90 (12-31-2008), ducnq (12-31-2008), ductoan63 (01-04-2009), longnguyen2512 (04-20-2010), SanhVV (12-31-2008), tu0ng_c0ng (12-31-2008)
12-31-2008, 01:09 PM #2 Tham gia t: Dec 2008 Bi Gi: 15 Thanks: 8 Thanked 2 Times in 2 Posts

ChuNhoc90
Thnh vin mi Newbie

Bi ny rt hay , cc k b ch cho ai trin khai nhng h thng voice hoc video trn nn switch v router ca Cisco. Tks bc!

12-31-2008, 08:37 PM

#3 Tham gia t: Dec 2008 Bi Gi: 107 Thanks: 19 Thanked 15 Times in 12 Posts

v1st@z3r
Thnh vin thng xuyn Gi lng

Hic, bi vit di m trnh by km qu ngi hng mun xem lun __________________ Software is like s3x, it's better when it's free! - But sometimes, I say no with s3x

04-20-2010, 11:13 PM

#4 Tham gia t: Sep 2009 Bi Gi: 99 Thanks: 45 Thanked 9 Times in 7 Posts

longnguyen2512
Thnh vin mi Member

c bi qos voice trn layer 3 khng?

Ti Trc | Ti K

ang c: 1 (0 thnh vin v 1 khch)

6 of 7

8/22/2011 21:30

[Text] Qos Dnh cho LAN ! - Din n hc vin NetPro

http://forum.netpro.com.vn/showthread.php?t=382

Quyn Hn Ca Bn You You You You may may may may not not not not post new threads post replies post attachments edit your posts

BB code is M Smilies ang M [IMG] ang M HTML ang Tt Forum Rules Chuyn n

Mi gi GMT +7. Hin ti l 09:28 PM. Lin Lc - NETPRO - Lu Tr - Tr Ln Trn Powered by: vBulletin v3.8.5 Copyright 2000-2011, Jelsoft Enterprises Ltd.

7 of 7

8/22/2011 21:30