• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

Wred

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wred

    WRED

    Mô tả:
    Bài thực hành này hướng dẫn thực hiện tính năng tránh tắc nghẽn dựa vào việc drop gói tin. Khác với tail drop là drop tất cả các gói tin đến sau khi hàng đợi bị đầy, Weighted random early detection (WRED) sẽ drop tin gói dựa trên giá trị DSCP hoặc IP Precedence (mặc định).

    Yêu cầu:
    Yêu cầu của bài thực hành này là cấu hình WRED trên mỗi lớp dựa vào giá trị DSCP, lưu ý là khi đặt WRED trên hàng đợi mỗi lớp, thí việc drop gói sẽ chỉ xảy cho lớp đó khi hàng đợi của lớp đó bị đẩy. Ở bài thực hành này ta sẽ nhóm hai loại traffic có giá trị DSCP khác nhau vào cùng một lớp, trong trường hợp hàng đợi của lớp bị đầy thì việc drop gói tin sẽ xảy ra, trong đó traffic có traffic mà giá trị DSCP có khả năng drop cao sẽ bị drop trước ví dụ AF23 thì khả năng drop cao hơn AF21.
    Lưu ý: Việc drop dựa vào giá trị ngưỡng hàng đợi trung bình, không phải giá trị ngưỡng của hàng đợi hiện tại.


    Thực hiện
    Cấu hình ban đầu

    Cấu hình trên R1
    R1#sh run
    Building configuration...

    Current configuration : 1337 bytes
    !
    version 12.2
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R1
    !
    logging queue-limit 100
    !
    memory-size iomem 10
    ip subnet-zero
    !
    !
    !
    ip cef
    mpls ldp logging neighbor-changes
    !
    !
    no voice hpi capture buffer
    no voice hpi capture destination
    !
    !
    mta receive maximum-recipients 0
    !
    !
    interface Ethernet0/0
    ip address 192.168.0.1 255.255.255.0
    half-duplex
    !
    interface Serial0/0
    ip address 192.168.1.1 255.255.255.0
    !
    no ip http server
    ip classless
    ip route 0.0.0.0 0.0.0.0 192.168.1.2
    !
    !
    call rsvp-sync
    !
    voice-port 1/1/0
    !
    voice-port 1/1/1
    !
    !
    mgcp profile default
    !
    dial-peer cor custom
    !
    !
    !
    dial-peer voice 1 pots
    destination-pattern 101
    port 1/1/0
    !
    dial-peer voice 2 voip
    destination-pattern 201
    session target ipv4:192.168.2.2
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    !
    end

    R1#

    Cấu hình trên R2

    R2#sh run
    Building configuration...

    Current configuration : 1351 bytes
    !
    version 12.2
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R2
    !
    logging queue-limit 100
    !
    ip subnet-zero
    !
    !
    no ip domain lookup
    ip host R3 192.168.2.2
    ip host R1 192.168.1.1
    !
    ip cef
    mpls ldp logging neighbor-changes
    !
    !
    no voice hpi capture buffer
    no voice hpi capture destination
    !
    !
    interface Ethernet0/0
    ip address 172.16.1.1 255.255.255.0
    half-duplex
    !
    interface Serial0/0
    ip address 192.168.1.2 255.255.255.0
    clockrate 2000000
    fair-queue
    no cdp enable
    !
    interface Serial0/1
    bandwidth 128
    ip address 192.168.2.1 255.255.255.0
    load-interval 30
    no cdp enable
    !
    ip http server
    ip classless
    ip route 100.1.1.0 255.255.255.0 192.168.2.2
    ip route 101.1.1.0 255.255.255.0 192.168.2.2
    ip route 192.168.0.0 255.255.255.0 192.168.1.1
    !
    !
    !
    !
    !
    call rsvp-sync
    !
    !
    mgcp profile default
    !
    dial-peer cor custom
    !
    !
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    !
    end

    Cấu hình trên R3

    R3#sh run
    Building configuration...

    Current configuration : 1060 bytes
    !
    version 12.2
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R3
    !
    !
    ip subnet-zero
    !
    !
    voice call carrier capacity active
    !
    !
    mta receive maximum-recipients 0
    !
    !
    interface Loopback0
    ip address 100.1.1.1 255.255.255.0
    !
    interface Loopback1
    ip address 101.1.1.1 255.255.255.0
    !
    !
    interface Ethernet0/0
    no ip address
    half-duplex
    !
    interface Serial0/0
    ip address 192.168.2.2 255.255.255.0

    !
    ip classless
    ip route 0.0.0.0 0.0.0.0 192.168.2.1
    ip http server

    !
    call rsvp-sync
    !
    voice-port 1/0/0
    !
    voice-port 1/0/1
    !
    !
    mgcp profile default
    !
    dial-peer cor custom
    !
    dial-peer voice 1 pots
    destination-pattern 201
    port 1/0/0
    !
    dial-peer voice 2 voip
    destination-pattern 101
    session target ipv4:192.168.1.1
    !
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    !
    end

    R3#


    Các bước thực hiện

    Bước 1: Cấu hình trên R1:

    Cấu hình phân loại lưu lượng từ máy 192.168.0.2 đến đích đến 100.1.1.1 và 101.1.1.1

    access-list 100 permit ip host 192.168.0.2 host 100.1.1.1
    access-list 101 permit ip host 192.168.0.2 host 101.1.1.1

    Tiến hành phân loại lưu lượng voip cùng với các lưu lượng được chọn bằng ACL 100 và 101

    class-map match-all VoIP
    match ip rtp 16384 16383
    class-map match-all D-100
    match access-group 100
    class-map match-all D-101
    match access-group 101

    Cấu hình policy-map dùng phân loại và đánh dấu các lưu lượng tương ứng

    policy-map CLASSIFY
    class VoIP
    set dscp ef
    class D-100
    set dscp af21
    class D-101
    set dscp af23

    Áp dụng lên cổng

    interface Serial0/0
    service-policy output CLASSIFY

    Bước 2: Cấu hình trên R2

    Cấu hình phân loại lưu lượng đã được đánh dấu

    class-map match-any PING // Nhóm hai luồng traffic có giá trị DSCP khác nhau vào cùng một lớp
    match dscp af21
    match dscp af23
    class-map match-all VoIP
    match dscp ef

    Cấu hình policy-map TRAFFIC dùng để xây dựng hàng đợi LLQ cho phép băng thông dành cho voip tối đa chiếm 45% băng thông cổng và bật cơ chế WRED lên hàng đợi PING (CBWFQ) sao cho hàng đợi này ưu tiên về tỷ lệ loại bỏ gói tin của các gói tin af11 hơn af21

    policy-map TRAFFIC
    class VoIP
    priority percent 45
    class PING
    bandwidth 10
    random-detect dscp-based //Drop dựa vào giá trị DSCP
    class class-default
    fair-queue
    random-detect dscp-based
    !
    Áp dụng lên cổng

    interface Serial0/1
    bandwidth 128
    service-policy output TRAFFIC



    Kiểm tra

    Tạo lượng lớn Traffic qua lệnh Ping từ host A đến hai địa chỉ 100.1.1.1 và 101.1.1.1 trên R3
    R2#sh policy-map interface s0/1
    Serial0/1

    Service-policy output: TRAFFIC

    Class-map: VoIP (match-all)
    0 packets, 0 bytes
    30 second offered rate 0 bps, drop rate 0 bps
    Match: dscp ef
    Queueing
    Strict Priority
    Output Queue: Conversation 40
    Bandwidth 60 (%)
    Bandwidth 76 (kbps) Burst 1900 (Bytes)
    (pkts matched/bytes matched) 0/0
    (total drops/bytes drops) 0/0

    Class-map: PING (match-any)
    1845 packets, 2334016 bytes
    30 second offered rate 55000 bps, drop rate 0 bps
    Match: dscp af21
    971 packets, 1229040 bytes
    30 second rate 27000 bps
    Match: dscp af23
    874 packets, 1104976 bytes
    30 second rate 28000 bps
    Queueing
    Output Queue: Conversation 41
    Bandwidth 10 (kbps)
    (pkts matched/bytes matched) 1533/1865680
    (depth/total drops/no-buffer drops) 12/0/0
    exponential weight: 9
    mean queue depth: 13 //Kích cỡ hàng đợi trung bình

    dscp Transmitted Random drop Tail drop Minimum Maximum Mark
    pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
    af11 0/0 0/0 0/0 32 40 1/10
    af12 0/0 0/0 0/0 28 40 1/10
    af13 0/0 0/0 0/0 24 40 1/10
    af21 975/1234144 0/0 0/0 32 40 1/10
    af22 0/0 0/0 0/0 28 40 1/10
    af23 874/1104976 0/0 0/0 24 40 1/10
    af31 0/0 0/0 0/0 32 40 1/10
    af32 0/0 0/0 0/0 28 40 1/10
    af33 0/0 0/0 0/0 24 40 1/10
    af41 0/0 0/0 0/0 32 40 1/10
    af42 0/0 0/0 0/0 28 40 1/10
    af43 0/0 0/0 0/0 24 40 1/10
    cs1 0/0 0/0 0/0 22 40 1/10
    cs2 0/0 0/0 0/0 24 40 1/10
    cs3 0/0 0/0 0/0 26 40 1/10
    cs4 0/0 0/0 0/0 28 40 1/10
    cs5 0/0 0/0 0/0 30 40 1/10
    cs6 0/0 0/0 0/0 32 40 1/10
    cs7 0/0 0/0 0/0 34 40 1/10
    ef 0/0 0/0 0/0 36 40 1/10
    rsvp 0/0 0/0 0/0 36 40 1/10
    default 0/0 0/0 0/0 20 40 1/10


    Class-map: class-default (match-any)
    426 packets, 250414 bytes
    30 second offered rate 6000 bps, drop rate 0 bps
    Match: any
    Queueing
    Flow Based Fair Queueing
    Maximum Number of Hashed Queues 32
    (total queued/total drops/no-buffer drops) 136/0/0
    exponential weight: 9

    dscp Transmitted Random drop Tail drop Minimum Maximum Mark
    pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
    af11 0/0 0/0 0/0 32 40 1/10
    af12 0/0 0/0 0/0 28 40 1/10
    af13 0/0 0/0 0/0 24 40 1/10
    af21 0/0 0/0 0/0 32 40 1/10
    af22 0/0 0/0 0/0 28 40 1/10
    af23 0/0 0/0 0/0 24 40 1/10
    af31 0/0 0/0 0/0 32 40 1/10
    af32 0/0 0/0 0/0 28 40 1/10
    af33 0/0 0/0 0/0 24 40 1/10
    af41 0/0 0/0 0/0 32 40 1/10
    af42 0/0 0/0 0/0 28 40 1/10
    af43 0/0 0/0 0/0 24 40 1/10
    cs1 0/0 0/0 0/0 22 40 1/10
    cs2 0/0 0/0 0/0 24 40 1/10
    cs3 0/0 0/0 0/0 26 40 1/10
    cs4 0/0 0/0 0/0 28 40 1/10
    cs5 0/0 0/0 0/0 30 40 1/10
    cs6 0/0 0/0 0/0 32 40 1/10
    cs7 0/0 0/0 0/0 34 40 1/10
    ef 0/0 0/0 0/0 36 40 1/10
    rsvp 0/0 0/0 0/0 36 40 1/10
    default 431/255542 0/0 0/0 20 40 1/10

    Thời điểm này cổng s0/1 nghẽn và bắt đầu loại bỏ gói tin

    R2#sh policy-map interface s0/1
    Serial0/1

    Service-policy output: TRAFFIC

    Class-map: VoIP (match-all)
    1716 packets, 109584 bytes
    30 second offered rate 16000 bps, drop rate 0 bps
    Match: dscp ef
    Queueing
    Strict Priority
    Output Queue: Conversation 40
    Bandwidth 45 (%)
    Bandwidth 57 (kbps) Burst 1425 (Bytes)
    (pkts matched/bytes matched) 1679/107216
    (total drops/bytes drops) 0/0

    Class-map: PING (match-any)
    4990 packets, 6171072 bytes
    30 second offered rate 58000 bps, drop rate 9000 bps
    Match: dscp af21
    2477 packets, 3066960 bytes
    30 second rate 29000 bps
    Match: dscp af23
    2513 packets, 3104112 bytes
    30 second rate 29000 bps
    Queueing
    Output Queue: Conversation 41
    Bandwidth 10 (kbps)
    (pkts matched/bytes matched) 4951/6120912
    (depth/total drops/no-buffer drops) 55/140/0
    exponential weight: 9
    mean queue depth: 43 // Vượt mức hàng đợi trung bình

    dscp Transmitted Random drop Tail drop Minimum Maximum Mark
    pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
    af11 0/0 0/0 0/0 32 40 1/10
    af12 0/0 0/0 0/0 28 40 1/10
    af13 0/0 0/0 0/0 24 40 1/10
    af21 2417/2994888 30/35208 30/36864 32 40 1/10
    af22 0/0 0/0 0/0 28 40 1/10
    af23 2433/3006784 55/6798 25/29344 24 40 1/10
    af31 0/0 0/0 0/0 32 40 1/10
    af32 0/0 0/0 0/0 28 40 1/10
    af33 0/0 0/0 0/0 24 40 1/10
    af41 0/0 0/0 0/0 32 40 1/10
    af42 0/0 0/0 0/0 28 40 1/10
    af43 0/0 0/0 0/0 24 40 1/10
    cs1 0/0 0/0 0/0 22 40 1/10
    cs2 0/0 0/0 0/0 24 40 1/10
    cs3 0/0 0/0 0/0 26 40 1/10
    cs4 0/0 0/0 0/0 28 40 1/10
    cs5 0/0 0/0 0/0 30 40 1/10
    cs6 0/0 0/0 0/0 32 40 1/10
    cs7 0/0 0/0 0/0 34 40 1/10
    ef 0/0 0/0 0/0 36 40 1/10
    rsvp 0/0 0/0 0/0 36 40 1/10
    default 0/0 0/0 0/0 20 40 1/10


    Class-map: class-default (match-any)
    895 packets, 1013568 bytes
    30 second offered rate 14000 bps, drop rate 14000 bps
    Match: any
    Queueing
    Flow Based Fair Queueing
    Maximum Number of Hashed Queues 32
    (total queued/total drops/no-buffer drops) 149/612/0
    exponential weight: 9

    dscp Transmitted Random drop Tail drop Minimum Maximum Mark
    pkts/bytes pkts/bytes pkts/bytes thresh thresh prob
    af11 0/0 0/0 0/0 32 40 1/10
    af12 0/0 0/0 0/0 28 40 1/10
    af13 0/0 0/0 0/0 24 40 1/10
    af21 0/0 0/0 0/0 32 40 1/10
    af22 0/0 0/0 0/0 28 40 1/10
    af23 0/0 0/0 0/0 24 40 1/10
    af31 0/0 0/0 0/0 32 40 1/10
    af32 0/0 0/0 0/0 28 40 1/10
    af33 0/0 0/0 0/0 24 40 1/10
    af41 0/0 0/0 0/0 32 40 1/10
    af42 0/0 0/0 0/0 28 40 1/10
    af43 0/0 0/0 0/0 24 40 1/10
    cs1 0/0 0/0 0/0 22 40 1/10
    cs2 0/0 0/0 0/0 24 40 1/10
    cs3 0/0 0/0 0/0 26 40 1/10
    cs4 0/0 0/0 0/0 28 40 1/10
    cs5 0/0 0/0 0/0 30 40 1/10
    cs6 8/480 0/0 7/420 32 40 1/10
    cs7 0/0 0/0 0/0 34 40 1/10
    ef 0/0 0/0 0/0 36 40 1/10
    rsvp 0/0 0/0 0/0 36 40 1/10
    default 310/2823 123/3600 602/767696 20 40 1/10

    R2#

    Từ kết quả trên có thể nhận thấy rằng do traffic có giá trị DSCP là AF21 có ngưỡng minimum cao hơn nên sẽ drop ít hơn traffic có giá trị DSCP AF23. Lưu ý khi ngưỡng tối đa của hàng đợi trung bình vượt mức thì sẽ bị tail drop.

    Cấu hình cuối cùng của hệ thống:

    Cấu hình trên R1
    R1#sh run
    Building configuration...

    Current configuration : 1337 bytes
    !
    version 12.2
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R1
    !
    logging queue-limit 100
    !
    memory-size iomem 10
    ip subnet-zero
    !
    !
    !
    ip cef
    mpls ldp logging neighbor-changes
    !
    !
    no voice hpi capture buffer
    no voice hpi capture destination
    !
    !
    mta receive maximum-recipients 0
    !
    !
    class-map match-all VoIP
    match ip rtp 16384 16383
    class-map match-all D-100
    match access-group 100
    class-map match-all D-101
    match access-group 101
    !
    !
    policy-map CLASSIFY
    class VoIP
    set dscp ef
    class D-100
    set dscp af21
    class D-101
    set dscp af23
    !
    !
    interface Ethernet0/0
    ip address 192.168.0.1 255.255.255.0
    half-duplex
    !
    interface Serial0/0
    ip address 192.168.1.1 255.255.255.0
    service-policy output CLASSIFY
    !
    no ip http server
    ip classless
    ip route 0.0.0.0 0.0.0.0 192.168.1.2
    !
    !
    !
    access-list 100 permit ip host 192.168.0.2 host 100.1.1.1
    access-list 101 permit ip host 192.168.0.2 host 101.1.1.1
    !
    !
    call rsvp-sync
    !
    voice-port 1/1/0
    !
    voice-port 1/1/1
    !
    !
    mgcp profile default
    !
    dial-peer cor custom
    !
    !
    !
    dial-peer voice 1 pots
    destination-pattern 101
    port 1/1/0
    !
    dial-peer voice 2 voip
    destination-pattern 201
    session target ipv4:192.168.2.2
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    !
    end

    R1#

    Cấu hình trên R2

    R2#sh run
    Building configuration...

    Current configuration : 1351 bytes
    !
    version 12.2
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname R2
    !
    logging queue-limit 100
    !
    ip subnet-zero
    !
    !
    no ip domain lookup
    ip host R3 192.168.2.2
    ip host R1 192.168.1.1
    !
    ip cef
    mpls ldp logging neighbor-changes
    !
    !
    no voice hpi capture buffer
    no voice hpi capture destination
    !
    !
    mta receive maximum-recipients 0
    !
    !
    class-map match-any PING
    match dscp af21
    match dscp af23
    class-map match-all VoIP
    match dscp ef
    !
    !
    policy-map TRAFFIC
    class VoIP
    priority percent 45
    class PING
    bandwidth 10
    random-detect dscp-based class class-default
    fair-queue
    random-detect dscp-based
    !
    !
    !
    !
    interface Ethernet0/0
    ip address 172.16.1.1 255.255.255.0
    half-duplex
    !
    interface Serial0/0
    ip address 192.168.1.2 255.255.255.0
    clockrate 2000000
    fair-queue
    no cdp enable
    !
    interface Serial0/1
    bandwidth 128
    ip address 192.168.2.1 255.255.255.0
    service-policy output TRAFFIC
    load-interval 30
    no cdp enable
    !
    ip http server
    ip classless
    ip route 100.1.1.0 255.255.255.0 192.168.2.2
    ip route 101.1.1.0 255.255.255.0 192.168.2.2
    ip route 192.168.0.0 255.255.255.0 192.168.1.1
    !
    !
    !
    !
    !
    call rsvp-sync
    !
    !
    mgcp profile default
    !
    dial-peer cor custom
    !
    !
    !
    !
    line con 0
    line aux 0
    line vty 0 4
    privilege level 15
    no login
    !
    !
    end
    Phạm Minh Tuấn

    Email : phamminhtuan@vnpro.org
    Yahoo : phamminhtuan_vnpro
    -----------------------------------------------------------------------------------------------
Trung Tâm Tin Học VnPro
149/1D Ung Văn Khiêm P25 Q.Bình thạnh TPHCM
Tel : (08) 35124257 (5 lines)
Fax: (08) 35124314

Home page: http://www.vnpro.vn
Support Forum: http://www.vnpro.org
- Chuyên đào tạo quản trị mạng và hạ tầng Internet
- Phát hành sách chuyên môn
- Tư vấn và tuyển dụng nhân sự IT
- Tư vấn thiết kế và hỗ trợ kỹ thuật hệ thống mạng

Network channel: http://www.dancisco.com
Blog: http://www.vnpro.org/blog
Working...
X