第1章 QoS配置命令
1.1 QoS配置命令
QoS配置命令包括:
l class
l class-map
l custom-queue-list
l fair-queue
l policy-map
l priority-group
l priority-list default
l priority-list interface
l priority-list protocol
l priority-list queue-limit
l queue-list default
l queue-list interface
l queue-list protocol
l queue-list queue byte-count
l queue-list queue limit
l random-detect
l service-policy
l show class-map
l show policy-map
l show queue
l show queueing
1.1.1 class
要配置當前策略映像所用的類型映像的名字,所佔帶寬和隊列上限,可使用策略映像配置態中的配置命令class,使用本命令的no形式從策略映像中刪除某個類型映像或恢復參數的默認值。
class class-name bandwidth bandwidth(kbps) [queue-limit packet-number]
no class class-name bandwidth bandwidth(kbps) [queue-limit packet-number]
參數
參數 | 參數說明 |
---|---|
class-name | 類型映象的名字(最長64個字符)。 |
bandwidth | 帶寬大小。 |
packet-number | 隊列最大長度。 |
缺省
隊列最大長度缺省爲64, 帶寬大小無缺省值。
命令模式
策略映像配置模式
使用說明
無
相關命令
class-map
policy-map
service-policy
1.1.2 class-map
要定義某種類型的流,可以使用全局配置命令class-map,使用本命令的no形式刪除某個類型映像。
class-map class-name match protocol protocol-type
class-map class-name match interface interface-type interface-number
class-map class-name match access-group list-name
no class-map class-name
參數
參數 | 參數說明 |
---|---|
class-name | 類型映象的名字(最長64個字符)。 |
protocol-type | 協議類型。 |
interface-type | 接口名。 |
interface-number | 接口號。 |
List-name | 訪問列表名。 |
缺省
無
命令模式
全局配置模式
使用說明
無
相關命令
class
policy-map
service-policy
1.1.3 custom-queue-list
要在一個接口上使用CQ算法,可使用接口配置命令custom-queue-list,使用本命令的no形式取消CQ算法。
custom-queue-list list-number
no custom-queue-list list-number
參數
參數 | 參數說明 |
---|---|
list-number | 自定義列表號(1-16)。 |
缺省
無
命令模式
接口配置模式
使用說明
無
相關命令
queue-list default
queue-list interface
queue-list protocol
queue-list queue byte-count
queue-list queue limit
1.1.4 fair-queue
要在一個接口上使用公平排隊策略,可使用接口配置命令fair-queue,使用本命令的no形式取消公平排隊策略(恢復到先入先出)。
fair-queue
no fair-queue
參數
無
缺省
在運行速率爲2.048Mbps或者更低的接口上,WFQ是默認的排隊模式。
命令模式
接口配置模式
使用說明
在配置了X25和LAPB的接口,此命令無效。
相關命令
class
class-map
policy-map
service-policy
1.1.5 policy-map
要配置一個策略映像,可以使用全局配置命令policy-map,使用本命令的no形式刪除某個策略映像。
policy-map policy-name
no policy-map policy-name
參數
參數 | 參數說明 |
---|---|
policy -name | 策略映象的名字(最長64個字符)。 |
缺省
無
命令模式
全局配置模式
使用說明
執行此命令可進入策略映像配置態。
相關命令
class
class-map
service-policy
1.1.6 priority-group
要在一個接口上使用PQ算法,可使用接口配置命令priority-group,使用本命令的no形式取消PQ算法。
priority-group list-number
no priority-group list-number
參數
參數 | 參數說明 |
---|---|
list-number | 優先權列表號(1-16)。 |
缺省
無
命令模式
接口配置模式
使用說明
無
相關命令
priority-list default
priority-list interface
priority-list protocol
priority-list queue-limit
1.1.7 priority-list default
要爲那些不符合優先權列表內的任何規則的數據包,分配一個優先權隊列,可使用全局配置命令priority-list default,使用本命令的no形式恢復缺省值。
priority-list list-number default {high | medium | normal | low}
no priority-list list-numberdefault
參數
參數 | 參數說明 |
---|---|
list-number | 優先權列表號(1-16)。 |
high | medium | normal | low | 優先級別。 |
缺省
每個優先權列表缺省值爲普通(normal)。
命令模式
全局配置模式
使用說明
無
相關命令
priority-group
priority-list interface
priority-list protocol
priority-list queue-limit
1.1.8 priority-list interface
要爲進入某個給定接口的數據包建立排隊優先權,可使用全局配置命令priority-list interface,使用本命令的no形式刪除某個定義。
priority-list list-number interface interface-type interface-number {high | medium | normal | low}
no priority-list list-number interface interface-type interface-number {high | medium | normal | low}
參數
參數 | 參數說明 |
---|---|
list-number | 優先權列表號(1-16)。 |
interface-type | 接口名。 |
interface-number | 接口號。 |
high | medium | normal | low | 優先級別。 |
缺省
無
命令模式
全局配置模式
使用說明
隊列號如果爲0,表示此類包應放入缺省隊列。
用no刪除時,可以在interface後直接輸入回車,則會把該列表所有以接口作爲匹配標準的項都刪除。如果不是這樣,則只有在接口名,接口號和優先級別全都匹配,才把該項刪除。
相關命令
priority-group
priority-list default
priority-list protocol
priority-list queue-limit
1.1.9 priority-list protocol
要根據協議的類型來建立排隊優先權,可使用全局配置命令priority-list protocol,使用本命令的no形式刪除某個定義。
priority-list list-number protocolprotocol-type {high | medium | normal | low} [keyword keyword-value]
no priority-list list-number protocolprotocol-type {high | medium | normal | low} [keyword keyword-value]
參數
參數 | 參數說明 |
---|---|
list-number | 優先權列表號(1-16)。 |
protocol-type | 協議類型(包括ip,arp,compressed_tcp)。 |
high | medium | normal | low | 優先級別。 |
keyword | 關鍵字類型(gt,lt,fragment,access-list,tcp,udp)。 |
keyword-value | 關鍵字的值(對於gt和lt來說是指包的長度;對於access-list來說是指訪問列表名;對於tcp和udp來說是指接口號;fragment無此項)。 |
缺省
無
命令模式
全局配置模式
使用說明
arp和compressed_tcp的關鍵字類型只有gt和lt。
隊列號如果爲0,表示此類包應放入缺省隊列。
用no刪除時,可以在protocol後直接輸入回車,則會把該列表所有以協議作爲匹配標準的項都刪除。如果不是這樣,則只有在協議類型,優先級別,關鍵字類型和關鍵字的值全都匹配,才把該項刪除。
相關命令
priority-group
priority-list default
priority-list interface
priority-list queue-limit
1.1.10 priority-list queue-limit
要指定每一個優先權隊列的隊列上限,可使用全局配置命令priority-list queue-limit,使用本命令的no形式恢復缺省值。
priority-list list-number queue-limit high-limit medium-limit normal-limit low-limit
no priority-list list-number queue-limit
參數
參數 | 參數說明 |
---|---|
list-number | 優先權列表號。 |
high-limit | 高優先權隊列的上限(1-32767)。 |
middle-limit | 中優先權隊列的上限(1-32767)。 |
normal-limit | 普通優先權隊列的上限(1-32767)。 |
low-limit | 低優先權隊列的上限(1-32767)。 |
缺省
默認值高20,中40,普通60,低80
命令模式
全局配置模式
使用說明
無
相關命令
priority-group
priority-list default
priority-list interface
priority-list protocol
1.1.11 queue-list default
要爲那些不符合自定義列表中的任何規則的數據包,分配一個隊列編號,可使用全局配置命令queue-list default,使用本命令的no形式恢復缺省值。
queue-list list-number default queue-number
no queue-list list-number default
參數
參數 | 參數說明 |
---|---|
list-number | 自定義列表號(1-16)。 |
queue-number | 隊列號。 |
缺省
默認爲1
命令模式
全局配置模式
使用說明
無
相關命令
queue-list interface
queue-list protocol
queue-list queue byte-count
queue-list queue limit
1.1.12 queue-list interface
要爲進入某個給定接口的數據包建立自定義隊列,可使用全局配置命令queue-list interface,使用本命令的no形式刪除某個定義。
queue-list list-number interface interface-type interface-number queue-number
no queue-list list-number interface[interface-type interface-number queue-number]
參數
參數 | 參數說明 |
---|---|
list-number | 優先權列表號(1-16)。 |
interface-type | 接口名。 |
interface-number | 接口號。 |
queue-number | 隊列號。 |
缺省
無
命令模式
全局配置模式
使用說明
隊列號如果爲0,表示此類包應放入缺省隊列。
用no刪除時,可以在interface後直接輸入回車,則會把該列表所有以接口作爲匹配標準的項都刪除。如果不是這樣,則只有在接口名,接口號和隊列號全都匹配,才把該項刪除。
相關命令
queue-list default
queue-list protocol
queue-list queue byte-count
queue-list queue limit
1.1.13 queue-list protocol
要根據協議的類型來建立自定義隊列,可使用全局配置命令queue-list protocol,使用本命令的no形式刪除某個定義。
queue-list list-numberprotocol protocol-typequeue-number [keyword keyword-value]
no queue-list list-number protocol[protocol-type queue-number keyword keyword-value]
參數
參數 | 參數說明 |
---|---|
list-number | 自定義列表號(1-16)。 |
protocol-type | 協議類型(包括ip,arp,compressed_tcp)。 |
queue-number | 隊列號。 |
keyword | 關鍵字類型(gt,lt,fragment,access-list,tcp,udp)。 |
keyword-value | 關鍵字的值(對於gt和lt來說是指包的長度;對於access-list來說是指訪問列表名;對於tcp和udp來說是指接口號;fragment無此項)。 |
缺省
無
命令模式
全局配置模式
使用說明
arp和compressed_tcp的關鍵字類型只有gt和lt。
隊列號如果爲0,表示此類包應放入缺省隊列。
用no刪除時,可以在protocol後直接輸入回車,則會把該列表所有以協議作爲匹配標準的項都刪除。如果不是這樣,則只有在協議類型,隊列號,關鍵字類型和關鍵字的值全都匹配,才把該項刪除。
相關命令
queue-list default
queue-list interface
queue-list queue byte-count
queue-list queue limit
1.1.14 queue-list queue byte-count
要指定某個自定義列表每一個隊列的發送字節數,可使用全局配置命令queue -list queue byte-count,使用本命令的no形式恢復缺省值。
queue-list list-number queue queue-number byte-count byte-count-number
no queue-list list-number queue queue-number byte-count byte-count-number
參數
參數 | 參數說明 |
---|---|
list-number | 自定義列表號。 |
queue-number | 隊列號。 |
byte-count-number | 發送字節數(1- 16777215)。 |
缺省
默認值1500
命令模式
全局配置模式
使用說明
無
相關命令
queue-list default
queue-list interface
queue-list protocol
queue-list queue limit
1.1.15 queue-list queue limit
要指定某個自定義列表每一個隊列的隊列上限,可使用全局配置命令queue -list queue limit,使用本命令的no形式恢復缺省值。
queue-list list-number queue queue-number limit limit-number
no queue-list list-number queue queue-number limit limit-number
參數
參數 | 參數說明 |
---|---|
list-number | 自定義列表號。 |
queue-number | 隊列號。 |
limit-number | 隊列的上限(1-32767)。 |
缺省
默認值20
命令模式
全局配置模式
使用說明
無
相關命令
queue-list default
queue-list interface
queue-list protocol
queue-list queue byte-count
1.1.16 random-detect
要在一個接口上配置加權早期隨機檢測,可以使用接口配置命令random-detect,使用本命令的no形式恢復缺省值。
random-detect
no random-detect
參數
無
缺省
無
命令模式
接口配置模式
使用說明
在配置了X25和LAPB的接口,此命令無效。
相關命令
無
1.1.17 service-policy
要在一個接口上配置某個策略映像,可以使用接口配置命令service-policy,使用本命令的no形式從接口上刪除策略映像
service-policy policy-name
no service-policy
參數
參數 | 參數說明 |
---|---|
policy-name | 策略映象的名字(最長64個字符)。 |
缺省
無
命令模式
接口配置模式
使用說明
只在配置了WFQ 算法的接口有效。
相關命令
class-map
fair-queue
policy-map
1.1.18 show class-map
要顯示類型映像的配置,可以使用授權模式命令show class-map。
show class-map [class-name]
參數
參數 | 參數說明 |
---|---|
class-name | 類型映象的名字(最長64個字符)。 |
缺省
無
命令模式
授權命令模式
使用說明
如果輸入名字,只顯示該類型映像的配置,否則顯示所有類型映像的配置。
相關命令
class-map
1.1.19 show policy-map
要顯示策略映像的配置,可以使用授權模式命令show policy-map
show policy-map [policy-name]
參數
參數 | 參數說明 |
---|---|
policy-name | 策略映象的名字(最長64個字符)。 |
缺省
無
命令模式
授權命令模式
使用說明
如果輸入名字,只顯示該策略映像的配置,否則顯示所有策略映像的配置。
相關命令
policy-map
1.1.20 show queue
要顯示接口的隊列的狀況,可以使用授權模式命令show queue。
show queue interface-type interface-number
參數
參數 | 參數說明 |
---|---|
interface-type | 接口名。 |
interface-number | 接口號。 |
缺省
無
命令模式
授權命令模式
使用說明
無
相關命令
無
1.1.21 show queueing
要顯示自定義列表的配置或優先權列表的配置,可以使用授權模式命令show queueing。
show queueing {custom | priority}
參數
無
缺省
無
命令模式
授權命令模式
使用說明
無
相關命令
無
第2章 CRTP配置命令
本章介紹CRTP命令。CRTP用在低速串行鏈路上,可以用來對RTP報文的頭部進行壓縮,有效降低帶寬佔用率,同時由於報文長度的減小,在這類鏈路上報文傳輸的延時也可以大大減小。
2.1 CRTP配置命令
CRTP配置命令包括:
l debug ip rtp header-compression
l ip rtp compression-connections
l ip rtp header-compression
l show ip rtp header-compression
2.1.1 debug ip rtp header-compression
[no] debug ip rtp header-compression
命令模式
全局模式
示例
Router#debug ip rtp header-compression
21:39:30: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30315, Gen = 0
21:39:30: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23507, Gen = 0
21:39:30: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30316, Gen = 0
21:39:30: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23508, Gen = 0
21:39:31: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30317, Gen = 0
21:39:31: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23509, Gen = 0
21:39:31: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30318, Gen = 0
21:39:31: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23510, Gen = 0
21:39:31: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30319, Gen = 0
21:39:31: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23511, Gen = 0
21:39:31: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30320, Gen = 0
21:39:31: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23512, Gen = 0
21:39:31: RHC Serial1/0: output COMPRESSED_RTP, conn 0, cksum 0x0000, seq 30321, Gen = 0
21:39:31: RHC Serial1/0: recv COMPRESSED_RTP, conn 0, cksum 0x0000, seq 23513, Gen = 0
以下的表格描述了CRTP debug命令輸出的解釋:
域 | 解釋 |
---|---|
21:39:31 | 系統當前時間 |
RHC | RTP header compression |
Serial 1/0 | Interface號 |
Recv(output) | 輸入或輸出 |
COMPRESSED_RTP(uncompress) | 報文類型 |
Conn | 連接號 |
Cksum | UDP校驗和 |
Seq | RTP序列號 |
Gen | CRTP報文的generation值 |
2.1.2 ip rtp header-compression
在串行鏈路上激活CRTP,需要在interface配置模式下使用這個命令;禁止CRTP需要使用命令的no形式。
ip rtp header-compression [{iphc-format | passive}]
no ip rtp header-compression
參數
參數 | 參數說明 |
---|---|
iphc-format | 遵從rfc2507 IPHC規範的CRTP協議。 |
passive | 在接收到對端的CRTP報文後開始發送CRTP報文。 |
缺省值
在未配置該命令的情況下爲禁止狀態。配置該命令時在不加可選參數的情況下默認爲iphc-format。
命令模式
interface配置模式。
使用說明
目前我們只在PPP封裝的串行鏈路上支持CRTP,以後會擴展到Frame Relay、HDLC及ISDN端口等。在使用時必須在串行鏈路的兩端同時配置該命令,否則不起作用。同時,在報文的有效負荷相對頭部較小的情況下,這個協議較爲適用,但在頭部遠小於淨荷的情況下,反而會增加路由器對報文的處理開銷適得其反。因此,一般在傳輸類似RTP報文的鏈路上使用該協議。
示例
Router_config#interface serial 1/2
Router_config_s1/2#ip rtp header-compression
Router_config_s1/2#ip rtp compression-connections 25
Router_config_s1/2#enc ppp
Router_config_s1/2#
2.1.3 ip rtp compression-connections
ip rtp compression-connections number
no ip rtp compression-connections
參數
參數 | 參數說明 |
---|---|
number | 本地保存的CRTP最大連接數,範圍在3-256之間,缺省爲15。 |
缺省值
15個連接。
命令模式
interface配置模式。
使用說明
一般可以估計在該鏈路上可能同時出現的RTP會話個數,配置連接數大於它即可。
示例
Router_config#interface serial 1/2
Router_config_s1/2#ip rtp header-compression
Router_config_s1/2#ip rtp compression-connections 25
Router_config_s1/2#enc ppp
Router_config_s1/2#
2.1.4 show ip rtp header-compression
show ip rtp header-compression [type number] [detail]
參數
參數 | 參數說明 |
---|---|
type number | (可選)interface的類型和interface號,如serial 0/0。 |
detail | (可選)顯示每個連接詳細的信息。 |
命令模式
全局模式
顯示示例
Router#sh ip rtp header-compression
RTP/UDP/IP header compression statistics:
Interface Serial1/0:
Rcvd: 8900 total, 8858 compressed, 0 errors
0 dropped, 0 buffer copies, 0 buffer failures
Sent: 8907 total, 8865 compressed,
336735 bytes saved, 197685 bytes sent
Connect: 15 rx slots, 15 tx slots, 14 long searches, 1 misses
Router#
命令顯示的關鍵字解釋見下表:
關鍵字 | 解釋 |
---|---|
Interface Serial1/0: | Interface號和interface類型。 |
Rcvd: total | 在該端口上收到的CRTP報文總數。 |
compressed | 壓縮的CRTP報文總數。 |
Errors | 收到的錯誤報文總數。 |
dropped | 收到的報文被直接刪除的總數。 |
buffer copies, | 必須被複制保存的報文數。 |
buffer failures | 在恢復成正常IP報文時申請內存失敗次數。 |
Sent: total | 發送的CRTP報文總數。 |
compressed | 發送的壓縮CRTP報文總數。 |
bytes saved | 節約的字節數。 |
bytes sent | 實際發送的字節數。 |
Connect: rx slots | 接收的數據結構總數。 |
tx slots | 發送數據結構總數。 |
long searches | 需要在發送數據結構中搜索以確定使用哪一個的次數。 |
Misses | 查找數據結構失敗次數。 |
第3章 CTCP配置命令
本章介紹CTCP命令。CTCP用在低速串行鏈路上,可以用來對TCP/IP報文的頭部進行壓縮,有效降低帶寬佔用率,同時由於報文長度的減小,在這類鏈路上報文傳輸的延時也可以大大減小。CTCP在使用TELNET之類的需要良好響應速度的交互協議上效果尤爲顯著。
3.1 CTCP配置命令
CTCP配置命令包括:
l debug ip tcp header-compression
l ip tcp compression-connections
l ip tcp header-compression
l show ip tcp header-compression
3.1.1 debug ip tcp header-compression
[no] debug ip tcp header-compression
命令模式
全局配置態
示例
Router#debug ip tcp h
TCP header compression debug is enalbed!
22:17:02: THC Serial1/0: new connection, conn 0
22:17:02: THC Serial1/0: output uncompressed, conn 0, cksum 0xA286, seq 95270092
22:17:02: THC Serial1/0: output COMPRESSED_TCP, conn 0, cksum 0x9F7D, seq 952702
22:17:02: THC Serial1/0: recv uncompressed, conn 0, cksum 0xA17F, seq 1220171780
22:17:02: THC Serial1/0: output uncompressed, conn 0, cksum 0xA283, seq 95270095
22:17:02: THC Serial1/0: recv COMPRESSED_TCP, conn 0, cksum 0x24CC, seq 12201713
22:17:02: THC Serial1/0: output COMPRESSED_TCP, conn 0, cksum 0xA283, seq 952705
以下的表格描述了CTCP debug命令輸出的解釋:
域 | 解釋 |
---|---|
22:17:02 | 系統當前時間 |
THC | TCP header compression |
Serial 1/0 | Interface號 |
Recv(output) | 輸入或輸出 |
COMPRESSED_TCP uncompressed) | 報文類型 |
Conn | 連接號 |
Cksum | UDP校驗和 |
Seq | RTP序列號 |
3.1.2 ip tcp header-compression
在串行鏈路上激活CTCP,需要在interface配置模式下使用這個命令;禁止CTCP需要使用命令的no形式。
ip tcp header-compression [{iphc-format | passive}]
no ip tcp header-compression
參數
參數 | 參數說明 |
---|---|
iphc-format | (可選)遵從rfc2507 IPHC規範的CTCP協議。 |
passive | (可選)在接收到對端的CTCP報文後開始發送CTCP報文 |
缺省值
在未配置該命令的情況下爲禁止狀態。配置該命令時在不加可選參數的情況下默認爲iphc-format。
命令模式
接口配置模式。
使用說明
目前我們只在PPP封裝的串行鏈路上支持CTCP,以後會擴展到Frame Relay、HDLC及ISDN端口等。在使用時必須在串行鏈路的兩端同時配置該命令,否則不起作用。同時,在報文的有效負荷相對頭部較小的情況下,這個協議較爲適用,但在頭部遠小於淨荷的情況下,反而會增加路由器對報文的處理開銷適得其反。
我們的CTCP實現中如果配置了CRTP後,不管其後是否再配置TCP/IP頭部壓縮,均同時採用基於rfc2507的IPHC格式的CRTP與TCP/IP頭部壓縮,因此,如果對端是僅支持rfc1144規定的TCP/IP頭部壓縮規範的終端,是無法對通的。另外,如果在本端不配CRTP的前提下,配置TCP/IP頭部壓縮,在PPP協議中,如果對端請求以rfc2507規範的TCP/IP頭部壓縮協商,則通過,並支持CRTP與rfc2507規範的TCP/IP頭部壓縮;否則,支持rfc1144規定的TCP/IP頭部壓縮規範。
示例
Router_config#interface serial 1/2
Router_config_s1/2#ip tcp header-compression
3.1.3 ip tcp compression-connections
ip tcp compression-connections number
no ip tcp compression-connections
參數
參數 | 參數說明 |
---|---|
number | 本地保存的CTCP最大連接數,範圍在3-256之間,缺省爲16。 |
缺省值
16個連接。
命令模式
接口配置態。
使用說明
一般可以估計在該鏈路上可能同時出現的TCP/IP會話個數,配置連接數大於它即可。
示例
Router_config#interface serial 1/2
Router_config_s1/2#ip tcp header-compression
Router_config_s1/2#ip tcp compression-connections 25
Router_config_s1/2#enc ppp
Router_config_s1/2#
3.1.4 show ip tcp header-compression
show ip tcp header-compression [type number] [detail]
參數
參數 | 參數說明 |
---|---|
type number | (可選)interface的類型和interface號,如serial 1/2。 |
detail | (可選)顯示每個連接詳細的信息。 |
命令模式
全局模式
示例
Router#sh ip tcp header-compression
IP/TCP header compression statistics:
Interface Serial1/0:
Rcvd: 8900 total, 8858 compressed, 0 errors
0 dropped, 0 buffer copies, 0 buffer failures
Sent: 8907 total, 8865 compressed,
336735 bytes saved, 197685 bytes sent
Connect: 16 rx slots, 16 tx slots, 15 long searches, 1 misses
Router#
命令顯示的關鍵字解釋見下表:
關鍵字 | 解釋 |
---|---|
Interface Serial1/0: | Interface號和interface類型。 |
Rcvd: total | 在該端口上收到的CTCP報文總數。 |
compressed | 壓縮的CTCP報文總數。 |
errors | 收到的錯誤報文總數。 |
dropped | 收到的報文被直接刪除的總數。 |
buffer copies, | 必須被複制保存的報文數。 |
buffer failures | 在恢復成正常IP報文時申請內存失敗次數。 |
Sent: total | 發送的CTCP報文總數。 |
compressed | 發送的壓縮CTCP報文總數。 |
bytes saved | 節約的字節數。 |
bytes sent | 實際發送的字節數。 |
Connect: rx slots | 接收的數據結構總數。 |
tx slots | 發送數據結構總數。 |
long searches | 需要在發送數據結構中搜索以確定使用哪一個的次數。 |
Misses | 查找數據結構失敗次數。 |
第4章 DLC配置命令
4.1 DLC配置命令
DLC配置命令包括:
l dlc-compresslempel-ziv
l dlc-compress mppc
l debug compress events
l debug compress error
l debug compress packet
l show compress-statistics
4.1.1 dlc-compress lempel-ziv
在接口配置LZ 壓縮協議
dlc-compress Lempel-Ziv [mode mode-number]
no dlc-compress Lempel-Ziv
參數
參數 | 參數說明 |
---|---|
mode-number | 壓縮模式,取值範圍爲1-10,缺省爲4。 |
缺省
no dlc-compress Lempel-Ziv
命令模式
接口配置態
使用說明
端口必須封裝PPP,對端必須配置相同的壓縮協議(STAC LZS),該命令纔有效。
壓縮模式mode-number數值越大,壓縮比越大,但佔CPU資源也越多,用戶在使用時要注意整體性能。建議使用小於等於4的數值。
示例
router>enable
router#config
router_config#interface s1/0
router_config_s1/0#enca ppp
router_config_s1/0# dlc-compress Lempel-Ziv
配置後可以通過show compress-statistics命令來查看配置是否生效,應該注意的是,由於壓縮縮協議的PPP協商需要一秒左右的時間,所以建議用戶等一秒後,運行show compress命令,如果我們能看到以下信息,說明配置已經生效。
Router#show compress
DLC Data Statistics ---
In interface Serial0/0 compress type Lempel-Ziv
Receive bytes compressed: 0
Receive bytes decompressed: 0
sent bytes compresseds: 0
sent bytes original: 0
resyns: 0
4.1.2 dlc-compress mppc
在接口配置MPPC 壓縮協議。
dlc-compress MPPC
No dlc-compress
參數
無
缺省
no dlc-compress
命令模式
接口配置態
使用說明
端口必須封裝PPP,對端必須配置相同的壓縮協議(MPPC),該命令纔有效。
示例
router>enable
router#config
router_config#interface s1/0
router_config_s1/0#enca ppp
router_config_s1/0# dlc-compress MPPC
配置後可以通過show compress-statistics命令來查看配置是否生效,應該注意的是,由於壓縮縮協議的PPP協商需要一秒左右的時間,所以建議用戶等一秒後,運行show compress命令,如果我們能看到以下信息,說明配置已經生效。
Router#show compress
DLC Data Statistics ---
In interface Serial0/0 compress type MPPC
Receive bytes compressed: 0
Receive bytes decompressed: 0
sent bytes compresseds: 0
sent bytes original: 0
resyns: 0
4.1.3 debug compress events
打開調試壓縮解壓縮相關事件的調試信息的開關
debug compress events
no debug compress events
參數
無
缺省
no debug compress events
命令模式
管理態
使用說明
只有配置了壓縮協議才真正有效
示例
router>enable
router# debug compress events
當PPP鏈路上有負載報文通過時,我們能看到如下調試信息(假設配置Lempel-Ziv壓縮算法):
router#ping 3.1.1.2
PING 3.1.1.2 (3.1.1.2): 56 data bytes
!!!!!
--- 3.1.1.2 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 10/12/20 ms
router#2004-2-13 14:29:01 DLC Serial3/2:0: LZ Comp : Pkt Head is 0xC006, History head pos is 511, len: 24, loc seq: 0x6
2004-2-13 14:29:01 DLC Serial3/2:0: LZ Decomp: Pkt Head is 0xC006, History head pos is 510, len:85, loc seq: 0x6, peer seq: 0x6
2004-2-13 14:29:01 DLC Serial3/2:0: LZ Comp : Pkt Head is 0xC007, History head pos is 596, len: 22, loc seq: 0x7
2004-2-13 14:29:01 DLC Serial3/2:0: LZ Decomp: Pkt Head is 0xC007, History head pos is 595, len:85, loc seq: 0x7, peer seq: 0x7
4.1.4 debug compress error
打開調試壓縮解壓縮相關錯誤的調試信息的開關
debug compress error
no debug compress error
參數
無
缺省
no debug compress error
命令模式
管理態
使用說明
只有配置了壓縮協議才真正有效 。
示例
router>enable
router # debug compress error
此調試開關打開後,當報文壓縮和解壓縮後的報文大小超過預分配的Buffer,或者出現壓縮或者解壓錯誤時,會打出信息,如:
2068-1-22 23:35:55 DLC Serial2/0:0: STAC LZS Comp : Comp buffer overflow! loc seq: 0x9F, err code: 0x8
2068-1-22 23:35:55 DLC Serial2/0:0: STAC LZS Comp : Comp buffer overflow! loc seq: 0xA7, err code: 0x8
2068-1-22 23:35:56 DLC Serial2/0:0: STAC LZS Comp : Comp buffer overflow! loc seq: 0xA9, err code: 0x8
2068-1-22 23:35:56 DLC Serial2/0:0: STAC LZS Comp : Comp buffer overflow! loc seq: 0xAB, err code: 0x8
又如:
2004-2-13 11:08:44 DLC Serial3/2:0: STAC LZS Decomp: Error! Sequence not identical!Pkt Head is 0xC011 Sequence Number from peer is 0x11, Local Sequence Number is 0x10
2004-2-13 11:09:09 DLC Serial3/2:0: STAC LZS Decomp: Error! Sequence not identical!Pkt Head is 0x80CC Sequence Number from peer is 0xCC, Local Sequence Number is 0xC6
4.1.5 debug compress packet
打開調試壓縮解壓縮報文的調試信息的開關
debug compress packet
no debug compress packet
參數
無
缺省
no debug compress packet
命令模式
管理態
使用說明
只有配置了壓縮協議才真正有效。
示例
router>enable
router # debug compress packet
此開關打開後,當PPP鏈路上有負載報文通過時,我們能看到如下調試信息(假設配置MPPC壓縮算法):
Router#
Router#ping 3.1.1.1 -n 1
PING 3.1.1.1 (3.1.1.1): 56 data bytes
!
--- 3.1.1.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 20/20/20 ms
Router#2068-1-23 03:38:39 DLC Serial2/0:0: MPPC Comp : Dump raw packet from local below. len:85, loc seq:0x5
21 45 00 00 54 00 12 00 00 FF 01 B3 92 03 01 01 !E..T...........
02 03 01 01 01 08 00 32 4E 00 0E 00 00 00 16 D0 .......2N.......
7E 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 ~...............
13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 ............. !"
23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 #$%&'()*+,-./012
33 34 35 36 37 34567
2068-1-23 03:38:39 DLC Serial2/0:0: MPPC Decomp: Dump compressed packet from local below. len :24
20 05 E1 5A 12 E1 59 89 70 AE 46 49 C0 18 05 00 ..Z..Y.p.FI....
01 6A 83 F7 0A FA 66 E0 .j....f.
2068-1-23 03:38:39 DLC Serial2/0:0: MPPC Decomp: Dump compressed packet from peer below. len:21, loc seq:5, peer seq:5
E1 5A 59 E1 59 4B E1 5C 8E 93 80 03 B0 1A 62 A0 .ZY.YK.\......b.
FD C2 BE 99 B8 .....
2068-1-23 03:38:39 DLC Serial2/0:0: MPPC Decomp: Dump decompressed packet below. len: 85, loc seq:5, peer seq:5
21 45 00 00 54 07 59 00 00 FF 01 AC 4B 03 01 01 !E..T.Y.....K...
01 03 01 01 02 00 00 3A 4E 00 0E 00 00 00 16 D0 .......:N.......
7E 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 ~...............
13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 ............. !"
23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 #$%&'()*+,-./012
33 34 35 36 37 34567
4.1.6 show compress-statistics
打開調試壓縮解壓縮相關事件的調試信息的開關
show compress-statistics
參數
無
缺省
無
命令模式
全局配置模式, 用戶管理模式,端口配置模式
使用說明
只有配置了壓縮協議才真正有效
示例
router>enable
router # show compress-statistics
DLC Data Statistics ---
In interface Serial2/0:0 compress type Lempel-Ziv
Receive bytes compressed: 5076
Receive bytes decompressed: 6120
sent bytes compresseds: 133111
sent bytes original: 277983
resyns: 0
通過顯示的信息我們知道端口S2/0:0配置了Lempel-Ziv壓縮算法,同時可以計算出壓縮比。對於以上信息,我們可以得出,發送通道的壓縮比:277983/133111 = 2.1, 接收通道的壓縮比爲:6120/5076 = 1.2 。
第5章 CAR配置命令
5.1 CAR配置命令
CAR配置命令包括:
l rate-limit
l show rate-limit
5.1.1 rate-limit
配置速率限制
rate-limit [input | output] [all | access-group name] bps
no rate-limit [input | output] [all | access-group name]
參數
參數 | 參數說明 |
---|---|
name | 訪問列表名字(最長20個字符)。 |
bps | 每秒的比特數(8000 - 1000000000)。 |
缺省
無
命令模式
端口配置模式
使用說明
支持的端口有同步串口,以太網端口,E1端口。
每個端口最多可配置輸入或輸出的速率限制各8條。
相關命令
無
示例
Router_config#ip access-list extended aaa
Router_config_ext_nacl#permit tcp any any eq www
Router_config#interface fastethernet 0/0
Router_config_f0/0#ip address 10.0.0.1 255.255.255.0
Router_config_f0/0#rate-limit input access-group aaa 6000000
5.1.2 show rate-limit
顯示速率限制信息
show rate-limit interface-type interface-number
參數
參數 | 參數說明 |
---|---|
interface-type | 端口類型。 |
interface-number | 端口號。 |
缺省
顯示所有端口的速率限制信息
命令模式
全局配置模式
使用說明
支持的端口有同步串口,以太網端口,E1端口。
相關命令
無
示例
Router_config#show rate-limit interface fastethernet 0/0