实验28:HDLC 和PPP 封装<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
1. 实验目的
通过本实验,读者可以掌握如下技能:
(1) 串行链路上的封装概念
(2) HDLC 封装
(3) PPP 封装
2. 实验拓扑

如图:

3. 实验步骤
注:
显示串行接口时,常见以下几种状态:
Serial0/0/0 is up, line protocol is up
//链路正常
Serial0/0/0 is administratively down, line protocol is down
//没有打开该接口,执行“no shutdown”可以打开接口
Serial0/0/0 is up, line protocol is down
//物理层正常,数据链路层有问题,通常是没有配置时钟、两端封装不匹配、PPP 认证错误
Serial0/0/0 is down, line protocol is down
//物理层故障,通常是连线问题
配置如下:
r0(config)#int s0/0
r0(config-if)#ip add 172.16.1.1 255.255.255.0
r0(config-if)#no sh
r0(config-if)#
*Mar  1 00:01:31.655: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
*Mar  1 00:01:32.659: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
*Mar  1 00:01:57.271: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
r0(config-if)#
r0(config-if)#do sh ip int s0/0
Serial0/0 is up, line protocol is down
  Internet address is 172.16.1.1/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Local Proxy ARP is disabled
  Security level is default
  <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Split horizon is enabled
  ICMP redirects are always sent
  ICMP unreachables are always sent
  ICMP mask replies are never sent
  IP fast switching is enabled
  IP fast switching on the same interface is enabled
  IP Flow switching is disabled
  IP CEF switching is enabled
  IP CEF Fast switching turbo vector
  IP multicast fast switching is enabled
  IP multicast distributed fast switching is disabled
  IP route-cache flags are Fast, CEF
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  RTP/IP header compression is disabled
  Policy routing is disabled
  Network address translation is disabled
  BGP Policy Mapping is disabled
  WCCP Redirect outbound is disabled
  WCCP Redirect inbound is disabled
  WCCP Redirect exclude is disabled
r0(config-if)#
*Mar  1 00:03:17.263: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r0(config-if)#do sh int s0/0
Serial0/0 is up, line protocol is up
  Hardware is GT96K Serial
  Internet address is 172.16.1.1/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set//该接口的默认封装为HDLC 封装
  Keepalive set (10 sec)
  CRC checking enabled
  Last input 00:00:01, output 00:00:02, output hang never
  Last clearing of "show interface" counters 00:02:53
  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
     7 packets input, 764 bytes, 0 no buffer
     Received 7 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     20 packets output, 1960 bytes, 0 underruns
     0 output errors, 0 collisions, 5 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
         
r0(config-if)#
r0(config-if)#
r0(config-if)#
r0(config-if)#enc 
r0(config-if)#encapsulation ppp
r0(config-if)#
*Mar  1 00:04:33.727: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
r0(config-if)#
r0(config-if)#do ping 172.16.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
由于R1还没有封装PPP,链路两端封装不同协议所以PING不通
r0(config-if)#
*Mar  1 00:05:39.947: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r0(config-if)#do ping 172.16.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/21/64 ms
链路的两端封装相同,则ping 测试应该正常
r0(config-if)#
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/21/64 ms
r0(config-if)#do sh int s0/0
Serial0/0 is up, line protocol is up
  Hardware is GT96K Serial
  Internet address is 172.16.1.1/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation PPP, LCP Open//该接口的封装为PPP 封装
  Open: IPCP, CDPCP, loopback not set//网络层支持IP 和CDP 协议
  Keepalive set (10 sec)
  CRC checking enabled
  Last input 00:00:43, output 00:00:02, output hang never
  Last clearing of "show interface" counters 00:03:55
  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
     58 packets input, 2928 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
     69 packets output, 3012 bytes, 0 underruns
         
r0(config-if)#
 
 
 
r1(config)#int s0/0
r1(config-if)#ip add 172.16.1.2 255.255.255.0
r1(config-if)#no sh
r1(config-if)#do sh
*Mar  1 00:03:00.043: %LINK-3-UPDOWN: Interface Serial0/0, changed state to up
r1(config-if)#do sh ip int
*Mar  1 00:03:01.047: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r1(config-if)#do sh ip int s0/0
Serial0/0 is up, line protocol is up
  Internet address is 172.16.1.2/24
  Broadcast address is 255.255.255.255
  Address determined by setup command
  MTU is 1500 bytes
  Helper address is not set
  Directed broadcast forwarding is disabled
  Outgoing access list is not set
  Inbound  access list is not set
  Proxy ARP is enabled
  Local Proxy ARP is disabled
  Security level is default
  Split horizon is enabled
  ICMP redirects are always sent
  ICMP unreachables are always sent
  ICMP mask replies are never sent
  IP fast switching is enabled
  IP fast switching on the same interface is enabled
  IP Flow switching is disabled
  IP CEF switching is enabled
  IP CEF Fast switching turbo vector
  IP multicast fast switching is enabled
  IP multicast distributed fast switching is disabled
  IP route-cache flags are Fast, CEF
  Router Discovery is disabled
  IP output packet accounting is disabled
  IP access violation accounting is disabled
  TCP/IP header compression is disabled
  RTP/IP header compression is disabled
  Policy routing is disabled
  Network address translation is disabled
  BGP Policy Mapping is disabled
  WCCP Redirect outbound is disabled
  WCCP Redirect inbound is disabled
  WCCP Redirect exclude is disabled
r1(config-if)#
r1(config-if)#
r1(config-if)#
*Mar  1 00:04:57.355: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down
r1(config-if)#do sh int s0/0
Serial0/0 is up, line protocol is down
  Hardware is GT96K Serial
  Internet address is 172.16.1.2/24
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation HDLC, loopback not set
  Keepalive set (10 sec)
  CRC checking enabled
  Last input 00:00:29, output 00:00:00, output hang never
  Last clearing of "show interface" counters 00:04:13
  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
     35 packets input, 2518 bytes, 0 no buffer
     Received 35 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     18 packets output, 1316 bytes, 0 underruns
     0 output errors, 0 collisions, 3 interface resets
     0 output buffer failures, 0 output buffers swapped out
     0 carrier transitions
     DCD=up  DSR=up  DTR=up  RTS=up  CTS=up
         
r1(config-if)#
r1(config-if)#
r1(config-if)#
r1(config-if)#en
r1(config-if)#encapsulation ppp
r1(config-if)#
*Mar  1 00:05:41.015: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up
r1(config-if)#

转载于:https://blog.51cto.com/gauyanm/238099

NA-NP-IE系列实验28:HDLC 和PPP 封装相关推荐

  1. 网络原理实验7 HDLC及PPP协议

    赞赏码 & 联系方式 & 个人闲话 [实验名称]HDLC及PPP协议 [实验目的] 1.理解串口的数据链路层协议的封装: 2.建立网络安全的概念,了解PPP认证的有关知识: 3.HDL ...

  2. HDLC 和 PPP封装简介

    广域网封装技术:HDLC , PPP HDLC简介:高级数据链路控制协议(High-level Data Link Control) HDLC是点到点串行线路上(同步电路)的帧封装格式,其帧格式和以太 ...

  3. STM32 基础系列教程 28 - USB_DFU

    前言 学习stm32 USB接口使用,学会用CUBE工具快速创建USB设备工程及调试,关于usb的相关知道请读者提前准备并学习,当然如果不想深究其中原理的话,跟着本文来操作就可以实现基于USB的设备开 ...

  4. RCNN系列实验的PASCAL VOC数据集格式设置

    我们在做RCNN系列的实验时,往往需要把数据集的格式设置为和PASCAL VOC数据集一样的格式,其实当然也可以修改读取数据的代码,只是这样更为麻烦,自己的数据格式变了又得修改.  首先以VOC200 ...

  5. Mininet系列实验(七):Mininet脚本实现控制交换机行为

    Mininet系列实验(七):Mininet脚本实现控制交换机行为 1 实验目的 熟悉Mininet自定义拓扑脚本的编写: 掌握使用"ovs-vsctl"命令直接控制Open vS ...

  6. Mininet系列实验(六):Mininet动态改变转发规则实验

    Mininet系列实验(六):Mininet动态改变转发规则实验 一. 实验目的 熟悉Mininet自定义拓扑脚本的编写: 熟悉编写POX脚本动态改变转发规则 二.实验原理 在SDN环境中,控制器可以 ...

  7. Mininet系列实验(五):Mininet设置带宽之简单性能测试

    Mininet系列实验(五):Mininet设置带宽之简单性能测试 1.实验目的 该实验通过Mininet学习python自定义拓扑实现,可在python脚本文件中设计任意想要的拓扑,简单方便,并通过 ...

  8. HDLC和 PPP的实验

    HDLC和 PPP的实验 HDLC,高级数据链路控制(High-Level Data Link Control或简称HDLC),是一个在同步网上传输 数据.面向比特的数据链路层协议,它是由国际标准化组 ...

  9. WebGoat系列实验Cross-Site Scripting (XSS)

    WebGoat系列实验Cross-Site Scripting (XSS) PhishingTitle 本次实验是在一个已知存在XSS漏洞的页面进行钓鱼攻击.通过使用XSS与HTML注入,在页面中注入 ...

最新文章

  1. UVA1108 Mining Your Own Business(思维、割点)(2011 ICPC - WorldFinal)
  2. 好莱坞电影公司系列电影
  3. 一站式开源测试平台:MeterSphere
  4. python建立数据库并序列化_python之数据的序列化
  5. electron 解压zip_如何将Node.js中的.zip/.rar文件解压缩到文件夹中
  6. 【SDOI2017】硬币游戏【KMP】【概率期望】【高斯消元】
  7. 《黑客》月刊中文版第一期正式发布,很给力!推荐围观!
  8. 【HTML】获取当前时间并显示在网页上
  9. 【英语学习】【医学】Unit 05 The Digestive System
  10. 如何通过TRAMP / Emacs远程控制nrepl-ritz-jack-in工作
  11. [转载] python中numpy模块的around方法_更好地舍入Python的NumPy.around:舍入numpy的数组
  12. 【细节实现 回文串12】LeetCode 564. Find the Closest Palindrome
  13. CSS2 及CSS3 在ie浏览器下的支持情况
  14. i.MX应用处理器-iMX8系列产品介绍
  15. R语言ggplot2可视化条形图:通过双色渐变配色颜色主题可视化条形图、为每个条形添加标签文本(geom_text函数)
  16. ZABBIX3.04设置短信报警
  17. 【巴比特:区块链是什么】笔记
  18. 腾讯区块链正式落地法律场景,携手慧狮构建“司法联盟链”
  19. 9_用户的登录和登出
  20. swift 百度地图加载与百度地图电子围栏加载

热门文章

  1. NLP复习资料(5)-第九章 句法分析
  2. Pytorch(5)-梯度反向传播
  3. js中select下拉框重置_如何利用CSS3制作炫酷的下拉框
  4. 启动linux的rpc服务的命令
  5. 开发者应该了解的API技术清单!
  6. 科目三场外考试易出错的环节
  7. 使用 OpenCL.Net 进行 C# GPU 并行编程
  8. 运算符优先级 必熟记,放到心里
  9. 无法转化为项目财富的技术或功能就是垃圾
  10. 帧内16*16模式的宏块数据传输顺序