IP SLA的路径控制
一、定義
SLA?服務(wù)水平協(xié)議(簡稱:SLA,全稱:service level agreement)是在一定開銷下為保障服務(wù)的性能和可靠性,服務(wù)提供商與用戶間定義的一種雙方認(rèn)可的協(xié)定。通常這個開銷是驅(qū)動提供服務(wù)質(zhì)量的主要因素。
簡單點(diǎn)說就是通過發(fā)送測試報文,對網(wǎng)絡(luò)性能,服務(wù)質(zhì)量進(jìn)行分析,并為用戶提供網(wǎng)絡(luò)服務(wù)質(zhì)量的各種參數(shù),例如:抖動延遲,文件傳輸速率,TCP時延等等
二、主要配置命令
ip sla monitor?operation-number//定義SLA的編號
type echo protocol ipIcmpEcho?{destination-ip-address?|destination-hostname} [source-ipaddr?{ip-address?|hostname} |?source-interface?interface-name]//定義icmp測試的目的地址和源地址(我這里做實驗的是用icmp 其實type后可以用很多協(xié)議的…很強(qiáng)大)
ip sla monitor schedule?operation-number?[life?{forever|?seconds}] [start-time?{hh:mm[:ss] [month?day?|?daymonth] |?pending?|?now?|?after?hh:mm:ss] [ageoutseconds] [recurring]//調(diào)用SLA運(yùn)行的時間
三、實驗
拓?fù)?/span>
實驗要求:
R1連接到ISP-1和ISP-2,其中連到ISP-1的是主路徑,到ISP-2是備用路徑。當(dāng)連接到ISP-1鏈路出現(xiàn)故障時,正常的數(shù)據(jù)流量可以通過ISP-2過。
??R1配置如下:
interface FastEthernet1/0
ip address 192.168.2.1 255.255.255.0
interface FastEthernet1/1
ip address 192.168.1.1 255.255.255.0
?
ip sla monitor 10
?type echo protocol ipIcmpEcho 192.168.2.2 source-interface FastEthernet1/0
?frequency 5? //每隔5秒測試一次
ip sla monitor schedule 10 life forever start-time now
?
?
ip sla monitor 11
?type echo protocol ipIcmpEcho 192.168.1.1 source-interface FastEthernet1/1
?frequency 5
ip sla monitor schedule 11 life forever start-time now
?
track 1 rtr 10 reachability//定義一個track跟蹤目的地的可達(dá)性以便在靜態(tài)路由的時候調(diào)用
track 2 rtr 11 reachability//同上
?
浮動路由:
ip route 0.0.0.0 0.0.0.0 192.168.2.2 track 1//主鏈路
ip route 0.0.0.0 0.0.0.0 192.168.1.2 2 track 2//備份鏈路
?
實驗調(diào)試:
R1#debug ip sla monitor trace ??//打開sla跟蹤調(diào)試
R1#debug ip routing? //打開路由調(diào)試 等下會看到路由表的變化
IP routing debugging is on
R1#debug ip sla monitor trace
IP SLA Monitor TRACE debugging for all operation is on
R1#
*Mar? 1 01:02:56.663: IP SLA Monitor(11) Scheduler: Starting an operation
*Mar? 1 01:02:56.667: IP SLA Monitor(11) echo operation: Sending an echo operation
*Mar? 1 01:02:56.675: IP SLA Monitor(11) echo operation: RTT=8
*Mar? 1 01:02:56.679: IP SLA Monitor(11) Scheduler: Updating result
*Mar? 1 01:02:56.915: IP SLA Monitor(10) Scheduler: Starting an operation
*Mar? 1 01:02:56.915: IP SLA Monitor(10) echo operation: Sending an echo operation
*Mar? 1 01:02:56.923: IP SLA Monitor(10) echo operation: RTT=4
*Mar? 1 01:02:56.927: IP SLA Monitor(10) Scheduler: Updating result
R1#
*Mar? 1 01:03:01.663: IP SLA Monitor(11) Scheduler: Starting an operation
*Mar? 1 01:03:01.667: IP SLA Monitor(11) echo operation: Sending an echo operation
*Mar? 1 01:03:01.675: IP SLA Monitor(11) echo operation: RTT=8
*Mar? 1 01:03:01.675: IP SLA Monitor(11) Scheduler: Updating result
*Mar? 1 01:03:01.915: IP SLA Monitor(10) Scheduler: Starting an operation
*Mar? 1 01:03:01.915: IP SLA Monitor(10) echo operation: Sending an echo operation
R1#
*Mar? 1 01:03:04.459: RT: NET-RED 0.0.0.0/0
R1#
*Mar? 1 01:03:06.663: IP SLA Monitor(11) Scheduler: Starting an operation
*Mar? 1 01:03:06.667: IP SLA Monitor(11) echo operation: Sending an echo operation
*Mar? 1 01:03:06.675: IP SLA Monitor(11) echo operation: RTT=8
*Mar? 1 01:03:06.679: IP SLA Monitor(11) Scheduler: Updating result
*Mar? 1 01:03:06.919: IP SLA Monitor(10) echo operation: Timeout? //跟蹤出現(xiàn)timeout
*Mar? 1 01:03:06.919: IP SLA Monitor(10) Scheduler: Updating result
R1#
*Mar? 1 01:03:11.331: RT: del 0.0.0.0 via 192.168.2.2, static metric [1/0]
*Mar? 1 01:03:11.335: RT: delete network route to 0.0.0.0
*Mar? 1 01:03:11.339: RT: NET-RED 0.0.0.0/0
*Mar? 1 01:03:11.339: RT: NET-RED 0.0.0.0/0
*Mar? 1 01:03:11.339: RT: SET_LAST_RDB for 0.0.0.0/0
? NEW rdb: via 192.168.1.2
?
*Mar? 1 01:03:11.343: RT: add 0.0.0.0/0 via 192.168.1.2, static metric [2/0]
*Mar? 1 01:03:11.343: RT: NET-RED 0.0.0.0/0
*Mar? 1 01:03:11.343: RT: default path is now 0.0.0.0 via 192.168.1.2
*Mar? 1 01:03:11.343: RT: new default network 0.0.0.0
*Mar? 1 01:03:11.343: RT: NET-RED 0.0.0.0/0? //靜態(tài)路由變成了備用路徑
*Mar? 1 01:03:11.663: IP SLA Monitor(11) Scheduler: Starting an operation
R1#
*Mar? 1 01:03:11.663: IP SLA Monitor(11) echo operation: Sending an echo operation
*Mar? 1 01:03:11.675: IP SLA Monitor(11) echo operation: RTT=8
*Mar? 1 01:03:11.679: IP SLA Monitor(11) Scheduler: Updating result
*Mar? 1 01:03:11.919: IP SLA Monitor(10) Scheduler: Starting an operation
*Mar? 1 01:03:11.919: IP SLA Monitor(10) echo operation: Sending an echo operation
R1#
*Mar? 1 01:03:16.663: IP SLA Monitor(11) Scheduler: Starting an operation
*Mar? 1 01:03:16.667: IP SLA Monitor(11) echo operation: Sending an echo operation
*Mar? 1 01:03:16.675: IP SLA Monitor(11) echo operation: RTT=8
*Mar? 1 01:03:16.679: IP SLA Monitor(11) Scheduler: Updating result
*Mar? 1 01:03:16.919: IP SLA Monitor(10) echo operation: Timeout
*Mar? 1 01:03:16.919: IP SLA Monitor(10) Scheduler: Updating result
R1#u all
All possible debugging has been turned off
R1#
*Mar? 1 01:03:21.663: IP SLA Monitor(11) Scheduler: Starting an operation
*Mar? 1 01:03:21.663: IP SLA Monitor(11) echo operation: Sending an echo operation
*Mar? 1 01:03:21.663: IP SLA Monitor(11) echo operation: RTT=1
*Mar? 1 01:03:21.663: IP SLA Monitor(11) Scheduler: Updating result
R1#sho ip rou
R1#sho ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
?????? D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
?????? N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
?????? E1 - OSPF external type 1, E2 - OSPF external type 2
?????? i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
?????? ia - IS-IS inter area, * - candidate default, U - per-user static route
?????? o - ODR, P - periodic downloaded static route
?
Gateway of last resort is 192.168.1.2 to network 0.0.0.0
?
C??? 192.168.1.0/24 is directly connected, FastEthernet1/1
C??? 192.168.2.0/24 is directly connected, FastEthernet1/0
S*?? 0.0.0.0/0 [2/0] via 192.168.1.2 //備用路徑出現(xiàn)在路由表、
注:當(dāng)主鏈路恢復(fù)時又會重新出現(xiàn)時,主路徑又會替換掉備用路徑!!!
實驗的主要思想:結(jié)合SLA能測試鏈路的各種參數(shù),來實現(xiàn)路徑的控制,或者是冗余路徑。
SLA的功能肯定不是這一點(diǎn)點(diǎn),鑒于本人也只是剛剛開始看SLA,這個小實驗提供給大家初步了解SLA。
?
?
?
?
轉(zhuǎn)載于:https://blog.51cto.com/dxiaozhi/940998
總結(jié)
以上是生活随笔為你收集整理的IP SLA的路径控制的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 通过Python脚本理解系统进程间通信
- 下一篇: nis服务器架设