Cisco路由器配置基于类的加权公平队列

网络工程师配置基于类的加权公平队列

网络工程师配置基于类的加权公平队列(CBWFQ)
【实验名称】
Cisco路由器配置基于类的加权公平队列(CBWFQ)

【实验目的】
掌握Cisco路由器配置基于类的加权公平队列(CBWFQ)的原理及配置。

【背景描述】
假设校园网通过一台路由器连接到校园外的另一台路由器上,现要在路由器上做适当配置,实现校园网内部主机与校园网外部主机的相互通信。
该网络存在的问题是:当校园网内部主机与校园网外部主机的相互通信时,小数据量对延时敏感的应用得不到应有的服务质量,例如:在对主机进行远程登陆访问时,输入命令后很长时间内无法得到主机的回应。本实验以2台R2624路由器为例,路由器分别为Router1和Router2,路由器之间通过串口采用V35 DCE/DTE电缆连接 。PC1的IP地址和缺省网关分别为172.16.1.11和172.16.1.1,PC2的IP地址和缺省网关分别为172.16.3.22和172.16.3.2 ,网络掩码都是255.255.255.0

【实现功能】
实现网络的互连互通,从而实现信息的共享和传递,并且使小数据量对延时敏感的应用得到应有的服务质量。
实验设备】
R2624(2台)、V35 DTE线缆(1根)、V35 DCE线缆(1根)

【实验步骤】

第一步:在路由器Router1上配置接口的IP地址和串口上的时钟频率
Router1(config)# interface fastethernet 0 !进入接口F0的配置模式
Router1(config-if)# ip address 172.16.1.1 255.255.255.0 !配置路由器接口F0的IP地址
Router1(config)# no shutdown !开启路由器fastethernet0接口
!
Router1(config)# interface serial 0 !进入接口S0配置模式
Router1(config-if)# ip address 172.16.2.1 255.255.255.0 !配置路由器接口S0的IP地址
Router1(config-if)#clock rate 64000 !配置Router1的时钟频率(DCE)
Router1(config)# no shutdown !开启路由器fastethernet0接口

验证测试:验证路由器接口的配置
Router1#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0 172.16.1.1 YES manual up up

Serial0 172.16.2.1 YES manual down down

Serial1 unassigned YES unset administratively down down

Router1#show interface serial 0
Serial0 is down, line protocol is down
Hardware is HDLC4530A
Internet address is 172.16.2.1/24
MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/0 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 8 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=down DSR=down DTR=down RTS=down CTS=down

第二步:在路由器Router1上配置静态路由
Router1(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.2

Router1(config)#ip route 172.16.3.0 255.255.255.0 serial 0

验证测试:验证Router1上的静态路由配置
Router1#show ip route
Codes: C – connected, S – static, R – RIP
O – OSPF, IA – OSPF inter area
E1 – OSPF external type 1, E2 – OSPF external type 2

Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.1.0 is directly connected, FastEthernet0
C 172.16.2.0 is directly connected, Serial0
S 172.16.3.0/24 [1/0] via 172.16.2.2

第三步:在路由器Router2上配置接口的IP地址和串口上的时钟频率
Router2(config)# interface fastethernet 0 !进入接口F0的配置模式
Router2(config-if)# ip address 172.16.3.2 255.255.255.0 !配置路由器接口F0的IP地址
Router2(config)# no shutdown !开启路由器fastethernet0接口
!
Router2(config)# interface serial 0 !进入接口S0配置模式
Router2(config-if)# ip address 172.16.2.2 255.255.255.0 !配置路由器接口S0的IP地址
Router2(config)# no shutdown !开启路由器fastethernet0接口

验证测试:验证路由器接口的配置
Router2#show ip interface brief
Interface IP-Address OK? Method Status Protocol

FastEthernet0 172.16.3.2 YES manual up up

Serial0 172.16.2.2 YES manual up up

Serial1 unassigned YES unset administratively down down

Router2#show nterface serial 0
Serial0 is up, line protocol is up
Hardware is HDLC4530A
Internet address is 172.16.2.2/24
MTU 1500 bytes, BW 2048 Kbit, DLY 20000 usec, rely 255/255, load 1/255
Encapsulation HDLC, loopback not set, keepalive set (10 sec)
Last input never, output never, output hang never
Last clearing of “show interface” counters never
Input queue: 0/75/0 (size/max/drops); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/64/0 (size/threshold/drops)
Conversations 0/0 (active/max active)
Reserved Conversations 0/0 (allocated/max allocated)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
0 packets output, 0 bytes, 0 underruns
0 output errors, 0 collisions, 8 interface resets
0 output buffer failures, 0 output buffers swapped out
0 carrier transitions
DCD=up DSR=up DTR=up RTS=up CTS=up

第四步:在路由器Router2上配置静态路由
Router2(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1

Router2(config)#ip route 172.16.3.0 255.255.255.0 serial 0

验证测试:验证Router2上的静态路由配置
Router2#show ip route
Codes: C – connected, S – static, R – RIP
O – OSPF, IA – OSPF inter area
E1 – OSPF external type 1, E2 – OSPF external type 2

Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.3.0 is directly connected, FastEthernet0
C 172.16.2.0 is directly connected, Serial0
S 172.16.1.0/24 [1/0] via 172.16.2.1

第五步:测试网络的互连互通性
C:\>ping 172.16.3.22 !从PC1 ping PC2
Pinging 172.16.3.22 with 32 bytes of data:

Reply from 172.16.3.22: bytes=32 time<10ms TTL=126
Reply from 172.16.3.22: bytes=32 time<10ms TTL=126
Reply from 172.16.3.22: bytes=32 time<10ms TTL=126
Reply from 172.16.3.22: bytes=32 time<10ms TTL=126

C:\>ping 172.16.1.11 !从PC2 ping PC1
Pinging 172.16.1.11 with 32 bytes of data:

Reply from 172.16.1.11: bytes=32 time<10ms TTL=126
Reply from 172.16.1.11: bytes=32 time<10ms TTL=126
Reply from 172.16.1.11: bytes=32 time<10ms TTL=126
Reply from 172.16.1.11: bytes=32 time<10ms TTL=126

第六步:PC2需要安装Win2000 Server系统,并且将其配置为telnet服务器和FTP服务器

第七步:从PC1对PC2进行telnet,同时从PC2中复制文件,观察telnet的响应效果

第八步:在Router1上定义CBWFQ
Router1(config)#access-list 100 permit tcp any any eq telnet !定义Telnet数据流
Router1(config)#access-list 101 permit tcp any any eq ftp
Router1(config)#access-list 101 permit tcp any any eq ftp-data !定义Ftp数据流
Router1(config)#class-map class1
Router1(config-cmap)#match access-group 100 !定义类映射class1
Router1(config)#class-map class2
Router1(config-cmap)#match access-group 101 !定义类映射class1
Router1(config)#policy-map policy1 ! 定义策略映射policy1
Router1(config-pmap)#class class1
Router1(config-pmap-c)#bandwidth 64 !为类映射class1分配64K的带宽
Router1(config-pmap)#class class2
Router1(config-pmap-c)#bandwidth 512 !为类映射class2分配512K的带宽

第八步:在Router1的WAN0接口上启用CBWFQ
Router1(config)# interface serial 0 !进入接口S0配置模式
Router1(config-if)#service-policy output policy1 !启用CBWFQ

 

第九步:从PC1对PC2进行telnet,同时从PC2中复制文件,再次观察telnet的响应效果

【注意事项】
如果两台路由器通过串口直接互连,则必须在其中一端设置时钟频率(DCE)。
实验效果可能不十分明显。

【参考配置】
Router1#show running-config ! 显示路由器Router1的全部配置
Router2#show running-config ! 显示路由器Router2的全部配置

成为第一个发表评论的人

发表评论

您的电子邮件地址不会被公开.


*