zoukankan      html  css  js  c++  java
  • CCIE路由实验(8) -- QoS

    1.查看端口缺省的队列机制
    2.配置CB-WFQ
    3.配置CB-LLQ
    4.配置CB-Shapping在以太接口下
    5.配置CB-Shapping在FR接口下
    6.配置帧中继流量整形FRTS
    7.配置CB-Policing
    8.配置WRR
    9.配置SRR
    10.配置数据包的各种压缩方式
    11.配置链路分片和交叉离开LFI-Multilink接口
    12.配置链路分片和交叉离开LFI-FR接口
    13.在路由器上配置auto qos voip
    14.配置auto qos enterprise

    enable
    conf t
    no ip do lo
    enable pass cisco
    line con 0
    logg sync
    exec-t 0 0
    exit
    line vty 0 4
    pass cisco
    logg sync
    exit
    host

    1.查看端口缺省的队列机制
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握端口的缺省队列
    2).掌握修改端口缺省队列的方法
    3).掌握修改WFQ队列参数的方法
    理论基础:
    1).缺省情况下,端口速率小于等于2.048Mbps,接口队列是WFQ,大于2.048Mbps,接口队列是FIFQ

    R1:
    router ospf 1
    router-id 11.1.1.1
    exit

    int f0/0
    ip add 14.1.1.1 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int l0
    ip add 11.1.1.1 255.255.255.0
    ip ospf 1 area 0
    exit

    R2:
    router ospf 1
    router-id 22.1.1.1
    exit

    int s2/1
    encapsulation frame-relay
    no shut
    exit
    int s2/1.1 point-to-point
    ip add 24.1.1.2 255.255.255.0
    frame-relay interface-dlci 204
    exit
    ip ospf 1 area 0
    exit
    int f1/0
    ip add 24.1.2.2 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int s2/0
    encapsulation ppp
    ip add 24.1.3.2 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int l0
    ip add 22.1.1.1 255.255.255.0
    ip ospf 1 area 0
    exit

    R3:
    router ospf 1
    router-id 33.1.1.1
    exit

    int f0/1
    ip add 34.1.1.3 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int l0
    ip add 33.1.1.1 255.255.255.0
    ip ospf 1 area 0
    exit

    R4:
    router ospf 1
    router-id 44.1.1.1
    exit

    int f0/0
    ip add 14.1.1.4 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int f0/1
    ip add 34.1.1.4 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int s2/1
    encapsulation frame-relay
    no shut
    exit
    int s2/1.1 point-to-point
    ip add 24.1.1.4 255.255.255.0
    frame-relay interface-dlci 402
    exit
    ip ospf 1 area 0
    exit
    int f1/0
    ip add 24.1.2.4 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int s2/0
    encapsulation ppp
    ip add 24.1.3.4 255.255.255.0
    ip ospf 1 area 0
    no shut
    exit
    int l0
    ip add 44.1.1.1 255.255.255.0
    ip ospf 1 area 0
    exit

    -----------------------------------------------------------------
    R4:
    show int s2/0

    int s2/0
    bandwidth 3000
    exit

    show int s2/0

    show int f0/0

    int f0/0
    fair-queue
    exit

    show int f0/0

    2.配置CB-WFQ
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握CBWFQ的各种配置方法
    2).掌握修改每个class内部的队列机制的方法
    3).掌握修改每个class队列长度的方法
    4).掌握简单的测试是否匹配某一个class的方法
    5).理解max-reserved-bandwidth的含义
    理论基础:
    1).CBWFQ只能应用在出接口
    2).CBWFQ机制实现了在出接口带宽拥塞的情况下的最小带宽保证
    3).CBWFQ里面的每一个class内部,可以采用WFQ的分类、丢弃和调度机制
    4).在出接口带宽有多余的情况下,每个class按照最小带宽保证的比例来占用多余带宽
    5).CBWFQ配置的带宽值为物理带宽
    6).CBWFQ在缺省情况下能够分配的最大带宽和平台有关,高端平台(如cisco 7206)可以最大分配接口带宽的99%;在一些低端平台(如cisco 2810),缺省最大可以分配带宽的75%。要突破这个限制,可以在接口下配置命令max-reserved-bandwidth来实现。在cisco 7206平台上,这个命令和CBWFQ一起时不生效。
    R4:
    access-list 100 permit icmp any any
    access-list 101 permit tcp any any
    class-map ICMP
    match access-group 100
    exit
    class-map TCP
    match access-group 101
    exit

    policy-map cbwfq
    class ICMP
    bandwidth 2000
    exit
    class TCP
    bandwidth 3000
    exit
    exit

    int f1/0
    service-policy output cbwfq
    exit

    show class-map
    show policy-map
    show int f1/0
    show policy-map int f1/0

    policy-map cbwfq
    class ICMP
    fair-queue
    queue-limit 128
    exit
    class class-default
    fair-queue
    queue-limit 128
    exit
    exit

    show policy-map cbwfq
    show policy-map int f1/0

    policy-map cbwfq-new
    class ICMP
    bandwidth percent 2
    exit
    class TCP
    bandwidth percent 3
    exit
    exit

    int f1/0
    no service-policy output cbwfq
    service-policy output cbwfq-new
    exit

    show policy-map cbwfq-new
    show policy-map int f1/0

    R1:
    ping 22.1.1.1 repeat 20

    R3:
    telnet 22.1.1.1

    R4:
    show policy-map int f1/0

    3.配置CB-LLQ
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握CB-LLQ的配置方法
    2).理解在配置CBWFQ时,bandwidth remaining的含义
    理论基础:
    1).CB-LLQ只能应用在出接口
    2).CB-LLQ确保了属于优先级的队列有最小的转发时延
    3).CB-LLQ在出接口带宽拥塞的情况下,有流量监管的作用
    4).CB-LLQ场应用于语音数据包
    5).CB-LLQ配置的带宽值为物理带宽

    R4:
    policy-map cbwfq
    class ICMP
    no fair-queue
    no queue-limit
    no bandwidth 2000
    priority 20000
    exit
    exit

    show policy-map cbwfq

    int f1/0
    no service-policy output cbwfq-new
    service-policy output cbwfq
    exit

    show policy-map int f1/0

    R1:
    ping 22.1.1.1 repeat 40

    R4:
    show policy-map int f1/0

    policy-map cbwfq
    class TCP
    bandwidth remaining percent 50
    exit
    exit

    高端平台:剩余带宽=接口带宽-LLQ分配带宽
    低端平台:剩余带宽=接口带宽*75%-LLQ分配带宽

    show policy-map int f1/0

    4.配置CB-Shapping在以太接口下
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握CB-Shapping的配置方法
    2).理解配置BE和不配置BE的区别
    3).理解shapping是如何取令牌和注入令牌
    4).掌握配置peak值后shapping的速率
    理论基础
    1).CB-Shapping只能应用在出接口
    2).CB-Shapping令牌桶大小为BC+BE(如果没有配置BE,大小为BC)
    3).CB-Shapping注入令牌的方式为每隔Tc,注入BC个令牌
    4).CB-Shapping取令牌的方式,当有数据包到达,如果能取到足够的令牌,就发送;如果取不到足够的令牌,先取完目前令牌桶的令牌,然后等待下一个Tc时刻注入BC个令牌,取出需要的值,然后发送。
    5).在配置BE后,并没有增加CIR的速率,只是在链路空闲的时候,可以存下更多的令牌,有更强的burst容忍能力
    6).当配置了peak值,shapping后的速率为peak*(1+BE/BC)

    R4:
    policy-map cb-shape
    class ICMP
    shape average 500000 (CIR)
    exit
    class TCP
    shape average 600000
    exit
    exit

    int f1/0
    no service-policy output cbwfq
    service-policy output cb-shape
    exit

    show policy-map int f1/0

    令牌桶的大小为500byte,缺省的TC值为4ms,因此算出BC值等于500000*0.004=2000. 每隔4ms,往桶里注入2000bit的令牌

    policy-map cb-shape
    class ICMP
    shape average 500000 12000 0 (BC)
    exit
    exit

    show policy-map int f1/0

    policy-map cb-shape
    class ICMP
    shape average percent 5 20 ms (TC)
    exit
    exit

    show policy-map int f1/0

    policy-map cb-shape
    class ICMP
    shape peak 5000000 (PEAK)
    exit
    exit

    show policy-map int f1/0

    5.配置CB-Shapping在FR接口下
    ----------------------------------------------------------------------------
    实验目的:
    1).理解在帧中继接口下的CB-Shapping的工作原理
    2).掌握配置CB-Shapping在FR接口下
    3).掌握查看配置生效情况
    4).理解map-class应用在接口下和PVC下的区别
    5).掌握policy-map的嵌套配置方法
    理论基础:
    1).帧中继网络发生拥塞,FR交换机向发送数据的路由器发送BECN报文,路由器每收到一个BECN报文,降低25%的速率,一直降到min cir值,通过减少令牌桶的大小来实现。如果16个tc周期都没有收到BECN报文,就增加发送速率,通过增加令牌桶的大小来实现。每个tc周期增加令牌桶的大小为(BC+BE)/16
    2).map-class应用到PVC下,只对PVC生效
    3).map-class应用到多点子接口或者主接口,对所有的PVC都生效。

    R4:
    policy-map yeslab
    class class-default

    定义CIR,整形速率;定义MIN CIR, 最低发送速率

    shape average 128000
    shape adaptive 64000
    exit

    map-class frame-relay kaka
    service-policy output yeslab
    exit
    exit

    int s2/1.1
    frame-relay interface-dlci 402
    class kaka
    exit

    show policy-map int s2/1.1

    int s2/1.1
    frame-relay interface-dlci 402
    no class kaka
    exit
    frame-relay class kaka
    exit

    show policy-map int s2/1.1

    class-map ipp5
    match ip precedence 5
    exit
    class-map http
    match protocol http
    exit

    policy-map child
    class ipp5
    priority percent 30
    exit
    class http
    bandwith percent 40
    exit
    exit

    policy-map yeslab
    class class-default
    service-policy child
    exit

    show policy-map int s2/1.1

    6.配置帧中继流量整形FRTS
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握配置FRTS的方法
    2).掌握查看配置生效的方法
    3).掌握FRTS配置嵌套service-policy的方法
    理论基础:
    1).帧中继的流量整形只能应用在pvc下。路由器降低发送速率和增加发送速率的工作原理和实验5描述一致。

    R4:
    map-class frame-relay frts
    frame-relay cir 256000
    frame-relay mincir 128000
    frame-relay bc 12000
    exit

    int s2/1.1
    frame-relay interface-dlci 402
    class frts
    exit
    exit

    int s2/1
    frame-relay traffic-shapping
    exit

    show frame-relay pvc 402

    class-map ipp5
    match ip precedence 5
    exit
    class-map http
    match protocol http
    exit

    policy-map child
    class ipp5
    priority percent 30
    exit
    class http
    bandwith percent 40
    exit
    exit

    map-class frame-relay frts
    service-policy output child
    exit

    show run | section map-class
    show frame-relay pvc 402

    7.配置CB-Policing
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握单速率单桶的配置方法
    2).当我单速率双桶的配置方法
    3).掌握双速率双桶的配置方法
    4).理解以上各个配置方法的令牌桶大小、令牌桶个数、注入令牌的方法、取令牌的方法

    1).CB-Policing可以应用在入接口,也可以应用在出接口
    2).采用CB-Policing的方法,利用是否能够取到令牌和在哪一个令牌桶取令牌的方法,可以把数据报文分到不同组,confrom组、exceed组、violate组。对属于某一个组的数据报文采取何种处理方式,并没有限制,可以是传送transmit、打标记mark、丢弃drop
    3).以下图表总结了单速率单桶、单速率双桶、双速率双桶三种方式的令牌桶大小、令牌桶个数、注入令牌的方法、取令牌的方法和如何被划分到不同的组。

    4).配置BC的时候,一定要确保BC大于出接口的MTU值。令牌桶越大,当前一段时间空闲,可以让令牌桶装越多的令牌,这样可以增加对数据报文的burst容忍能力
    5).在单速率单桶、单速率双桶两种模式下,如果CIR速率相同,尽管可能令牌桶的大小不同,监管速率值是一样的。不同的是单速率单桶只能把数据包分到conform组和exceed组,而单速率双桶可以把数据包分到conform组、exceed组和violate组。
    6).配置了violate参数后,激活双令牌桶。单速率双桶对数据包分组的方法和双速率双桶的分组方法不一样。
    单速率双桶:数据包在BC能取到令牌,属于conform组;在BC不能取到令牌,在BE取到令牌,属于exceed组;在两个桶都不能取到令牌,属于violate组。BC和BE两个桶没有大小关系
    双速率双桶:在BC和BE桶都能取到令牌,属于conform组;在BC不能取到令牌,在BE取到令牌,属于exceed组;在两个桶都不能取到令牌,属于violate组。BE桶一定要大于BC桶。PIR一定要大于CIR。
    7).CB-Policy的配置方法很多,以下4个配置命令含义一样,都配置了CIR、BC和BE值
    police 80000 1500 1000
    police cir 80000 1500 1000
    police cir 80000 bc 1500 be 1000
    police rate 80000 bps burst 1500 bytes peak-burst 1000 bytes

    将class ICMP的速率限制到5Mbps,定义令牌桶
    ----------------------------------------------------------------
    R4:
    policy-map cb-police1
    class ICMP
    police cir 5000000 5000 4000
    exit
    exit

    int f1/0
    no service-policy output cb-shape
    service-policy output cb-police1
    exit

    show policy-map cb-police1
    show policy-map int f1/0

    将class ICMP的速率限制到5Mbps, BC值为5000byte,BE值为4000byte,对于conform的数据包转发,对于exceed的数据包打上标记AF11,对于violate的数据包,丢弃
    -----------------------------------------------------------------
    R4:
    policy-map cb-police2
    class ICMP
    police cir 5000000 bc 5000 be 4000
    conform-action transmit
    exceed-action set-dscp-transmit af11
    violate-action drop
    exit
    exit
    exit

    int f1/0
    no service-policy output cb-police1
    service-policy output cb-police2
    exit

    show policy-map int f1/0

    配置class ICMP的pir速率为6Mbps,CIR的速率为5Mbps,BC值为5000byte,BE值为8000byte。对于速率在5Mbps以下的数据包,属于conform组,转发;对于速率在5Mbps和6Mbps的数据包,属于exceed组,对于速率在6Mbps以上的数据包,属于violate组,丢弃。
    -----------------------------------------------------------------
    R4:
    policy-map cb-police3
    class ICMP
    police cir 5000000 bc 5000 pir 6000000 be 8000
    conform-action transmit
    exceed-action set-dscp-transmit af11
    violate-action drop
    exit
    exit
    exit

    int f1/0
    no service-policy output cb-police2
    service-policy output cb-police3
    exit

    show policy-map int f1/0

    8.配置WRR
    ----------------------------------------------------------------------------

    9.配置SRR
    ----------------------------------------------------------------------------

    10.配置数据包的各种压缩方式
    ----------------------------------------------------------------------------
    实验目的:
    1).掌握配置ppp的压缩方法
    2).掌握配置frame-relay的压缩方法
    3).掌握配置tcp头部压缩方法
    4).掌握配置RTP头部压缩方法
    5).掌握配置基于类的TCP和RTP头部压缩方法

    1).以上的压缩技术都是基于链路的
    2).撒所技术都是配置在低速广域网链路上,在以太接口上不支持对于TCP和RTP的头部压缩
    3).数据报文被压缩后,可以减少串行化时延,但是会引入压缩时延,常常采用硬件压缩技术
    4).配置压缩的时候,在链路的两端都必须配置
    5).二层压缩主要针对PPP封装和帧中继封装

    配置ppp压缩
    ------------------------------------------------------------------
    由于路由器用dynamips模拟,没有压缩芯片,采用软件压缩
    R4:
    int s2/0
    encapsulation ppp
    compress stac software
    exit

    R2:
    int s2/0
    encapsulation ppp
    compress stac software
    exit

    R2:
    ping 24.1.3.4 repeat 100

    R4:
    show compress details

    配置帧中继负载的压缩
    ------------------------------------------------------------------
    R2:
    int s2/1.1
    frame-relay payload-compression frF9 stac software
    exit

    R4:
    int s2/1.1
    frame-relay payload-compression frF9 stac software
    exit

    R2:
    ping 24.1.1.4 repeat 100
    show compress

    配置TCP头部压缩
    ------------------------------------------------------------------
    R4:
    int s2/0
    ip tcp header-compression
    exit

    R2:
    int s2/0
    ip tcp header-compression
    exit

    R4:
    telnet 24.1.3.2
    show ip tcp header-compression

    配置RTP头部压缩
    ------------------------------------------------------------------
    R2:
    int s2/0
    ip rtp header-compression
    exit

    R4:
    int s2/0
    ip rtp header-compression
    exit

    show ip rtp header-compression

    配置基于类的TCP和RTP头部压缩
    ------------------------------------------------------------------
    R4:
    policy-map compress
    class ICMP
    compression header ip tcp
    compression header ip rtp
    exit
    exit

    int s2/0
    service-policy output compress
    exit

    show policy-map int s2/0

    11.配置链路分片和交叉离开LFI-Multilink接口
    ----------------------------------------------------------------------------
    1).掌握PPP multilink的配置方法
    2).掌握PPP multilink的LFI配置方法
    3).理解PPP multilink是如何传送数据报文的
    4).查看PPP multilink的分片情况

    配置ppp multilink,包含R2、R4的S2/0、S2/2接口
    -----------------------------------------------------------------
    R2:
    int s2/0
    encapsulation ppp
    ppp multilink
    ppp multilink group 24
    exit
    int s2/2
    encapsulation ppp
    ppp multilink
    ppp multilink group 24
    exit
    int multilink 24
    ip add 24.1.3.2 255.255.255.0
    ppp multilink
    ppp multilink group 24
    exit

    R4:
    int s2/0
    encapsulation ppp
    ppp multilink
    ppp multilink group 24
    exit
    int s2/2
    encapsulation ppp
    ppp multilink
    ppp multilink group 24
    exit
    int multilink 24
    ip add 24.1.3.4 255.255.255.0
    ppp multilink
    ppp multilink group 24
    exit

    show ppp multilink

    R4:
    ping 24.1.3.2 repeat size 1000

    配置ppp multilink的LFI
    ------------------------------------------------------------------
    R2:
    int multilink 24
    ppp multilink fragment 50
    ppp multilink interleave
    fair-queue
    exit

    R4:
    int multilink 24
    ppp multilink fragment 50
    ppp multilink interleave
    fair-queue
    exit

    队列机制改为WFQ,不然LFI功能不会被激活

    R2:
    show ppp multilink

    R4:
    ping 24.1.3.2 repeat 1 size 200

    12.配置链路分片和交叉离开LFI-FR接口
    ----------------------------------------------------------------------------
    实验目的:
    1).配置在帧中继接口下的LFI,规范为FRF.12

    1).配置FRF.12,接口必须使能FRTS
    2).在有VOIP语音流量的帧中继接口上使用
    3).如果数据报文大于设定的分片长度,会被分片
    4).分片的数据报文和语音报文会交叉离开路由器进入帧中继网络

    R2/R4:
    show run int s2/1
    show run int s2/1.1

    R2/R4:
    int s2/1
    frame-relay traffic-shaping
    exit

    R2:
    map-class frame-relay lfi
    frame-relay fragment 80
    frame-relay cir 256000
    frame-relay mincir 128000
    exit

    int s2/1.1
    frame-relay interface-dlci 204
    class lfi
    exit

    R4:
    map-class frame-relay lfi
    frame-relay fragment 80
    frame-relay cir 256000
    frame-relay mincir 128000
    exit

    int s2/1.1
    frame-relay interface-dlci 402
    class lfi
    exit

    show frame-relay fragment

    13.在路由器上配置auto qos voip
    ----------------------------------------------------------------------------
    实验目的:
    1).理解auto qos的trust模式和untrust模式
    2).理解auto qos在高速串口链路(接口带宽大于768kbps)上自动生成的配置和低速串口链路上自动生成的配置

    1).Trust模式是信任邻居对VOIP数据包打的QoS标记,直接利用标记对数据包进行分类
    2).Untrust模式是不信任邻居对VOIP数据包打的QoS标记,利用VOIP的协议特点来对数据包进行分类
    3).在网络的QoS信任边界配置模式为untrust
    4).在信任QoS标记的网络内部,配置为trust模式
    5).在串行链路带宽小于等于768kbps的情况下,配置auto qos voip后,接口自动封装为PPP,会自动生成PPP multilink接口,并把接口方法PPP multilink接口下,激活PPP multilink的LFI功能和TCP、RTP的头部压缩功能
    6).在以太接口上配置的auto qos voip生成的配置和高速串口链路(接口带宽大于768kbps)上自动生成的配置一样

    R4:
    int s2/0
    bandwidth 768
    auto qos voip trust
    exit

    show running-config

    int s2/0
    no bandwidth
    no auto qos voip trust
    exit

    int s2/0
    auto qos voip trust
    no fair-queue
    auto qos voip trust
    exit

    show running-config

    int s2/0
    no auto qos voip trust
    aoto qos voip
    exit

    show running-config

    14.配置auto qos enterprise
    ----------------------------------------------------------------------------

  • 相关阅读:
    Selenium入门15 截图
    selenium入门14 窗口切换
    Locust的官网及安装
    命令行输入Jmeter提示不是内部或外部命令,处理方式:添加环境变量
    python pip安装报错python setup.py egg_info failed with error code 1
    Selenium入门13 cookie的增删改查
    Selenium入门12 鼠标和键盘事件
    Selenium入门11 滚动条控制(通过js)
    Selenium入门10 弹出框的处理 switch_to.alert
    Selenium入门9 上传文件
  • 原文地址:https://www.cnblogs.com/thlzhf/p/3247563.html
Copyright © 2011-2022 走看看