第 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
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 .
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 . 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 . 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
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

本文转自 tiger506 51CTO博客,原文链接:http://blog.51cto.com/tiger506/139116,如需转载请自行联系原作者

CCIE实验笔记之---第1章WAN协议(HDLC)相关推荐

  1. 《OpenWrt开发笔记》第6章 WAN和LAN灵活切换

    6.1VLAN介绍 LAN: Local Area Network 的英文简称,即局域网 指在较小的地理范围内,将两台以上的计算机通过传输电缆连接起来,实现资源共享.局域网的传输速度通常在 10Mb/ ...

  2. CVE 2013-2094 exploit 实验笔记

    CVE 2013-2094 exploit 实验笔记 1. links 2. 实验流程 2.1 安装ubuntu64 虚拟机 2.2 编译 2.6.38 内核 2.3 开始exploitation 3 ...

  3. CISCO认证中文书籍全集和CCIE实验全集网盘打包

    重磅出击:CISCO认证中文书籍全集和CCIE实验全集网盘打包 CCNA学习指南中文版(第六版)640-802.rar [url]http://www.fs2you.com/files/9af8d9e ...

  4. 李弘毅机器学习笔记:第十三章—CNN

    李弘毅机器学习笔记:第十三章-CNN 为什么用CNN Small region Same Patterns Subsampling CNN架构 Convolution Propetry1 Propet ...

  5. 强化学习(RLAI)读书笔记第十六章Applications and Case Studies(不含alphago)

    强化学习(RLAI)读书笔记第十六章Applications and Case Studies(不含alphago) 16.1 TD-Gammon 16.2 Samuel's Checkers Pla ...

  6. 花书笔记:第07章 深度学习中的正则化

    花书笔记:第07章 深度学习中的正则化 7.1 参数范数惩罚 参数范数惩罚 Ω ( θ ) \Omega(\theta) Ω(θ) α ∈ [ 0 , ∞ ) \alpha \in [0,\infty ...

  7. 一文弄懂元学习 (Meta Learing)(附代码实战)《繁凡的深度学习笔记》第 15 章 元学习详解 (上)万字中文综述

    <繁凡的深度学习笔记>第 15 章 元学习详解 (上)万字中文综述(DL笔记整理系列) 3043331995@qq.com https://fanfansann.blog.csdn.net ...

  8. 一文让你完全弄懂逻辑回归和分类问题实战《繁凡的深度学习笔记》第 3 章 分类问题与信息论基础(上)(DL笔记整理系列)

    好吧,只好拆分为上下两篇发布了>_< 终于肝出来了,今天就是除夕夜了,祝大家新快乐!^q^ <繁凡的深度学习笔记>第 3 章 分类问题与信息论基础 (上)(逻辑回归.Softm ...

  9. 一文让你完全弄懂回归问题、激活函数、梯度下降和神经元模型实战《繁凡的深度学习笔记》第 2 章 回归问题与神经元模型(DL笔记整理系列)

    <繁凡的深度学习笔记>第 2 章 回归问题与神经元模型(DL笔记整理系列) 3043331995@qq.com https://fanfansann.blog.csdn.net/ http ...

  10. C++ Primer 学习笔记(第四章:表达式)

    2019独角兽企业重金招聘Python工程师标准>>> ##C++ Primer 学习笔记(第四章:表达式) [TOC] ###4.1 基础 左值和右值: 当一个对象被用作右值的时候 ...

最新文章

  1. 关于小程序云开发的一些经典问题处理
  2. 树莓派 rfid_树莓派工控机做Modbus RTU主站读取RFID数据
  3. java process exit_Java Process exitValue()方法
  4. 可以救命的生活小常识
  5. nagios 使用mysql_Nagios监控MySQL
  6. js判断移动端,pc端,安卓,苹果浏览器的方法
  7. flutter的按钮如何变为不可选中_Flutter 61: 图解基本 Button 按钮小结 (一)
  8. javaweb servlet
  9. sklearn学习总结
  10. 查询显示注释_第2章 查询基础
  11. linkedin客户开发_10个LinkedIn WordPress插件赢得新客户
  12. pikachu逻辑漏洞实验
  13. 最新版Unity安装和启动教程
  14. catia制作物料明细_CATIA课时:动力头主架详细标注及物料清单视频教程_翼狐网...
  15. python利用WMI等监控获取windows状态如CPU、内存、硬盘等信息
  16. /oa/web应用程序中的服务器错误修复,如何处理OA系统在线阅读或编辑文档时weboffice控件提示“文件存取错误”的问题?...
  17. 【spring MVC】解决spring MVC不支持PUT请求
  18. 分析2022年国内国际学校ib的分数
  19. 如何下载和使用ST官方例程
  20. 听说你连这个简单的SU建模都不会?!

热门文章

  1. 手把手教你搭建 RabbitMQ 集群
  2. 小码哥crm学习笔记
  3. 如何解决merge conflict的方法
  4. 集合的特性(成员操作符、for循环遍历)
  5. 饥荒联机版steam专用服务器创建
  6. 创建可引导的 macOS High Sierra 安装 U 盘
  7. Java 案例:珠穆朗玛峰的高度
  8. 理解v8的Isolate调度
  9. The LINQ expression node type 'ArrayIndex' is not supported in LINQ to Entities.
  10. 蛋白组笔记之-实践2 人溶菌酶蛋白二级结构的分析