路由器中常用链路协议实例(ppp和HDLC)

来源:互联网 发布:金橙子软件参数设置 编辑:程序博客网 时间:2024/06/11 04:00

串行链路上的封装概念
HDLC的PPP封装的区别

 

R1#sh int s2/0
Serial2/0 is up, line protocol is up
Hardware is M4T
Internet address is 192.168.12.1/24
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--------默认的封装格式是HDLC
Keepalive set (10 sec)
Restart-Delay is 0 secs
Last input 00:00:06, output 00:00:03, 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/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
113 packets input, 7732 bytes, 0 no buffer
Received 108 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
122 packets output, 8872 bytes, 0 underruns
0 output errors, 0 collisions, 3 interface resets
0 output buffer failures, 0 output buffers swapped out
4 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up

R1#
R1#
R1#
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int s2/0
R1(config-if)#en
R1(config-if)#encapsulation ?
atm-dxi ATM-DXI encapsulation
bstun Block Serial tunneling (BSTUN)
frame-relay Frame Relay networks
hdlc Serial HDLC synchronous
lapb LAPB (X.25 Level 2)
ppp Point-to-Point protocol
sdlc SDLC
sdlc-primary SDLC (primary)
sdlc-secondary SDLC (secondary)
smds Switched Megabit Data Service (SMDS)
stun Serial tunneling (STUN)
x25 X.25

R1(config-if)#encapsulation ppp---------------------实验PPP封装


----------------------------------------------


R2(config-if)#int s2/0
R2(config-if)#en
R2(config-if)#encapsulation ppp
R2(config-if)#
*Sep 23 09:27:39.315: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2(config-if)#^Z
R2#
*Sep 23 09:27:44.483: %SYS-5-CONFIG_I: Configured from console by console
R2#sh int s2/0
Serial2/0 is up, line protocol is up
Hardware is M4T
Internet address is 192.168.12.2/24
MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation PPP, LCP Open
Open: IPCP, CDPCP, crc 16, loopback not set
Keepalive set (10 sec)
Restart-Delay is 0 secs
Last input 00:00:31, output 00:00:03, output hang never
Last clearing of "show interface" counters 00:01:36
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
29 packets input, 1388 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
30 packets output, 1396 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

R2#
R2#ping 192.168.12.1--------------同时封装PPP协议测试连通

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 28/83/116 ms
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int s2/0
R2(config-if)#en
R2(config-if)#encapsulation hdlc-----------R1封装PPP,R2封装HDLC
R2(config-if)#exit
*Sep 23 09:30:57.755: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to down
R2(config-if)#exit^Z
R2#pi
*Sep 23 09:30:59.227: %SYS-5-CONFIG_I: Configured from console by console
*Sep 23 09:30:59.775: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
R2#ping 192.168.12.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.1, timeout is 2 seconds:
....
*Sep 23 09:31:27.795: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to down.
Success rate is 0 percent (0/5)
R2#sh int s2/0
Serial2/0 is up, line protocol is down -----------R1封装PPP,R2封装HDLC时,封装不匹配,造成链路故障
Hardware is M4T
Internet address is 192.168.12.2/24
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 00:00:01, output 00:00:07, output hang never
Last clearing of "show interface" counters 00:00:38
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
4 packets input, 64 bytes, 0 no buffer
Received 4 broadcasts, 0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
8 packets output, 502 bytes, 0 underruns
0 output errors, 0 collisions, 2 interface resets
0 output buffer failures, 0 output buffers swapped out
2 carrier transitions DCD=up DSR=up DTR=up RTS=up CTS=up

R2#
R2#