11 12
发新话题
打印

CCIE RS Lab 实验笔记精华

CCIE RS Lab 实验笔记精华

CCIE RS Lab 实验笔记精华
CCIE实验笔记第1章 WAN协议(HDLC)
第 1 章   WAN协议
(HDLC)
1.1         HDLC协议概述
高级数据链路控制(HDLC)是一种高效协议,Cisco版的HDLC协议和各厂商均不
兼容,主要有以下特点:
与其它厂商不兼容
快速,高效
支持keepalive机制
支持SLARP
支持STAC
Cisco路由器默认的串口封装即为HDLC,可以通过show interface serial 1/0的
输出看到默认的设置:
例1-1 通过show interface serial 1/0的输出结果:
Serial1/1 is administratively down, line protocol is down
Hardware is M4T
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
Last input never, output never, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations 0/0/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
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 runts, 0 giants, 0 throttles
     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, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     1 carrier transitions     DCD=down DSR=down DTR=up RTS=up
CTS=down
接口的详细参数可以参考本人blog上的《通过串行接口的信息获得故障诊断帮助
》一文。
HDLC需要的控制开销很小,1个位和一个结束标志字段,一个可变地址字段,一
个控制字段和一个信息长度字段。整个数据帧长度控制在7-12个byte。
利用keepalive机制验证连接完整性,DCE端发送序列号到DTE端,DTE按顺序返回
,如果序列号连续丢失3次,即关闭此链路。例1-2中可以看到链路由于没有收到
keepalive信号返回而断开。使用debug serial interface 命令看到相关的
keepalive信息。
例1-2 HDLC帧上没有收到keepalive
R1#debug serial interface
Serial network interface debugging is on
01:05:47: Serial1/0: HDLC myseq 6, mineseen 6, yourseen 2, line up 
ßkeepalive KA 
01:12:11: Serial1/0: HDLC myseq 7, mineseen 6, yourseen 2, line up  
ßKA not received
01:12:21: Serial1/0: HDLC myseq 8, mineseen 6, yourseen 2, line down   
ßstill not KA
01:12:31: Serial1/0: HDLC myseq 9, mineseen 6, yourseen 2, line down
01:12:32: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to down
01:12:41: Serial1/0: HDLC myseq 10, mineseen 6, yourseen 2, line down
例1-2中,序列号myseq字段与mineseen字段不匹配,相差大于3,表明keepalive
已经丢失3次以上,即重新初始化该链路。另一台路由器的keepalive在yourseen
字段中显示。例1-3显示了解决些问题后的调试结果:
例1-3         正常工作时的HDLC链路调试结果
01:20:11: Serial1/0: HDLC myseq 55, mineseen 0*, yourseen 1, line up
01:20:12: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to up
01:20:21: Serial1/0: HDLC myseq 56, mineseen 56*, yourseen 2, line up
01:20:31: Serial1/0: HDLC myseq 57, mineseen 57*, yourseen 3, line up
01:20:41: Serial1/0: HDLC myseq 58, mineseen 58*, yourseen 4, line up
01:20:51: Serial1/0: HDLC myseq 59, mineseen 59*, yourseen 5, line up
01:21:01: Serial1/0: HDLC myseq 60, mineseen 60*, yourseen 6, line up
01:21:11: Serial1/0: HDLC myseq 61, mineseen 61*, yourseen 7, line up
01:21:21: Serial1/0: HDLC myseq 62, mineseen 62*, yourseen 8, line up
01:21:31: Serial1/0: HDLC myseq 63, mineseen 63*, yourseen 9, line up

只有链路的layer 1正常工作时,交换keepalive机制才有效。如果DCD=up
DSR=up DTR=up RTS=up CTS=up这些项中有一项是down状态,keepalive就不工作

  HDLC通过使用STAC压缩算法支持有效载荷压缩。使用的是压缩技术是
Lempel-Ziv压缩算法,能提供良好压缩率,但是占用CPU资源。也适用于LAPB、
X.25和帧中继。
1.1.1           HDLC设置
HDLC是串口的默认封装,可以分为3个步骤:
第1步 encapsulation hdlc   配置数据封装格式为HDLC
第2步 clock rate clock_speed   对DCE端设备设置时钟,在背背实验时设置
第3步 compression stac       配置压缩(可选)
1.1.2           HDLC的“big show”和“big D”
HDLC的big show 和big debug命令包括:show interface serial_interface 和
show controllers serial_interface。
1、  show interface serial_interface
例1-4 串口的show interface 信息
R1# sho interfaces serial 1/0
Serial1/0 is up, line protocol is up      <--这两个字段分别代表OSI分层
的第1层和第2层
Hardware is M4T
Internet address is 1.1.1.1/30
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
Encapsulation HDLC, crc 16, loopback not set     <--显示封装的格
式和CRC信息
Keepalive set (10 sec)               <--keepalive值
Restart-Delay is 0 secs
Last input 00:00:08, output 00:00:03, output hang never
Last clearing of "show interface" counters 00:17:12
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: weighted fair
Output queue: 0/1000/64/0 (size/max total/threshold/drops)
     Conversations 0/1/256 (active/max active/max total)
     Reserved Conversations 0/0 (allocated/max allocated)
     Available Bandwidth 1158 kilobits/sec
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
     120 packets input, 8201 bytes, 0 no buffer
     Received 120 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     120 packets output, 8048 bytes, 0 underruns
     0 output errors, 0 collisions, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions     DCD=up DSR=up DTR=up RTS=up CTS=up
具体说明参看本从blog上《通过串行接口的信息获得故障诊断帮助》一文。

2、  show controller serial_interface
例1-5 show controller 信息
R1#sho controller serial 1/0
M4T: show controller:
PAS unit 0, subunit 0, f/w version 1-45, rev ID 0x2800001, version 1
idb = 0x63064FD0, ds = 0x63066D28, ssb=0x63067024
Clock mux=0x0, ucmd_ctrl=0x1C, port_status=0x7B
Serial config=0x8, line config=0x200
maxdgram=1608, bufpool=199Kb, 120 particles
     DCD=up DSR=up DTR=up RTS=up CTS=up
line state: up
cable type : V.11 (X.21) DCE cable, received clockrate 2015232 <--线
缆类型及确定DCE or DTE,时钟

base0 registers=0x3D000000, base1 registers=0x3D002000
mxt_ds=0x6349A76C, rx ring entries=66, tx ring entries=128
rxring=0x5A363A0, rxr shadow=0x6306CDD0, rx_head=37
txring=0x5A365E0, txr shadow=0x6306D114, tx_head=88, tx_tail=88,
tx_count=0
throttled=0, enabled=0
halted=0, last halt reason=0
Microcode fatal errors=0
rx_no_eop_err=0, rx_no_stp_err=0, rx_no_eop_stp_err=0
rx_no_buf=0, rx_soft_overrun_err=0, dump_err= 0, bogus=0,
mxt_flags=0x0
tx_underrun_err=0, tx_soft_underrun_err=0, tx_limited=1(2)
tx_fullring=0, tx_started=857
rx_int_count=764, tx_int_count=865

3、命令debug serial interface
使用debug前在设置中设定logging buffered 10000。这样可以避免大量数据占
用控制台,无法正常工作。
1.2         HDLC配置
本节中学习HDLC配置步骤方法及相关内容。
       1.2.1          实验内容
使用HDLC配置三个分公司的路由器
使用有效载荷压缩提高传输效率
只涉及WAN的配置,LAN不讨论
如图1-1配置网络

图1-1
RouterA(1.1.1.1)---------(1.1.1.2)routerB(2.2.2.2)-------- (2.2.2.1)
routerC
A为上海分公司                  B为北京总公司                       
 C为沈阳分公司
       1.2.2          所需设备
3台路由器
4条串行线缆,两条DTE公口线缆,两条DCE母口线缆
       1.2.3          实验步骤
北京总公司的router配置为DCE端,提供时钟
北京部公司的router配置主要步骤如下:
第1步 (可选)设置主机名为beijing
第2步 用encapsulation hdlc命令配置串口的HDLC封装
第3步 设置串口上的波特率    (DTE端不需要配置)
第4步 配置压缩
第5步 给串口配置IP地址
       1.2.4          完整配置示例
例1-6,三台设置的配置示例
北京总公司路由器B的配置
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname Beijing
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 1.1.1.2 255.255.255.252
serial restart_delay 0
compress stac
clockrate 115200
!         
interface Serial1/1
ip address 2.2.2.2 255.255.255.252
serial restart_delay 0
compress stac
clockrate 115200
上海分公司路由器A的配置
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname shanghai
!
logging buffered 10000 debugging
!
ip subnet-zero
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 1.1.1.1 255.255.255.252
no ip mroute-cache
compress stac
serial restart_delay 0
 
沈阳分公司路由器C的配置   
version 12.2
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname shenyang
!
ip subnet-zero
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 2.2.2.1 255.255.255.252
compress stac
serial restart_delay 0

[ 本帖最后由 Insomnia 于 2008-8-4 09:35 编辑 ]
本帖最近评分记录

TOP

第 2  章    >WAN点对点协议(PPP)
2.1         PPP协议概述
目前大多数模拟拨号连接都采用PPP做为数据链路协议,主要有下面特点:
错误检测
自动协商网络层地址
CHAP or PAP 认证
数据压缩
符合ISO标准
PPP和串行线路Internet协议(SLIP)常常使人混淆,SLIP仅仅支持IP协议,PPP
支持IP、IPX、以及AppleTalk等多协议。
PPP将数据链路层为为3个子层:
NCP   建立和协商网络层协议及相应的地址
LCP   建立链路、认证用户和检测链路质量
HDLC  在链路上封装数据包
表2-1 概述PPP及其子层
OSI层 常见协议
第3层 IP、IPX、AppleTalk
第2层 NCP、LCP、HDLC
第1层 EIA/TIA-232、X.24、V.23、V.35和ISDN等
与PPP相关的RFC:
RFC1144  TCP/IP数据包压缩
RFC1220  PPP在网桥上的扩充
RFC1334  PPP认证协议
RFC1378  PPP AppleTalk控制协议(ATCP)
RFC1552  PPP互联网数据包交换控制协议(IPXCP)
RFC1570  PPP LCP协议扩充
RFC1661  PPP协议(PPP)
RFC1662  PPP中的HDLC封装
RFC1990  PPP多链路协议(MP)
注:在http://www.isi.edu/in-notes/rfcxxxx.txt概要,xxxx代表RFC的编号。
PPP的大多数扩展功能如数据纠错及支持多种网络协议等,都是由LCP和NCP来控
制的。LCP用于配置和测试数据链路,工作方式如下:
第1步  链路建立阶段―――首先打开连接,然后确定相关通信参数(包括MTU
、compress type、及链路认证类型。链路设置完后确认帧,然后是可选的链路
质量确认阶段,LCP确定链路质量
第2步  可选(必要)的认证阶段―――两种认证方式:质询应答握手认证协
议(CHAP)和密码认证协议(PAP)。PPP本身不需要认证,cisco路由器异步线
路需要认证,建议使用CHAP认证方式。
第3步  网络层协议阶段―――LCP引导NCP激活和配置网络层协议。这一阶段
结束后即可传输数据包。
第4步  链路终止阶段―――LCP指导NCP关闭layer 3。

LCP使用3种类型LCP数据帧完成上述步骤:
链路建立帧(Link establishment frames)―――建立链路
  链路终止帧(Link terminateon frames)―――关闭链路
  链路维护帧(Link maintenance frames)―――维护链路
2.2         PPP的应用
  PPP适用接口类型:
同步
异步(R&S的考试已经不考了)
ISDN(R&S的考试已经不考了)
高速串口(HSSI)
数字用户线路(DSL)(R&S的考试不考)
2.2.1         同步串行链路上配置PPP
基本的PPP配置只需要配置PPP封装就可以了,例2-1的配置是安照图2-1进行配置

图2-1两台路由器进行PPP配置

图2-1中路由器B的串口配置为DCE端,在routerB的串口上配置clock rate。
例2-1路由器A的配置
interface Serial1/0
ip address 1.1.1.1 255.255.255.252
encapsulation ppp
no ip mroute-cache
serial restart_delay 0
例2-2路由器B的配置
interface Serial1/0
ip address 1.1.1.2 255.255.255.252
encapsulation ppp
serial restart_delay 0
clockrate 115200
2.2.2         PPP的CHAP和PAP认证
所有使用PPP的接口都可以使用CHAP和PAP进行认证。都是利用设备的惟一主机名
进行验证的,工作方式如下:
第1步  建立PPP会话,router确认LCP的认证类型
第2步  router确认CHAP or PAP方式,然后判断认证方式:
     ――检查本地用户数据库,默认设置
     ――将认证请求转发给TACACS+ or RADIUS Server
第3步  认证过程,收到认证请求回应,有回应即创建PPP,如果返回否定应答
,即拒绝连接请求。

LCP确定链路参数后开始执行CHAP or PAP。PAP通过明文发送密码,router对其
进行确认,安全性差
CHAP在质询过程中使用MD5散列发生器产生一个128位的随机数,在链路上传送这
些散列数及其限定字符。
初始化的router send 质询信号到romte rouer。Reomte router 回应下面4部分
重要信息:
CHAP质询信号数据包类型识别号
身份标识(ID)的版本号,识别质询信号序列号
一个随机数
发出质询信号的router的hostname
Remote router received ,than search 与此username相对应的密码,Than身份
标识,随机数及密码都输入到MD5散列发生器里,产生一个散列数。然后随同
CHAP应答数据包类型识别号、身份标识及router hostname一起发送给始发
router,正在初始化的router同样使用MD5散列数发生器产生一个与remote
router送来的散列值相等的一个散列数,如果不相等则认证失败,链路关闭。

配置CHAP:
第1步  配置PPP封装
第2步  在local router配置一个和拨入router hostname一致的username。在
remote router上也加入一个与local router hostname 相同的username。分配
给两个username 的password必须一致。
第3步  在PPP接口下配置CHAP

  例2-3的配置是安照图2-1的网络拓扑进行配置的信息
  例2-3配置CHAP认证
RouterA:
hostname routerA

username routerB password 0 cisco
!
ip subnet-zero
!
interface Serial1/0
ip address 1.1.1.1 255.255.255.252
encapsulation ppp
no ip mroute-cache
serial restart_delay 0
ppp authentication chap

routerB:
hostname routerB
!
username routerA password 0 cisco
!
ip subnet-zero
!
interface Serial1/0
ip address 1.1.1.2 255.255.255.252
encapsulation ppp
serial restart_delay 0
clockrate 115200
ppp authentication chap

配置PAP认证
第1步  配置PPP
第2步  在本地router 加上remote router的hostname,在remote router上加
上本地router的hostname,分配给两个用户的密码必须一致。
第3步  配置PAP
          Ppp authentication pap
          Ppp pap sent-username local_device_name password password
例2-4的配置是安照图2-1的网络拓扑进行配置的信息
  例2-4配置PAP认证
RouterA:
hostname routerA

username routerB password 0 cisco
!
ip subnet-zero
!
interface Serial1/0
ip address 1.1.1.1 255.255.255.252
encapsulation ppp
no ip mroute-cache
serial restart_delay 0
ppp authentication pap
ppp pap sent-username routerA password cisco

routerB:
hostname routerB
!
username routerA password 0 cisco
!
ip subnet-zero
!
interface Serial1/0
ip address 1.1.1.2 255.255.255.252
encapsulation ppp
serial restart_delay 0
clockrate 115200
ppp authentication pap
ppp pap sent-username routerB password cisco

注:hostname and password 区分大小写
2.2.3   PPP压缩的配置
数据压缩的协商是LCP在初始化时进行,cisco有3种在PPP链路上进行有效载荷压
缩的方式:
预测压缩(Predictor)  使用无损预测算法,可以复制原始数据位流,从而
没有数据的衰减or loss,内存密集型算法,占用较多内存但不会占用过多CPU
资源。
栈式存储算法(Stacker)  基于Lempel-Ziv(LZ)的数据算法,建立一个压缩字
典的索引,than通过该索引来预测数据流中出现的下一个字符。占用较多的CPU
,和较少的内存。
Microsoft的点对点压缩(MPPC)  RFC2118阐述了这一压缩方式,和stacker一
样占用较多CPU和较少内存。
在接口上使用下面的命令进行压缩方式的配置:
compress [predictor | stac | mppc]

RFC1144中规定,TCP头部压缩采用的是Van Jacobson算法,在有许多小数据包是
非常有用,使用下面命令启用TCP头部压缩:
Ip tcp header-compression [passive]
参数passive只有在接口上入站TCP数据包压缩情况下才对出站的TCP数据包进行
压缩,没有指定即对所有数据进行压缩。

注:TCP数据头部压缩方式不能有效载荷压缩一起使用,在配置压缩之前要考虑
router的性能。
2.2.4   配置多链路捆绑PPP
是将多个物理链路合并或者捆绑成一个大逻辑链路的机制。
主要起到增加带宽,减少延时,线路备份的作用,另外一个作用是可以将不同类
型的接口捆绑为一个逻辑接口。
多链路PPP常用于:
同步接口
异步接口
ISDN  BRI and PRI
MLPPP是由LCP在初始化时设置的一个功能选项。MLPPP将packet分成多个小块的
片段同时送到远端router,LCP再将它们恢复成完整的packet。
可以在接口或拨号设备上使用下面命令对MLPPP进行配置:
Ppp multilink
Dialer load-threshold load [inbound | outbound | either]
Dialer load-threshold 命令指定阈值,当负担超过时拨号设备初始化另一条链
路,其范围从1-255。
IOS11.1开始支持MLPPP,11.3则包含了带宽分配控制协议(BACP)的功能部件。
MLPPP配置过程:
第1步  建立一个逻辑的MLPPP接口,使用interface multilink
multilink_interface_number
第2步  给MLPPP接口分配IP地址,这一步不需要多说了吧
第3步  把相应的PPP链路配置到相应的MLPPP group
          Ppp Multilink   配置启用MLPPP
     Multilink-group multilink_group_number 分配进相应的multilink
group

下面这个例子多链路捆绑的实例,在图2-2中北京和上海两个公司之间为提高带
宽,增加效率,决定使用MLPPP技术,使用两条64K的DDN线路进行捆绑。此例中
北京的路由器配置为DCE端,详细配置见例2-5所示:

例2-5 MLPPP的配置
北京路由器上的配置
hostname beijing
!
interface Multilink1
ip address 1.1.1.2 255.255.255.252
ppp multilink
multilink-group 1
!
interface Serial1/0
no ip address
encapsulation ppp
serial restart_delay 0
clockrate 115200
ppp multilink
multilink-group 1
!         
interface Serial1/1
ip address 2.2.2.2 255.255.255.252
serial restart_delay 0
clockrate 115200
!
interface Serial1/2
no ip address
encapsulation ppp
serial restart_delay 0
ppp multilink
multilink-group 1
!

上海路由器的配置
hostname shanghai
interface Multilink1
ip address 1.1.1.1 255.255.255.252
ppp multilink
multilink-group 1
!
interface Serial1/0
no ip address
encapsulation ppp
no ip mroute-cache
serial restart_delay 0
ppp multilink
multilink-group 1
!
interface Serial1/1
no ip address
encapsulation ppp
serial restart_delay 0
ppp multilink
multilink-group 1

MLPPP的验证
Show ppp multilink
例2-6 在上海路由器上执行show ppp multilink命令的结果
shanghai#sho ppp multilink

Multilink1, bundle name is beijing
Bundle up for 00:33:43
0 lost fragments, 0 reordered, 0 unassigned
0 discarded, 0 lost received, 1/255 load
0x266 received sequence, 0x264 sent sequence
Member links: 2 active, 0 inactive (max not set, min not set)   <
-链路成员有两个活跃的
    Serial1/0, since 00:52:59, last rcvd seq 000264
    Serial1/1, since 00:26:06, last rcvd seq 000265
shanghai#
Debug
在此例中我们使用debug这个调试工具结合扩展ping进行MLPPP的测试,在上海路
由器上执行debug ppp multilink fragments 这个命令,在北京路由器上执行扩
展ping,包的数量为1000个,大小为2000字节。例2-7为ping的使用,例2-8为
debug测试结果。
例2-7 ping命令执行
beijing#ping   
Protocol [ip]:
Target IP address: 1.1.1.1
Repeat count [5]: 1000   
Datagram size [100]: 2000
Timeout in seconds [2]:
Extended commands [n]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 1000, 2000-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!
略!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!
Success rate is 100 percent (1000/1000), round-trip min/avg/max =
4/119/376  

例2-8 debug 测试结果
01:04:45: Se1/1 MLP: I frag 40001EF7 size 760 direct
01:04:45: Se1/1 MLP: I frag 40001EF9 size 270 direct
01:04:45: Se1/0 MLP: O frag 80001EF6 size 758
01:04:45: Se1/1 MLP: O frag 40001EF7 size 760
01:04:45: Se1/0 MLP: O frag 80001EF8 size 268
01:04:45: Se1/1 MLP: O frag 40001EF9 size 270
01:04:45: Se1/0 MLP: I frag 80001EFA size 758 direct
01:04:45: Se1/0 MLP: I frag 80001EFC size 268 direct
01:04:45: Se1/1 MLP: I frag 40001EFB size 760 direct
01:04:45: Se1/1 MLP: I frag 40001EFD size 270 direct
01:04:45: Se1/0 MLP: O frag 80001EFA size 758
2.2.5         PPP的LAPB和LQM
两种方法加强PPP链路质量:
平衡式链路接入过程(LAPB)数字模式协商  ppp reliablelink
链路质量监控(LQM)  ppp quality
LQM发送链路质量报告(LQR)代替keepalive,只监视链路质量。
LAPB提供重传纠错功能,可以使用压缩,但不能使用MPPP。

LQM配置命令:
Ppp multilink percentage_of_successful_traffic

2.2.6         PPP的“big show”和“big D”
Show interface interface_name    提供物理端口状态
Show line x     提供物理状态和部分逻辑接口状态
Show ip route   验证PPP子网是否处在up 和active状态
Debug ppp negotiation   显示LCP协商过程,例2-6显示PPP会话过程
Debug ppp authentication   显示PPP认证错误
Debug dialer   用于拨号开始里的调试(这

例2-9 debug ppp negotiation命令结果

shanghai(config-if)# debug ppp negotiation
00:14:45: Se1/0 LCP: I CONFREQ [Closed] id 5 len 15
00:14:45: Se1/0 LCP:    AuthProto CHAP (0x0305C22305)
00:14:45: Se1/0 LCP:    MagicNumber 0x011842CD (0x0506011842CD)
00:14:45: Se1/0 LCP: Lower layer not up, Fast Starting
00:14:45: Se1/0 PPP: Treating connection as a dedicated line
00:14:45: Se1/0 PPP: Phase is ESTABLISHING, Active Open    <-ppp
negotiation begins
00:14:45: Se1/0 LCP: O CONFREQ [Closed] id 49 len 15
00:14:45: Se1/0 LCP:    AuthProto CHAP (0x0305C22305)
00:14:45: Se1/0 LCP:    MagicNumber 0x001866BC (0x0506001866BC)
00:14:45: Se1/0 LCP: O CONFACK [REQsent] id 5 len 15
00:14:45: Se1/0 LCP:    AuthProto CHAP (0x0305C22305)
00:14:45: Se1/0 LCP:    MagicNumber 0x011842CD (0x0506011842CD)
00:14:45: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
00:14:45: Se1/0 LCP: I CONFACK [ACKsent] id 49 len 15
00:14:45: Se1/0 LCP:    AuthProto CHAP (0x0305C22305)
00:14:45: Se1/0 LCP:    MagicNumber 0x001866BC (0x0506001866BC)
00:14:45: Se1/0 LCP: State is Open         
00:14:45: Se1/0 PPP: Phase is AUTHENTICATING, by both   <-CHAP 
begins
00:14:45: Se1/0 CHAP: O CHALLENGE id 3 len 29 from "shanghai" <-
CHAP challenge
00:14:45: Se1/0 CHAP: I CHALLENGE id 2 len 28 from "beijing"
00:14:45: Se1/0 CHAP: Using hostname from configured hostname
00:14:45: Se1/0 CHAP: Using password from AAA
00:14:45: Se1/0 CHAP: O RESPONSE id 2 len 29 from "shanghai"
00:14:45: Se1/0 CHAP: I RESPONSE id 3 len 28 from "beijing"
00:14:45: Se1/0 PPP: Phase is FORWARDING, Attempting Forward
00:14:45: Se1/0 PPP: Phase is AUTHENTICATING, Unauthenticated User
00:14:45: Se1/0 CHAP: I SUCCESS id 2 len 4                       <
-CHAP OK
00:14:45: Se1/0 PPP: Phase is FORWARDING, Attempting Forward
00:14:45: Se1/0 PPP: Phase is AUTHENTICATING, Authenticated User
00:14:45: Se1/0 CHAP: O SUCCESS id 3 len 4       <-CHAP OK
00:14:45: Se1/0 PPP: Phase is UP
00:14:45: Se1/0 IPCP: O CONFREQ [Closed] id 5 len 10      <-IP
Parameters
00:14:45: Se1/0 IPCP:    Address 1.1.1.1 (0x030601010101)
00:14:45: Se1/0 CDPCP: O CONFREQ [Closed] id 5 len 4
00:14:45: Se1/0 IPCP: I CONFREQ [REQsent] id 3 len 10
00:14:45: Se1/0 IPCP:    Address 1.1.1.2 (0x030601010102)
00:14:45: Se1/0 IPCP: O CONFACK [REQsent] id 3 len 10
00:14:45: Se1/0 IPCP:    Address 1.1.1.2 (0x030601010102)
00:14:45: Se1/0 IPCP: I CONFACK [ACKsent] id 5 len 10
00:14:45: Se1/0 IPCP:    Address 1.1.1.1 (0x030601010101)
00:14:45: Se1/0 IPCP: State is Open             <-IP OK
00:14:45: Se1/0 CDPCP: I CONFREQ [REQsent] id 3 len 4
00:14:45: Se1/0 CDPCP: O CONFACK [REQsent] id 3 len 4
00:14:45: Se1/0 CDPCP: I CONFACK [ACKsent] id 5 len 4
00:14:45: Se1/0 CDPCP: State is Open
00:14:45: Se1/0 IPCP: Install route to 1.1.1.2
00:14:45: Se1/0 IPCP: Add link info for cef entry 1.1.1.2
00:14:46: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0,
changed state to up
2.3         同步链路上的PPP、CHAP和LQM配置实验(lab_2)
2.3.1         实验内容
l         采用PPP协议
l         使用CHAP认证方式
l         配置LQM,保证链路不允许超过40%的包丢失率
2.3.2         实验拓扑
实验的拓扑如图2-3所示。
图2-3 实验拓扑

2.3.3         所需设备
路由器两台
背对背线缆两条
V.35公头线缆两条
2.3.4         实验步骤
A router配置为DCE端,提供时钟
B router配置为DTE端,接受时钟
主要步骤如下:
第1步 设置主机名为A
第2步 用encapsulation ppp命令配置串口的PPP封装
第3步 设置串口上的波特率    (DTE端不需要配置)
第4步 配置CHAP认证
第5步 配置对端相应主机用户和密码
第6步 配置LQM
第7步 给串口配置IP地址
2.3.5         完整配置
例2-9 是配置完后A路由器和B路由器的配置信息
hostname A
!
username B password 0 cisco
!
interface Serial1/0
ip address 1.1.1.2 255.255.255.252
encapsulation ppp
serial restart_delay 0
clockrate 115200
ppp quality 60
ppp authentication chap
   ――――――――――――――――――
hostname B

username A password 0 cisco
!
interface Serial1/0
ip address 1.1.1.1 255.255.255.252
encapsulation ppp
no ip mroute-cache
serial restart_delay 0
ppp quality 60
ppp authentication chap
ppp multilink
2.3.6         验证配置
使用下面几个工具进行检查配置,详细就不写了
show interface
debug ppp negotiation
ping

BGP路由反射-network学习笔记
提供了在大型I-BGP实现中I-BGP全网状连接问题的一个简单解决方案。
详细介绍RFC1966文档。
实验拓扑:
R1-------R7--------R3
分别用串口连接
配置如下:
R7:
hostname r7         

interface Loopback0                  
ip address 116.83.25.1 255.255.255.0
interface Loopback1            
ip address 116.83.26.1 255.255.255.0        
!
interface Ethernet0   
no ip address                     
!
interface Serial0
ip address 192.168.54.5 255.255.255.252                              

encapsulation ppp                 
no fair-queue
!
interface Serial1   
ip address 192.168.54.1 255.255.255.252      
encapsulation ppp            
!
router bgp 15210               
network 192.168.54.0
neighbor 192.168.54.2 remote-as 15210
neighbor 192.168.54.2 route-reflector-client
配置充当反射客户端的每个邻居.
neighbor 192.168.54.6 remote-as 15210
建立BGP对等体关系
neighbor 192.168.54.6 route-reflector-client
no auto-summary
!
R2:
hostname r2                     
interface Loopback0         
ip address 10.1.1.1 255.255.255.0        

!
Router bgp 15210
bgp log-neighbor-changes
network 10.1.1.0 mask 255.255.255.0
network 192.168.54.0 mask 255.255.255.0
neighbor 192.168.54.1 remote-as 15210
no auto-summary
R3:
router bgp 15210
no synchronization
bgp log-neighbor-changes
network 192.168.54.0 mask 255.255.255.0
neighbor 192.168.54.5 remote-as 15210
no auto-summary
配置过程非常简单,但是非常实用。
这是今天呆着无聊做个实验给大家个参考。
BGP对等体组-network学习笔记
在实际应用中大部分的BGP配置是比较复杂的,对等体组是简化配置的一种方法.
配置的基本步骤:
1 使用 neighbor peer-group-name peer-group 来创建BGP对等体组.
2 使用 neighbor peer-group-name 给对等体加上希望的参数.
3 使用 neighbor ip -address peer-group 将具有相同属性的BGP对等体放到一
个组里.
对比例子:
正常配置:
router bgp 100
neighbor 192.168.1.1 remote-as 200
neighbor 192.168.1.1 password cisco
neighbor 192.168.1.2 remote-as 200
neighbor 192.168.1.2 next-hop-self
neighbor 192.168.1.2 password cisco
neighbor 192.168.1.3 remote-as 200
neighbor 192.168.1.3 password cisco
neighbor 192.168.1.3 next-hop-self
neighbor 192.168.2.2 remote-as 100
neighbor 192.168.2.2 password ccie
neighbor 192.168.2.2 next-hop-self
neighbor 192.168.2.2 route-reflector-client
neighbor 192.168.2.3 remote-as 100
neighbor 192.168.2.3 password ccie
neighbor 192.168.2.3 next-hop-self
neighbor 192.168.2.3 route-reflector-client
用对等体组简化后:
router bgp 100
neighbor in peer-group
neighbor in remote-as 100
neighbor in password ccie
neighbor in next-hop-self
neighbor in route-reflector-client
neighbor 192.168.2.2 peer-group in
neighbor 192.168.2.3 peer-group in
neighbor out peer-group
neighbor out password cisco
neighbor out remote-as 200
neighbor out next-hop-self
neighbor 192.168.1.1 peer-group out
neighbor 192.168.1.2 peer-group out
neighbor 192.168.1.3 peer-group out
这样的配置对以后的管理建造了良好的环境!

CCIE试验备考之冗余备份
HRRP 热备份路由协议
  多台路由器组成一个“热备份组”,用来模拟为一个虚拟的路由器(拥有虚
拟的IP 地址和虚拟的MAC地址),在一个备份组中,只有一台路由器作为活动路
由器发送数据包,只有当活动路由器失效后,将选择一台备份路由器才能成为活
动路由器转发数据包,但对于网络中的主机来说,虚拟路由器并没有发生任何改
变。
  HSRP有三种广播包:ONG>
  1) Hello包,hello消息通知其他路由器发送路由器的HSRP优先级和状态信
息,HSRP路由器,默认为每3秒钟发送一个hello消息;可以修改这个参数。
  2) Coup包,当一个备用路由器变为一个主动路由器时发送一个coup消息。
  3) Resign包,当主动路由器要宕机或者当有优先级更高的路由器发送
hello消息时,主动路由器发送一个resign消息。
  HSRP状态类型:
  1) Initial初始化,HSRP启动时的状态,HSRP还没有运行,一般是在改变
配置或端口刚启动时进入该状态。
  2) Learn学习状态,路由器已经得到了虚拟IP地址,但是它既不是活动路
由器也不是备份路由器。它一直监听从活动路由器和备份路由器发来的HELLO报
文。
  3) Listen监听状态,路由器正在监听hello消息。
  4) Speak对话状态,在该状态下,路由器定期发送HELLO报文,并且积极参
加活动路由器或等待路由器的竞选。
  5) Standby被动状态,当主动路由器失效时路由器准备接包传输功能。
  6) Active活动状态,路由器执行包传输功能。
  HSRP路由器体系
  1)活动路由器,负责转发发送到虚拟路由器的数据。它通过发送HELLO消息
(基于UDP,端口号为1985的广播)来通告它的活跃状态
  2)备份路由器,监视HSRP组中的运行状态,并且在当前活跃路由器不可用
时,迅速承担起负责数据转发的任务。备份路由器也发送HELLO消息来通告组中
其他的路由器它备份路由器的角色。
  3) 虚拟路由器,向最终的用户来代表一台能持续工作的路由器设备。它有
自己的MAC和IP地址。但是实际上它是不用来转发数据包,它的作用仅仅是代表
一台可用的路由设备。
  虚拟MAC地址组成:
  Vendor ID:厂商ID,构成MAC地址的头3个字节
  HSRP代码:表示该地址是HSRP虚拟路由器的。XX07.acxx
  组ID:最后一个字节是组ID,由组号组成
  如我们可以通过命令:show ip arp命令查看
  0000.0007.ac01
  4)其他路由器,也监听HELLO消息,但是不作应答,这样它就不会在备份组
有身份的概念,同时它也不参与发送到虚拟路由器的数据包,但是还是转发其他
路由器发来的数据包。
  选举过程
  1) 默认情况下,优先级为100,这时MAC地址最小的成为活动路由器
  2) 当活动路由器失效后,备份路由器替代成为活动路由器,当活动和备份
路由器都失效后,其他路由器将参与活动和备份路由器的选举工作
  a) 优先级高的成为活动路由器,默认为100,取值为0~255
  b) 优先级别相同时,接口IP地址高的将成为活动路由器
  HSRP的抢占Preempt技术
  HRSP技术能够保证优先级高的路由器失效恢复后总能处于活动状态。活动路
由器失效后,优先级最高的备用路由器处于活动状态,如果没有使用preempt技
术,则当活动路由器恢复后,只能处于备用状态,先前的备用服务器代替其角色
处于活动状态,直到下一次选举发生。
  HSRP的端口跟踪track技术
  如果所监测的端口出现故障,则也可以进行路由器的切换。如果主路由器上
有多条线路被跟踪,则当一条线路出现故障时,就会切换到备份路由器上,即使
其他都线路正常工作,直到主路由器该线路正常工作,才能重新切换回来。接口
跟踪使得能够根据HSRP组路由器的接口是否可用,来自动调整该路由器的优先级
。当被跟踪的接口不可用时,路由器的HSRP优先级将降低。HSRP跟踪特性确保当
HSRP活跃路由器的重要入站接口不可用时,该路由器不再是活跃路由器。
  多组HSRP
  为了方便负载均衡,同一台路由器可以是同一个网段或VLAN中多个HSRP备用
组的成员。配置多个备用组可进一步提高冗余性,在网络中均衡负载,提高冗余
路由器的使用率。路由器在为一个HSRP组转发通信流的同时,可以在另一个HSRP
组中处于备用或监听状态。每个备用组都模拟一个虚拟路由器。在VLAN或接口上
,最多可以有255个备用组
  如下图,路由器A和路由器B都是HSRP组1和2的成员,然而,路由器A是HSRP
组1的活跃路由器和HSRP组2的备用路由器;而路由器B是HSRP组2的活跃路由器和
HSRP组1的备用路由器。
配置过程:
  默认配置
  特性      默认配置
--------------------------------
  HSRP组                未定义
  备用组编号         0
  备用组MAC地址         0000.0c07.acXX, XX是HSRP组号
  优先级                 100
  延时                 0(没有延时)
  跟踪端口的优先级 10
  HELLO时间         3秒
  HOLD时间         10秒
  配置要求:
  1. HSRP最多可以配置32个VLAN或路由接口
  2. 配置接口必须是3层接口
  路由接口:接口使用no switchport,并且配置ip地址
  SVI(交换虚拟接口):使用命令interface vlan vlan号
  3层以太网通道(EtherChannel)
  3. 所有3层接口都必须配置IP地址
  配置HSRP
  1) 进入全局模式   configure terminal
  2) 进入接口模式   interface 接口
  3) 使能HSRP,指定热备份组的组号和虚拟IP 地址
  standby 组号 ip IP地址
  组号:取值为0-255,如果是一个备用组,可以不输入组号,默认为0
  ip地址:是虚拟的Ip地址,不能为接口上的地址
  4) 指定备用组的优先级别
  standby 组号 priority 优先级别
  优先级:取值为1-255,默认为100,数值越大级别越高
  5) 指定抢占模式,当活动路由器失效后,备份路由器马上替换为活动路由
器,不需要时间等待(hold time)
  standby 组号 preempt [delay 秒数]
  d  elay:取值为0-3600(1小时)
  6) 设置端口跟踪(可选)
  standby 组号 track 端口号 降低的优先级别
  降低的优先级别:默认为10
  7) 人工指定虚拟mac地址(可选)
  standby 组号 mac mac地址
  8) 使用实际接口的mac地址(可选,只有25系列路由器使用)
  standby 组号 use-bia
  9) 配置认证(可选)
  standby 组号 authentication mode text 密码
  密码:密码是明文,默认为cisco
  注意:对于IOS12.3以上的版本中,HSRP支持MD5的认证,具体配置命令为
  standby 组号 authentication md5 key-string 密码
  10)配置HSRP时间(可选)
  standby 组号 timers hello秒数 hold秒数
  hello秒数:取值为1-255,默认为3秒
  hold秒数:取值为1-255,默认为10秒,hold time= 3*hello time
检验和调试:
  检验:
  show standby [接口 [组]][active|init|listen|standby][brief]
  如:
  show standby Ethernet0 init brief
  调试:
  debug standby:显示所有的HSRP错误、事件和数据包
  debug standby terse :显示除hello和通告以外的所有HSRP错误、事件和
数据包
  debug standby events detail:显示HSRP事件
  debug standby error:显示HSRP错误
  debug standby packets [advertise|coup|hello|resign][detail]
  案例:
案例:
sw1(config)#int vlan 10
sw1(config-if)#ip address 192.168.1.1 255.255.255.0
sw1(config-if)#standby 1 ip 192.168.1.254
sw1(config-if)#standby 1 priority 110
-----------------------------------------------------
sw2(config)#int vlan 10
sw2(config-if)#ip address 192.168.1.2 255.255.255.0
sw2(config-if)#standby 1 ip 192.168.1.254
sw2(config-if)#standby 1 priority 100
------------------------------------------------------
SW1#show standby
Vlan10 - Group 1
State is Active
2 state changes, last state change 00:02:38
Virtual IP address is 192.168.1.254
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.124 secs
Preemption enabled
Active router is local
Standby router is 192.168.1.2, priority 100 (expires in 7.992 sec)
Priority 110 (configured 110)
IP redundancy name is "hsrp-Vl10-1" (default)
---------------------------------------------------------
SW2#show standy
Vlan10 - Group 1
State is Standby
1 state change, last state change 00:02:32
Virtual IP address is 192.168.1.254
Active virtual MAC address is 0000.0c07.ac01
Local virtual MAC address is 0000.0c07.ac01 (v1 default)
Hello time 3 sec, hold time 10 sec
Next hello sent in 0.328 secs
Preemption enabled
Active router is 192.168.1.1, priority 110 (expires in 9.456 sec)
Standby router is local
Priority 100 (default 100)
IP redundancy name is "hsrp-Vl10-1" (default)
SW1#show stan brie
P indicates configured to preempt.
|
Interface  Grp  Prio  P State  Active  Standby   Virtual IP
V10   1   110  P Active  local   192.168.1.2  192.168.1.254


  多组HSRP备用组:
Router A Configuration
Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.0.0.1 255.255.255.0
Switch(config-if)# standby 1 ip 10.0.0.3
Switch(config-if)# standby 1 priority 110
Switch(config-if)# standby 1 preempt
Switch(config-if)# standby 2 ip 10.0.0.4
Switch(config-if)# standby 2 preempt
Switch(config-if)# end
Router B Configuration
Switch# configure terminal
Switch(config)# interface gigabitethernet0/1
Switch(config-if)# no switchport
Switch(config-if)# ip address 10.0.0.2 255.255.255.0
Switch(config-if)# standby 1 ip 10.0.0.3
Switch(config-if)# standby 1 preempt
Switch(config-if)# standby 2 ip 10.0.0.4
Switch(config-if)# standby 2 priority 110
Switch(config-if)# standby 2 preempt
Switch(config-if)# end

案例:
  CCIE-LAB(V160)
  题目要求:
  Configure HSRP on R3 and R4 for hosts on VLAN A:Carefully read
the requirements:
  There are 10 hosts on VLAN A.5 Windows PC‘s and 5 Unix
workstations
  The Windows PC‘s are configured to use 160.YY.10.50 as their
default gateway
  The UNIX workstations are configured to use 160.YY.10.100 as their
default gateway
  R3 is the preferred router for Windows users.
  R4 is the prefered router for Unix users.
  If the frame relay connection on R3 goes down,then R4 becomes the
preferred router for all users.
  If the frame relay connection on R4 goes down,then R3 becomes the
preferred router for all users.
  Once either R3 or R4 recover from a failure then the network must
operate as outined
  above,I.e Each router must resume their original role.
  配置:
R3
config termi
interface f0/0
standby 1 ip 160.11.10.50
standby 1 priority 110
standby 1 track s0/0 20
standby 1 preempt
standby 2 ip 160.11.10.100
standby 2 preempt
R4
config termi
interface f0/0
standby 1 ip 160.11.10.50
standby 1 preempt
standby 2 ip 160.11.10.100
standby 2 priority 110
standby 2 track s0/0 20
standby 2 preempt


  Trunk链路上的HSRP
  此项功能能通过在子网和VLAN间提供负载均衡和冗余能力提高整个网络的韧
性。我们可以实现通过两个路由器来实现在干道上的互为活跃/备份路由器。我
们只要设置一下他们在HSRP中的优先级就可以实现。
  配置步骤:
  1. 定义封装类型和vlan
  如:
interface f0/0.10
encapaulation isl 10
interface f0/0.20
encapaulation isl 20


  2.分配IP地址
  如:
interface f0/0.10
ip address 10.10.10.2 255.255.255.0
interface f0/0.20
ip address 10.10.20.2 255.255.255.0


  3.启动HSRP
  如:
inteface f0/0.10
standby 1 ip 10.10.10.254
standby 1 priority 105
standby 1 preempt
interface f0/0.20
standby 2 ip 10.10.20.254
standby 2 priority 90

新:HSRP2
  在CISCO IOS 12.3以上的版本中,HSRP支持V2的版本。HSRP V2和HSRP V1命
令上没有什么不同,只是HSRP V2所支持的组号进行了扩展,HSRP V1只支持0-
255个组,而HSRP V2可以支持0-4095个组,主要是应用在它可以支持匹配在子接
口上的VLAN号(扩展的VLAN可以支持到4094个)
  HSRP V1和HSRP V2不能同时在一个接口上启用,但是在同一台路由器上的不
同接口上,可以应用不同版本的HSRP
  配置过程:
  1) 进入全局模式   configure terminal
  2) 进入接口模式   interface 接口
  3) 启用HSRP版本2
  standby version 2
  4) 配置HSRP
  standby 组号 ip ip地址
  组号:取值范围0-4095
  案例:
RouterA#configure terminal
RouterA(config)#interface f0/0
RouterA(config-if)#standby version 2
RouterA(config-if)#standby 4095 ip 10.1.1.1
RouterA(config-if)#standby 4095 timers msec 15 msec 50
RouterA(config-if)#standby 4095 priority 200
RouterA(config-if)#standby 4095 preempt
-----------------------------------------------------------
RouterB#configure terminal
RouterB(config)#interface f0/0
RouterB(config-if)#standby version 2
RouterB(config-if)#standby 4095 ip 10.1.1.1
RouterB(config-if)#standby 4095 timers msec 15 msec 50
RouterB(config-if)#standby 4095 preempt
------------------------------------------------------------
RouterA#show standby
FastEthernet0/0 - Group 4095 (version 2)
State is Active
2 state changes, last state change 00:11:47
Virtual IP address is 10.1.1.1
Active virtual MAC address is 0000.0c9f.ffff
Local virtual MAC address is 0000.0c9f.ffff (v2 default)
Hello time 15 msec, hold time 50 msec
Next hello sent in 0.007 secs
Preemption enabled
Active router is local
Standby router is 10.1.1.3, priority 100 (expires in 0.030 sec)
Priority 200 (configured 200)
IP redundancy name is "hsrp-Fa0/0-4095" (default)

TOP

WAN协议(帧中继)之一
3.1         帧中继概述
3.1.1         帧中继相关术语
l         PVC(永久虚电路)  传输帧的逻辑端到端电路,PVC的终点是用
DLCI来寻址。
l         DLCI(数据链路连接标识符)  16-1007的逻辑数字,标识CPE和帧
中继交换机之间的PVC,只在本地有效。
l         LMI(本地管理接口)  router and frame switch 之间使用的信
令标准,交换机使用LMI确定已定义的DLCI及其状态。支持10s间隔的keepalive
机制。Cisco支持三种LMI:
※       CISCO:Cisco、Digital和Northern Telecom定义,自动协商失败后默
认的LMI类型,状态信息通过DLCI 0传送。
※       ANSI:ANSI标准T1.617定义,最常用的LMI类型,通过DLCI1023传送。
※       Q933A:定义为ITU-T Q.933的LMI类型,状态信息通过DLCI 0传送。
l         NNI(网络到网络接口)  2台交换机间通信标准,帧中继和ATM均
使用NNI,ATM称为网络节点接口(Network Node Interface)。
l         本地访问速率  与帧中继服务提供者相连链路的时钟速率或称接口
速率。可以工作在T1、T3或者HSSI下。
图3-1为常用的帧中继网络示意图

下面术语称为数据速率度量值。服务商使用这些来规定服务级别,这些术语还用
于帧中继流量整形:
l       Bc(承诺突发量)  以CIR为基础的允许接收和发送的bit number
l       CIR(承诺信息速率)  PVC允许的最大的数据速率,超过时置为可丢弃
位(DE)。单位bit/s。
l       Bc(过量突发)  达到了承诺突发值之后可发送的超出bit number。
l       MaxR(最大速率)  单位bit/s,计算公式:MaxR=CIR×((Bc+Be)/Bc)

图3-2显示各种速率间的关系。

3.1.2         技术概览
帧中继特点:
l        通过统计多路复用技术全多个逻辑电路功能在一个物理电路上实现。
l        不需要链路具备专门的端到端的电路,降低成本。
l        统计多路复用技术通过减少对router串中和CSU/DSU的使用需求,增加
了网络的可扩展性。
l        可扩展网络设计:
※       三层结构:核心层、分布层和访问层。
※       全连接、部分连接和混合连接。
※       增加了协议广播和性能控制。

帧中继使用的是面向连接的数据流,依靠上层网络协议完成错误检测和纠正。
帧中继是CCIT和ANSI的标准,替换X.25协议。
下面标准描述了帧中继:
l        ANSI T1.606:“帧中继传输服务的框架结构和服务描述”(1991)
l        ANSI T1.617:“帧中继传输服务的信令定义”(1991)
l        ANSI T1.618:“帧中继传输服务的核心部分”(1991)
l        ITU Q9.33 and Q.922:用户控制
l        RFC 1490:帧中继封装定义
www.frforum.com上有帧中继的实例和其他相关资料。
3.1.3         帧中继LMI操作
帧中继链路在Cisco router(DTE)上激活并开始工作时,首先连续向router发3
个LMI消息(ANSI、ITU和CISCO。Router在DLCI 1023上监听CISCO消息,DLCI 0
上监听ANSI和ITU消息,帧中继响应后router设定接口的LMI类型以与接收到LMI
类型相匹配。收到多个LMI时使用最后一个类型,Cisco称这种方式为LMI
autosense。
然后Router每10s发一次LMI状态信息,即LMI keepalive。Router工作在图3-3所
示的方式中。
图3-3 帧中继LMI的工作模式

1.         每经第6个LMI 状态请求,DTE发一个完整的状态请求。见例3-1显示
LMI交换的信息:
例3-1 debug frame lmi所显示的信息
02:01:54: Serial1/0(out): StEnq, myseq 216, yourseen 215, DTE up
02:01:54: datagramstart = 0x5800AD4, datagramsize = 14
02:01:54: FR encap = 0x00010308
02:01:54: 00 75 95 01 01 00 03 02 D8 D7
02:01:54:
02:01:54: Serial1/0(in): Status, myseq 216
02:01:54: RT IE 1, length 1, type 0
02:01:54: KA IE 3, length 2, yourseq 216, myseq 216
02:01:54: PVC IE 0x7 , length 0x3 , dlci 502, status 0x2
02:01:54: PVC IE 0x7 , length 0x3 , dlci 503, status 0x2
02:01:54: PVC IE 0x7 , length 0x3 , dlci 504, status 0x2
02:02:04: Serial1/0(out): StEnq, myseq 217, yourseen 216, DTE up
02:02:04: datagramstart = 0x58014D4, datagramsize = 14
02:02:04: FR encap = 0x00010308
02:02:04: 00 75 95 01 01 01 03 02 D9 D8
02:02:04:
02:02:04: Serial1/0(in): Status, myseq 217
02:02:04: RT IE 1, length 1, type 1
02:02:04: KA IE 3, length 2, yourseq 217, myseq 217
02:02:14: Serial1/0(out): StEnq, myseq 218, yourseen 217, DTE up
02:02:14: datagramstart = 0x5801B14, datagramsize = 14
02:02:14: FR encap = 0x00010308
02:02:14: 00 75 95 01 01 01 03 02 DA D9
02:02:14:
02:02:14: Serial1/0(in): Status, myseq 218
02:02:14: RT IE 1, length 1, type 1
02:02:14: KA IE 3, length 2, yourseq 218, myseq 218
02:02:24: Serial1/0(out): StEnq, myseq 219, yourseen 218, DTE up
02:02:24: datagramstart = 0x5AFAEF4, datagramsize = 14
02:02:24: FR encap = 0x00010308
02:02:24: 00 75 95 01 01 01 03 02 DB DA
02:02:24:
02:02:24: Serial1/0(in): Status, myseq 219
02:02:24: RT IE 1, length 1, type 1
02:02:24: KA IE 3, length 2, yourseq 219, myseq 219
02:02:34: Serial1/0(out): StEnq, myseq 220, yourseen 219, DTE up
02:02:34: datagramstart = 0x5801894, datagramsize = 14
02:02:34: FR encap = 0x00010308
02:02:34: 00 75 95 01 01 01 03 02 DC DB
02:02:34:
02:02:34: Serial1/0(in): Status, myseq 220
02:02:34: RT IE 1, length 1, type 1
02:02:34: KA IE 3, length 2, yourseq 220, myseq 220
02:02:44: Serial1/0(out): StEnq, myseq 221, yourseen 220, DTE up
02:02:44: datagramstart = 0x5AFB034, datagramsize = 14
02:02:44: FR encap = 0x00010308
02:02:44: 00 75 95 01 01 01 03 02 DD DC
02:02:44:
02:02:44: Serial1/0(in): Status, myseq 221
02:02:44: RT IE 1, length 1, type 1
02:02:44: KA IE 3, length 2, yourseq 221, myseq 221
02:02:54: Serial1/0(out): StEnq, myseq 222, yourseen 221, DTE up
02:02:54: datagramstart = 0x5AFB3F4, datagramsize = 14
02:02:54: FR encap = 0x00010308
02:02:54: 00 75 95 01 01 00 03 02 DE DD
02:02:54:
02:02:54: Serial1/0(in): Status, myseq 222
02:02:54: RT IE 1, length 1, type 0
02:02:54: KA IE 3, length 2, yourseq 222, myseq 222
02:02:54: PVC IE 0x7 , length 0x3 , dlci 502, status 0x2
02:02:54: PVC IE 0x7 , length 0x3 , dlci 503, status 0x2
02:02:54: PVC IE 0x7 , length 0x3 , dlci 504, status 0x2
02:03:04: Serial1/0(out): StEnq, myseq 223, yourseen 222, DTE up
02:03:04: datagramstart = 0x5AFBB74, datagramsize = 14
02:03:04: FR encap = 0x00010308
02:03:04: 00 75 95 01 01 01 03 02 DF DE
02:03:04:
02:03:04: Serial1/0(in): Status, myseq 223
02:03:04: RT IE 1, length 1, type 1
02:03:04: KA IE 3, length 2, yourseq 223, myseq 223

2.         帧中继交换机接收到信号后,发送完整响应消息,包含所有DLCI列
表。
3.         工作中的DLCI,router根据接口配置的第3层网络协议发送一个逆向
ARP请求。如果不支持RARP请求,则需要使用frmae-relay map,后面再讲。
4.         根据收到的RARP信息里所包含的每条DLCI在基帧中继映射表中建立
一个映射项。包括本地DLCI和发出请求的远端router的网络层地址信息,PVC状
态信息,可以使用show frame-relay pvc命令显示,三种状态:Router
※       ACTIVE  表明PVC工作正常。
※       INACTIVE   本地连接正常,远端router到帧中继交换机没有工作

※       DELETED  没有收到LMI or 物理层连接未建立。
5.         每10s交换一次keepalive,每60s or 每到第6次交换时,发送一个
完整LMI状态请求,如果连续3次完整状态请求没有收到LMI信号,就表明链路断
开了。router
3.2>         帧中继的配置
第1步  在接口或子接口进行帧中继封装
Router(config-if)#encapsulaion frame-relay [ cisco | ietf ]
Cisco是默认封装,符合RFC1490 or cisco设备时使用。第三方时用ietf。

第2步  设置LMI类型
IOS 11.2 or later的router支持LMI auto autosense。手工配置使用下面命令

Router(config-if)#frame-relay lmi-type [ ansi | cisco | q933i ]
LMI默认类型是cisco。

第3步  配置静态or动态地址映射
根据远端设备是否支持RARP选用frame-relay map or frame-relay interface-
dlci命令。
两种子接口类型: 
※       Point-to-point
使用如下命令:
Router(config-if)#frame-relay interface-dlci dlci_number
※       Point-to-multipoint
需要使用静态寻址方式,主要是因为路由的问题决定。使用下面命令配置:
Router(config-if)#frame-relay map protocol [ ip | dec | appletalk |
xns | ipx | vines | clns | bridge | llc2 | dlsw ] next_hop_address [
broadcast ] [ ietf | cisco ]
Frame-relay map是在本地DLCI和下一跳建立地址映射。Broadcast用来转发广播
,建议无论何时都采用。
表3-1 列出不同接口逆向ARP地址映射的一些用法
表3-1 推荐的RARP和对应的地址映射  
标准接口
Point-to-multipoint
Point-to-point
连接到不支持RARP的设备

每个协议加入网络地址      
每个协议加入网络地址。使用frame-relay map
每个协议加入网络地址,使用  
frame-relay interface-dlci  
每个协议加入网络地址。使用frame-relay map

静态or 动态寻址
静态寻址
动态寻址
静态寻址


第4步  相关协议问题
在帧中继上配置路由需要注意的问题。如:ospf时需要使用neighbor声明or 改
变网络类型。
距离矢量路由协议or eigrp 的多点网络有水平分割问题,表3-2列出常见问题。
表3-2 帧中继网络常见问题
Protocol                    Point-to-multipoint Point-
to-point
OSPF 必须使用neighbor声明or接口上使用ip ospf network type命令,使用优
先级1设置DR路由器,该router有到all neihgebor的PVC。 必须使用neighbor声
明,或者在接口上使用ip ospf network type broadcast命令。
EIGRP 关闭水平分割,加入bandwidth命令 加入bandwidth命令
IGRP 关闭水平分割,加入bandwidth命令 加入bandwidth命令
RIP 关闭水平分割 无
BGP 无 无
桥接 设置到router的根桥,该根桥具到all子桥的PVC 设置到router的根桥,该
根桥具到all子桥的PVC

注:在rip or igrp网络中使用no ip split-horizon关闭水平分割。
在EIGRP网络中使用no ip split-horizon eigrp autonomous_system命令关闭。
在point-to-point接口配置中无需关闭。
3.2.1         实例:配置混合型帧中继网络
图3-4是一个混合型的帧中继网络,在本例中要配置router A、B、C之间的
point-to-multipoint网络。
还要配置一个point-to-point网络。Route protocol use igrp。
图3-4 帧中混合型网络
先配置R5开始,先配置㥈中继封装,然后配置两种类型子接口。路由器配置见例
3-1 所示。
例3-2 封装的设置和子接口类型定义
R5(config)#int s1/0
R5(config-if)#encapsulation frame-relay
R5(config)#int s1/0.1 multipoint          <-配置点到多点子接口
R5(config-subif)#ip add 172.16.1.5 255.255.255.0
R5(config-subif)#frame-relay map ip 172.16.1.2 502 broadcast <-配置静
态寻址
R5(config-subif)#frame-relay map ip 172.16.1.3 503 broadcast
R5(config-subif)#exit
R5(config)#int s1/0.2 point-to-point  <-配置点到点子接口
R5(config-subif)#ip add 172.16.16.5 255.255.255.0
R5(config-subif)#frame-relay interface-dlci 504   <-配置动态寻址

配置R2路由器上的点对多点接口,此路由器上不需要配置子接口。如例3-2所示

例3-3 R2路由器点对多点配置
R2(config)#int s1/0
R2(config-if)#ip add 172.16.1.2 255.255.255.0
R2(config-if)#encapsulation frame-felay
R2(config-if)#frame-relay map ip 172.16.1.5 205 broadcast
R2(config-if)#frame-relay map ip 172.16.1.3 205 broadcast
R2(config-if)#

配置R4路由器上的点到点接口,如例3-3所示:
例3-4 R4路由器点对点配置
R4(config)#int s1/0
R4(config-if)#encapsulation frame-relay
R4(config-if)#ip add 172.16.16.4 255.255.255.0
R4(config-if)#frame
R4(config-if)#frame-relay interface-dlci 405

到此基本的帧中继的配置已经完成,下面需要解决的就是水平分割的问题了.
水平分割默认为开,因此在R5上不会转发R2后面172.16.2.0这个子网的路由信息
给R3.
解决这一问题就是在R5的serial1/0.1子接口上使用no ip split-horizon命令。
例3-5 列出了完整的配置:
例3-5 图3-4中所有路由器的配置信息
hostname R5
!
interface Loopback1
ip address 172.16.5.1 255.255.255.0
!
interface Serial1/0
no ip address
encapsulation frame-relay
serial restart_delay 0
!         
interface Serial1/0.1 multipoint
ip address 172.16.1.5 255.255.255.0
frame-relay map ip 172.16.1.3 503 broadcast
frame-relay map ip 172.16.1.2 502 broadcast
!
interface Serial1/0.2 point-to-point
ip address 172.16.16.5 255.255.255.0
frame-relay interface-dlci 504
-------------------------------------------------------
hostname R2
!
interface Loopback1
ip address 172.16.2.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.1.2 255.255.255.0
encapsulation frame-relay
serial restart_delay 0
frame-relay map ip 172.16.1.3 205 broadcast
frame-relay map ip 172.16.1.5 205 broadcast
!
---------------------------------------------------------
hostname R3
!
interface Loopback1
ip address 172.16.3.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.1.3 255.255.255.0
encapsulation frame-relay
serial restart_delay 0
frame-relay map ip 172.16.1.5 305 broadcast
frame-relay map ip 172.16.1.2 305 broadcast
!
-------------------------------------------------------
hostname R4
!
interface Loopback1
ip address 172.16.4.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.16.4 255.255.255.0
encapsulation frame-relay
serial restart_delay 0
frame-relay interface-dlci 405
!
在配置帧中继网络也可以在接口下加入bandwidth命令以便于route protocol准
确的select routes。
3.3 帧中继的big show” and “big D”
l       Show frame-relay pvc [ dlci | interface ]
l       Show frame-relay lmi
l       Show frame-relay map
l       Debug frame-relay lmi
3.3.1 show frame-realy pvc命令
可以显示router上的所有PVC,显示PVC的工作状态和前向显式拥塞通知/后向显
式拥塞通知和数据包的DE位等信息。例3-6 显示了在R5上的PVC信息状态:
例3-5 show frame-relay pvc 命令的信息
R5#sho frame-relay pvc

PVC Statistics for interface Serial1/0 (Frame Relay DTE)

              Active     Inactive      Deleted       Static
  Local          3            0            0            0
  Switched       0            0            0            0
  Unused         0            0            0            0

DLCI = 502, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE =
Serial1/0.1

  input pkts 30            output pkts 21           in bytes 3244      
  out bytes 1898           dropped pkts 0           in FECN pkts 0     

  in BECN pkts 0           out FECN pkts 0          out BECN pkts 0   

  in DE pkts 0             out DE pkts 0         
  out bcast pkts 11        out bcast bytes 858      
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  pvc create time 00:15:01, last time pvc status changed 00:15:01

DLCI = 503, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE =
Serial1/0.1

  input pkts 30            output pkts 21           in bytes 3272      
  out bytes 1898           dropped pkts 0           in FECN pkts 0     

  in BECN pkts 0           out FECN pkts 0          out BECN pkts 0   

  in DE pkts 0             out DE pkts 0         
  out bcast pkts 11        out bcast bytes 858      
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  pvc create time 00:15:05, last time pvc status changed 00:15:05

DLCI = 504, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE =
Serial1/0.2

  input pkts 28            output pkts 27           in bytes 3132      
  out bytes 2426           dropped pkts 0           in FECN pkts 0     

  in BECN pkts 0           out FECN pkts 0          out BECN pkts 0   

  in DE pkts 0             out DE pkts 0         
  out bcast pkts 27        out bcast bytes 2426      
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  pvc create time 00:35:13, last time pvc status changed 00:34:03
R5#
字段“pvc create time”和“last time pvc status changed”这两个时间应
该接近,如果不接近说明PVC工作状态不正常。 
根据PVC的三种状态可以判断出帧中继网络哪里有问题。
3.3.2 show frame-relay lmi命令
例3-6 Show frame-relay lmi显示LMI不匹配的信息
R3(config-if)#do sho frame-relay lmi

LMI Statistics for interface Serial1/0 (Frame Relay DTE) LMI TYPE =
CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 405              Num Status msgs Rcvd 389
  Num Update Status Rcvd 0              Num Status Timeouts 16
R3(config-if)#do sho frame-relay lmi

LMI Statistics for interface Serial1/0 (Frame Relay DTE) LMI TYPE =
CISCO
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 426              Num Status msgs Rcvd 389
  Num Update Status Rcvd 0              Num Status Timeouts 37
注意例3-6中灰色部分的字段,Num Status Enq. Sent xxx是否随着Num Status
msgs Rcvd yyy的数字在增长,如果只发不收,说明交换机or LMI匹配错误。
改正LMI类型后,使用clear counters清空接口的信息,再使用show frame-
relay lmi命令查看,见例3-7所示恢复正常:
例3-7 显示LMI恢复正确后的信息
R3(config-if)#do sho frame-relay lmi

LMI Statistics for interface Serial1/0 (Frame Relay DTE) LMI TYPE =
ANSI
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 1                Num Status msgs Rcvd 1
  Num Update Status Rcvd 0              Num Status Timeouts 0
R3(config-if)#do sho frame-relay lmi

LMI Statistics for interface Serial1/0 (Frame Relay DTE) LMI TYPE =
ANSI
  Invalid Unnumbered info 0             Invalid Prot Disc 0
  Invalid dummy Call Ref 0              Invalid Msg Type 0
  Invalid Status Message 0              Invalid Lock Shift 0
  Invalid Information ID 0              Invalid Report IE Len 0
  Invalid Report Request 0              Invalid Keep IE Len 0
  Num Status Enq. Sent 14               Num Status msgs Rcvd 14
  Num Update Status Rcvd 0              Num Status Timeouts 0
R3(config-if)#

3.3.3 show frame-relay map命令
显示本与loacl router相连的remote IP adderss 的DLCI,显示是动态还是静态
获得的,可以验证frame-relay map命令是否执行和检查逆向ARP工作情况。例3
-8 是显示的信息:
例3-8 show frame-relay map命令输出结果
R3#sho frame-relay map
Serial1/0 (up): ip 172.16.1.5 dlci 305(0x131,0x4C10), static,
              broadcast,
              CISCO, status defined, active
Serial1/0 (up): ip 172.16.1.2 dlci 305(0x131,0x4C10), static,
              broadcast,
              CISCO, status defined, active
3.3.4 debug frame-relay lmi命令
该命令可以查看yourseq和myseq是否在递增,router收到一个序列号会将其加1
并在下一次交换时以这个序列号返回,如果连续3次丢失LMI信息or keepalive,
链路即复位。如果只有一个序列号改变了,说明可能是LMI不匹配造成。如果没
有任何信息说明router and frame-relay switch 之间链路有连接问题。例3-9
给出了正常工作时的信息:
例3-9 debug frame-relay lmi显示信息
R3#debug frame-relay lmi
Frame Relay LMI debugging is on
Displaying all Frame Relay LMI data
R3#
01:25:04: Serial1/0(out): StEnq, myseq 78, yourseen 77, DTE up
01:25:04: datagramstart = 0x5800354, datagramsize = 14
01:25:04: FR encap = 0x00010308
01:25:04: 00 75 95 01 01 01 03 02 4E 4D
01:25:04:
01:25:04: Serial1/0(in): Status, myseq 78
01:25:04: RT IE 1, length 1, type 1
01:25:04: KA IE 3, length 2, yourseq 78, myseq 78
01:25:14: Serial1/0(out): StEnq, myseq 79, yourseen 78, DTE up
01:25:14: datagramstart = 0x5801ED4, datagramsize = 14
01:25:14: FR encap = 0x00010308
01:25:14: 00 75 95 01 01 00 03 02 4F 4E
01:25:14:
01:25:14: Serial1/0(in): Status, myseq 79
01:25:14: RT IE 1, length 1, type 0
01:25:14: KA IE 3, length 2, yourseq 79, myseq 79
01:25:14: PVC IE 0x7 , length 0x3 , dlci 305, status 0x2
01:25:24: Serial1/0(out): StEnq, myseq 80, yourseen 79, DTE up
01:25:24: datagramstart = 0x5AFB034, datagramsize = 14
01:25:24: FR encap = 0x00010308
01:25:24: 00 75 95 01 01 01 03 02 50 4F
01:25:24:
01:25:24: Serial1/0(in): Status, myseq 80
01:25:24: RT IE 1, length 1, type 1
01:25:24: KA IE 3, length 2, yourseq 80, myseq 80
3.3.5 其它帧中继配置命令
l        R3(config-if)#no frame-relay inverse-arp  禁止发送逆向ARP和
no arp frame-relay 命令一起使用可禁止PVC动态映射
l        R3(config-if)#no arp frame-relay   禁止ARP响应,和上一个命
令结合使用
l        R3(config-if)#keepalive keepalive_interavl_in_seconds  修改
keepalive时间,默认为10 seconds。链路两端必须一致。
l        Clear frame-relay-inarp  清除动态地址映射。
l        Frame-relay priority-dlci-group group_number high_dlci
medium_dlci normal_dlci low_dlci  为不同类型的帧中继使用多个并行的
DLCI。
3.5 帧中继流量整形
我们先看一个网络模型,图3-5这个模型中有几百个远端站点需要访问授权中心
,假设在主站点到授权中心的链路出现问题,很快恢复了,在主站点到授权中心
会出现许多TCP连接请求,出现大量数据,由于主站到授权中心的链路速率为
64Kbit/s,产生拥塞,远端站点仍以T1的速率进行传输,并不知道主站到授权中
心的链路只是64Kbit/s。Frame-relay Traffic Shaping(帧中继流量整形)就
是为解决这类问题。
图3-5 帧中继网络模型

再看几个术语:
l        承诺速率计算间隔(Tc)  <125ms,Tc=Bc/CIR。 
l        承诺信息速率(CIR)  期望平均速率,和物理接口一致。 
l        承诺突发量(Bc)  每个Tc时段时传送的数据量,通常为CIR1/8,
单位bit/s。
l        过量突发量(Be)  试图传输超过CIR的那部分数据量,单位bit/s
。实际由供应商决定。
l        最小承诺信息速率(MinCIR)  信道拥挤时能够传送的最小数据量

l        传输字节(Byte increment)  =Bc/8,每个时段里传输的数据量。
l        前向显式拥塞通告(FECN)  当帧中继交换机察觉到发生拥塞,即
向目的设备发送一个FECN数据包,指示有拥塞。
l        后向显式拥塞通告(BECN)  当帧中继交换机察觉到发生拥塞,即
向源设备发送一个BECN数据包,指示降低发送数据包的速率。IOS 11.2 or
later version supported BECN。
l        可丢弃指示符(De)  当网络发生拥塞时,有De编织物设置的数据
包将被丢弃。
  
启动流量整形后,router在发送packet前会检查是否有可用的令牌桶or标志,事
先定义令牌桶的容量,存有以一定速率放进去的令牌。任何时router发送的速率
大小要和令牌桶一致。在数据送出接口之前都要通过为VC而建立的队列。
BECN响应模式:如果router收到BECN,则速率降低25%,在接下来每个Tc间隔后
都再降低25%,起到降低到MinCIR为止。如果有16个Tc间隔没有再收到BECN,速
率则以每次(Be+Bc)/16增加。配置帧中继流量整形步骤:
第1步  允许FRTS  router(config-if)#frame-relay traffic-shaping。
第2步  创建映射类,router(config-if)#frame-relay class calss_name_l
[ in | out ],
router(config)#map-class frame-relay class_name_l。前者可以多个VC使用
同一个映射类。
第3步  在映射类配置中设置选项:
n         Frame-relay adaptive-shaping [ becn | foresinght ]    使用
BECN
n         Frame-relay cir [ in | out ]bit/s  将CIR设置为物理接口速率
n         Frame-relay bc [ in | out ]bit/s  合适的设置为远端设备的
1/8CIR。
n         Frame-relay be out bit/s    不应超过接口速率。
n         Frame-relay mincir [ in | out ]bit/s  设为和供应商提供的
CIR值。
n         Frame-relay traffic-rate cir peak_speed    可选,不应超过接
口速率,
第4步  可选将队列应用于映射类,默认是FIFO。
3.5.1 实例:帧中继流量整形的配置
图3-6 为一个帧中继点对点网络。
该实例中为防止R5发送大量数据到R2的PVC,同时还要对传送到R3的流量整形,
假设R5和R3的接口速率为1.544Mbit/s,R2则是64Kbit/s。R5和R2之间的PVC的
CIR供应商设定为32kbit/s,R5和R3之间的PVC的CIR为512Kbit/s。
图3-6




例3-10 R5 FRTS:配置
R5(config)#int s1/0
R5(config-if)#frame-relay traffic-shaping    <-enable FRTS
R5(config-if)#exit
R5(config)#int s1/0.1
R5(config-subif)#frame
R5(config-subif)#frame-relay class 64kb       <-set map class
R5(config-subif)#exit
R5(config)#int s1/0.2
R5(config-subif)#frame-relay class t1
R5(config-subif)#

例3-11配置映射类

R5(config)#map-class frame-relay 64kb   <-建立映射类
R5(config-map-class)#frame-relay adaptive-shaping becn   <-Eable
BENC response
R5(config-map-class)#frame-relay cir 1544000      <-设置为物理端口速

R5(config-map-class)#frame-relay bc 8000   <-设置为远端端口速率的
1/8
R5(config-map-class)#frame-relay be 64000   <-Initail burst
R5(config-map-class)#frame-relay mincir 32000    <-Carrier enforced
CIR
R5(config-map-class)#exit
R5(config)#map-class frame-relay t1
R5(config-map-class)#frame-relay adaptive-shaping becn
R5(config-map-class)#frame-relay cir 1544000
R5(config-map-class)#frame-relay bc 8000
R5(config-map-class)#frame-relay be 64000
R5(config-map-class)#frame-relay mincir 512000
R5(config-map-class)#
使用show traffic-shape和show frame-relay pvc dlci_number命令验证FRTS配
置,例3-12列出两条命令所显示的信息:
例3-12 show traffic-shape and show frame-relay pvc 命令显示信息
R5#show traffic-shape

Interface   Se1/0.1
       Access Target    Byte   Sustain   Excess    Interval  Increment
Adapt
VC     List   Rate      Limit  bits/int  bits/int  (ms)      (bytes)   
Active
503           1544000   9930   15440     64000     10        1930      
BECN
502           1544000   9930   15440     64000     10        1930      
BECN

Interface   Se1/0.2
       Access Target    Byte   Sustain   Excess    Interval  Increment
Adapt
VC     List   Rate      Limit  bits/int  bits/int  (ms)      (bytes)   
Active
504           1544000   9930   15440     64000     10        1930      
BECN


R5#show frame-relay pvc 502

PVC Statistics for interface Serial1/0 (Frame Relay DTE)

DLCI = 502, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE =
Serial1/0.1

  input pkts 365           output pkts 205          in bytes 37862     
  out bytes 17038          dropped pkts 0           in FECN pkts 0     

  in BECN pkts 0           out FECN pkts 0          out BECN pkts 0   

  in DE pkts 0             out DE pkts 0         
  out bcast pkts 188       out bcast bytes 15294     
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  Shaping adapts to BECN
  pvc create time 04:11:05, last time pvc status changed 04:11:05
  cir 1544000   bc 15440     be 64000     byte limit 9930   interval
10  
  mincir 32000     byte increment 1930  Adaptive Shaping BECN
  pkts 13        bytes 1014      pkts delayed 0         bytes delayed
0        
  shaping inactive   
  traffic shaping drops 0
  Queueing strategy: fifo
  Output queue 0/40, 0 drop, 0 dequeued
R5#
3.6   实验4:配置帧中继网络
3.6.1         实验内容
  主要是练习点到多点和点到点的帧继基本配置命令。
l        安照图3-7 结构配置点到多点和点到点的帧中继网络。 
l        R5到R2和R3使用静态PVC映射。
l        R5到R4之间使用动态PVC映射。
3.6.2         实验拓扑
  安照图3-7这个拓扑连接好设备。
图3-7 实验拓扑




     3.6.3         所需设备
l        5台router,其中一台配置为帧中继交换机。
l        背对背线缆4条。
3.6.4         实验步骤
第1步  配置帧中继封装和子接口
     encapsulation frame-relay  [ cisco | ietf ]
          interface s1/0.1  [ point-to-point | multipoint ]
第2步  配置LMI类型(本实验中采用自动识别)
     frame-relay lmi-type  [ ansi | cisco | q933i ]
第3步  配置地址映射为动态or 静态
     frame-relay map protocol [ ip | dec | appletalk | xns | ipx |
vines | clns | bridge | llc2 | dlsw ] next_hop_address [ broadcast ] [
ietf | cisco ]
     frame-relay interface-dlci dlci_number
  第4步  关掉水平分割
在接口下no ip split-horizon
  第5步  配置EIGRP,并关闭自动汇总。
       router eigrp as_number
network network_address subnet_mask
no auto-summary
第6步  检查配置,检查路由。
3.6.5         完整配置
例3-13 R5的配置
hostname R5
!
interface Loopback1
ip address 172.16.5.1 255.255.255.0
!
interface Serial1/0
no ip address
encapsulation frame-relay
no ip split-horizon
no fair-queue
serial restart_delay 0
!
interface Serial1/0.1 multipoint
ip address 172.16.1.5 255.255.255.0
frame-relay map ip 172.16.1.3 503 broadcast
frame-relay map ip 172.16.1.2 502 broadcast
!
interface Serial1/0.2 multipoint
ip address 172.16.16.5 255.255.255.0
frame-relay interface-dlci 504
!
router eigrp 100
network 172.16.1.0 0.0.0.255
network 172.16.5.0 0.0.0.255
network 172.16.16.0 0.0.0.255
no auto-summary
no eigrp log-neighbor-changes
!

例3-14 R2的配置
hostname R2
!
interface Loopback1
ip address 172.16.2.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.1.2 255.255.255.0
encapsulation frame-relay
serial restart_delay 0
no arp frame-relay
frame-relay map ip 172.16.1.3 205 broadcast
frame-relay map ip 172.16.1.5 205 broadcast
no frame-relay inverse-arp
!
router eigrp 100
network 172.16.1.0 0.0.0.255
network 172.16.2.0 0.0.0.255
no auto-summary
!

例3-15 R3的配置
hostname R3
!
interface Loopback1
ip address 172.16.3.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.1.3 255.255.255.0
encapsulation frame-relay
serial restart_delay 0
no arp frame-relay
frame-relay map ip 172.16.1.2 205 broadcast
frame-relay map ip 172.16.1.5 205 broadcast
no frame-relay inverse-arp
!
router eigrp 100
network 172.16.1.0 0.0.0.255
network 172.16.3.0 0.0.0.255
no auto-summary
!

例3-16 R4的配置
hostname R4

interface Loopback1
ip address 172.16.4.1 255.255.255.0
!
interface Serial1/0
ip address 172.16.16.4 255.255.255.0
encapsulation frame-relay
serial restart_delay 0
frame-relay interface-dlci 405
!
router eigrp 100
network 172.16.4.0 0.0.0.255
network 172.16.16.0 0.0.0.255
no auto-summary
no eigrp log-neighbor-changes
!
3.6.6         验证配置
l        show ip route   显示路由信息,可以看到路由表是否正确。例3-16
是在R5上执行该命令的结果。
l        show ip eigrp neighbors  验证EIGRP工作是否正常,是否建立了
正确的邻居关系,例3-17。
例3-17    R5上执行show ip route 的结果
R5#sho ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B -
BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/24 is subnetted, 6 subnets
C       172.16.16.0 is directly connected, Serial1/0.2
D       172.16.4.0 [90/2297856] via 172.16.16.4, 00:11:18, Serial1/0.2
C       172.16.5.0 is directly connected, Loopback1
C       172.16.1.0 is directly connected, Serial1/0.1
D       172.16.2.0 [90/2297856] via 172.16.1.2, 00:11:18, Serial1/0.1
D       172.16.3.0 [90/2297856] via 172.16.1.3, 00:11:18, Serial1/0.1
R5#

例3-16         
R5#sho ip eigrp neighbors
IP-EIGRP neighbors for process 100
H   Address                 Interface       Hold Uptime   SRTT   RTO  
Q  Seq Type
                                            (sec)         (ms)      
Cnt Num
2   172.16.16.4             Se1/0.2          137 00:13:42  256  1536  
0  2   
1   172.16.1.3              Se1/0.1          172 00:14:08  297  1782  
0  3   
0   172.16.1.2              Se1/0.1          164 00:15:55  215  1290  
0  5   
R5#
3.7        实验5:配置帧中继流量整形及OSPF的配置
3.7.1         实验内容

l        此次实验的拓扑是一个全网状的帧中继网络
l        在网络中配置OSPF路由协议
l        布署帧中继流量整形
u       在R5路由器是配置流量整形,本地端口速率为1.544Mbit/s。
u       R5到R3的PVC的CIR为32kbit/s。
u       R3本地端口速率为64kbit/s,对此PVC进行流量整形。
3.7.2         实验拓扑
安照图3-8这个拓扑图进行实验
  图3-8,实验拓扑示意图

3.7.3         所需设备
l        4台路由器,一台配置为帧中继交换机
l        3条背对背线缆
l        PC一台
3.7.4         实验步骤
第1步 安照帧中继的配置步骤R5帧中继封装
第2步 配置地址静态映射
第3步 配置路由协议
第4步 启动FRTS
第5步 为每条PVC配置一个映射类
第6步 在子接口上应用帧中继映射类
在本实验中只在R5到R3的PVC上做流量整形。
3.7.5         完整配置
例3-16         R5的完整配置
hostname R5
!
interface Loopback1
ip address 172.16.5.1 255.255.255.0
!
interface Serial1/0
no ip address
encapsulation frame-relay
no fair-queue
serial restart_delay 0
frame-relay traffic-shaping
!
interface Serial1/0.1 multipoint
ip address 172.16.1.5 255.255.255.248
frame-relay class 64k
frame-relay map ip 172.16.1.3 503 broadcast
frame-relay map ip 172.16.1.2 502 broadcast
!
router ospf 501
log-adjacency-changes
network 172.16.1.0 0.0.0.7 area 0
network 172.16.5.0 0.0.0.255 area 500
neighbor 172.16.1.2 priority 1
neighbor 172.16.1.3 priority 1

map-class frame-relay 64k
frame-relay cir 1544000
frame-relay bc 8000
frame-relay be 64000
frame-relay mincir 32000
frame-relay adaptive-shaping becn
!
例3-17         R2的完整配置
hostname R2
!
interface Loopback1
ip address 172.16.2.1 255.255.255.0
!
interface Serial1/0
no ip address
encapsulation frame-relay
serial restart_delay 0
!
interface Serial1/0.1 multipoint
ip address 172.16.1.2 255.255.255.248
frame-relay map ip 172.16.1.3 203 broadcast
frame-relay map ip 172.16.1.5 205 broadcast
!
router ospf 201
log-adjacency-changes
redistribute connected
network 172.16.1.0 0.0.0.7 area 0
network 172.16.2.0 0.0.0.255 area 200
neighbor 172.16.1.5 priority 1
neighbor 172.16.1.3 priority 1
!
 
例3-18         R3的完整配置
hostname R3
!
interface Loopback1
ip address 172.16.3.1 255.255.255.0
!
interface Serial1/0
no ip address
encapsulation frame-relay
serial restart_delay 0
!
interface Serial1/0.1 multipoint
ip address 172.16.1.3 255.255.255.248
frame-relay map ip 172.16.1.5 305 broadcast
frame-relay map ip 172.16.1.2 302 broadcast
!
!
router ospf 301
log-adjacency-changes
redistribute connected
network 172.16.1.0 0.0.0.7 area 0
network 172.16.3.0 0.0.0.255 area 300
neighbor 172.16.1.2 priority 1
neighbor 172.16.1.5 priority 1
3.7.6         验证配置
在R5上使用show frame-relay pvc 503 验证流量整形的配置情况,见例3-20所
示信息。
使用show ip route 进行验证OSPF是否正常工作。
例3-19         在R5上show frame-relay pvc 503的结果
R5#show frame-relay pvc 503

PVC Statistics for interface Serial1/0 (Frame Relay DTE)

DLCI = 503, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE =
Serial1/0.1

  input pkts 28            output pkts 28           in bytes 2236      
  out bytes 2344           dropped pkts 0           in FECN pkts 0     

  in BECN pkts 0           out FECN pkts 0          out BECN pkts 0   

  in DE pkts 0             out DE pkts 0         
  out bcast pkts 0         out bcast bytes 0         
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
  Shaping adapts to BECN
  pvc create time 00:08:27, last time pvc status changed 00:07:18
  cir 1544000   bc 15440     be 64000     byte limit 9930   interval
10  
  mincir 32000     byte increment 1930  Adaptive Shaping BECN
  pkts 28        bytes 2344      pkts delayed 0         bytes delayed
0        
  shaping inactive   
  traffic shaping drops 0
  Queueing strategy: fifo
  Output queue 0/40, 0 drop, 0 dequeued
R5#

例3-20         show ip route 所得路由信息
R5#show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B -
BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     172.16.0.0/16 is variably subnetted, 4 subnets, 3 masks
C       172.16.5.0/24 is directly connected, Loopback1
C       172.16.1.0/29 is directly connected, Serial1/0.1
O IA    172.16.3.1/32 [110/65] via 172.16.1.3, 00:06:27, Serial1/0.1
O IA    172.16.2.1/32 [110/65] via 172.16.1.2, 00:06:27, Serial1/0.1
R5#

例3-21         show ip ospf neighbor
R5#show ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         
Interface
172.16.3.1        1   FULL/BDR        00:01:59    172.16.1.3      
Serial1/0.1
172.16.2.1        1   FULL/DROTHER    00:01:41    172.16.1.2      
Serial1/0.1
R5#
3.8         实验6:PPP over frame-relay的配置
3.8.1         实验内容
l        在Frame Relay的PVC上建立端到端的PPP会话,注意:只能在PVC处于
active状态时才能建立。能够在一条Frame-relay链路上的多个虚链路上存在多
个PPP会话。(也就是说要PVC仅允许一个PPP会话)。
l        一个PPP连接建立在一个虚拟访问接口上。
l        PPP over Frame Relay仅在IP上支持。
l        硬件压缩和一些队列不能应用于虚拟接口之上像weighted fair
queueing, custom queueing, and priority queueing。
l        默认,一个virtual template interface的封装类型是PPP,所以
encapsulation PPP不会显示在你的配置中。
3.8.2         实验拓扑
在图3-9 PPP over frame-relay的拓扑示意图中,R5和R6在frame-relay上封装
PPP协议。
图3-9 PPP over frame-relay


3.8.3         所需设备
l       路由器3台,一台模拟帧中继交换机。
l       V.35线缆公头两条。
3.8.4         实验步骤
第1步 在接口上配置帧中继封装。
第2步 在子接口上配置Frame-relay 支持PPP。
第3步 配置虚拟接口,包括IP地址。
第4步 配置PPP认证类型(可选),虚拟接口封装默认PPP。见例3-20 所示接口
封装。
例3-20 show interface virtual-template 1信息
R5#  sho int virtual-TEmplate 1
Virtual-Template1 is down, line protocol is down
  Hardware is Virtual Template interface
  Internet address is 172.16.11.5/24
  MTU 1500 bytes, BW 100000 Kbit, DLY 100000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, loopback not set     <-默认封装PPP
  DTR is pulsed for 5 seconds on reset
  LCP Closed
  Closed: OSICP, BRIDGECP, TAGCP, IPCP, CCP, CDPCP, LLC2, IPXCP, NBFCP
          BACP, ATCP, IPV6CP
  Last input never, output never, output hang never
  Last clearing of "show interface" counters 00:24:25
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops:
0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  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 runts, 0 giants, 0 throttles
     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, 0 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
R5# sho run
R5#
3.8.5         完整配置
例3-21 R5的完整配置
hostname R5
!
interface Serial1/1
no ip address
encapsulation frame-relay
serial restart_delay 0
!
interface Serial1/1.1 point-to-point
frame-relay interface-dlci 516 ppp Virtual-Template1
!
interface Virtual-Template1
ip address 172.16.11.5 255.255.255.0
!

例3-21 R6的完整配置
hostname R6
!
interface Serial1/0
no ip address
encapsulation frame-relay
serial restart_delay 0
!
interface Serial1/0.1 point-to-point
frame-relay interface-dlci 615 ppp Virtual-Template1
!
interface Virtual-Template1
ip address 172.16.11.6 255.255.255.0
!
3.8.6         验证配置
使用show interface virtual-template 1显示接口状态。
使用show running-config 显示配置信息。
使用ping测试连通性。
第 4 章    距离矢量路由协议RIP V1 and V2
RIP工作在UDP的520端口上,以跳数为度量,工作过程如下:
1.         初始化  每个参与工作的接口发送请求数据包(Request Message
),向所有RIP router请求一份完整的路由表,以广播形式发出。
2.         接收请示  RIP有两种类型消息,响应和接收消息。
3.         接收到响应  接收并处理响应,对路由表进行添加、删除or 修改

4.         常规路由更新和定时器  每30s以应答消息的形式发送一个完整路
由表到neighbors,Router收到后设置一个180s的超时计时器(Timeout  Timer
),Cisco称为Invalid Timer。如果在180s内没有任何更新消息,则将跳数置为
16(不可达),并宣告。直240s后刷新计时器(Flush Timer)将其删除。Cisco
还使用了第三种计时器抑制计时器(Holddown Timer),Router接收到度量更高
的路由后的180s内不会用使用接收到的路由更新路由表,为收敛提供额外时间。
5.         触发路由更新  中发送与变更的路由。

各种计时器可以使用下面的命令进行修改: 
Timer basic update invalid holddown flush.

TOP

4.1.1         有类路由(RIP V1)
l         RIP-1在路由宣告中不携带子网掩码。
l         RIP-1使用接收路由的接口的掩码来确定目的网络的掩码。
l         如果不是直连网络,且不是同一个主网络,则会用其主网络地址进行
匹配,有子网则进行汇总。
图4-1 是一个RIP路由的网络图,在每台路由器是配置一个loopback接口模拟网
络。
图4-1 RIP路由例子


R1的F0/0接口配置的IP是128.200.1.1/24,当接收到属于另一个主网络地址的路
由更新信息时,则将主网络的掩码设置为汇总的网络地址。例4-1所显示的是RIP
路由更新的信息。

图4-1 有类路由发送接收路由的debug信息
00:20:13: RIP: sending v1 update to 255.255.255.255 via
FastEthernet0/0 (128.200.1.1) 
<-以广播包发送
00:20:13: RIP: build update entries
00:20:13:       network 128.1.0.0 metric 1
00:20:13: RIP: sending v1 update to 255.255.255.255 via Loopback1
(128.200.11.1)
00:20:13: RIP: build update entries
00:20:13:       network 128.200.0.0 metric 1
00:20:13:       network 192.16.1.0 metric 2
00:20:20: RIP: received v1 update from 128.200.1.2 on FastEthernet0/0
00:20:20:      192.16.1.0 in 1 hops

R2有两个接口,一个接口配置的IP是128.200.1.2/24,掩码是24位的,接收的路
由信息将主网掩码设置为接口F0/0的主网掩码。F1/0接口的子网掩码是30位的,
当他从F0/0接口接收到128.200.1.0/24和128.1.1.0/24这两个子网时,从F1/0接
口发送的时候则汇总为128.200.0.0/16,例4-2 是在路由器R2上debug ip rip获
得的信息。
例4-2 R2上debug ip rip的信息
00:43:57: RIP: received v1 update from 128.200.1.1 on FastEthernet0/0
00:43:57:      128.200.11.0 in 1 hops
00:44:21: RIP: sending v1 update