广域网协议的封装【实验名称】广域网协议的封装【实验目的】掌握广域网协议的封装类型和封装方法【背景描述】你是公司的网络管理员,两个分公司之间希望能够申请一条广域网专线进行连接。公司现有锐捷路由器两台,希望你了解该设备的广域网接口所支持的协议,以确定选择哪一种广域网链路。【技术原理】常见广域网专线技术有,DDN专线、PSTN/ISDN专线、帧中继专线、X.25专线等。数据链路层提供各种专线技术的协议,主要有PPP、HDLC、X.25、Frame-relay以及ATM等。【实现功能】查看路由器广域网接口支持的数据链路层协议,并进行正确的封装。【实验设备】R1762路由器(1台)【实验拓扑】【实验步骤】步骤一查看广域网接口默认的封装类型:Router1#showinterfaceserial1/2serial1/2isUP,lineprotocolisUP//查看接口的状态,是否为UPHardwareisPQ2SCCHDLCCONTROLLERserialInterfaceaddressis:1.1.1.2/24//查看接口IP地址的配置MTU1500bytes,BW512Kbit//查看接口的带宽为512KEncapsulationprotocolisHDLC,loopbacknotset//默认的封装协议是HDLCKeepaliveintervalis10sec,setCarrierdelayis2secRXloadis1,Txloadis1Queueingstrategy:WFQ5minutesinputrate17bits/sec,0packets/sec5minutesoutputrate17bits/sec,0packets/sec511packetsinput,11242bytes,0nobufferReceived511broadcasts,0runts,0giants0inputerrors,0CRC,0frame,0overrun,0abort511packetsoutput,11242bytes,0underruns0outputerrors,0collisions,1interfaceresets1carriertransitionsV35DTEcable//该接口为DTE端DCD=upDSR=upDTR=upRTS=upCTS=up步骤二查看广域网接口支持的封装类型:RouterA(config)#interfaceserial1/2RouterA(config-if)#encapsulation?//encapsulation是封装数据链路层协议的命令frame-relayFrameRelaynetworks//帧中继协议hdlcserialHDLCsynchronous//高级数据链路控制协议lapbLAPB(X.25Level2)//X.25的二层协议pppPoint-to-Pointprotocol//PPP点到点协议x25X.25//X.25协议步骤三更改广域网接口的封装类型:PPP封装RouterA(config)#interfaceserial1/2//进行serial1/2RouterA(config-if)#encapsulationppp//将接口协议封装为PPPRouterA(config-if)#endRouterA#showinterfaceserial1/2//查看接口的封装协议serial1/2isUP,lineprotocolisDOWNHardwareisPQ2SCCHDLCCONTROLLERserialInterfaceaddressis:192.168.1.1/24MTU1500bytes,BW2000KbitEncapsulationprotocolisPPP,loopbacknotsetKeepaliveintervalis10sec,setCarrierdelayis2secRXloadis1,Txloadis1LCPReqsent//PPP协议相关参数Closed:ipcpQueueingstrategy:FIFOOutputqueue0/40,0drops;Inputqueue0/75,0drops5minutesinputrate14bits/sec,0packets/sec5minutesoutputrate36bits/sec,0packets/sec403packetsinput,8866bytes,0nobufferReceived246broadcasts,0runts,0giants15inputerrors,0CRC,15frame,0overrun,0abort1011packetsoutput,29156bytes,0underruns0outputerrors,0collisions,59interfaceresets1carriertransitionsV35DCEcableDCD=upDSR=upDTR=upRTS=upCTS=upFrame-Relay封装RouterA(config)#interfaceserial1/2//进行serial1/2RouterA(config-if)#encapsulationframe-relay//将接口协议封装为帧中继RouterA(config-if)#endRouterA#showinterfaceserial1/2//查看接口的封装协议serial1/2isUP,lineprotocolisUPHardwareisPQ2SCCHDLCCONTROLLERserialInterfaceaddressis:192.168.1.1/24MTU1500bytes,BW2000KbitEncapsulationprotocolisFRAMERELAY,loopbacknotset//封装协议Keepaliveintervalis10sec,setCarrierdelayis2secRXloadis1,Txloadis1LMIenqsent1,LMIstatusrecvd0,LMIupdaterecvd0,DTELMIupLMIenqrecvd0,LMIstatussent0,LMIupdatesent0LMIDLCI0LMItypeisCCITT,framerelayDTEinterfacebroadcasts0//帧中继协议相关参数Queueingstrategy:FIFOOutputqueue0/40,0drops;Inputqueue0/75,0drops5minutesinputrate15bits/sec,0packets/sec5minutesoutputrate36bits/sec,0packets/sec405packetsinput,8910bytes,0nobufferReceived246broadcasts,0runts,0giants15inputerrors,0CRC,15frame,0overrun,0abort1017packetsoutput,29239bytes,0underruns0outputerrors,0collisions,61interfaceresets1carriertransitionsV35DCEcableDCD=upDSR=upDTR=upRTS=upCTS=upX.25封装RouterA(config)#interfaceserial1/2//进行serial1/2RouterA(config-if)#encapsulationX25//将接口协议封装为X.25RouterA(config-if)#endRouterA#showinterfaceserial1/2//查看接口的封装协议serial1/2isUP,lineprotocolisDOWNHardwareisPQ2SCCHDLCCONTROLLERserialInterfaceaddressis:192.168.1.1/24MTU1500bytes,BW2000KbitEncapsulationprotocolisX.25,loopbacknotset//查看封装协议Keepaliveintervalis0sec,nosetCarrierdelayis2secRXloadis1,Txloadis1LAPBDTE,modulo8,k7,N112056,N220T13000,interfaceoutage(partialT3)0,T40StateSABMSENT,VS0,VR0,RemoteVR0,Retransmissions2Queues:U/Sframes0,Iframes0,unack.0,reTx0IFRAMEs0/0RNRs0/0REJs0/0SABM/Es2/0FRMRs0/0DISCs0/0X25DTE,address,stateR1,modulo8Defaults:DEFencapsulation,idle0,nvc3input/outputwindowsizes2/2,packetsizes128/128Timers:T20180,T21200,T22180,T23180,TH0Channels:Incoming-onlynone,Two-way1-1024,Outgoing-onlynoneRESTARTs0/0CALLs0+0/0+0/0+0DIAGs0/0//X.25协议相关参数Queueingstrategy:FIFOOutputqueue0/40,0drops;Inputqueue0/75,0drops5minutesinputrate16bits/sec,0packets/sec5minutesoutputrate32bits/sec,0packets/sec407packetsinput,8954bytes,0nobufferReceived246broadcasts,0runts,0giants15inputerrors,0CRC,15frame,0overrun,0abort1021packetsoutput,29269bytes,0underruns0outputerrors,0collisions,61interfaceresets1carriertransitionsV35DCEcableDCD=upDSR=upDTR=upRTS=upCTS=up【注意事项】封装广域网协议时,要求V.35线缆的两个端口封装协议一致,否则无法建立链路。