Tuesday, December 16, 2014

Notes: Choosing the Best Router Switching Path

Introduction

  • A plethora of switching paths available in various Cisco IOS releases.
  • Which is the best, and how do they all work?
  • Three steps to forwarding a packet through a router:
  1. Determine if the packet's destination is reachable.
  2. Determine the next hop toward the destination, and the interface through which that next hop is reachable.
  3. Rewrite the MAC header on the packet so it will successfully reach its next hop.

 

Process Switching

  • Lowest common denominator in switching paths.
  • Available on every version of IOS, on every platform, and for every type of traffic being switched.
  • Defined by two essential concepts:
  1. The forwarding decision and MAC rewrite information are taken from the routing table (RIB) and ARP cache (or another Layer 3 to Layer 2 mapping table).
  2. The packet is switched by a normal process running within IOS. The forwarding decision is made by a process scheduled through the IOS scheduler. Processes that normally run on the router are not interrupted to process switch a packet.



Examine the diagram in more detail:
  1. The interface processor first detects there is a packet, and transfers this packet to the input/output memory on the router.
  2. The interface processor generates a receive interrupt. During this interrupt, the central processor determines the type of packet (assume an IP packet), and copies it into processor memory if necessary. Finally, the processor places the packet on the appropriate process' input queue and the interrupt is released.
  3. When the scheduler runs next, it notes the packet in the input queue of IP Input, and schedules this process to run.
  4. When IP Input runs, it consults the RIB to determine the next hop and the output interface, then refers to the ARP cache to find the MAC information.
  5. IP Input then rewrites the MAC header, and places the packet on the output queue of the correct outbound interface.
  6. The packet is copied from the output queue to the transmit queue. Any outbound QoS is applied between these two queues.
  7. The outbound interface processor detects the packet on its transmit queue, and transfers the packet.

 

Interrupt Context Switching

The primary differences between interrupt context switching and process switching are:
  • The process currently running on the processor is interrupted to switch the packet. Packets are switched on demand, rather than switched only when the IP Input process is scheduled.
  • The processor uses some form of route cache to find all the information needed to switch the packet.


In more detail:
  1. The interface processor first detects a packet, and transfers it to the input/output memory on the router.
  2. The interface processor generates a receive interrupt. During this interrupt, the central processor determines the type of packet (assume an IP packet), and then begins to switch the packet.
  3. The processor searches the route cache to determine if the packet's destination is reachable, what the output interface should be, what the next hop towards the destination is, and what MAC header the packet should have. The processor rewrites the MAC header using this information.
  4. The packet is copied to the transmit or output queue of the outbound interface (depending on various factors). The process that was running on the processor before the interrupt occurred continues running.
  5. The output interface processor detects the packet on its transmit queue, and transfers it.

 

What is this cache?

Three possible answers, depending on the type of interrupt context switching:
  • Fast Switching
  • Optimum Switching
  • Cisco Express Forwarding


Fast Switching

  • Stores the forwarding information and MAC header rewrite string using a binary tree for quick lookup and reference.


  • The binary tree can actually have 32 levels (the illustration is extremely abbreviated).
  • To search the binary tree, the binary string is read from left to right (starting from the most significant bit), and branching left or right in the tree based on the number.
  • The bits are compared in order, until the end is reached. 

Results of the binary tree structure and the storage of MAC header rewrite information as part of the tree nodes:
  • Building the cache entries must be done in process switching. Fast cache entries are built as packets are process switched.
  • When the ARP table changes, some portion of the fast cache must be invalidated (and recreated through the process switching of packets).
  • The fast cache can only build entries at one depth (one prefix length) for any particular destination within the routing table.
  • There is no way to point from one entry to another within the fast cache. Recursive routes cannot be resolved within the fast cache itself. To keep fast switching entries from losing their synchronization with the routing table and ARP cache, and to keep unused entries from unduly consuming memory, 1/20th of the fast cache is invalidated, randomly, every minute. If the routers memory drops below a very low watermark, 1/5th of the fast cache entries are invalidated every minute.

 

Fast Switching Prefix Length

The rules for deciding what prefix length to build a given cache entry are:
  • If building a fast policy entry, always cache to /32.
  • If building an entry against an MPOA VC, always cache to /32.
  • If the network is not subnetted (it's a major network entry):
  1. if it is directly connected, use /32
  2. otherwise use the major net mask
  • If it is a supernet, use the supernet's mask
  • If the network is subnetted:
  1. if directly connected, use /32
  2. if there are multiple paths to this subnet, use 32
  3. in all other cases, use the longest prefix length in this major net

  • Fast switching is entirely destination-based; load sharing occurs on a per-destination basis.
  • If there are multiple equal-cost paths for a destination network, fast cache has one entry for each host reachable within that network, but all traffic destined to a particular host follows one link.


Optimum Switching

  • Stores the forwarding information and the MAC header rewrite information in a 256 way multiway tree (256 way mtree).
  • Looking up a prefix takes fewer steps when using an mtree.


  • Each octect is used to determine which of the 256 branches to take at each level of the tree.
  • There are, at most, 4 lookups in finding any destination.
  • The MAC header rewrite and output interface information are stored as part of the tree node, so cache invalidation and aging still occur as in the fast switching.
  • Determines the prefix length for each cache entry in the same way as fast switching.


Cisco Express Forwarding (CEF)

  • Also uses a 256 way data structure but does not use a tree.
  • Uses a trie, i.e. the searched information is actually not in the data structure but stored in a separate datastrucutre, and the trie simply points to it.
  • Instead of storing the outbound interface and MAC header rewrite within the tree itself, CEF stores this information in a separate data structure called the adjacency table.



  • The separation of the reachability information (FIB) and the forwarding information (the adjacency table) provides a number of benefits:
  1. Both can be built without process switching packets.
  2. MAC header rewrite is not stored in cache entries, so changes do not require invalidation of cache entries.
  3. Can point directly to the forwarding information, rather than to a the recursed next hop.

  • Essentially, all cache aging is eliminated, and the cache is pre-built based on the information contained in the routing table and ARP cache.
  • No need to process switch any packets to build a cache entry.


Entries in The Adjacency Table

The adjacency table can contain entries other than MAC header rewrite strings and outbound interface information:
  • cache - A MAC heaeder rewrite string and outbound interface used to reach a particular adjacent host or router.
  • receive - Packets destined to this IP address should be received by the router (broadcast addresses and interface IP addresses).
  • drop - Packets destined to this IP address should be dropped (denied by an access-list, or routed to NULL interface).
  • punt - CEF cannot switch this packet; pass it to the next best switching method (generally fast switching).
  • glean - The next hop is directly connected, but there are no MAC header rewrite strings currently available.

How are glean adjacencies built and used?

  • A CEF router attached to a broadcast network builds a number of adjacency table entries by default.
  • Four adjacency table entries are built by default: three receives, and one glean.

10.1.1.0/24, version 17, attached, connected
0 packets, 0 bytes
  via Ethernet2/0, 0 dependencies
    valid glean adjacency
10.1.1.0/32, version 4, receive
10.1.1.1/32, version 3, receive
10.1.1.255/32, version 5, receive



  • Receive entries represent a broadcast address or an address configured on the router.
  • Glean entry represents the remainder of the address space on the connected network.
  • If a packet to host 10.1.1.50 is received, the router attempts to switch it, and finds it resolved to the glean adjacency.
  • CEF signals that an ARP cache entry is need for 10.1.1.50.
  • The ARP process sends an ARP request, and the appropriate adjacency table entry is built from the new ARP cache information.
  • The next packet to 10.1.1.50 is switched through the new adjacency.

10.1.1.0/24, version 17, attached, connected
0 packets, 0 bytes
  via Ethernet2/0, 0 dependencies
    valid glean adjacency
10.1.1.0/32, version 4, receive
10.1.1.1/32, version 3, receive
10.1.1.50/32, version 12, cached adjacency 208.0.3.2
0 packets, 0 bytes
  via 208.0.3.2, Ethernet2/0, 1 dependency
    next hop 208.0.3.2, Ethernet2/0
    valid cached adjacency
10.1.1.255/32, version 5, receive



CEF Load Sharing

  • Also takes advantage of the separation between the CEF table and the adjacency table.
  • Better form of load sharing than any other interrupt context switching mode.
  • A loadshare table is inserted between the CEF table and the adjacency table.



  • CEF table points to the loadshare table, which contains pointers to the adjacency table entries for available parallel paths.
  • The source and destination addresses are passed through a hash algorithm to determine which loadshare table entry to use for each packet.
  • Each loadshare table has 16 entries that are distributed between the available paths according to the traffic share counter in the routing table.
  • If the traffic share counter is 1 (as is the case of multiple equal-cost paths), each possible next hop receives an equal number of pointers from the loadshare table.
  • If the number of available paths is not evenly divisible into 16, some paths will have more entries than others.
  • From IOS Realease 12.0, the number of entries is reduced to provide a proportionate number of loadshare table entries for each path.
  • For example, only 15 loadshare table entries are used for three equal-cost paths.


Which Switching Path Is The Best?

  • Cisco Express Forwarding
  • CEF is definitely faster and better than any other switching mode.
  • Recommended if the IOS supports it.
  • Particularly true if there are parallel links across which traffic should be load-shared.
  • As a second option, use fast switching.
  • Avoid process switching.

References

How to Choose the Best Router Switching Path for Your Network

Monday, December 15, 2014

Notes: How Does Load Balancing Work?

My previous post examined how routes are installed in the routing table and which one is used when making a forwarding decision. It was stated that if a router learns multiple paths to the same destination with the same metric from the same routing protocol, it will install all equal-cost paths into the routing table and load balance between them. This post will look at the load balancing procedure more closely.

Introduction

  • Load balancing is a standard functionality in the Cisco IOS router software.
  • Available across all router platforms.
  • Inherent to the forwarding process, and is automatically activated if the routing table has multiple paths to a destination.

Load-Balancing

  • Limited number of equal-cost entries the routing protocol puts in the routing table.
  • Four entries is the default for most IP routing protocols.
  • BGP is the exception, where only one entry is the default.
  • Six different paths configured is the maximum number.
  • EIGRP also supports unequal-cost load-balancing.
  • The variance command accomplishes unequal-cost load-balancing.
  • The maximum-paths command determines the number of routes that can be installed based on the value configured for the protocol.
  • If the routing table is set to only one entry, load balancing is disabled.
  • Use show ip route to find equal-cost routes.

Router# show ip route 1.0.0.0
Routing entry for 1.0.0.0/8
  Known via "rip", distance 120, metric 1
  Redistributing via rip
  Advertised by rip (self originated)
  Last update from 192.168.75.7 on Serial1, 00:00:00 ago
  Routing Descriptor Blocks:
  * 192.168.57.7, from 192.168.57.7, 00:00:18 ago, via Serial0
      Route metric is 1, traffic share count is 1
    192.168.75.7, from 192.168.75.7, 00:00:00 ago, via Serial1
      Route metric is 1, traffic share count is 1


  • There are two routing descriptor blocks.
  • Each block is one route.
  • An asterisk (*) next to one of the block entries corresponds to the active route that is used for new traffic.
  • New traffic corresponds to a single packet or an entire flow to a destination, depending on the type of switching configured.
  • For process-switching - load balancing is on a per-packet basis and the asterisk (*) points to the interface over which the next packet is sent.
  • For fast-switching -  load balancing is on a per-destination basis and the asterisk (*) points to the interface over which the next destination-based flow is sent.
  • The position of the asterisk (*) keeps rotating amont the equal-cost paths to each time a packet/flow is served.

Per-Destination Load Balancing

  • Per-destination load balancing means that the router distributes the packets based on the destination address.
  • Given two paths to the same network, all packets for A on that network go over the first path, all packets for B on that network go over the second path, and so on.
  • This preserves packet order, with potential unequal usage of the links.
  • To achieve more equally used links, the IOS builds a route-cache entry for every destination address, instead of every destination network (as is the case when only a single path exists).
  • Traffic for different hosts on the same destination network can use different paths.
  • As a downside, the memory and processing requirements for maintaining the cache on core routers, which carry traffic for thousands of destination hosts, becomes very demanding.

Per-Packet Load Balancing

  • Per-packet load balancing means that the router sends one packet fro A over the first path and the second packet for A over the second path, and so on.
  • Guarantees equal load across all links.
  • However, the packets may arrive out of order at the destination.
  • Disables the forwarding acceleration by a route cache, because the route cache information includes the outgoing interface.
  • The forwarding process determines the outgoing interface for each packet by looking up the routing table and picking the least used interface.
  • Ensures equal utilization of the links, but is a processor-intensive task and impacts the overall forwarding performance.
  • Not well-suited for higher speed interfaces.

Switching Method

  • Per-destination or per-packet load-balancing depends on the type of switching scheme used for IP packets.
  • By default, on most Cisco routers, fast switching is enabled.
  • This is a demand caching scheme that does per-destination load-balancing.
  • To set per-packet load-balancing, enable process switching by disabling fast switching (no ip route-cache).
  • Now the router CPU looks at every single packet and load balances on the number of routes in the routing table for the destination.
  • This can crash a low-end router because the CPU must do all the processing.
  • Newer switching schemes like Cisco Express Forwarding (CEF) allows the router to do per-packet and per-destination load-balancing more quickly.
  • Requires extra resources to deal with maintaining CEF entries and adjacencies.

References

How Does Load Balancing Work?

Notes: Route Selection in Cisco Routers

This post will examine how a router chooses which route is the best among those presented by routing protocols, manual configuration, and various other means.

Processes Involved

Three components involved in building and maintaining the routing table:
  • processes that run a routing protocol (such as EIGRP, OSPF, BGP, and IS-IS)
  • the routing table itself (accepts information from the routing protocols and replies to requests from forwarding processes)
  • the forwarding process, which requests information from the routing table to make a packet forwarding decision

Building the Routing Table

Three main considerations when building the routing table:
  • Prefix length - Each unique prefix is considered as a separate destination. 
  • Administrative distance - The measure of trustworthiness of the source of the route. If the route is learned from multiple sources, the lowest administrative distance (the believability of the source) is preferred. 
  • Metric - The measure used by the routing protocol to calculate the path cost to a given destination. Each routing protocol uses a different metric.


Backup Routes

  • What happens to routes that are not installed in the routing table?
  • What if the most preferred route fails?
  • Two approaches to solve this problem:
    1. Have the routing process attempt to install its best route periodically.
    2. Have the routing protocol keep the route in its own database, and instruct the routing process to report if the best path fails. 
  • If the routing protocol does not have its own database, it attempts to install the updated information in the routing table.
  • If there's already a route to the same destination, the installation attempt fails.
  • For protocols that have their own database (EIGRP, OSPF, BGP, IS-IS, and RIP), a backup route is registered when the initial attempt to install the route fails.
  • If the best path fails, the routing table process calls each routing protocol process that has registered a backup route, and asks them to reinstall the route (the lowest administrative distance wins).


Adjusting the Administrative Distance

  • Changing the administrative distance can be very dangerous!
  • For an entire routing protocol, the change is quite easy; simply specify the distance under the routing process.
  • For static routes, the distance can be configured for each route individually.

How Metrics Determine the Route Selection Process

  • Routes are chosen in the routing table based on the lowest administrative distance.
  • If there are multiple paths to the same destination from a single routing protocol, the best path is selected based on the lowest metric.
  • The parameters used to determine the metrics differ for each routing protocol.
  • If there are multiple paths to the same destination with equal metrics, all routes are installed in the routing table and load balancing is done between them.

Prefix lengths

  • Let's assume that a router has learned the following routes:
  1. EIGRP (internal): 192.168.32.0/26
  2. RIP: 192.168.32.0/24
  3. OSPF: 192.168.32.0/19
  • What will be installed in the routing table?
  • All of them, because they have different prefix lengths, so they are considered different destinations.

Making Forwarding Decisions

  • Longer prefixes are always preferred!
  • Let's look at the three routes previously installed in the routing table.

router# show ip route
     ....
     D   192.168.32.0/26 [90/25789217] via 10.1.1.1
     R   192.168.32.0/24 [120/4] via 10.1.1.2
     O   192.168.32.0/19 [110/229840] via 10.1.1.3
     ....


  • A packet destined to 192.168.32.1 matches all routes but it is forwarded according to the EIGRP route because of the longest prefix length.
  • Similarly, a packet to 192.168.32.254 would be forwarded 10.1.1.2 (RIP route) because of the most specific match.

IP Classless

  • Only affects the forwarding process, not the building of the routing table.
  • If IP classless isn't configured (no ip classless), the router won't forward packets to supernets.
  • If one part of a major network is known, but the subnet toward which the packet is destined within that major network is unknown, the packet is dropped.
  • The router only uses the default route if the destination major network doesn't exist in the routing table at all.
  • Configuring ip classless allows the router to ignore the classful boundaries of the networks in its routing table and simply route to the longest prefix match it can find.

Summary

  • Making a forwarding decision actually consists of three processes: the routing protocols, the routing table, and the forwarding process.
  • Installing a route into the routing table: the lowest administrative distance wins; if there are multiple paths to the same destination, compare the metric (install all equal-cost routes).
  • Making a forwarding decision: the longest prefix wins.
  • The process is illustrated in the diagram below.


References

Route Selection in Cisco Routers
What is Administrative Distance?

Friday, December 12, 2014

Notes: GLBP

Feature Overview

  • GLBP provides automatic router backup for IP hosts configured with a single default gateway.
  • Multiple first-hop routers combine to offer a single virtual router while sharing the IP packet forwarding load.
  • GLBP performs a similar, but not identicaly, function to HSRP and VRRP.
  • In HSRP, only one member is elected as the active router to forward packets sent to the virtual IP address of the group, the other routers are unused in terms of user data transmission. Load sharing is achieved by configuring multiple HSRP groups and virtual IP addresses, and pointing the end hosts to different default gateways - causing extra administrative burden.
  • GLBP provides load balancing over multiple rouers (gateways) by using a single virtual IP address and multiple virtual MAC addresses.
  • All end hosts are configured with the same default gateway (the virtual IP address), and all routers in the GLBP group participate in forwarding packets.
  • GLBP members communicate between each other through Hello messages every 3 seconds.
  • The Hellos are sent to the multicast IP address 224.0.0.102 UDP port 3222 (source and destination).

GLBP Active Virtual Gateway (AVG)

  • One member is elected as the AVG for a  GLBP group.
  • Other members provide backup for the AVG in the event that the AVG becomes unavailable.
  • The AVG assigns a virtual MAC address to each member of the GLBP group.
  • Each gateway, an active virtual forwarder (AVF) assumes responsibility for forwarding packets sent to their virtual MAC address (as assigned by the AVG).
  • The AVG replies to ARP requests for the virtual IP address.
  • Load sharing is achieved by the AVG replying to ARP requests with different virtual MAC addresses.
  • If a router goes down, another member will assume responsibility for forwarding packets to the virtual MAC address of the failed router.

GLBP Virtual MAC Address Assignment

  • Up to four virtual MAC addresses per group.
  • The AVG is responsible for assigning the virtual MAC addresses to each member of the group.
  • Members request a virtual MAC address after they discover the AVG through Hello messages.
  • Gateways are assigned the next MAC address in sequence.

GLBP Virtual Gateway Redundancy

  • Operated in same way as HSRP.
  • One gateway is elected as the AVG, another as the standby virtual gateway, and the remaining members are placed in a listen state.
  • If an AVG fails, the standby virtual gateway will assume responsibility for the virtual IP address.
  • A new standby virtual gateway is then elected from the routers in the listen state.

GLBP Virtual Forwarder Redundancy

  • Similar to virtual gateway redundancy.
  • If the AVF fails one of the secondary virtual forwarders in the listen state assumes responsibility for the virtual MAC address.
  • The redirect time is the interval during which the AVG continues to redirect hosts to the old virtual forwarder MAC address.
  • When the redirect timer expires, the AVG stops redirecting hosts to the virtual forwarder.
  • However, the virtual forwarder will continue to forward packets that were sent to the old virtual forwarder MAC address.
  • The secondary holdtime is the interval during which the virtual forwarder is valid.
  • When the secondary holdtime expires, the virtual forwarder is removed from all gateways in the GLBP group.
  • The expired virtual forwarder number becomes eligible for reassignment by the AVG.

GLBP Gateway Priority

  • Determines the role that each GLBP gateway plays and what happens if the AVG fails.
  • Defines the order of ascendancy to becoming an AVG if the current AVG fails.
  • A value of 1 through 255.
  • The router with the highest priority is elected as the AVG.
  • With same priorities, the higher IP address is preferred.
  • By default, the preemption is disabled.
  • A backup virtual gateway can become the AVG only if the current AVG fails, regardless of the priorities assigned.
  • Preemption allows a backup virtual gateway to become the AVG, if the backup virtual gateway is assigned a higher priority than the current AVG.

GLBP Gateway Weighting and Tracking

  • A weighting scheme used to determine the forwarding capacity of each router in the GLBP group.
  • The weighting determines if the router will forward packets and, if so, the proportion of hosts for which it will forward packets.
  • Thresholds can be set to disable forwarding when the weighting falls below a certain value, and when it rises above another threshold, forwarding is automatically re-enabled.
  • The GLBP group weighting can be automatically adjusted by tracking the state of an interface.
  • If a tracked interface goes down, the GLBP group weighting is reduced by a specified value.
  • Different interfaces can be tracked to decrement the GLBP weighting by varying amounts.

Benefits

  • load sharing: traffic from LAN clients can be shared by multiple routers
  • multiple virtual routers: supports up to 1024 GLBP groups on each physical interface of a router, and up to four AVFs per group
  • preemption: AVG with a higher priority backup virtual gateway; AVF preemption uses weighting instead of priority
  • authentication: simple text password authentication scheme to detect configuration errors or the industry-standard MD5 algorithm for improved reliability, security, and protection against GLBP-spoofing software

Configuration Tasks

  • Enabling GLBP (required).
  • Customizing GLBP (optional).
  • Configuring GLBP Weighting (optional).
  • Verifying GLBP (optional).

Enabling GLBP

  • Easy to configure.
  • Each gateway in a GLBP group must be configured with the same group number.
  • At least one gateway in the GLBP group must be configured with the virtual IP address of the group.
  • All other parameters can be learned.
  • If VLANs are in use on an interface, the GLBP group number must be different for each VLAN.

interface GigabitEthernet0/1
  glbp 47 ip 10.1.47.1


Customizing GLBP

  • As soon as the GLBP group is enabled, that group is operating.
  • If the GLBP group is enabled before customizing is completed, the router could take over control of the group and become the AVG before the full configuration is finished.
  • Customize before enabling GLBP.

glbp 47 authentication text GLBPSTRING
  • authenticates GLBP packets received from other routers in the group
  • if configured, all routers within the GLBP group must use the same authentication string

glbp 47 forwarder preempt [delay minimum 30]
  • configures the router to take over as AVF if it has a higher priority than the current AVF
  • enabled by default with a delay of 30 seconds

glbp 47 load-balancing {host-dependent | round-robin | weighted}
  • specifies the method of load-balancing used by the GLBP AVG

glbp 47 preempt [delay minimum <sec>]
  • configures the router to take over as AVG if it has a higher priority than the current AVG
  • disabled by default

glbp 47 priority 100
  • sets the priority level of the gateway within a GLBP group
  • the default is 100

glbp 47 timers [msec] Hellotime [msec] Holdtime
  • Hellotime configures the interval between successive Hello packets sent by the AVG in a GLBP group
  • Holdtime specifies the interval in seconds before the AVG and AVF information in the Hello packet is considered invalid


Configuring GLBP Weighting

  • GLBP Weighting is used to determine whether a router can act as a virtual forwarder.
  • Thresholds and tracked interfaces can be set.
  • When the GLBP router weighting drops below a specified value, the router will no longer be an active virtual forwarder.
  • When the weighting rises above a specified value, the router can resume its role as an active virtual forwarder.

track <obj-num> interface <int-num> {line-protocol | ip routing}
  • configures an interface to be tracked where the status change affects the weighting of a GLBP gateway.
  • line-protocol keyword tracks whether the interface is up
  • ip routing keyword also checks that IP routing is enabled on the interface, and an IP address is configured

glbp 47 weighting <max> [lower <low>] [upper <up>]
  • specifies the initial weighting value, and the lower and upper thresholds, for a GLBP gateway

glbp 47 weighting track <obj-num> [decrement <value>]
  • specifies an object to be tracked that affects the weighting of a GLBP gateway
  • <value> argument specifies a reduction in the weighting of a GLBP gateway when a tracked object fails


Verifying GLBP


dc1-edgertr1#show glbp
GigabitEthernet0/0 - Group 47
  State is Active
    2 state changes, last state change 11w6d
  Virtual IP address is 10.1.47.1
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 1.376 secs
  Redirect time 600 sec, forwarder timeout 14400 sec
  Authentication text, string "GLBPSTRING"
  Preemption disabled
  Active is local
  Standby is 10.42.100.102, priority 101 (expires in 9.440 sec)
  Priority 100 (default)
  Weighting 100 (default 100), thresholds: lower 1, upper 100
  Load balancing: round-robin
  Group members:
    3794.0fc5.3a1b (10.1.47.101)
    ccef.4712.7d1b (10.1.47.102) local

  There are 2 forwarders (1 active)
  Forwarder 1
    State is Active
      1 state change, last state change 19w1d
    MAC address is 0007.b400.0101 (default)
    Owner ID is ccef.4712.7d1b
    Redirection enabled
    Preemption enabled, min delay 30 sec
    Active is local, weighting 100
    Client selection count: 813
  Forwarder 2
    State is Listen
      2 state changes, last state change 11w6d
    MAC address is 0007.b400.0102 (learnt)
    Owner ID is 3794.0fc5.3a1b
    Redirection enabled, 599.456 sec remaining (maximum 600 sec)
    Time to live: 14399.456 sec (maximum 14400 sec)
    Preemption enabled, min delay 30 sec
    Active is 10.42.100.252 (primary), weighting 100 (expires in 9.600 sec)
    Client selection count: 814


References

Gateway Load Balancing Protocol

Tuesday, December 9, 2014

Notes: Spanning Tree Protocol Problems and Related Design Considerations

I'm troubleshooting an STP issue at work, so I decided to continue my "Notes" collection with the documentation I'm reading.

This post discusses some of the common reasons that STP can fail and the information for which to look to identify the source of the problem. The post also shows the kind of design that minimizes STP related issues and is easy to troubleshoot.

Spanning Tree Protocol Failure

  • The primary function of STP is to cut loops created by redundant links in a Layer 2 network.
  • Switches exchange BPDUs to elect which port should forward or block traffic.
  • Troubleshooting can be very difficult, depending on the design.
  • A loop occurs when a port should block, but instead forwards traffic.

STP Convergence

Next, different situations that can use the STA (STP algorithm) to fail are listed. Most of these failures relate to a massive loss of BPDUs, which causes blocked ports to transition to forwarding mode.

Duplex Mismatch

If the duplex mode is manually set to Full on one side and left to autonegotiate on the other side, the link ends up in half-duplex. The port with full-duplex no longer negotiates. The full-duplex/half-duplex mismatch can easily lead to a switching loop. The full-duplex does not perform carrier sense before sending frames, so it can transmit traffic even if the half-duplex is already using the link. This situation is a problem for half-duplex; the switch detects a collision and runs the backoff algorithm before the bridge attempts another transmission of the frame. If there is enough traffic from full-duplex, every packet from half-duplex undergoes deferment or collision and eventually gets dropped. From STP's perspective, full-duplex does not receive BPDUs from half-duplex any more, so it starts unblocking ports to find an alternate path to the root.

Unidirectional Link

  • Common cause of a switching loop.
  • Possible causes on fiber links: a failure that goes without detection or a problem with a transceiver.
  • Anything that can lead to a link staying up and providing a one-way communication is very dangerous with regard to STP.

SW-A DSG ----------+ BLK SW-B
      -- BPDUs lost -->
     <-- BPDUs sent --


  • The link drops traffic from SW-A to SW-B while transmitting traffic from SW-B to SW-A.
  • Assume that SW-B was blocking before the link became unidirectional.
  • Since all BPDUs that come from SW-A are lost, SW-B eventually transitions its port to forwarding state creating a loop.
  • UDLD can detect improper cabling or unidirectional links at Layer 2 and automatically break resulting loops by distabling some ports.

Packet Corruption

  • If a link has a high rate of physical errors, a certain number of consecutive BPDUs can be lost, which can lead a blocking port to transition to forwarding state.
  • Not common because STP default parameters are very conservative.
  • The blocking port needs to miss BPDUs for 50 seconds before transitioning to forwarding.
  • The successful transmission of a single BPDU breaks the loop.
  • Typically occurs with the careless adjustment of STP parameters, for example changing the max-age.

Resource Errors

  • STP is implemented in software, even on high-end platforms that perform most switching functions in hardware with specialized ASICs.
  • If the CPU is overutilized, resources can be inadequate for the transmission of BPDUs.
  • The STA is generally not processor-intensive and has priority over other processes.

PortFast Configuration Error

  • PortFast is typically enabled on interfaces that conenct to a host.
  • When the link comes up, the switch skips the first states of the STA and directly transitions to the forwarding state.
  • If enabled between two switches with redundant links, a loop is created.
  • The loop stops as soon as either switch receives a BPDU that puts one of the ports in blocking mode.
  • But if the traffic is very intensive, the switch can have trouble succesfully sending any BDPUs.
  • The problem can delay the convergence considerably or bring down the network in extreme cases.

Awkward STP Parameter Tuning and Diameter Issues

  • An aggressive value for the MaxAge parameter and the ForwarDelay can lead to a very unstable STP
  • topology.
  • The conservative default values for the STP timers impose a maximum network diameter of seven.
  • The maximum network diameter restricts how far away from each other the switches in a network can be.
  • In this case, two distinct switches cannot be more than seven hops away from each other.
  • Part of the restriction comes from the Age field in the BPDU.
  • When a BPDU propagates from the root switch toward the leaves of the tree, the Age field increments at each switch.
  • Eventually, the BPDU is discarded when the Age field goes beyond a maximum value.
  • Chaning STP timers requires careful planning.
  • It's dangerous to try to achieve faster convergence in this way.
  • Modifying an STP timer has an impact on the diameter of the network and the stability of the STP.

Software Errors

  • As one of the first features implemented in Cisco products, STP is generally very stable.
  • Only interaction with newer features, like EtherChannel, has caused STP to fail in some very specific cases in the past.
  • A number of different factors can cause a software bug and can have a number of different effects.
  • No way to adequately describe the issues that a bug can introduce.
  • Dangerous: if BPDUs are ignored or a blocking port transitions to forwarding.


Design STP for Trouble Avoidance


Know Where the Root Is

  • Do not leave STP to decide which switch is root.
  • Root placement depends on the design of the network.
  • Generally, choose a powerful switch in the middle of the network.
  • For each VLAN, hardcode the primary and secondary root switches with a reduction of the STP priority parameter.

Know Where Redundancy Is

  • Plan the organization of redundant links.
  • Forget about the plug-and-play feature of STP.
  • Tune the STP cost parameter to decide which ports block.
  • Tuning is usually not necessary if a hierarchical design exists and the root switch is in a good location.
  • For each VLAN, know which ports should be blocking in a stable network.
  • Have a network diagram that clearly shows each physical loop and which ports should be blocked to break them.

Minimize the Number of Blocked Ports

  • The only critical action that STP takes is the blocking of ports.
  • A single blocking port that mistakenly transitions to forwarding can melt down a large part of the network.
  • To limit the risk, reduce the number of blocked ports as much as possible.

Prune Unused VLANs

  • No need for more than two redundant links between two nodes in a switched network.
  • Distribution switches are typically dual-attached to two core switches.
  • However, each distribution switch might connect hosts in different VLANs. They would then receive unnecessary broadcast and multicast traffic for the other VLAN, and also block one port for that VLAN.
  • Prune any VLAN that you do not need off your trunks.

Use Layer 3 Switching

  • Layer 3 switching means routing almost at the speed of switching.
  • A router performs to main functions:
  1. A router builds a forwarding table, and exchanges information with peers using a routing protocol.
  2. A router receives packets and forwards them to the correct interface basd on the destination address.
  • High-end Cisco Layer 3 switches are now able to perform the second function at the same speed as the Layer 2 switching function.
  • If a routing hop and additional segmentation is introduced in the network, there is no speed penalty.
  • Benefits of converting the core switches to Layer 3:
  1. no possibility for an STP loop
  2. no ports are blocked
  3. no speed penalty
  4. redundancy is still present, with a reliance on Layer 3 routing protocols.
  • There is a single drawback with switching to a Layer 3 design: the migration implies a rework of the addressing scheme.

Keep STP Even If It Is Unnecessary

  • Even if there are no blocked ports or physical redundancy, do not disable STP.
  • STP is generally not very processor-intensive.
  • The few BPDUs sent on each link do not significantly reduce the available bandwidth.
  • A network without STP can melt down in a fraction of a second if an operator makes an error on a patch panes, for example.
  • Disabling STP is not worth the risk.

Keep Traffic off the Administrative VLAN and Do Not Have a Single VLAN Span the Entire Network

  • A Cisco switch typically has a single IP address that binds it to a VLAN (administrative VLAN).
  • In this VLAN, the switch behaves like a generic IP host.
  • Every broadcast or multicast packet is forwarded to the CPU.
  • A high rate of broadcast or multicast traffic can adversely impact the CPU and its capability to process vital BPDUs.
  • Keep user traffic off the administrative VLAN.

References

Spanning Tree Protocol Problems and Related Design Considerations

Saturday, December 6, 2014

Notes: Configuring HSRP

Configuring HSRP on Catalyst 3560 IOS Software Release 12.2(52)SE.

HSRP Versions


HSRPv1 - Version 1 is the default version of HSRP. It has the following features:
  • The HSRP group number range is from 0 to 255.
  • HSRPv1 uses the multicast IP address 224.0.0.2.
  • HSRPv1 and CGMP are mutually exclusive.

HSRPv2 - Version 2 has these features:
  • extends the group number range to 0-4095 (group number can match all VLAN IDs)
  • virtual MAC address from 0000.0C9F.F000 to 0000.0C9F.FFFF
  • uses the multicast IP address 224.0.0.102
  • HSRPv2 and CGMP are not mutually exclusive, both can be enabled at the same time
  • HSRPv2 has different packet format than HSRPv1

Default HSRP Configuration

  • HSRP version: Version 1
  • HSRP groups: None configured
  • Standby group number: 0
  • Standby MAC address: System assigned as 0000.0C07.ACxx, where xx is the HSRP group number
  • Standby priority: 100
  • Standby delay: 0 (no delay)
  • Standby track interface priority: 10
  • Standby Hellotime: 3 seconds
  • Standby Holdtime: 10 seconds

HSRP Configuration Guidelines

  • HSRP for IPv4 and HSRP for IPv6 are mutually exclusive, both cannot be enabled simultaneously.
  • HSRPv1 and HSRPv2 are mutually exclusive. HSRPv2 is not interoperable with HSRPv1 on an interface and the reverse.
  • Support up to 32 instances of HSRP groups.
  • The interface must be a Layer 3 interface, either a router port or an SVI.
  • All Layer 3 interfaces must have IP addresses assigned.
  • Configure only on instance of an FHRP.
  • The HSRP version can be changed from HSRPv2 to HSRPv1 only if the group number is less than 256.
  • For HSRPv2 and HSRP for IPv6, group numbers that are multiples of 256 must be used; valid ranges are 0 to 255, 512 to 767, 3840 to 4095, and so on.
  • If the HSRP version is changed on an interface, each HSRP group resets because it now has a new virtual MAC address.


Enabling HSRP


standby version {1 | 2}
  • (Optional) Configures the HSRP version on the interface.
  • 1 for HSRPv1, 2 for HSRPv2.
  • If not specified, the interface runs HSRPv1 by default.

standby [gp-num] ip [ip-add]
  • (Optional) [gp-num] specifies the group number for which HSRP is enabled.
  • (Optional on all but one interface) [ip-add] sets the virtual IP address for the HSRP group. Must be set on at least one interface, can be learned by other interfaces.

Example
standby version 1
standby 47 ip 10.0.47.1



Configuring HSRP Priority

  • The standby priority, standby preempt, and standby track commands are used to set characteristics for finding the active and standby routers.
  • Assigning a priority allows allows the active and standby routers to be manually defined.
  • If preemption is enabled, the router with the highest priority becomes the active router.
  • If priorities are equal, the current active router does not change.
  • The highest numerical value (1 to 255) represents the highest priority (most likely to become the active router).
  • The priority can change dynamically if an interface is tracked, and the status goes down.
  • By default, the priority is decreased by 10.
  • If an interface is not tracked, its state change does not affect the priority.
  • When multiple tracked interfaces are down, the configured priority decerements are cumulative.
  • If tracked interface were not configured with a decrement priority, the default decrement is 10, and it is non-cumulative.
  • When routing is first enabled for the interface, it does not have a complete routing table. If it is configured to preempt, it becomes the active router, even though it is unable to provide adequate routing services. To solve this problem, configure a delay time to allow the router to update its routing table.

standby [gp-num] priority [value] preempt
  • Sets a priority value used in choosing the active router.
  • (Optional) [value] The range is 1 to 255 (100 by default), the highest number represents the highest priority.
  • (Optional) preempt, so that when the local router has a higher priority than the active router, it assumes control as the active router.

standby [gp-num] track [int-num] [int-prio]
  • Configures an interface to track another interface so that if it goes down, the priority is lowered.
  • [int-num] is the interface identifier of the tracked interface.
  • (Optional) [int-prio] specifies the amount by which the priority is decremented, when the interface goes down (10 by default).

Example
standby 47 priority 150 preempt
standby 47 track GigabitEthernet0/0 60



Configuring HSRP Authentication and Timers

  • The authentication string is sent unencrypted in all HSRP messages.
  • The same authentication string must be configured on all routers.
  • Authentication mismatch prevents a device from learning the virtual IP address, and timer values from other routers.
  • Routers on which timer values are not configured can learn timer values from the active or standby router.
  • The timers configured on an active router always override any other timer settings.
  • All routers in an HSRP group should use the same timer values.
  • Normally, the Holdtime is greater than or equal to 3 times the Hellotime.

standby [gp-num] authentication [string]
  • (Optional) [string] sets the authentication string to be carried in all HSRP messages, up to eight characters in length (the default is cisco).

standby [gp-num] timers [Hello] [Hold]
  • Configures the time between Hello packets and the time before other routers declare the active router to be down.
  • [Hello] sets the Hello interval in seconds, the range is from 1 to 255 (3 by default).
  • [Hold] sets the time in seconds before th active or standby router is declared to be down, the range is from 1 to 255 (10 by default).

Example
standby 47 authentication hsrpstring
standby 47 timers 5 15



Verification


Applied the following configuration.

SW01#
interface Vlan47
 ip address 10.0.47.101 255.255.255.0
 standby version 2
 standby 47 ip 10.0.47.1
 standby 47 priority 150
 standby 47 preempt

SW02#
interface Vlan47
 ip address 10.0.47.102 255.255.255.0
 standby version 2
 standby 47 ip 10.0.47.1



Verying the configuration.

SW01#show standby brief
                     P indicates configured to preempt.
                    
Interface   Grp  Pri P State    Active          Standby         Virtual IP
Vl4         47   150 P Active   local           10.0.47.102     10.0.47.1  

SW02#show standby brief
                     P indicates configured to preempt.
                    
Interface   Grp  Pri P State    Active          Standby         Virtual IP
Vl4         47   100   Standby  10.0.47.101     local           10.0.47.1 


SW01#show standby
Vlan47 - Group 47 (version 2)
  State is Active
    5 state changes, last state change 00:04:48
  Virtual IP address is 10.0.47.1
  Active virtual MAC address is 0000.0C9F.F02F
    Local virtual MAC address is 0000.0C9F.F02F (v2 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.086 secs
  Preemption enabled
  Active router is local
  Standby router is 10.0.47.102
  Priority 150 (configured 150)
  Group name is hsrp-Vl4-47 (default)

SW02#show standby
Vlan47 - Group 47 (version 2)
  State is Standby
    3 state changes, last state change 00:07:06
  Virtual IP address is 10.0.47.1
  Active virtual MAC address is unknown
    Local virtual MAC address is 0000.0C9F.F02F (v2 default)
  Hello time 3 sec, hold time 10 sec
    Next hello sent in 0.739 secs
  Preemption disabled
  Active router is 10.0.47.101

  Standby router is local
  Priority 100 (default 100)
  Group name is hsrp-Vl4-47 (default)


As a bonus, proof that the HSRPv2 devices are communicating using the multicast IP address 224.0.0.102.

SW01#debug ip packet
IP: s=10.0.47.102 (Vlan47), d=224.0.0.102 len 29, rcvd 2

SW01#
IP: s=10.0.47.101 (local), d=224.0.0.102 (Vlan47), len 29, sending broad/multicast


References

Configuring HSRP

Notes: Understanding HSRP

Background Information

  • HSRP, which is unique to Cisco platforms, provides network redundancy for IP networks.
  • Ensures that user traffic immediately and transparently recovers from first-hop failures.
  • Two or more routers act as a single virtual router by sharing an IP address and a MAC address.
  • End hosts do not typically contain a routing table and use only a single next-hop IP address (the
    default gateway).
  • The default gateway is configured as the virtual IP address.
  • HSRP routers continually exchange status messages.
  • One router can assume the responsibility of another, if a router fails for either planned or unplanned reasons.
  • The changeover is transparent to end hosts.
  • Windows hosts can be configured to run multiple default gateways, but they are not dynamic (only a single default gateway is used at a time).
  • The system only selects an additional configured default gateway at boot time if the first configured default gateway is determined unreachable by Internet Control Management Protocol (ICMP).

Basic Operation

  • Two or more HSRP routers work in concert to present the illusion of a single default gateway.
  • This set of routers is known as an HSRP group or standby group.
  • One router (the active router) is selected from the group to forward packets sent to the virtual IP address.
  • Another router is selected as the standby router.
  • If the active router fails, the standby router assumes its role.
  • Only the active and standby routers send periodic HSRP messages after the election process is completed.
  • Additional routers in the HSRP group remain in the Listen state.
  • If the standby router fails or becomes the active router, another router is elected as the new standby router. 
  • Each standby group emulates a single virtual router (default gateway).
  • A single well-known MAC and IP address is allocated to each group.
  • Multiple groups can coexist and overlap on a LAN.
  • Individual routers can participate in multiple groups.
  • The router maintains a separate state and timers for each group.

HSRP Terms

  • Active router: The router that currently forwards packets for the virtual router. 
  • Standby router: The primary backup router. 
  • Standby group: The set of routers that participate in HSRP and jointly emulate a virtual router. 
  • Hello time: The interval between successive HSRP hello messages from a given router. 
  • Hold time: The interval between the receipt of a hello message and the presumption that the sending router has failed.

HSRP Router Communication

  • HSRP routers communicate by exchanging HSRP information through HSRP hello packets.
    HSRP uses the destination multicast IP address 224.0.0.2 on UDP port 1985.
  • The active router sources hello packets from its configured IP address and the HSRP virtual MAC address.
  • The standby router sources hello messages from its configured IP address and the burned-in MAC address (BIA).
  • The virtual MAC address is 0000.0c07.acxx, where xx is the HSRP group number.
  • When an HSRP group number is not specified, the default group number is 0.

HSRP Features


Preemption
The feature enables the router with the highest priority to immediately become the active router.
Preference is determnined first by the highest priority value configured (default 100), and then by the highest IP address.

When a higher priority router preempts a lower priority router, it sends a coup message. When a lower priority active router receives a coup message or hello message from a higher priority active router, it changes to the speak state and sends a resign message.

Preempt Delay
The feature allows preemption to be delayed for a configurable time period, allowing the router to populate its routing table before becoming the active router.

Interface Tracking
HSRP monitors the status of another interface in order to alter the HSRP priority for a given group. If the specified interface's status goes down, the HSRP priority of a router is reduced, allowing another HSRP router higher priority to become active (if preemption is enabled).

When multiple tracked interfaces are down, the priority is reduced by a cumulative amount. If the decrement value is not specifically set, the priority value is decreased by 10 for each interface that goes down.

Use of BIA
The feature allows HSRP groups to use an interface's burned-in MAC address instead of a virtual MAC address (some hardware only recognize a single MAC address).

Several disadvantages:
  • When a router becomes active, the virtual IP address is moved to a different MAC address. The newly active router sends a gratuitous ARP response, but not all host implementations handle the gratuitous ARP correctly.
  • Proxy ARP breaks when use-bia is configured. A standby router cannot cover for the lost proxy ARP database of a failed router. 
  • Problems related to specific IOS versions: prior to Cisco IOS release 12.0(3.4)T, only one HSRP group is allowed if use-bia is configured, or prior to Cisco IOS release 12.0(6.2), the use-bia command on a subinterface actually showed up on the main interface and applied it to all subinterfaces.

Multiple HSRP Groups
The features enables load-sharing within networks, and allows redundant routers to be more fully utilized. A router can have different roles for different HSRP groups. While a router is forwarding traffic for one HSRP group, it can be in standby or in Listen state for another group.

Syslog Support
The feature allows for more efficient logging and tracking of the current HSRP status. Syslog support was added in Cisco IOS release 11.3.

HSRP Debugging
To enable HSRP debugging, use the debug standby command. The command prints output of HSRP state and packet information fro all standby groups on all interfaces.

A debug condition allows the output to be filtered upon interface and group number (debug condition standby int-num group-num). Debug conditions can be set for groups that do not exist, which allows the information capture during the initialization of a new group.

The standby debug command must be enabled to produce any output.

Enhanced HSRP Debugging
Before Cisco IOS release 12.1(0.2), HSRP debugging was of limited use because information was lost in the noise from periodic hello messages. Thus the enhanced debugging feature was added in Cisco IOS 12.1(0.2).

The following table explains the command options for enhanced debugging.



Authentication
The feature provides added security, and protects against the threat of spoofing attacks. Clear-text (default) and MD5 authentication are available.

SNMP MIB
There are two relevant MIBs for HSRP:
  • ciscoMgmt 106: The MIB module for managing HSRP
  • ciscoMgmt 107: The extension MIB module for managing HSRP

HSRP Support for MPLS VPNs
The feature is useful when a CE router is connected to two PE routers, and the default route points to the HSRP virtual IP address.


HSRP States

  • Initial: The start. Indicates that HSRP does not run. Entered through a configuration change or when an interface first becomes available.
  • Learn: The router has not determined the virtual IP address, and has not yet seen an authenticated hello message from the active router. The router still waits to hear from the active router.
  • Listen: The router knows the virtual IP address, but is neither the active router nor the standby router. The router listen for hello messages from the active and standby routers.
  • Speak: The router sends periodic hello messages and actively participates in the election of the active and/or standby router. A router cannot enter Speak state unless it has the virtual IP address.
  • Standby: The router is a candidate to become the next active router and sends periodic hello messages. There is only one router in the group in the standby state.
  • Active: The router currently forwards packets that are sent to the group virtual IP address. The router sends periodic hello messages. There is only one router in the group in the active state.

HSRP Timers

  • HSRP routers use only three timers, which time the hello messages.
  • Convergence depends on how the HSRP hello and hold timers are configured.
  • By default, the timers are set to 3 and 10 seconds, respectively.
  • A hello packet is sent between the HSRP group every 3 seconds, and the standby router becomes active when a hello packet has not been received for 10 seconds.
  • The timer values are configurable, but setting the hello timer below 1 second and the hold timer
    below 4 seconds is not recommended. 
  • If the HSRP tracking mechanism is used and the tracked link fails, the failover or preemption occurs immediately, regardless of the hello and hold timers.
  • Active timer: Used to monitor the active router. Started any time a hello packet is received from the active router. Expired in accordance with the hold time value.
  • Standby timer: Used to monitor the standby router. Started any time a hello message is received from the standby router. Expired in accordance with the hold time value.
  • Hello timer: Used to clock hello packets. Routers in Active, Standby, or Speak states generate hello messages.

Packet Format



Op Code
The Op code describes the type of message that the packet contains.
Possible values:
  • 0 - Hello (sent to indicate that the router runs HSRP and is able to become the active router)
  • 1 - Coup (sent when the router wishes to become the active router)
  • 2 - Resign (sent when a router no longer wishes to be the active router)

State
Each router in the HSRP group implements a state machine. The state field describes the current state of the router.
Individual states:
  • 0 - Initial
  • 1 - Learn
  • 2 - Listen
  • 4 - Speak
  • 8 - Standby
  • 16 - Active

Hellotime
Only meaningful in hello messages. Contains the period (in seconds) between the hello messages that the router sends.

Holdtime
Only meaningful in hello messages. Contains the amount of time (in seconds) that the current hello message should be considered valid before initiating a state change.

Priority
Used to elect the active and standby routers. Highest priority wins. In case of a tie, the highest IP address is preferred.

Group
Identifies the HSRP group.

Authentication Data
Contains a clear-text, eight-character password.

Virtual IP Address
Specifies the virtual IP address used by this HSRP group.


HSRP Events

  • 1 - HSRP is configured on an enabled interface.
  • 2 - HSRP is disabled on an interface or the interface is disabled.
  • 3 - Active timer expiry. The Active timer is set to the hold time when the last hello message is seen from the active router.
  • 4 - Standby timer expiry. The Standby timer is set to the hold time when the last hello message is seen from the standby router.
  • 5 - Hello timer expiry. The periodic timer for sending Hello messages is expired.
  • 6 - Receipt of a Hello message of higher priority from a router in Speak state.
  • 7 - Receipt of a Hello message of higher priority from the active router.
  • 8 - Receipt of a Hello message of lower priority from the active router.
  • 9 - Receipt of a Resign message from the active router.
  • 10 - Receipt of a Coup message from a higher priority router
  • 11 - Receipt of a Hello message of higher priority from the standby router.
  • 12 - Receipt of a Hello message of lower priority from the standby router.


HSRP Actions


A - Start Active Timer
The Active timer is set to the Holdtime field in the Hello message from the Active router. Otherwise set to the current Holdtime value in use by the router. The Active Timer is then started.

B - Start Standby Timer
The Standby timer is set to the Holdtime field in the Hello message from the Standby router. Otherwise set to the current Holdtime value in use by the router. The Standby timer is then started.

C - Stop Active Timer
The Active timer is stopped.

D - Stop Standby Timer
The Standby timer is stopped.

E - Learn Parameters
This action is taken when a message is received from the active router. If the virtual IP address for this group was not manually configured, it can be learned from the message. The router can also learn Hellotime and Holdtime values from the message.

F - Send Hello Message
The router sends a Hello message with its current State, Hellotime, and Holdtime.

G - Send Coup Message
The router sends a Coup message to inform the active router that there is a higher priority router available.

H - Send Resign Message
The router sends a Resign message to allow another router to become the active router.

I - Send Gratuitous ARP Message
The router broadcasts an ARP response packet advertising the group's virtual IP and MAC addresses.


HSRP State Table

Each time that an event occurs, the associated action results, and the router transitions to the next HSRP state. In the diagram, numbers designate events, and letters designate the associated action.



References

Understanding and Troubleshooting HSRP Problems in Catalyst Switch Networks
Hot Standby Router Protocol Features and Functionality
RFC 2281: Cisco Hot Standby Router Protocol (HSRP)