1. 幀中繼技術
幀中繼(Frame Relay ,FR)是一種包交換技術,運行在OSI網絡模型中二層(數據鏈路層),它是X.25技術的簡化版,具有更好的通信性能。幀中繼技術在中小型企業中的廣域網中比較常用,相比於直接開通一條專線線路來說,幀中繼線路的通信費用更低。
幀中繼技術具有以下特點:
- 採用分組交換技術
- 網絡費用低,網絡資源利用率高
- 是X.25技術的簡化版,併兼容X.25,tcp/ip等多種網絡協議
2. 幀中繼技術的應用場景
一般企業用戶需要通過租用的專線線路把各地分散的網絡連接起來,如果採用點對點專線線路的話,ISP(因特網服務提供商)需要給每個地方的路由器分配一條物理線路,如下圖所示:
如果是採用點對點專線線路方式通信,R1想要和其他設備進行通信就需要跟每臺設備建立一條物理線路,R2,R3等設備以此類推,這意味着每臺設備就需要4條物理線路。但是使用幀中繼技術的話,因爲幀中繼網絡是共享的,所以每臺設備可以通過一條物理線路連接到幀中繼網絡中,這樣就極大地減少了線路,減少了網絡費用。
3. 幀中繼的術語
現在我們來了解一下幀中繼的幾個術語:PVC ,LMI ,DLCI ,IARP。
PVC:永久虛電路(Permanent Virtual Circuit,簡稱PVC)是永久建立的線路,用於兩臺設備通信而建立的一條邏輯專線,實際上是由ISP在幀中繼交換機上配置交換表實現兩臺設備通信。
LMI:本地管理接口 ,是路由器和幀中繼交換機之間的一種通信協議,實際上就是路由器和幀中繼交換機相互發送hello包來檢測路由器和交換機之間的連接,以維護其連接狀態。
DLCI:數據鏈路連接標識符,其實就是一個序號,其範圍是0 ~ 1023,其中0-15以及1008-1023被保留用作特殊用途。通常是用於標識網絡中中的PVC線路,也就是說每條PVC線路都會有一個DLCI序號。簡單來理解DLCI就是一個數據鏈路層地址,設備之間通信需要通過DLCI來完成,包括幀中繼交換機的交換表也需要用到DLCI地址。
IARP:逆向ARP,通常用於一個設備有多個目的可以訪問時,需要通過IARP來確定具體要訪問的目的地。
4. 部署幀中繼技術
我們可以看到上圖建立的R1到R2的通信線路就是一條PVC線路,每條線路標識的序號就是DLCI,也就是所謂的數據鏈路地址(數據鏈路標識符),每條PVC線路都會使用LMI協議來維護連接及其狀態,如果想要實現R1,R2,R3設備之間通信的話,還需要配置幀中繼交換機的映射表。
首先配置幀中繼交換機,開啓幀中繼交換功能,然後封裝每個接口爲幀中繼協議,並定義爲DCE接口,配置如下:
//開啓幀中繼交換功能
FR-SW#conf t
FR-SW(config)#frame-relay switching
爲每個接口封裝幀中繼協議並定義爲DCE接口,因爲運營商的幀中繼網絡是DCE接口,配置如下:
FR-SW(config)#int s0/1
FR-SW(config-if)#no shutdown
FR-SW(config-if)#encapsulation frame-relay
FR-SW(config-if)#frame-relay intf-type dce
FR-SW(config-if)#exit
FR-SW(config)#int s0/2
FR-SW(config-if)#no shutdown
FR-SW(config-if)#encapsulation
FR-SW(config-if)#encapsulation frame-relay
FR-SW(config-if)#frame-relay intf-type dce
FR-SW(config-if)#exit
FR-SW(config)#int s0/3
FR-SW(config-if)#no shutdown
FR-SW(config-if)#encapsulation frame-relay
FR-SW(config-if)#frame-relay intf-type dce
FR-SW(config-if)#exit
然後在FR-SW幀中繼交換機的交換表中配置兩條專線線路:R1 - R2和R1 - R3,配置如下:
FR-SW(config)#
FR-SW(config)#int s0/1
FR-SW(config-if)#frame-relay route 102 interface s0/2 201
FR-SW(config-if)#frame-relay route 103 interface s0/3 301
FR-SW(config-if)#exit
FR-SW(config)#
FR-SW(config)#int s0/2
FR-SW(config-if)#frame-relay route 201 interface s0/1 102
FR-SW(config-if)#exit
FR-SW(config)#int s0/3
FR-SW(config-if)#frame-relay route 301 interface s0/1 103
FR-SW(config-if)#exit
FR-SW(config)#
以frame-relay route 102 interface s0/2 201命令爲例,在幀中繼交換機的s0/1口配置路由信息:s0/1口的102到s0/2口的201路由信息。
在R1設備的接口封裝爲幀中繼協議,並關閉IARP協議,然後配置映射表:
R1(config)#int s0/0
R1(config-if)#encapsulation frame-relay
R1(config-if)#no frame-relay inverse-arp
R1(config-if)#frame-relay map ip 192.168.1.2 102 broadcast
R1(config-if)#frame-relay map ip 192.168.1.3 103 broadcast
R1(config-if)#exit
R1(config)#
對於R2,R3設備也需要關閉IARP協議並配置映射表......
R2設備配置:
R2(config)#int s0/0
R2(config-if)#no shutdown
R2(config-if)#encapsulation frame-relay
R2(config-if)#no frame-relay inverse-arp
R2(config-if)#frame-relay map ip 192.168.1.1 201 broadcast
R2(config-if)#exit
R2(config)#
R3設備配置如下:
R3(config)#int s0/0
R3(config-if)#no shutdown
R3(config-if)#encapsulation frame-relay
R3(config-if)#no frame-relay inverse-arp
R3(config-if)#frame-relay map ip 192.168.1.1 301 broadcast
R3(config-if)#exit
R3(config)#
另外,還需要配置三臺設備的ip地址,這裏略過......
然後查看設備的PVC線路,以R1設備爲例:
R1#show frame-relay pvc
PVC Statistics for interface Serial0/0 (Frame Relay DTE)
Active Inactive Deleted Static
Local 2 0 0 0
Switched 0 0 0 0
Unused 0 0 0 0
//PVC線路是ACTIVE,正常
DLCI = 102, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0
input pkts 0 output pkts 0 in bytes 0
out bytes 0 dropped pkts 0 in pkts dropped 0
out pkts dropped 0 out bytes dropped 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
pvc create time 00:21:29, last time pvc status changed 00:00:29
DLCI = 103, DLCI USAGE = LOCAL, PVC STATUS = ACTIVE, INTERFACE = Serial0/0
input pkts 0 output pkts 0 in bytes 0
out bytes 0 dropped pkts 0 in pkts dropped 0
out pkts dropped 0 out bytes dropped 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
pvc create time 00:21:16, last time pvc status changed 00:00:17
R1#
一般PVC線路有三種狀態:ACTIVE則表示PVC線路完全正常;INACITVE表示本端PVC線路正常,但是對端不正常;DELETED表示本端PVC線路有故障。當通過show命令查看pvc線路的狀態是ACTIVE的話,說明該線路是正常的。
查看R1設備的映射表信息:
R1#show frame-relay map
Serial0/0 (up): ip 192.168.1.2 dlci 102(0x66,0x1860), static,
broadcast,
CISCO, status defined, active
Serial0/0 (up): ip 192.168.1.3 dlci 103(0x67,0x1870), static,
broadcast,
CISCO, status defined, active
R1#
在之前的配置中是關閉了IARP協議,手動綁定了DLCI和IP之間的映射,因此這裏顯示是static,並且是處於Active狀態,說明映射是正常的。R1設備的映射表學到了R2和R3設備的兩條映射信息。
查看幀中繼交換機的路由表信息:
FR-SW#show frame-relay route
Input Intf Input Dlci Output Intf Output Dlci Status
Serial0/1 102 Serial0/2 201 active
Serial0/1 103 Serial0/3 301 active
Serial0/2 201 Serial0/1 102 active
Serial0/3 301 Serial0/1 103 active
FR-SW#
測試網絡連通性:
R1#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 92/95/104 ms
R1#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 68/93/104 ms
R1#
R2#ping 192.168.1.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.3, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R2#
從測試結果來看,R2和R3之間是無法通信的,這是因爲由於分支之間沒有到對方的映射信息,所以無法通信,如果分點之間想要通信還需要加入對方的映射信息,這個任務就交給你們了。
到此幀中繼技術實驗完成。