Está en la página 1de 9

Bi ging QoS CCNP Switching

I. NHU CU V QOS V CC M HNH QOS:


1.1. Nhu cu v QoS:
Theo truyn thng, khi nhu cu v bng thng tng ln, hin tng nghn mng c th x y ra. Ta c th gii quyt bng cch tng bng thng kt ni hoc dng thit b phn cng khc thay th. Nhc im cch ny l khng ch ra cch thc u tin mt loi traffic ny so vi mt traffic khc. QoS l mt cng c tng th c dng bo v, u tin mt s traffic quan trng hoc cc traffic i hi x l nhanh v thi gian. QoS s m t cch thc packet c chuyn mch (forward) nh th no. Cc ng dng khc nhau s c cc nhu cu khc nhau cho vic truyn d liu. V d web, video, audio Khi mt packets i t host ny n host kia, mt gi tin (packet) c th gp cc vn : Delay: do routers x l tm kim trong bng routing table, thi gian packet truyn trn ng truyn. Jitter: cc packets khng n ng nh thi gian d nh. Cc d liu dng audio s b nh hng nhiu bi vn ny. Loss: mt packets

1.2. Cc m hnh QoS:


BEST-EFFORT DELIVERY:
Mt network ch n thun forward nhng packets m n nhn c. Switch v routers ch c gng ht sc (best-effort) forward packets i m khng bn tm n kiu ca traffic hay u tin ca dch v.

INTEGRATED SERVICE MODEL


Sp xp ng i trc t ngun n ch cho cc d liu c u tin. RSVP (RFC 1633) l mt protocol dng ny. RSVP s yu cu trc bng thng v gi (reserve) bw trn c ng i t ngun n ch. 1

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org

Bi ging QoS CCNP Switching Mi thit b mng trn ng i phi kim tra xem n c th h tr cho yu cu trn hay khng. Khi yu cu ti thiu c p ng, ng dng ngun s c thng bo xc nhn. Sau , ng dng c th s dng ng truyn.

DIFFERENTIATED SERVICES MODEL


Gii php IntServ t ra khng hiu qu v khng c kh nng m rng khi nhiu source phi cnh tranh vi nhau v bng thng. Trong gii php differentiated, mi routers v switch s qun l packets ring l. Mi routers s c mt chnh sch ring qun l v s t quyt nh cch thc chuyn packet theo cch ring. IntServ s qun l theo kiu per-flow, trong khi Difserv s qun l theo kiu perhop. Diffserv s quyt nh chnh sch QoS da vo cu trc ca gi IP. Course switching s tp trung vo Diffserv.

II. DIFFSERV QOS


Mi router v switch s kim tra packets quyt nh s fw packet nh th no. i vi packets, n ch n thun gn vi thng s vo header. Cc thng s c th l phn loi (classifications, marking)Packet s gi s routers v switch bit cch handle n. Vic phn loi c th din ra Layer-2 hoc Layer-3 Layer2: Thng thng, mt layer frame s khng c trng( field ) no phn loi frame. Tuy nhin, khi frame c truyn gia switch v switch, frame c th c phn loi da vo CoS. CoS: c dng trn ng trunk switch-switch. Hai kiu trunking s qun l gi tr CoS ny rt khc nhau: ISL: 4 bit user-id s c dng ch ra gi tr CoS ca frame. Dot1q: user-field s c dng ch ra gi tr CoS. Cc frame t native vlan s nhn gi tr CoS mc nh. Layer3: DSCP.

2.1. Class of services:


Trn ng trunking, frame c thm vo tagging. Dot1q: mi frame c thm vo 12-bit vlan-id v mt field gm 3 bit ch ra u tin. Nhng frame n t native-vlan s c cu hnh gi tr mc nh. ISL: c 4 bit trong user-field. Dng 3 bit thp nht gn priority. 2

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org

Bi ging QoS CCNP Switching

2.2. Layer 3 DSCP:


Dng Tos trong ip datagram Gi tr DSCP c cng v tr trong header ging nh TOS nhng s c din dch khc. Xem thm bng chuyn i trong gio trnh.

III. TH T CC TC V QOS C THC HIN:

3.1 Ingress queue:


Phn ln switch c hai dng queue: standard v priority queue Nhng packets vi u tin = 5 s c phc v trc Course bcmsn ko kho st k phn ny. 3

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org

Bi ging QoS CCNP Switching

3.2. Phn loi, trust v marking:


Qu trnh phn loi packets c th da trn tcp/udp hoc cc c ch phc tp khc. Frame c th mang nhiu gi tr CoS, ToS, DSCPSwitch s quyt nh l s dng (tin) trust gi tr no. C th cu hnh switch nh du hoc thay i cc gi tr QoS ny.

3.3. Policers:
Vic gii hn bng thng thc hin bi policers Sau khi packet c phn loi, ta c th cu hnh switch gii hn traffic.

3.4. Scheduling:
Scheduling cn c gi l egress queueing hoc congestion management Packets c gn vo egress queue da theo gi tr CoS: gi tr 0-3 gn vo standard, 4-7 gn vo second standard queue Catalyst dng k thut gi l WRR. Kch thc ca mi queue c cu hnh theo t l. Mi queue c gn mt trng s. Priority queue s lun c phc v trc v khng b xp vo hng i ny.

3.5. Congestion Avoidance:


Nu vic nghn vn xy ra mc d xp hng i, packets phi b drop. Mt switch phi d on vic congestion bng hai cch: TAIL-DROP WRED

3.5.1. Tail-drop:
Nhng packets n sau trong hng i s b drop Gy ra hin tng tcp global synchronization (xem thm trong sch)

3.5.2. WRED:
ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org 4

Bi ging QoS CCNP Switching - WRED s drop mt s packet c trong hng i Cc packets s b drop n mt gii hn no .

IV. CU HNH DIFFSERV:


Phn ny tp trung vo cu hnh trong Catalyst switch. Catalyst 3550 c rt nhiu tnh nng QoS mnh. cho php cu hnh QoS trn switch, dng l nh: Switch(config)# mls qos

Trong hnh v trn, gi tr DSCP s c dng khi packet c di chuyn trong switch nh sau: 1. Packet c gn mt gi tr DSCP. Gi tr ny c tnh t inbound switch port. 2. Khi packet c switch bn trong, mi gi tr DSCP c th c thay i hoc hnh ng tng ng. ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org 5

Bi ging QoS CCNP Switching 3. Khi packet c xp hng i, gi tr DSCP s c chuyn sang CoS. Gi tr CoS ny c th c dng xc nh hng i hay scheduling. Theo phn trc, Catalyst switch s tham kho cc i lng: CoS v DSCP. Compute CoS From Internal DSCP Trust CoS: Trust IP Precedence: Trust DSCP: mls qos map dscp-cos ... mls qos map cos-dscp ... mls qos map ip-prec-dscp ... mls qos trust dscp ... mls qos map dscp-mutation ...

IV.1. Cu hnh QoS Trust:


Khi mt packet i v o mt switch, switch s chn la thng s m n s tin cy (trust). Sau , packet s c x l tng ng trn thng s c tin cy ny. Switch(config-if)# mls qos trust {cos,dscp,ip precedence} Nu gi tr CoS c dng, n phi chuyn sang DSCP tng ng theo bng: Cos DSCP 0 0 1 8 2 16 3 24 4 32 5 40 6 48 7 56

Cc gi tr IP Precedence s c chuyn sang DSCP: Ip 0 Precedence DSCP 0 1 8 2 16 3 24 4 32 5 40 6 48 7 56

IV.2. nh ngha Policy


Policy c nh ngha v dng trong cc bc sau: 1. Mt hoc nhiu class c dng phn loi traffic. 2. Mt hoc nhiu policy c nh ngha, tham kho n mt hoc nhiu class. Mi policy c th cha cc hnh ng nh nh du (mark), police hoc nh dng (shape) traffic cho tng class. 3. Mi egress queue c th c gn mt policy trong mi chiu traffic. V d mt policy c th gn cho chiu inbound, trong khng mt policy khc c th gn cho chiu outbound. Khi c gn, policy bt u phn loi v x l cc traffic i qua switch.

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org

Bi ging QoS CCNP Switching Switch (config)# class-map class-name [match all | match any] Vic phn loi traffic c th da vo access-list, NBAR. Vi access-list: Switch(config-cmap)# match access-group name access-list Vi NBAR: Switch(config-cmap)# match protocol [protocol name] Bc k tip, nh ngha QoS policy switch(config)# policy-map policy-name Ch ra class trong policy Switch(config-pmap)# class class-name Sau , ta c th set cc dscp value hoc ip precedence Switch(config-pmap)# set dscp dscp-value Sau cng, p dng QoS vo mt interface, ti a mt cho inbound, mt cho outbound. Switch(config-if)# service-policy [input|output] policy-name

IV.3. Hiu chnh egress scheduling:


Phn ny s trnh by packet s c phn phi vo cc hng i v c x l nh th no. Mc nh c 2 hng i c gn trng s 4 v 255. thay i gi tr mc nh trn, dng lnh Switch(config-if)# wrr-queue bandwidth weight1 weight 2 [weight3] [weight 4] nh x packet vo egress-queue: Switch(config-if)# wrr-queue cos-map queue-id threshold cos-list Packet c gi tr CoS c ch ra trong cos-list s c t trong hng i queue-id. Mc nh, CoS gi tr 1 s c t trong hng 1, CoS 2 v 3 s vo hng 1 threshold 2, Cos 4 vo hng 2 threshold 1, CoS 6 v 7 v o hng 2 threshold 2. CoS 5 lun c t vo priority-queue, nu c mt priority-queue. Trnh nghn bng cch dng tail-drop:

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org

Bi ging QoS CCNP Switching Switch(config-if)# no wrr-queue random-detect queue-id Trnh nghn bng cch dng wred: Switch(config-if)# wrr-queue random-detect queu-id Thay i cc gii hn trong hng i Switch(config-if)#wrr-queue random-detect {max-threshold|min-threshold} queue-id

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org

Bi ging QoS CCNP Switching

ng Quang Minh, CCIE#11897 http://www.vnpro.org Email: dangquangminh@vnpro.org