Friday, January 9, 2015

CCIE OCG: RIPv2 and RIPng (Chapter 7)

Introduction to Dynamic Routing

  • Constitute messages exchanged between routers to detect their mutual presence and convey information about the existing networks in the topology, and algorithms necessary to process this information and advertise it throughout the network.
  • Distance-vector routing protocols are principally founded on the exchange of, well, distance vectors, or arrays of distances to known networks. 
  • The term vector = unidimensional array.
  • The term distance = the measure of feasibility, or a metric, of reaching a particular network.
  • Messages exchanges contain arrays, with each element containing information about networks known to the router originating the message, and that router’s distance to these networks.
  • A router learns about the existence of a network by receiving a message from its neighboring router that advertises the network. 
  • This neighbor then becomes the next hop toward this network.
  • After, the router starts advertising the route itself, announcing its own distance from the destination.
  • Each router advertises its own directly connected networks added to the routing protocol, and all routes learned by that protocol that have been placed into the routing table.
  • A router advertises only those routes used by itself.
  • Distance vector routing protocols exchange only lists of known networks and their distances.
  • They do not exchange information about the network's topology.
  • Generally prone to the creation of routing loops, but various avoidance methods exist.
  • Path-vector routing is an extension of distance-vector principles.
  • In addition to exchanging messages about known networks and their distances, each network is accompanied by a list of path elements.
  • These path elements can be theoretically anything.
  • BGP is the only common path-vector routing protocol.
  • In BGP, autonomous system numbers guarantee a loop-free topology.
  • A router will not accept an advertisement about a network whose path description already includes the identifier the router would put into that advertisement itself.
  • Link-state routing protocols exchange information about individual objects in the topology and their interconnections. 
  • IP prefixes are often treated only as attributes, or properties, of these objects.
  • Every router has exact information about the entire area’s topology: It knows every router, every network, and every link. This detailed information about each object in an area then allows the router to construct a so-called directed graph of the topology (in essence a map of the topology) and compute a tree of shortest paths to find all reachable destinations and least-cost paths toward them. 
  • Usually, the Shortest Path First (SPF) algorithm invented by Edsger W. Dijkstra is used.
  • Dijkstra’s algorithm by its very nature does not construct routes containing loops.
  • Temporary routing loops can still occur when routers do not compute shortest paths using the same information - usually during network convergence.
  • Link-state downside: inability to perform route summarization, filtering, or applying offset-lists in arbitrary parts of the network. 

RIPv2 Basics

  • General characteristic: classless, distance-vector, timer-driven routing protocol.
  • Transport protocol: UDP, port 520.
  • Metric: Hop count, with 15 as the maximum usable metric, and 16 considered to be infinite.
  • Hello interval: none; RIPv2 relies on the regular full routing updates instead.
  • Update destination: 224.0.0.9.
  • Update interval: 30 seconds.
  • Full or partial updates: Full updates at each interval. For on-demand circuits, allows RIPv2 to send full updates once, and then remain silent until changes occur (RFC 2091).
  •  Triggered updates: Yes, when routes change.
  • Authentication: plain-text and MD5.
  • Route tags: Yes, as routes are redistributed into RIPv2.
  • Next Hop field: Supports the assignment of a next-hop IP address for a route, allowing a router to advertise a next-hop router that is different from itself.

  • RIPv2 exchanges routes by sending RIPv2 updates on each RIPv2-enabled interface based on the Update timer.
  • RIPv2 router advertises its connected routes, and RIPv2-learned routes if they are in the  routing table.
  • RIPv2 routers do not form neighbor relationships, nor do they use a Hello protocol.
  • Each router simply sends updates to 224.0.0.9.
  • RIPv2 routers can also be configured to use 255.255.255.255 using the ip rip v2-broadcast per-interface command (not commonly done).
  • Two types of messages: Request and Response.
  • The message format for both message types is identical.


  • Command field is set to 1 for Request and 2 for Response.
  • Each routing entry occupies 20 octets in total.
  • At most 25 routing entries can be placed into a single RIP message.
  • A Request message is used to ask a neighbor to send a partial or a full RIP update immediately, rather than wait for the Update timer to expire.
  • Full RIP update Request contains exactly one routing entry with the address family ID set to 0 and metric set to 16.
  • If a Request message lists one or more networks, only the update on these networks is requested.
  • A full RIP update is requested when the RIP process is being started, a RIP-enabled interface comes up, or when the clear ip route * command is issued.
  • RIPv2 uses hop count as metric.
  • 15 is the largest valid metric, and 16 is considered to be infinity.
  • RIPv2 increments the metric when sending updates (RIPng and EIGRP increment their metrics when receiving updates).
  • By default, RIPv2 installs 4 equal-cost paths into the routing table, as dictated by the maximum-paths command (1-16).
  • The actual upper limit depends on the IOS version and router platform, and is not in fact related to RIPv2 or any other protocol.

RIPv2 Convergence and Loop Prevention

  • Counting to Infinity: If the next-hop to a network suddenly advertises that network with an increased metric, accept the advertisement immediately and update our metric accordingly. If the updated metric reaches infinity, stop using that next hop.
  • Split Horizon: Do not advertise routes whose outgoing interface field matches the interface out which the update would be sent.
  • Split Horizon with Poison Reverse: A stronger variant of Split Horizon; All routes whose outgoing interface matches the interface out which the update would be sent are advertised with an infinite metric.
  • Route Poisoning: Sending an infinite-metric route in routing updates when that route fails.
  • Triggered update: The immediate sending of a new update when routing information changes, instead of waiting for the Update timer to expire. Only the change network is sent in the triggered update. Complete updates continue to be sent in regular intevals.
  • Update timer: Specifies the time interval over which updates are sent, 30 seconds by default.
  • Invalid after timer: A per-route timer (default 180 seconds) that is reset and begins after an update about a route has been received from its next hop. If the updates about the route from its next hop cease to be received and the Invalid after tiemr reaches its limit, the route is declared invalid and the Holddown timer starts for this route.
  • Holddown timer: A per-route timer (default 180 seconds) that begins after a route has been declared invalid (the Invalid after timer has expired). The router starts advertising that route as unreachable, does not accept any updated information, and does not modify the routing table entry for that route until the Holddown timer for that route expires.
  • Flushed after timer: A per-route timer (default 240 seconds) that is reset and begins after an update about a route has been received from its next hop. If the updates about the route from its next hop cease to be received and the Flushed after timer reaches its limit, the router removes the route from the routing table entirely.

  • Routers exchange lists exchange lists, or vectors, of known networks and their distances.
  • For each network, a router chooses the neighbor providing the least total metric towards the network.
  • All routers advertising the same network with a total higher cost are ignored. 
  • One exception: if the next-hop router for a network suddenly advertises a higher distance than last time, this advertisement is not ignored but rather accepted immediately.
  • The router will update the total metric and advertise it. The network and the current next-
    hop are kept in the routing table.
  • Only a subsequent arrival of an update from a different neighbor providing a lower total
    metric would cause the router to change the next hop.
  • Count to Infinity: As per the logic of immediately accepting a higher metric from a next-hop, two routers will increase the metric of a route to infinity with a loop prevention mechanism.
  • The concept of a finite metric, i.e. a metric value representing an unreachable network, will eventually break the loop and drop the route from the routing table.
  • Split Horizon: a network should never be advertised back over the interface that is used to reach that network.
  • By default, Split Horizon is activated on most interfaces, notable exceptions being physical Frame Relay and ATM interfaces.
  • Split Horizon with Poison Reverse: a network should always be explicitly advertised as unreachable over the interface that is used to reach that network.
  • While more effective than merely Split Horizon, it is not implemented in the Cisco RIPv2.
  • Route Poisoning is a mechanism used to rapidly flush a route that has become unreachable.
  • Accomplished by advertising this route with the metric set to infinity.
  • A router that receives an update about a network from its next-hop with an infinite metric will immediately remove the route from the routing table.
  • The router will itself advertise that network as unreachable.
  • Routers that receive an update about an unreachable network from different neighbors than their respective next-hops are not influenced.
  • The message is indistinguishable from a Split Horizon with Poisoned Reverse advertisement. 
  • They process it accordingly but it has no effect on their routing tables.
  • Even though a route is removed from the routing table during a Route Poisoning procedure, RIP will still keep the route in its internal database marked as possibly down (show ip rip database) to allow repeated advertisements because a single advertisement can get lost (UPD-based protocol, no acknowledgements).
  • The unreachable route will be flushed from the RIP internal database after Flushed after - Invalid after seconds.
  • It is important to distinguish between Poisoned Reverse and Route Poisoning.
  • Both refer to advertising a network with an infinite metric.
  • Poisoned Reverse is an extension to the Split Horizon principle that advertises a route as unreachable back to its next-hop to prevent it from creating a routing loop.
  • Route Poisoning advertises a truly unreachable route to quickly flush it from the routing table to allow a backup path to take over.
  • Triggered updates are sent in the moment of detecting a change in reachability of a network, rather than waiting for the full Update interval to expire.
  • The update commonly carries only the changed network, without listing all other known networks.
  • The other networks continue to be advertised, along with the changed information, in regular intervals driven by the Update timer.
  • Triggered updates are also called flash updates.
  • The Holddown mechanism: delay processing updates about a network whose reachability has become questionable, as the received updates might not yet contain up-to-date information.
    The on-going lack of any information about a network from its next-hop is tolerable for a limited time period, but it exceeds a reasonable time, it is clear that "something happened".
  • The router that has detected a sudden loss of reachability information for a network must not immediately accept the updates from its neighbors; rather, it must give them certain time to learn about the outage and converge to a different path. Only after this time, updates from other routers regarding the missing network can be accepted as trustworthy again.
  • Two independent RIPv2 timers: the Invalid after timer and Holddown timer.
  • The Invalid after time is reset every time an update is received.
  • A route is considered usable within the Invalid after timer (180 seconds by default).
  • If the Invalid after timer has reached its limit and an update has not been received, the network is considered invalid. In such case, the following happens:
    1. The router declares the network invalid. Visible in the show ip route output as "is possibly down". The Invalid after timer is stopped for this network.
    2. The router starts the Holddown timer for this network. While the timer runs (180 seconds by default), the router itself advertises the network with infinite metric (Route Poisoning) to force its neighbors to find an alternative route if possible.
    3. The router also locks the entry in the routing table. Absolutely no updates whatsoever are accepted until Holddown timer expires, regardless of who sends them and what metric they claim.
    4. After the Holddown timer expires, the router unlocks the routing entry in its routing table and converges through a neighbor that offers the lowest metric route to the network.
     
  • The procedure is not triggered by the arrival of an update that advertises an unreachable network (Route Poisoning). Rather, this procedure is invoked after the reachability of a network can be neither confirmed nor refuted for a period of time.
  • After a router puts a route into the invalid state, it advertises that route as unreachable itself. "I know there is some problem reaching this network, but I don't know exactly what. Whoever uses me as a next-hop, stop doing that."
  • A router never updates an invalid route while the Holddown timer runs.
  • If there is a detour path, the router will learn about it after the Holddown timer expires and the routing entry is unlocked. However, the failed route might have been the only path to the destination, and there might be no alternative path available, so no neighbor will advertise it. That would cause the routing entry to linger in the routing table indefinitely, still pointing toward the previous next hop.
  • To prevent a route that has stopped being advertised from lingering in routing tables indefinitely, yet another timer is present: the Flushed after timer.
  • Similarly to the Invalid after timer, the Flushed after timer is reset every time an update about a network is received.
  • If the Flushed after timer reaches its limit, the route is immediately flushed from the routing table, and advertised as unreachable.
  • Default timer values: Update - 30 seconds, Invalid after and Holddown - 180 seconds, Flushed after - 240 seconds.
  • The default timer settings actually does not allow the Holddown timer to completely expire.
  • If a network stops being advertised  by its next-hop, it will be put into an invalid state 180 seconds after the last update arrived (the Flushed after timer also starts). The Holddown timer then starts, but after 60 seconds, the Flushed after timer will expire, and the router will remove the route entirely along with all associated timers.
  • As a result, the effective Holddown period is only 60 seconds.
  • The Flushed after timer has no effect on a route that is still considered valid (that is, its age is less than the upper limit of Invalid after ).

RIPv2 Convergence When Routing Updates Cease

  • RIPv2 must wait for some timers to expire before routes, whose advertisements from the neighbor have stopped, can be considered failed.
  • RIPv2 uses its Invalid after, Flushed after, and Holddown timers to prevent loops.
  • RIPv2's convergence time increases to several minutes as a result.
  1. R3's interface fails, but R1's interface stays up, so R1 must use its timers to detect route failures.
  2. R1's Invalid after and Flushed after timers for a network grow because R1 does not hear any further updates from R3.
  3. After the Invalid after timer expires (180 seconds), R1 starts a Holddown timer for the route. Holddown starts at (default) 180 seconds and counts down.
  4. The Flushed after timer expires after 240 seconds, or 60 seconds past the Invalid after timer. As a result, R1 flushes the route from its routing table, which also removes the Holddown timer for the route.
  5. R1 receives R2's next regular full routing update, and place the route in its routing table, completing convergence.
  • Either the Flushed after timer or the Holddown timer must expire before new routing information would be used.
  • When the route is flushed (removed), any associated timers are also removed, including the Holddown timer.
  • Had the Holddown timer been smaller, and it expired before the Flushed after timer, R1 would have been able to use the route advertised by R2 at that point in time.

Convergence Extras

  • RIPv2 timers can be tuned with the timers basic <update> <invalid> <holddown> <flush> command under the RIP process.
  • The timers should be consistent across routers.
  • Smaller values increase the chance of transient routing loops being formed during convergence.
  • The clear ip route commadn bypasses loop-prevention features by deleting the route and timers. It can be risk, but it certainly speeds convergence.

RIPv2 Configuration

  • version 2: tells the router to send and receive only RIPv2 updates (RIPv1 updates are ignored).
  • network: always recomputes its argument (the network address) into a classful representation.
  • neighbor <ip-add>: send unicast RIP updates to that neighbor.
  • Enabling RIPv2 on an interface makes the router begin sending RIPv2 updates, listening for RIPv2 updates (UDP port 520), and advertising that interface’s connected subnet.

Disabling RIPv2 Functions

  • Sending RIPv2 updates: make the interface passive (passive-interface <int-num> under the RIP process.
  • Listening for RIPv2 updates: filter all incoming routes using a distribute-list, or filter incoming RIPv2 packets using a per-interface ACL.
  • Advertising the connected subnet: filter outbound advertisements on other interfaces using distribute-lists, filtering an interface's connected subnet.
  • If there is a multipoint interface with four routers and you want to send RIP updates to only one of them, make the interface passive, and then use the neighbor command.
  • RIPv2 uses autosummarization at classful network boundaries by default.
  • Automatic summarization occurs when a router intends to advertise a subnetwork of a particular classful network X (also called major network) out an interface that is itself in a different classful network Y. 
  • Disabling autosummarization should be considered a mandatory part of any RIPv2 configuration.

RIPv2 Authentication

  • Two requirements: creating the keys and enabling the feature on interfaces.
  • Clear-text or MD5 keys.
  • Multiple keys are allowed, and are grouped together using a construct called a key chain.
  • A key chain is simply a set of related keys, each identified with a different number and might be restricted to a time period.
  • NTP is recommended.
  • Authentication is enabled on a per-interface basis, referring to a key chain with ip rip authentication key-chain <name> command.
  • The route selects valid key(s) from the key chain.
  • If multiple keys are valid for signing outgoing RIPv2 packets, the key with the lowest sequence number will be used.
  • The type of authentication, clear-text or MD5, is chosen per interface as well (ip rip authentication mode {text|md5}).
  • If the type is not specified, the default is clear-text.
  • When authentication is enabled, the maximum number of prefixes that can be advertised in a RIPv2 message is reduced by 1 to a value of 24. The first route entry in each RIPv2 message would carry 20 bytes of authentication data.
  • With MD5, more authentication data would be placed after the entire RIPv2 message.
    1st route entry = MD5 authentication + 24 routing entries + more authentication date after the 25th entry.

RIPv2 Next-Hop Feature and Split Horizon

  • Split Horizon setting is controlled per interface (ip split-horizon).
  • On by default, except for Frame Relay and ATM physical interfaces.
  • The RIPv2 next-hop feature allows a RIPv2 router to advertise a different next-hop router than the advertising router.
  • On Cisco routers, this feature is not configurable, and is almost unused.

RIPv2 Offset Lists

  • RIPv2 offset-list allows RIPv2 to add to a route's metric, either before sending an update, or for routes received in an update.
  • The offset-list refers to an ACL, and the router adds the specified offset, or extra metric, to any matching routes.
  • Any routes not matched by the offset-list are unchanged.
  • The offset-list also specifies which routing updates to examine by referring to a direction (in and out) and, optionally, an interface.
  • If the interface is omitted, all updates for the defined direction are examined.

Route Filtering with Distribute Lists and Prefix Lists

  • Outbound and inbound RIPv2 updates can be filtered at any interface, or for the entire RIPv2 process.
  • The routes are filtered by a distribute-list, which references an access-list or a prefix-list, under the RIP process.
  • Any subnets matched with a permit clause make it through, deny actions are filtered.
  • The filtering can be performed for either direction and, optionally, for a particular interface.
  • If the interface is omitted, all updates coming into or out of the RIPv2 process are filtered.
  • Prefix lists are designed to match a range of subnets, as well as a range of subnet masks associated with the subnets.

RIPng for IPv6

  • RIPng is just a straightforward adaptation of RIPv2 for IPv6 operation with practically no changes to the underlying protocol mechanisms.
  • FF02::9, UDP 521.
  • Metric is again based on hop count: maximum of 15, 16 representing infinity.
  • RIPng differes in its metric handling: the metric is incremented by the receiver of a RIPng advertisement, not by the advertisement sender anymore.
  • All loop avoidance techniques described in previous sections are used by RIPng in precisely the same way.
  • The number of route entries in a RIPng message is limited only by the IPv6 MTU on the link, and the protocol itself poses no limitation on their count.
  • As RIPng does not assume any multiprotocol capability, the address family ID field has been omitted.
  • Because of the unpopularity of in RIPv2, the next-hop field would uselessly occupy a significant space (128 bits) in RIPng. Therefore, the next-hop field, if necessary, is specified by a separate route entry.
  • Authentication is not handled by RIPng anymore; these functions are offloaded to IPsec.

RIPng lacks several features supported in RIPv2:
  • Split Horizon can be activated or deactivated only on a per-process basis, not on individual interfaces.
  • Passive interfaces are not supported
  • Static (manual) neighbors cannot be configured.
  • Per-process offset-lists are not supported.
  • Still, there are management improvements over RIPv2:
  • Multiple RIPng process can be run on the router (up to 4). Individual processes are distinguished by an alphanumeric name that is local to the router and does not need to match between different routers.
  • Route Poisoning can be activated on a per-process basis.
  • Interfaces can be configured with a metric-offset value that is added to the metric in all received advetisements over that interface.
  • The default route can be originated on a per-interface basis, including an option of suppressing all other updates over that interface.

Saturday, December 20, 2014

Notes: CEF Polarization

Introduction

  • CEF polarization can cause suboptimal use of redundant paths to a destination network.
  • CEF polarization is in effect when a hash algorithm chooses a particular path and the redundant paths remain completely unused.

Background


Consider the following topology.


  • Assume that to reach host 10.1.1.1 from [Top Left] router, there are two equal-cost paths (L1, L2).
  • The decision of the chosen link is made by a hashing algorithm using the source and destination IP addresses (SIP and DIP).
  • When there are only two paths, the router performs an exclusive OR (XOR) operation on the lower-order bits of the SIP and DIP (one bit, two bits for 3-4 links, and so on).
  • The XOR of the same SIP and DIP always results in the same hash, and hence, the use of the same link.
  • At the next layer, the same hashing algorithm is used along with the same hash input, and a single link is picked for all flows, leaving the other link underutilized.
  • CEF polarization = use of the same hash algorithm and same hash input, which results in the use of a single ECMP link for ALL flows.


In more detail:

1. Traffic sourced from 10.240.18.1 and destined to 10.240.20.1 arrives at Router A, and the information goes through a hashing algorithm. The path toward Router C is chosen. From there the packets travel to Router F, and on to their final destination.

2. Router A performs the hashing function on traffic sourced from 10.240.18.2 and destined to 10.240.20.1, and sends the packets to Router B. The same happens to traffic from 10.240.18.3.

3. Router B produces the same results that the hash algorithm on Router A produced. Therefore, both streams of packets pass along one path towards Router E. The link toward Router D is never used.

4. The packets are forwarded to their final destination through Router F.


Avoiding CEF Polarization


1. Alternate between default (SIP and DIP) and full (SIP + DIP + Layer 4 ports) hashing inputs configuration at each layer of the network.

The Catalyst 6500 provides a few choices for the hashing algorithm:
  • Default - Use the source and destination IP address, with unequal weights given to each link to prevent polarization.
  • Simple - Use the source and destination IP address, with equal weight given to each link.
  • Full - Use source and destination IP address and Layer 4 port number, with unequal weights.
  • Full Simple - Use the source and destination IP address and Layer 4 port number, with equal weights given to each link.

  • No commands (except show run) exist to check the load-sharing algorithm in use.
  • The Catalyst 6500 does not support per-packet load sharing.
  • The Full option does NOT include a universal ID in hash.

2. Alternate between an even and odd number of ECMP links at each layer of the network.
CEF load balancing is independent of the route source. OPSF routes exhibit the same behavior EIGRP.

The hash algorithm load-balances this way by default:

1: 1
2: 7-8
3: 1-1-1
4: 1-1-1-2
5: 1-1-1-1-1
6: 1-2-2-2-2-2
7: 1-1-1-1-1-1-1
8: 1-1-1-2-2-2-2-2

This means that:
  • For two equal cost paths, load-sharing is 46.666%-53.333%, not 50%-50%.
  • For three equal cost paths, load-sharing is 33.33%-33.33%-33.33% (as expected).
  • For four equal cost paths, load-sharing is 20%-20%-20%-40% and not 25%-25%-25%-25%.

  • Evidently, when there is an even number of ECMP links, the traffic is NOT load balanced!
  • Anti-polarization weight was introduced in Version 12.2(17d)SXB: mls ip cef load-sharing full simple
  • Use this command if there are two equal-cost paths, and both need to be used equally.

3. A concept called unique-ID/universal-ID helps with CEF polarization.
  • The universal ID is a randomly generated value at router bootup that can be controlled manually.
  • A universal algorithm (the default in current IOS versions) adds a 32-bit value to the hash function.
  • This seeds the hash function on each router with a unique ID, which ensures that the same source/destination pair hash into a different value on different routers along the path.
  • Result: better load sharing and lowered polarization.
  • The unique-ID concept does not work for an even number of equal-cost paths due to hardware limitation.
  • To overcome this problem, Cisco IOS adds one link to the hardware adjacency table when there is an even number of equal-cost paths in order to make the system believe that there is an odd number of equal-cost links.
  • Customize the universal ID with ip cef load-sharing algorithm universal <id>.

References

CEF Polarization

Notes: Load Balancing with CEF

Introduction

  • IOS 11.1(17)CC introduced CEF for Cisco 7200 and 7500 series routers
  • CEF can efficiently use multiple parallel links without additional hardware multiplexers.
  • More information: "Alternatives for high bandwidth connections using parallel T1/E1 links."

Load Balancing

  • A functionality that distributes packets across multiple links based on routing information.
  • If multiple paths to the same destination are discovered, they are installed into the routing table according to the route selection process (discussed previously).
  • Only parallel links of the same metric are discussed here (although, the same principles apply over unequal cost paths).
  • Load balancing does not have to be supported. A router can use a single path, even if additional equal-cost paths exists (maximum-paths 1).
  • By default, a router will try to do load balancing.
  • The default in IOS is 4 entries for most IP routing protocols.
  • For BGP, the default is only one entry.
  • The maximum number that can be configured is 6 different paths.
  • Two modes of load balancing: per-destination and per-packet basis.

Per-Destination

  • All packets for a given destination are forwarded along the same path.
  • Preserves packet order.
  • Potential unequal usage of links.
  • A larger number of destination addresses leads to more equally used links.
  • A route-cache entry for every destination address vs. every destination network as done when only a single path exists.
  • Therefore, traffic for two different hosts on the same destination network can use different paths.
  • Core routers memory and processing requirements become demanding.

Per-Packet

  • Guarantees equal load across all links.
  • Packets may arrive out-of-order at the destination (due to differential delay in the network).
  • Disables the forwarding acceleration by a route cache, which includes the outgoing interface information.
  • Instead, determines the outgoing interface for each packet by looking up the routing table and picking the least used interface.
  • Ensures equal link utilization.
  • Process-intensive and impacts overall forwarding performance.
  • Not well-suited for higher speed interfaces.

Load Balancing with CEF for IP

  • Includes enhancements that allow to use load balancing without sacrificing forwarding performance even for per-packet load balancing, which previously required disabling of route caching mechanisms like fast switching or optimum switching.
  • Supports encapsulations such as Frame Relay, Ethernet, PPP, HDLC, and tunnels.

How CEF Load Balancing Works

  • CEF is an advanced Layer 3 switching technology inside a router.
  • The route cache is filled on demand when the first packet for a specific destination needs to be forwarded.
  • CEF takes a different approach as it calculates all information necessary in advance.
  • CEF also decouples the forwarding information from the next hop adjacency.
  • Two main CEF components are:
  1. Forwarding Information Base (FIB)
  2. Adjacency Table

 

Forwarding Information Base (FIB)

  • Used to make IP destination prefix-based switching decisions.
  • Conceptually similar to the routing table.
  • Maintains a mirror image of the forwarding information of the IP routing table.
  • When a routing or topology change occurs, the IP routing table is updated, and those changes are reflected in the FIB.
  • One-to-one correlation between FIB entries and routing table entries, so the need for route cache maintenance is eliminated.

Adjacency Table

  • Network nodes are adjacent if they can reach each other with a single hop.
  • CEF uses the adjacency table to prepend Layer 2 addressing information.
  • Maintains Layer 2 next-hop addresses for all FIB entries.
  • Populated as adjacencies are discovered.
  • Each time an adjacency entry is created (through the ARP protocol, for example), a link-layer header for that node is precomputed and stored in the adjacency table.
  • Once a route is determined, it points to a next hop and corresponding adjacency entry.
  • For each resolved path to a destination prefix, a pointer is added for the adjacency corresponding to the next-hop interface for that path.
  • For per-destination load balancing a hash is computed from the source and destination IP addresses.
  • This hash points to exactly one adjacency entry, providing the same path for all packets with this source/destination IP address pair.
  • For per-packet load balancing the packets are distributed in round-robin fashion over the available paths.
  • The FIB and adjacency tables provide all the necessary forwarding information.

Example:

Destination      Adjacencies    #    Interface    Encapsulation
192.168.25.0/24  34, 45         34   Serial0      PPP
                                45   Serial1      PPP


For each packet a match of the destination address against the FIB is made. In this example the FIB entry has multiple adjacencies for the destination 192.168.25.0, one of the adjacencies needs to be selected. For per-packet load balancing packets are encapsulated and forwarded by alternating between entry #34 and entry #45. For load balancing on IP address basis a hashcode is generated out of the addresses. For any given pair of source and destination addresses the hashcode is always the same, thus guaranteeing that always the same path is used.

CEF Configuration

  • Straightforward, as the only configurable option is the load balancing mode.
  • The global command to enable CEF is ip cef.
  • The command automatically enables CEF on all interfaces that use supported encapsulations.
  • The default load balancing mode: per-destination.
  • To change the load balancing mode from per-destination to per-packet use the interface command ip load-sharing per-packet.
  • Enabling CEF is sufficient in most cases.
  • Per-packet load balancing is only rarely needed, e.g. when the majority of traffic is between two hosts.

Summary

  • CEF supports load balancing for TCP/IP over parallel links without impacting performance even if the traffic patterns require per-packet load balancing.

References

Load Balancing with CEF

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