IP SLA
Overview
The Cisco IOS IP Service Level Agreement (IP SLA) feature enables you to gather realistic information about how specific types of traffic are being handled end to end across a network. To do this, an IP SLA device runs a preconfigured test and generates traffic that is destined for a far-end device. As the far end responds with packets that are received back at the source, IP SLA gathers data about what happened along the way.
To set up an IP SLA operation, the Cisco IP SLA source device begins by opening a control connection to the IP SLA responder over UDP port 1967. The source uses the control connection to inform the responder to begin listening on an additional port where the actual IP SLA test operation will take place.
Configuration
Source
Switch(config)# ip sla operation-number
Switch(config-ip-sla)# test-type parameters...
Switch(config-ip-sla)# frequency seconds
Switch(config)# ip sla schedule operation-number [ life { forever | seconds }] [ start-time { hh: mm [: ss ] [ month day | day month ] | pending | now | after hh:mm:ss }] [ ageout seconds ] [ recurring ]
The operation-number is an arbitrary index that can range from 1 to a very large number. This number uniquely identifies the test.
By default, IP SLA operations are run at regular 60-second intervals for the lifetime of the test.
By default, an IP SLA scheduled operation will run for 3600 seconds (1 hour).
By default, the test statistics are collected and held in memory indefinitely. You can use the ageout keyword to specify how many seconds elapse before the data is aged out.
The recurring keyword can be used to schedule the test operation to run at the same time each day, as long as you have defined the starting time with hh:mm:ss , too.
Example of Test Type
Switch(config-ip-sla)# icmp-echo destination-ip-addr [ source-ip-addr ]
Switch(config-ip-sla)# udp-jitter destination-ip-addr dest-udp-port [ source-ip source-ip-addr ] [ source-port source-udp-port ] [ num-packets number-of-packets] [ interval packet-interval ]
Switch(config-ip-sla)# udp-jitter destination-ip-addr dest-udp-port codec { g711alaw | g711ulaw | g729a }
Example of Configuration
The following configuration commands are used to define IP SLA operation 100—an ICMP echo test that pings target 172.25.226.1 every 5 seconds.
Switch(config)# ip sla 100
Switch(config-ip-sla)# icmp-echo 172.25.226.1
Switch(config-ip-sla)# frequency 5
Switch(config-ip-sla)# exit
Switch(config)# ip sla schedule 100 life forever start-time now
Switches A and B are configured as an HSRP pair, sharing gateway address 192.168.1.1. Switch A has a higher priority (120) than Switch B (the default 100), so it is normally the active gateway. However, it is configured to ping an upstream router
Switch-A(config)# ip sla 10
Switch-A(config-ip-sla)# icmp-echo 192.168.70.1
Switch-A(config-ip-sla)# frequency 5
Switch-A(config-ip-sla)# exit
Switch-A(config)# ip sla schedule 10 life forever start-time now
Switch-A(config)# track 1 ip sla 10 reachability
Switch-A(config)# interface vlan10
Switch-A(config-if)# ip address 192.168.1.3 255.255.255.0
Switch-A(config-if)# standby 1 ip 192.168.1.1
Switch-A(config-if)# standby 1 priority 120
Switch-A(config-if)# standby 1 track 1 decrement 30
Switch-A(config-if)# standby 1 preempt
Switch-A(config-if)# no shutdown
Responder
Switch(config)# ip sla responder
Authentication
Switch(config)# key chain chain-name
Switch(config-keychain)# key key-number
Switch(config-keychain-key)# key-string string
Switch(config-keychain-key)# exit
Switch(config-keychain)# exit
Switch(config)# ip sla key-chain chain-name
Track Object
A track object can be used to provide a trigger to change priority for HSRP, VRRP and GLBP. It can monitor an interface.
Switch(config)# track object-number interface type number {line-protocol | ip routing}
The object-number is an arbitrary index (1 to 500). The condition that triggers an adjustment can be line-protocol (the interface line protocol is up) or ip routing . (IP routing is enabled, the interface has an IP address, and the interface is up.)
A track object can also monitor an IP SLA operation state.
Switch(config)# track object-number ip sla operation-number { state | reachability }
You can use the state keyword to track the return code or state of the IP SLA operation; the state is up if the IP SLA test was successful or down if it was not. The reachability keyword differs slightly: The result is up if the IP SLA operation is successful or has risen above a threshold; otherwise, the reachability is down.
Show Status
Switch# show ip sla statistics aggregated
Round Trip Time (RTT) for Index 1
Type of operation: icmp-echo
Start Time Index: 15:10:17.665 EDT Fri Aug 22 2014
RTT Values
Number Of RTT: 24
RTT Min/Avg/Max: 1/1/4 ms
Number of successes: 24
Number of failures: 0
Switch# show ip sla statistics 100
Round Trip Time (RTT) for Index 100
Latest RTT: 1 ms
Latest operation start time: 15:52:00.834 EDT Fri Aug 29 2014
Latest operation return code: OK
Number of successes: 117
Number of failures: 0
Operation time to live: Forever
Switch# show ip sla statistics aggregated 100
Round Trip Time (RTT) for Index 100
Type of operation: icmp-echo
Start Time Index: 15:43:55.842 EDT Fri Aug 29 2014
RTT Values
Number Of RTT: 121
RTT Min/Avg/Max: 1/1/4 ms
Number of successes: 121
Number of failures: 0
Switch# show ip sla configuration
IP SLAs, Infrastructure Engine-II
Entry number: 100
Owner:
Tag:
Type of operation to perform: echo
Target address: 172.25.226.1
Source address: 0.0.0.0
Request size (ARR data portion): 28
Operation timeout (milliseconds): 5000
Type Of Service parameters: 0x0
Verify data: No
Vrf Name:
Schedule:
Operation frequency (seconds): 5
Next Scheduled Start Time: Start Time already passed
Group Scheduled : FALSE
Randomly Scheduled : FALSE
Life (seconds): Forever
Entry Ageout (seconds): never
Recurring (Starting Everyday): FALSE
Status of entry (SNMP RowStatus): Active
Threshold (milliseconds): 5000
Distribution Statistics:
Number of statistic hours kept: 2
Number of statistic distribution buckets kept: 1
Statistic distribution interval (milliseconds): 20
History Statistics:
Number of history Lives kept: 0
Number of history Buckets kept: 15
History Filter Type: None
Enhanced History: