Sunday, April 12, 2015

BGP: Internet Routing Architectures, Part II

BUILDING PEER SESSIONS

  • A BGP neighbor connection can be established within the same AS (internal BGP or iBGP) or between routers in different ASs (external BGP or eBGP).
  • During the OPEN message exchange, peer routers compare ASs to determine if they are in the same or different AS.
  • The difference between iBGP and eBGP is how BGP would process the routing updates and which attributes are carried in internal vs. external BGP.
  • The neighbor negotiation process is mainly the same for internal and external BGP.
  • IP connectivity must exist via a protocol different from BGP.

PHYSICAL vs. LOGICAL CONNECTIONS

  • Indirectly connected external neighbors require extra configuration (multihop eBGP).
  • On the other hand, neighbors within the same autonomous system (internal neighbors) have no restrictions whatsoever on whether the peer is physically connected or separated by multiple IP hops.
  • As long as there is IP connectivity between the two neighbors, BGP requires no additional configuration.
  • Session stability depends on the stability of neighbor IP address.
  • Binding the BGP neighbor connection to a loopback interface will ensure that the BGP session is not reliant on any hardware interface that might be problematic.
  • Other than route reflection, BGP does not readvertise iBGP routes learned from other iBGP peers.
  • Thus, a full mesh within the AS is required.

SYNCHRONIZATION WITHIN AN AS

  • By default, BGP requires that it must be synchronized with the IGP before BGP may advertise transit routes to external ASs.
  • Whenever a router receives an update about a destination from an iBGP peer, the router tries to verify internal reachability for that destination before advertising it to other eBGP peers.
  • The router does this by checking the destination prefix first to see if a route to the next-hop router exists and second to see if a destination prefix in the IGP exists.
  • Otherwise, the router treats the destination prefix as not being synchronized with the IGP and does not advertise it.
  • The BGP rule states that a BGP router should not advertise to external neighbors destinations learned from IBGP neighbors unless those destinations are also known via an IGP. This is known as synchronization.
  • One option is to use default routes on non-BGP routers but this could lead to suboptimal routing or even routing loops.
  • no synchronization will tell BGP to override the synchronization requirement and allow it to advertise routes learned via IBGP, irrespective of the existence of an IGP route.
  • That said, by far the most common configuration in Internet-connected networks is to disableBGP synchronization and rely on a full mesh of IBGP routers. The thought of injecting tens of thousands of routes into an IGP is quite frightening.


SOURCES OF ROUTING UPDATES

 

DYNAMICALLY INJECTING INFORMATION INTO BGP

Two options:
  1. Purely dynamic: redistribution from an IGP to BGP (the redistribute command).
  2. Semidynamic: only certain IGP routes are injected into BGP (the network command).
  • If BGP does not find an exact match for routes redistributed via the network command, they will not be advertised.
  • If the mask is not specified with the network command and auto-summarization is enabled (default), existence of any subset of the classful prefix will result in the advertisement of the classful prefix.

INJECTION OF UNWANTED OR FAULTY INFORMATION

  • Redistributing the whole IGP into BGP could result in the advertisement of private addresses or internal addresses that are supposed to be used within the AS only.
  • In mutual redistribution, information that was injected from the outside into the AS could be sent back to the Internet as having originated from the AS.
  • Careful filtering is required to guard against these undesired consequences.
  • Some IGPs can inherently differentiate between internal and external routes.
  • For other IGPs, special route tagging can distinguish between internal and external routes.

UNSTABLE ROUTES

  • A process called route dampening penalizes and ultimately discontinues advertisement of fluctuating routes, depending on their degree of instability. Route advertisements may be suppressed for minutes or even hours (until they stabilize).
  • One way to minimize route instability is through aggregation. When an aggregate route announcement represents more than one route, the fluctuation of any single route does not cause fluctuation in the aggregate itself.

STATICALLY INJECTING INFORMATION INTO BGP

  • The most effective method of ensuring route stability.
  • IGP routes (or aggregates) to be advertised to BGP peers are manually defined as static routes.
  • If the route is advertised to the Internet from a single point, advertising a route that is actually down is not a big issue.
  • Hosts trying to access that destination will fail irrespective of whether the route is advertised.
  • On the other hand, if a route is advertised to the Internet from multiple points, advertising the route statically at all times might end up black-holing the traffic.

ORIGIN OF ROUTES

  • BGP considers the networks advertised via the network command or via aggregation as being internal to the AS and will include the ORIGIN attribute in each route as being IGP (i).
  • On the other hand, whenever a route is injected into BGP via redistribution (whether statically or dynamically), the ORIGIN of the route will be INCOMPLETE because the redistributed routes could have come from anywhere.
  • Aggregated routes will assume the worst ORIGIN value of all the component routes.
  • The ORIGIN attribute is used by the BGP decision process to favor one route over another.

BGP ROUTES: ADVERTISEMENT AND STORAGE

  • A route is defined as a unit of information that pairs a destination with the attributes of a path to that destination.
  • Routes are stored in the Routing Information Bases (RIBs): namely, the Adj-RIBs-In, Loc-RIB, and the Adj-RIBs-Out.
  • Adj-RIB-Out: Routes that will be advertised to other BGP speakers.
  • Loc-RIB: Routes that will be used by the local BGP speaker, and the next hop for each of these routes must be present in the local BGP speakers forwarding information base (FIB).
  • Adj-RIBs-In: Routes that are received from other BGP speakers.
  • If a BGP speaker chooses to advertise a route, it may add to or modify the route's path attributes before advertising it to the peer.

THE BGP RIB

  • Three distinct parts: Adj-RIB-In, Loc-RIB, and Adj-RIB-Out.
  • If a route is not placed in the Loc-RIB, it cannot be placed in the Adj-RIB-Out for advertisement to peers.

BGP DECISION PROCESS 

  • Based on the attribute values.
  • Only one best path is chosen, in the following preference order:
  1. If the next-hop is inaccessible, the route is ignored.
  2. WEIGHT (Cisco proprietary attribute, local to the router).
  3. LOCAL PREFERENCE.
  4. AS_PATH.
  5. ORIGIN type (IGP < EGP < incomplete).
  6. The lowest MED value.
  7. eBGP paths over iBGP paths.
  8. The route via the closes IGP neighbor. Follow the shortest path to the BGP NEXT_HOP.
  9. The lowest BGP ROUTER_ID.
  • If BGP Multipath is enabled, some steps could be bypassed, and all paths with the same AS_PATH length and MED value could be installed into the routing table.


BGP PATH ATTRIBUTES

  • A set of parameters that describe characteristics of a prefix (route).
  • Well-known mandatory: must be recognized by all BGP implementations and included in every UPDATE message.
  • Well-known discretionary: must be recognized by all BGP implementations but may or may not be sent in a particular UPDATE message.
  • Optional transitive:
  • Optional non-transitive:
  • Unrecognized non-transitive optional attributes must be quietly ignored and not passed along to other BGP peers.

ORIGIN (Type Code 1)

  • A well-known mandatory attribute that defines the origin of the path information.
  • 0: IGP - NLRI that is interior to the originating AS.
  • 1: EGP - NLRI learned via EGP.
  • 2: INCOMPLETE - NLRI learned by some other means.

AS_PATH (Type Code 2)

  • A well-known mandatory attribute that is composed of a sequence of AS path segments.
  • Inside the AS, the AS_PATH information is intact. However, when sending routes to eBGP peers, the AS that originates the route adds its own AS number.
  • Thereafter, each AS that receives the route and passes it on to other eBGP peers will prepend its AS number to the list.
  • Prepending is the act of adding the AS number to the beginning of the list.
  • Loop prevention: If the route is advertised to an AS whose AS number is already present in the AS_PATH, the UPDATE is ignored.

NEXT_HOP (Type Code 3)

  • A well-known mandatory attribute that defines the next-hop IP address.
  1. For eBGP, the next-hop is the IP address of the neighbor that announced the route.
  2. For iBGP, for routes that originated inside the AS, the next-hop is the IP address of the neighbor that announced the route.
  • A recursive IP lookup might be required for a router to know where to send the packet.
  • If a next-hop cannot be reached, BGP considers the route inaccessible.

MULTI_EXIT_DISC (MED) (Type Code 4)

  • An optional non-transitive attribute that is used to discriminate among multiple exits points to a neighboring AS.
  • A hint to external neighbors about the preferred path into an AS that has multiple entry points.
  • When BGP passes the routing update to another AS, the MED is reset to 0 (unless the outgoing MED is explicitly set to a specific value).
  • When the route is originated by the AS itself, the most common practice is for the MED value to follow the internal IGP metric of the route.
  • MEDs from different ASs are not comparable.
  • Still, for administrators who have a reason to do so, Cisco offers the bgp always-compare-med router command, which tells BGP to compare MEDs from different ASs for the same route.
  • When providers don't use MEDs or other attribute manipulation techniques to prefer the best-exit path, it's often referred to as closest-exit or hot potato routing.

LOCAL_PREF (Type Code 5)

  • A well-known discretionary attribute that is used to inform other BGP speakers in its own AS of the preference for an advertised route.
  • A higher local preference is preferred.
  • Exchanged between iBGP peers only.
  • Cisco proprietary WEIGHT attribute is similar.
  • The difference is that the weight parameter is local to the router and is not exchanged between routers, even internal to an AS.

ATOMIC_AGGREGATE (Type Code 6)

  • A well-known discretionary attribute that is used to inform other BGP speakers that the local system chose a less-specific route.

AGGREGATOR (Type Code 7)

  • An optinal transitive attribute that contains the last AS number that formed the aggreagate and the IP address of the BGP speaker that formed the aggregate route.

COMMUNITY (Type Code 8)

  • An optional transitive attribute that specifies all routes with this attribute belonging to the communities listed in the attribute.

ROUTE FILTERING AND ROUTE MANIPULATION

  • A BGP speaker can choose what routes to send and receive.
  • Route filtering is essential in defining routing policies.
  • Routes permitted through a filter can have their attributes manipulated.
  • Manipulating the attributes affects the BGP decision process used to identify the best routes to a given destination.
  • Both the inbound and outbound filtering can be applied to the peer and protocol levels.
  • Inbound filtering indicates that the BGP speaker is filtering routing updates received from other peers, whereas outbound filtering limits the routing updates advertised from the BGP speaker to other peers.
  • Both eBGP and iBGP filtering behavior is the same.
  • Three actions:
  1. Identifying the routes.
  2. Permitting or denying the routes.
  3. Manipulating the attributes.
  • After a route matches an instance, it is considered identified and will not be compared to any further instances. Hence, the order in which the instances are checked is important.
  • If the route proceeds to be compared against the entire list of instances and there is still no match, the route is discarded.
  • Prefix lists are currently the preferred mechanism to be used for filter routing information.
  • Trying to identify the AS_PATH list consists of comparing the list to what is called a regular expression.

PEER GROUPS

  • A group of BGP neighbors that share the same update policies.
  • Saves the administrator from repetitive configuration and the BGP router itself from parsing the policies sequentially for each individual neighbor.
  • With peer groups, the router formulates the update once, based on the policies of the peer group, and then floods the same update to all the neighbors that fall within the group.

BGP-4 AGGREGATION

  • Aggregation applies to routes that do not exist in the BGP routing table (contrary to the network command, which applies to rotes that do exist in the IP routing table).
  • Aggregation can be performed if at least one more-specific route of the aggregate exists in the BGP routing table.

Examples:
  1. Sending the aggregate route only and suppressing more specific routes.
  2. Sending the aggregate route and the more specific routes. Typical in a multihomed ISP scenario. Normally, the ISP does not want to advertise the more-specific routes further to the NAP, so it has the originating AS tag all the more-specific routes with the community attribute NO_EXPORT.
  3. Sending the aggregate route and a subset of more-specific routes.

Thursday, April 9, 2015

BGP: Internet Routing Architectures, Part I

HOW BGP WORKS

  • BGP is a path vector protocol used to carry routing information between autonomous sytems.
  • Path vector signifies that BGP carries a sequence of AS numbers that identifies the AS path. Also used for loop prevention.
  • BGP uses TCP port 179.
  • All the transport reliability is taken care of by TCP. No need to design this feature into the protocol itself.
  • BGP speakers = routers that run BGP.
  • BGP neighbors or peers = routers that form a TCP connection to exchange routing information.
  • Initially, all BGP routes are exchanged. Only incremental updates are sent as the network information changes.
  • Four message types: OPEN, NOTIFICATION, KEEPALIVE, and UPDATE.
  • BGP neighbors exchange OPEN messages to determine the connection parameters.
  • NOTIFICATION is sent in case of disagreement between the peers, and as a result, the session is not established or is torn down if already established.
  • UPDATE messages advertise BGP routes. Indicate a list of destinations that can be reached through that BGP speaker, and the related path attributes.
  • KEEPALIVE messages are sent periodically (every 60 seconds by defaut) between the BGP peers to ensure that the connection stays up.
  • A table version number keeps track of the current instance of the BGP routing table. Incremented at each change. A rapidly incrementing table version is usually an indication of network instability.


BGP MESSAGE HEADER FORMAT


+++++++++++++++++++++++++++++++++++++++++++
|       Marker       |   Length  |  Type  |
+++++++++++++++++++++++++++++++++++++++++++


  • Depending on the message type, there might or might not be a data portion following the header.
  • For example, KEEPALIVE messages consist of the message header only.
  • The Marker field (16 bytes) is used to either authenticate incoming BGP messages or detect loss of synchronization between two BGP peers.
  1. If the type is OPEN or OPEN+no authentication, the Marker field must be all 1s.
  2. Otherwise, the Marker field will be computed based on part of the authentication mechanism.
  • The Length field (2 bytes) indicates the total BGP message length.
  • The Type field (1 byte) indicates the message type (OPEN, UPDATE, NOTIFICATION, KEEPALIVE).


BGP NEIGHBOR NEGOTIATION

  • The OPEN Message.
  • BGP peers agree on a BGP version number. BGP tries to negotiate the highest common version.
  • The AS number is advertised in the OPEN message.
  • The Hold time indicates the maximum amount of time in seconds that may elapse between the receipt of successive KEEPALIVE or UPDATE messages.
  • The BGP neighbors negotiate to select the Hold time value which is lower.
  • The Hold timer could be 0, in which case the timers are never reset. The minimum Hold timer is 3 seconds.
  • BGP ID is also transported in the OPEN message. Typically the highest loopback IP address.
  • Optional parameters include the authentication information parameter.


BGP FINITE STATE MACHINE

 

1. Idle.
BGP initializes its resources, initiates a TCP transport connection, and starts listening for a connection that may be initiated by a remote peer.

2. Connect.
BGP is waiting for the transport protocol connection to be completed. If successful, the state transitions to OpenSent (the OPEN message is sent). If unsuccessful, the state transitions to Active.

3. Active.
BGP tries to acquire a peer by initiating a transport protocol connection. If expired, BGP restarts the ConnectRetry timer and falls back to the Connect state. The state might go back to Idle in case of other events, such as Stop event. A neighbor state that is oscillating between Connect and Active typically indicates a problem with the TCP transport connection.

4. OpenSent.
BGP is waiting for an OPEN message from its peer. In case of errors, an error NOTIFICATION is sent and the state goes back to Idle. If no errors, BGP starts sending KEEPALIVE messages.

5. OpenConfirm.
BGP waits for a KEEPALIVE message. If a KEEPALIVE is received, the state goes to Established, and the neighbor negotiation is complete.

6. Established.
The final stage in the neighbor negotiation. BGP starts exchanging UPDATE packets with its peers.


NOTIFICATION MESSAGE

  • Always sent whenever an error is detected.
  • After that, the peer connection is closed.

++++++++++++++++++++++++++++++++++++++++++
|  Error  | Error subcode |     Data     |
++++++++++++++++++++++++++++++++++++++++++


  • The Error code indicates the type of the notification.
  • The Error subcode provides more information about the nature of the error.
  • The Data field contains data relevant to the error, such as a bad header or an illegal AS number.

KEEPALIVE MESSAGE


  • Periodic messages exchanged between peers to determine whether peers are reachable.
  • The Hold time is the maximum amount of time that may elapse between the receipt of successive KEEPALIVE or UPDATE messages.
  • A recommended KEEPALIVE rate is 1/3 of the Hold time.
  • If the Hold timer is 0, periodic KEEPALIVE messages are not sent.
  • The KEEPALIVE message is a BGP header with no data following it.


UPDATE MESSAGE AND ROUTING INFORMATION


  • Basic blocks of an UPDATE message:
  1. Network Layer Reachability Information (NLRI).
  2. Path Attributes.
  3. Unfeasible Routes.

+++++++++++++++++++++++++++++++++++
|   Unfeasible routes length      |
+++++++++++++++++++++++++++++++++++
|   Withdrawn routes              |
+++++++++++++++++++++++++++++++++++
|   Total path attribute length   |
+++++++++++++++++++++++++++++++++++
|   Path attributes               |
+++++++++++++++++++++++++++++++++++
|     Length     |    Prefix      |
+++++++++++++++++++++++++++++++++++
|                                 | 
|      <length, prefix>           |  
|                                 |
+++++++++++++++++++++++++++++++++++


  • The NLRI (IP prefix route) indicates the networks being advertised.
  • The Path Attribute list enables BGP to detect routing loops and gives it flexibility to enforce local and global routing policies.

NETWORK LAYER REACHABILITY INFORMATION (NLRI)

  • The NLRI is the part of the BGP UPDATE message that lists the set of destinations about which BGP is trying to inform its other BGP neighbors.
  • The NLRI consists of one or more instances of the 2-tuple format <length, prefix>, where length is the number of the subnet mask that a particular prefix has.
  • Example: <19, 198.24.160.0> = 198.24.160.0/19.
  • Withdrawn routes have the same format.
  • An UPDATE message with no new NLRI or Path Attribute information is used to advertise only routes to be withdrawn from service.

PATH ATTRIBUTES

  • A set of parameters used to keep track of route-specific information.
  • Format: <attribute type, attribute length, attribute value>.
  • Four categories:
  1. Well-known mandatory.
  2. Well-known discretionary.
  3. Optional transitive.
  4. Optional non-transitive.
  • Well-known attributes are always transivite.
  • Well-known mandatory: Has to exist in the BGP UPDATE packet. Must be recognized by all BGP implementations. If missing, a NOTIFICATION error is generated, and the session is closed.
  • Well-known dicretionary: Recognized by all BGP implementations but might or might not be sent in the BGP UPDATE message.
  • Optinal transitive: The BGP implementation should accept the attribute and pass it along to other BGP speakers.
  • Optional non-transitive: The attribute is quietly ignored and not passed along to other BGP peers.

BGP CAPABILITIES NEGOTIATION

  • The purpose is to introduce a new optional parameter to BGP-4 called Capabilities.
  • Supported capabilites are included in the OPEN message.
  • If a peer supports a given capability, the speaker can use the capability with the peer.
  • If not supported, the BGP speaker receives a NOTIFICATION error message and attempts to reestablish the connection without sending the Capabilities parameter to the peer.

MULTIPROTOCOL EXTENSIONS FOR BGP

  • MP-BGP is negotiated via BGP capabilities.
  • Provides a backward-compatible extension to the BGP-4 protocol that let it carry information fro network layer protocols other than IPv4, such as IPv6 and IPX.
  • Two new attributes: Multiprotocol Reachable NLRI (MP_REACH_NLRI) and Multiprotocol Unreachable NLRI (MP_UNREACH_NLRI).
  • MP_REACH_NLRI and MP_UNREACH_NLRI are optional non-transitive attributes.
  • Interdomain multicast routing is the most common use of BGP's multiprotocol extensions.

TCP MD5 SIGNATURE OPTION

  • Help BGP protect itself from spoofed TCP segments and TCP resets in particular.
  • The TCP segment carries a digest message based on information known only to the connection end points.
  • When TCP receives a signed segment, the receiver must validate it by using its local key to
    calculate its own digest and compare the value with that of the received digest. 
  • If the comparison results in unequal values, the segment should be discarded and must not produce any response to the sender.
  • The MD5 key is never exchanged via the connection and that only the end points should be aware of the value.
  • There are performance implications that result in significantly increased delay with BGP message processing and generation.

Friday, March 27, 2015

CCIE OCG: IS-IS (Chapter 10)

IS-IS Terminology

  • End System (ES) = a host.
  • Intermediate System (IS) = a router.
  • System = a network node.
  • Circuit = an interface.
  • Domain = an autonomous system.

NSAP Addressing

  • An NSAP address is assigned to the entire network node, not to individual interfaces.
  • A single node requires only one NSAP address, regardless of how many network interfaces it uses.
  • Two parts: the Initial Domain Part (IDP) and the Domain Specific Part (DSP).
  • IDP = Authority and Format Identifier (AFI) and the Initial Domain Identifier (IDI).
  • IDI is indicated by AFI and might even be omitted.
  • AFI + IDI = the routing domain.
  • The System ID (6 octects) is the unique identifier of the node itself.
  • NSEL identifies the particular service in or above the network layer.
  • In typical IS-IS deployments, the addressing uses the AFI of 49 in which the length and meaning of the HO-DSP field are entirely up to the administrator.
  • If the value of the SEL octet is 0, no particular service is being addressed, and the entire NSAP address simply identifies the destination node itself without referring to any particular service on that node.

Example: 49.0001.1234.5678.3333.00.
  • The AFI is 49, signifying a local addres.
  • The 0001 is the area number.
  • The 1234.5678.3333 is the System ID of the node.
  • The trailing 00 is the SEL value.

The use of the dot, however, is arbitrary, as long as it separates groups of integer octet length.
Therefore, all the following notations represent the same address:
  • 49.0001.1234.5678.3333.00
  • 4900.0112.3456.7833.3300
  • 49.00.01.12.34.56.78.33.33.00
  • 49000112.34.5678.33.3300
  • 49000112345678333300

A Cisco router rewrites the address into the notation used in the first line.

Levels of Routing

  • Level 0 routing: Routing between two ES nodes on the same link, or between an ES
    node and its nearest IS.
  • Level 1 routing: Routing between ES nodes in a single area of a domain.
  • Level 2 routing: Routing between ES nodes in different areas of a domain.
  • Level 3 routing: Routing between ES nodes in different domains.
  • Both ES and IS send a periodic Hello message advertising their existence.
  • Aptly named, Hellos sent by ES nodes are called ES Hello (ESH), while Hellos sent by IS nodes are called IS Hello (ISH).
  • On Level 1, IS nodes collect lists of all ES nodes directly attached to them, and advertise these lists to each other.
  • On Level 2, IS nodes do not advertise the list of connected ES nodes anymore. Instead, in this level, IS nodes exchange area prefixes to learn how to reach particular areas.
  • If a Level 1 IS determines that the packet’s destination ES is in a different area, it will forward the packet toward the nearest IS capable of Level 2 routing, regardless of the destination area.
  • Hence, Level 1 routing can be described as routing by System ID, while Level 2 routing can be described as routing by area prefix.

IS-IS Metrics, Levels, and Adjacencies

  • Four metric types:
  1. Default: Required to be supported by all IS-IS implementations; usually relates to the bandwidth of the link (higher value represents a slower link).
  2. Delay: Relates to the transit delay on the link.
  3. Expense: Relates to the monetary cost of carrying data through the link.
  4. Error: Relates to the residual bit error rate of the link.
  • Most IS-IS implementations today support only the default metric.
  • Cisco IS-IS implementation assigns all interfaces the default metric of 10, regardless of their bandwidth.
  • Cisco IOS does not automatically recalculate an interface's bandwidth into its IS-IS metric.
  • Narrow metrics: network metric path of 6 bits (1-63), and the complete path metric of 10 bits (1-1023).
  • Wide metrics: 24 bits for the interface metric and 32 bits for the entire path metric.
  • IS-IS routers operate on each routing level independently.
  • For each level, an IS-IS router establishes separate adjacencies with its neighbors running on the same level, and maintains a separate link-state database.
  • Each router belongs to a single area (only one NET that carries the area identifier).
  • Level 1 adjacencies are created only between routers with the same area identifier.

IS-IS Packet Types

Four basic packet types:
  • Hello packet
  • Link State PDU
  • Complete Sequence Numbers PDU (CSNP)
  • Partial Sequence Numbers PDU (PSNP)

Hello Packets

  • Also denoted as IIH (IS-IS Hello) discover and maintain IS-IS neighbors.
  • On broadcast-type networks, IS-IS routers use separate Hello packets for L1 and L2 adjacencies.
  • On point-to-point type interfaces, a single L1L2 Hello is used.
  • Sent periodically every 10 seconds by default.
  • Hold time = Hello multiplier x Hello time.
  • By default, Hold time = 3 x 10 seconds = 30 seconds.
  • The timers do not need to match on neighboring routers.
  • On a DIS, the individual timers are always one-third of the configured timers.

Link State PDUs

  • There are no different types of LSPs.
  • Different network objects are described by distinct Type-Length-Value (TLV) records inside an LSP.
  • LSPs are uniquely identified by three parts:
  1. System ID of the router that originated the LSP.
  2. Pseudonode ID that differentiates between the LSP describing the router itself and the LSPs for multiaccess networks in which the router is a Designated IS.
  3. LSP Number denoting the fragment number of the LSP.
  • LSPID = System ID + Pseudonode ID + LSP Number.
  • For LSPs that describe routers themselves, the Pseudonode ID is always set to 0.
  • Each LSP has a sequence number, incremented at each change.
  • The LSP with the higher sequence number is more recent.
  • Each LSP has a Remaining Lifetime value (20 minutes).
  • IS-IS routers refresh their self-originated LSPs every 15 minutes.
  • Flooding an empty LSP with the Remaining Lifetime set to 0 is called an LSP purge.
  • After this timer expires, a router is required to wait at least another ZeroAgeLifetime (60 seconds) before flushing the LSP.
  • If putting all TLV records into a single LSP would cause it to exceed the MTU, the router will simply create multiple LSPs.
  • Fragmentation is performed only by the router that originates the LSP.
  • Fragmentation is signified by an increasing LSP Number, starting from 0.
  • After the LSP is flooded, it must not be modified by any other router, and also not be defragmented and/or refragmented.
  • The MTU on interfaces must be identical.

R1# show isis database
IS-IS Level-1 Link State Database:
LSPID        LSP Seq Num  LSP Checksum  LSP Holdtime   ATT/P/OL
R1.00-00   * 0x00000002   0x4BD3        676            0/0/0
R1.00-01   * 0x00000002   0xF403        708            0/0/0
R1.00-02   * 0x00000003   0xF86B        643            0/0/0
R2.00-00     0x00000003   0x449C        574            0/0/0


  • The router automatically substitutes the numerical System ID for the router's hostname to make the output easily readable.
  • Each LSP is identified by the triplet SystemID.PseudonodeID-Fragment in the LSPID column.
  • For LSPs that describe routers, the Pseudonode ID is always 0.
  • Entries marked with the asterisk sign are the LSPs that the router has originated itself.
  • A directly connected network is marked by an "IP" label.
  • A neighboring router is marked by an "IS" label and identified by its System ID and Pseudonode ID.
  • All metrics default to 10.
  • Each IS-IS router originates only a single LSP (plus Pseudonode LSPs if it is a DIS), and has therefore only a single or a few self-originated LSPs to age and refresh.

Complete and Partial Sequence Numbers PDUs

  • Used to synchronize link-state databases.
  • Similar to OSPF DBD packets.
  • Purpose is to advertise a complete list of LSPs in the sender's LSDB.
  • Receivers can flood a newer or missing LSP if they have one, or request an LSP if they find it missing in their own database.
  • If the sender’s link-state database contains so many LSPs that listing them all in a single CSNP packet would cause it to exceed the MTU, multiple CSNPs are sent.
  • For this purpose, individual LSPIDs are advertised.
  • LSPIDs range from 0000.0000.0000.00-00 to FFFF.FFFF.FFFF.FF-FF.
  • The bold part is the System ID, the following octet is the Pseudonode ID, and the octet following the dash is the LSP Number ID.
  • On point-to-point links, CSNP packets are exchanged usually only during initial adjacency buildup.
  • On broadcast networks, CSNP packets are originated periodically by the DIS.
  • PSNP packets are functionally similar to OSPF LSR and LSAck packets.
  • PSNP packets are used to request an LSP or acknowledge its successful arrival.


IS-IS Operation over Different Network Types

  • IS-IS natively supports only broadcast and point-to-point network types.
  • Running IS-IS over any Layer 2 technology works right out of the box.
  • No special provision to operate over partially meshed hub-and-spoke Frame Relay.
  • Recommended action to configure point-to-point subinterfaces and IS-IS point-to-point links.
  • Three possible adjacency states:
  1. Down - The initial state. No IIHs have been received.
  2. Initializing - IIHs have been received but the communication may not be bidirectional.
  3. Up - IIHs have been received and it is certain that the neighbor is also receiving IIHs.

Over Point-to-Point Links 

  • IS-IS expects to detect a single neighbor, bring up the adjacency, and synchronize the LSDB.
  • A three-way handshake to verify bidirectional connectivity.
  • The three-way handshake is simple:
  1. Router A <--- (Down) Router B + Router A (Initializing) ---> Router B
  2. Router A <--- (Up) Router B
  3. Router A (Up) ---> Router B
  • After the adjacency is declared as Up, routers will attempt to synchronize their link-state
  • databases.
  • Every LSP sent over a point-to-point link, whether during the initial database synchronization or anytime later when it is updated or purged, must be acknowledged, and this is done using PSNP or CSNP packets.

Over Broadcast Links

  • Similar to OSPF.
  • An IS-IS router lists the MAC address (or SNPAs) of all neighboring routers it hears in the IIH.
  • If a router receives an IIH from a neighbor and finds its own SNPA indicated in the IIH, it knows that the routers can see each other, and can move the adjacency to the Up state.
  • If IIH packets from a neighbor do not contain the receiving router’s SNPA, the adjacency is kept in the Initializing state.
  • IS-IS elects on Designated IS (DIS) for each broadcast network.
  • No backup DIS.
  • Selection criteria:
  1. The router with the highest interface priority.
  2. The router with the highest SNPA.
  3. If SNPAs are not comparable, the router with the highest System ID.
  • 0 is a valid priority as well, and it does not exclude a router from participating in DIS election.
  • DIS is preemptive.
  • The DIS election is effectively performed with each received IIH.
  • All routers on a common broadcast segment become fully adjacent, regardless of which is the DIS.
  • DIS has two important operations:
  1. Help routers synchronize on broadcast networks.
  2. Represent the broadcast segment in the LSDB as a standalone object - the Pseudonode.
  • Synchronization: The DIS creates and sends a CSNP packet in regular intervals (10 seconds by default) on the segment. This CSNP packet lists all LSPs present in the DIS’s link-state database. Other routers on the segment receive this CSNP and compare it to the index of their own link-state database.
  • The DIS is not a relay of LSPs; rather, it is a reference point of comparison.
  • If a router misses an LSP known by the DIS, or if the LSP is older than the one known by the DIS, the router will request the newer LSP through PSNP and the DIS will flood it.
  • If a router knows about a newer LSP than the one known by the DIS, or if the DIS seems to miss it completely, the router will simply flood the LSP onto the network.
  • No explicit acknowledgment by the DIS is sent.
  • If the LSP has arrived, the DIS will advertise it in its next periodic CSNP, and this CSNP serves as an implicit acknowledgment.
  • To exist as a pseudonode in a link-state database, a broadcast network must have its own LSP.
  • It is the responsibility of the DIS to originate and flood the Pseudonode LSP.

Areas in IS-IS

  • The entire node with all its interfaces belongs only to a single area.
  • IS-IS uses the entire high-order part of the NSAP address up to the start of System ID as the area identifier.
  • Nodes in a single area must obviously be addressed using the same NSAP format, the same initial domain identifier, and the same internal area number (high-order domain specific part).
  • IS-IS routers maintain separate and independent Level 1 (L1 in short) and Level 2 (L2 in short) link-state databases, and do not allow LSPs from one database to ever leak into the other.
  • L1 routing is a process of intra-area routing, delivering packets between stations located in the same area.
  • Each L1 router advertises its directly connected IP networks in its L1 LSP.
  • L2 routing is a process of inter-area routing, delivering packets between stations located in different areas.
  • L2 backbone must be contiguous and pervade all areas within the domain.
  • Each L2 router advertises its directly connected IP networks to achieve contiguous IP connectivity in the backbone, plus all other L1 routes from its own area with appropriate metrics , to advertise IP networks present in particular areas.
  • L2 routers establish adjacencies regardless of their areas.
  • L1 routers in an area behave as if they were in an OSPF Not So Stubby-Totally Stubby (NSSA-TS) area.
  • IS-IS on Cisco routers defaults to L1L2 operation, meaning that both L1 and L2 routing are enabled by default.
  • ATT/P/OL = ATTached, Partition repair, and Overload flags.
  • ATT = 1 means that the router can reach other areas.
  • L1 routers automatically install a default route toward their nearest L1L2 router whose ATT bit set.
  • Cisco routers do not support the Partition repair function (always set to 0).
  • The Overload bit was originally intended to signal that the router is, for whatever reason, unable to store all LSPs in its memory, and that its link-state database is overloaded.
  • If a router’s LSP has the O bit set, the SPF computation on other routers will ignore this router when computing shortest paths to other routers and their networks.
  • The router will not be used as a transit router to other routers, but it still will be considered as a router usable to reach its own directly connected networks.
  • Looking at any L2 LSP in isolation, you do not even know which prefix is directly connected to the router and which one is an L1 prefix “uptaken” into L2—they are both advertised in the same manner.

Authentication in IS-IS 

  • IIH packets are authenticated independently of LSP, CSNP, and PSNP packets.
  • L1 LSPs must use the same area password or the level-1 authentication password.
  • L2 LSPs must use the same domain password or the level-2 authentication password.
  • IIH authentication is configured independently of non-IIH.
  • IIH authentication is configured directly under the interface, so different neighbors can use different passwords.
  • Non-IIH must use the same authentication type and the same password.
  • If IIH packets received from a neighboring router fail authentication, no adjacency will be created between this router and the neighbor.
  • As a result, these routers will not accept LSP, CSNP, or PSNP packets from each other, as these packets are accepted only from routers in the Up adjacency state.
  • If IIH packets pass the authentication but the non-IIH packets fail it, the routers will be in the Up adjacency state but they will not be able to synchronize their link-state databases.

IPv6 Support in IS-IS

  • IS-IS does not require a particular Layer 3 protocol to carry its packets.
  • IS-IS can also carry information about destinations described by different address families in a single instance.
  • Rules about advertising IPv6 prefixes in L1 and L2 LSPs are identical to those for IPv4.
  • It is not necessary to start an additional IS-IS process to carry IPv6 routes along with IPv4.
  • Instead, the existing IS-IS process is simply instructed to advertise IPv6 routes along with other information it is already advertising.

Configuring IS-IS


key chain ISISAuth
key 1
key-string S3cretP4ss
!
interface Serial0/0/0
description => To R2 <=
ip address 10.1.12.1 255.255.255.0
ip router isis
isis authentication mode md5
isis authentication key-chain ISISAuth
isis three-way-handshake ietf
!
router isis
net 49.0001.0000.0000.0001.00
is-type level-1
authentication mode md5
authentication key-chain ISISAuth
metric-style wide
log-adjacency-changes all


  • Interfaces are added to IS-IS directly by configuring them with the ip router isis command. IS-IS has no network command; therefore, per-interface configuration is the way of adding networks and interfaces into IS-IS.
  • If a router is configured for L1L2 operation, it will by default try to establish both L1 and L2 adjacencies over all active IS-IS interfaces.
  • It is possible to limit its operation only to the selected level. That will prevent the router from sending and processing packets of a different routing level over that interface (Example: isis circuit-type level-2-only).

Thursday, March 26, 2015

400-101: IS-IS

Understanding CLNS Addressing

  • Apply to entire nodes and not interfaces.
  • IS-IS requires CLNS node addresses to function properly.
  • CLNS addresses used by routers are called network service access poins (NSAPs).
  • One part of an NSAP address is the NSAP selector (NSEL) byte.
  • When an NSAP is specified with an NSEL of 0, the NSAP is called the network entity title (NET).
  • An NSEL of 0 identifies network services.

NSAP Addresses

  • Maximum size of 20 bytes.
  • The high-order bits describe inter-area structure, and the low-order bits identify unique systems within an area.
  • IS-IS uses the OSI address in the LSPs to identify the router and build the topology table and the underlying IS-IS routing tree.
  • OSI addresses are NSAPs. They contain the following:
  • The device's OSI address.
  • A link to the higher-layer process.
  • Equivalent to the combination of the IP address and upper-layer protocol in an IP header.

IS-IS NSAP Address Structure

  • Three fields: the area address, the system ID, and the NSEL.

+++++++++++++++++++++++++++++++++++++++++++++++++++++
|    IDP    |                 DSP                   |
+++++++++++++++++++++++++++++++++++++++++++++++++++++
| AFI | IDI |  High Order DSP  |  System ID  | NSEL |
++++++++++++++++++++++++++++++++++++++++++++++++++++
+


  • Initial Domain Identifier (IDI) identifies the domain of the NSAP address.
  • Authority and Format Identifier (AFI) makes up the format of the address and the authority that assigned the address.
  • Initial Domain Part (IDP) = AFI + IDI.

  • Domain-Specific Part (DSP) contributes to routing within an IS-IS routing domain.
  • High-Order Domain-Specific Part (HODSP) is more or less the OSI equivalent of a subnet in IP.
  • System ID identifies an individual OSI device. (In OSI, a device has an address, where as in IP, each interface has an address.)
  • NSEL identifies a process on the device. (It corresponds roughly to a port or socket in IP, not used in routing decisions.)
  • DSP = HODSP + System ID + NSEL

Example:  49.0001.0000.0c12.3456.00
  • AFI = 49 (private)
  • Area ID = 0001
  • System ID = 0000.0c12.3456
  • NSEL = 0 (also called NET)

Identifying Sysems in IS-IS

  • Unlike OSPF, an IS-IS router can be a member of only one area.
  • Other restrictions:
  1. All routers in an area must use the same area address.
  2. ESs recognize only ISs and other ESs on the same subnetwork that share the same area address.
  3. L1 intra-area routing is based on system IDs (must be unique).
  4. L2 system IDs must also be unique.
  5. It is customary to use a MAC address from the router as the system ID.
  6. All system IDs in a domain must be of equal length.

NET Addresses

  • NSAP addresses with an NSEL value of 0.
  • Used to uniquely identify a host within an IS-IS routing domain.
  • Because IS-IS originates from the OSI world, NET addresses are required even if the only routed protocol is IP.
  • NET address (NSEL = 00) refers to the device itself.
  • Routers use the NET to identify themselves in the LSPs.
  • Addresses starting with the AFI value of 49 are private addresses, analogous to RFC 1918 for IP addresses.
  • A circuit is the IS-IS term for an interface.

IS-IS PDUs

  • Hello PDU (ESH, ISH, IIH): Used to establish and maintain adjacencies.
  • Link-state PDU (LSP): Used to distribute link-state information.
  • Partial Sequence Number PDU (PSNP): Used to acknowledge and request missing pieces of link-state information.
  • Complete Sequence Number PDU (CSNP): Used to describe the complete list of LSPs in a router's LSDB.

  • L1 and L2 establish separate adjacencies for L1 and L2, one for each level.
  • Unlike OSPF, IS-IS routers in a LAN establish adjacencies with all other routers on the LAN.
  • IIH PDUs announce the area ID.
  • Separate IIH packets announce the L1 and L2 neighbors.
  • Adjacencies form based on the area address communicated in the incoming IIH and the type of router (L1 or L2).
  • L1 routers accept L1 IIH PDUs from their own area and establish adjacencies with other routers in their own area.
  • L2 routers (or the L2 process within any L1/L2 router) accept only L2 IIH PDUs and establish only Level 2 adjacencies.
  • Dijkstra's algorithm requires a virtual router (pseudonode) called the DIS to build a directed graph for broadcast media.
  • DIS selection criteria:
  1. highest priority (default 64, within 0-127)
  2. highest MAC address
  • The L1 DIS and L2 DIS on a LAN might or might not be the same router.
  • Preemptive. Any adjacent IS with a higher priority automatically takes over the DIS role.
  • No backup DIS.
  • Routers on a LAN establish adjacencies with all other routers and with the DIS.
  • Each IS is required to advertise a single adjacency to the pseudonode.
  • A pseudonode LSP details only the adjacent ISs.
  • The pseudonode LSP is used to build the map of the network and to calculate the shortest path first (SPF) tree (equivalent to the network LSA in OSPF).
  • L1 LSPs are flooded within the local area.
  • L2 LSPs area flooded throughout the backbone.
  • Each IS originates its own LSP (one for L1 and one for L2).
  • Identified by the originator's system ID and an LSP number starting at 0.
  • If an LSP exceeds the MTU, it is fragmented into several LSPs, numbered 1, 2, 3, and so on.
  • IS-IS maintains the L1 and L2 LSPs in separate LSDBs.
  • IS examines the checksum of received LSPs and discards any invalid LSPs, flooding them with an expired lifetime age.
  • If the LSP is valid and newer than what is currently in the LSDB, it is retained, acknowledged and given a lifetime of 1200 seconds.
  • When the LSP expires, it is kept for an additional 60 seconds before it is flooded as an expired LSP.
  • Sequence Number PDUs (SNPs) are used to acknowledge the receipt of LSPs and to maintain LSDB synchronization.
  • Two kinds: Complete SNPs (CSNPs) and Partial SNPs (PSNPs).
  • Adjacent IS-IS routers exchange CSNPs to compare their LSDBs.
  • CSNPs are multicast every 10 seconds.
  • Adjacent IS-IS routers use PSNPs to acknowledge the receipt of LSPs and to request transmission of missing or newer LSPs.CSNPs are not periodically sent on point-to-point links.
  • A CSNP is sent only once, when the point-to-point link first comes up.
  • After that, LSPs are sent to describe topology changes, and they are acknowledged with a PSNP.

Configuring IS-IS for IP

  • OSI CLNS protocol must also be configured.
  • Each IS-IS router requires a NET, and IS-IS packets are directly encapsulated onto the data link layer instead of traveling inside IP packets.
  • A NET address identifies a device (an IS or ES), not an interface.

Basic Configuration for Integrated IS-IS
  1. Define areas, prepare the addressing plan (NETs) for routers, and determine which interfaces to enable IS-IS.
  2. Enable IS-IS on the router.
  3. Configure the router's NET.
  4. Enable IS_IS on the proper interfaces.

Three commands to enable Integrated IS-IS on a router for IP routing. Additional commands to fine-tune the IS-IS process.
  • router isis: enables IS-IS as an IP routing protocol.
  • net [number]: assigns a NET to a router to identify it.
  • ip router isis [tag]: enables IS-IS on the interface (no network statement).

A router's CLNS address (NET) consists of three main parts:
  1. The prefix, which identifies the area that the router is a part of.
  2. The system ID, which uniquely identifies each device.
  3. The NSEL, which must be 0.
  • The IS-IS neighbor relationships are established over CLNS, not over IP.
  • Two ends of a CLNS adjacency can have IP addresses on different subnets, with no impact on the operation of IS-IS.
  • Multiple IS-IS processes is possible (marked with a tag). 
  • The process name is locally significant. If omitted, Cisco IOS assumes a null tag.
  • By default, the Cisco IOS makes the router an L1/L2 router.

  • NET = area ID + system ID + NSEL (00).
  • Area ID = 1-13 bytes.
  • System ID = 6 bytes.

  • If no tag is listed, the Cisco IOS assumes a tag value of 0.
  • If only one IS-IS process is active on the router, not tag value is needed.

Example:

router isis
 net 49.0001.0000.0000.0001.00
!
interface ethernet0
 ip address 10.1.1.1 255.255.255.0
 ip router isis
!
interface ethernet1
 ip address 10.1.2.1 255.255.255.0
 router isis

Sunday, March 22, 2015

400-101: MPLS Concepts, Part II

MPLS L3VPNs

  • MPLS L3VPNs allow ISPs to providate private Layer 3 services for their customers.
  • MPLS L3VPNs are aware of the IP addressing at customer locations.
  • At the same time, different customers can have overlapping IP address spaces.
  • The concept of using multiple routing tables, called Virtual Routing and Forwarding (VRF) tables, separate customer routes, allowing duplicate address ranges.



  • Routers have different roles in MPLS VPNs.
  • Customer Edge (CE): A router that is not MPLS aware. Does not send any labeled packets, only peers with the PE router.
  • Provider Edge (PE): An entry point into the MPLS network. Adds labels to packets received from the CE. Connects to multiple CEs and segregates their routes using VRFs.
  • Provider (P): An LSR in the MPLS core. Fowards packets based on labels only. Does not know or care about customer VPN routes. 
  • CEs exchange routes with the PE using a routing protocol.
  • The PE stores the routes in separate per-customer VRFs.
  • The PE redistributes those routes into iBGP and exchanges those routes with other PEs.
  • The routes are never advertised to P routers.
  • The ingress PE pushes two labels on the packet:
  1. An outer MPLS header (S-bit = 0): a label to forward the packet towards the far-end PE.
  2. An inner MPLS header (S-bit = 1): a label to identify the VPN.

General MPLS VPN Traffic Flow

  1. CE1 forwards an unlabeled packet to PE1.
  2. PE1 receives the packet on an interface assigned to VRF-A and makes a routing decision based on VRF-A's forwarding tables. PE1 adds two labels and forwards the labeled packets.
  3. P1 processes the labeled packet and swaps the top label.
  4. P2 receives the labeled packet, pops the top label (penultimate hop pop) and sends the packet to PE2.
  5. Based on the VPN label, PE2 knows that the packet belongs to VRF-A. PE2 removes the label and forwards the packet unlabeled to CE2.

  • Extranet (route leaking) means importing routes from one VRF into a different VRF that servies another VPN site.

MPLS VPLS

  • Virtual Private LAN Service (VPLS) emulates a LAN segment across the MPLS backbone.
  • When the customer with different Ethernet sites connects to an MPLS backbone where VPLS is deployed, it appears as if all the sites are interconnected through a virtual Ethernet switch.
  • VPLS is the same as EoMPLS, as in it is a Layer 2 domain.
  • However, EoMPLS is a service that is point-to-point in nature, whereas VPLS—emulating a LAN—is point-to-multipoint in nature.

Any Transport over MPLS (AToM)

  • AToM provides a solution whereby the MPLS backbone also carries the Layer 2 traffic from the customers, thereby eliminating the need to run two separate networks side by side.
  • The service provider can provide an existing service (ATM, Frame Relay, and so on) over the MPLS backbone.
  • Customers might not want to migrate to MPLS VPNs for two reasons: 1) they want to retain complete control over their network and how it is built, and 2) they have legacy equipment running protocols that cannot be carried over IP.
  • Whereas MPLS VPN provides a service of creating VPNs at Layer 3, AToM creates VPNs at Layer 2 and is sometimes referred to as L2VPN.
  • AToM is a Layer 2 point-to-point service.
  • Benefits of AToM:
  1. The customer does not need to change anything (no need for a routing protocol like with MPLS L3VPNs).
  2. The service provider does not have to change anything on the P routers in the MPLS core. The intelligence to support AToM sits entirely on the PE routers.

L2TPv3

  • L2TPv3 is the Layer 2 transport service over an IP network.
  • The Layer 2 frames are encapsulated with an L2TPv3 header and are transported across the IP network.
  • Similar to AToM, L2TPv3 can carry ATM, Frame Relay, HDLC, PPP, Ethernet, and others.
  • Both the AToM and L2TPv3 solutions use the same architecture, but the network that is carrying the service is different. AToM is carried over MPLS, L2TPv3 is carried over IP.
  • The Layer 2 frames are either encapsulated into an IP packet (L2TPv3) or are labeled (AToM).

Overlay Transport Virtualization (OTV)

  • OTV allows for live migration of virtual machines between sites, the process being completely transparent to the end users.
  • A typical requirement for live migration is that the host machines are in the same IP subnet and the same VLAN. OTV extends the Layer 2 domain across data centers.
  • In essence, OTV accomplishes the same goal as other L2 tunneling protocols such as L2TPv3, AToM, and VPLS. For OTV specifically, the goal is to take Ethernet frames from an end station, like a virtual machine, encapsulate them inside IPv4, transport them over the Data Center Interconnect (DCI) network, decapsulate them on the other side, and out pops the original Ethernet frame.
  • OTV benefits over AToM and VPLS:
  1. Transport agnostic: As long as there is IPv4 connectivity between the data centers, OTV can be used. AToM and VPLS require MPLS.
  2. Simple provisioning: OTV is a CE side protocol. AToM and VPLS are PE side protocols.
  • OTV is an encapsulation nightmare: ICMP over IP over Ethernet over MPLS over GRE over IP over Ethernet (IoIoEoMPLSoGREoIP for short).
  • As a summary, OTV is a fancy GRE tunnel.

Saturday, March 21, 2015

400-101: MPLS Concepts, Part I

Label Switching


MPLS shifts the paradigm from packet forwarding from the destination IP address to label switching. Normally, when a router receives a packet, it looks at the IP header, and makes a forwarding decision based on the destination IP address (the longest match in the routing table). On the contrary, in MPLS networks, a label is added between the Layer 2 and Layer 3 headers, and the router performs packet forwarding strictly based on that label. This allows end-to-end circuits across any type of transport medium, using any protocol.

Label-Switched Path (LSP)

  • LSPs are predetermined unidirectional routes through the MPLS core.
  • Routers define the LSPs by exchanging MPLS information before forwarding any packets.
  • Contrary to LSPs, normal IP routing operates on a hop-by-hop basis, each router making routing decisions independently.

Label-Switching Router (LSR)

  • LSR is a router configured with MPLS that participates in LSPs.
  • LSRs can interpret MPLS headers and performs MPLS operations required to pass traffic through the network.
  • There are diffrent types of LSRs: ingress LSR, "normal" LSR, and egress LSR.
  • Ingress LSR is the entry point into the MPLS network. Native IPv4 packets are assigned MPLS label(s).
  • "Normal" LSRs forward MPLS traffic along the LSP, using only the MPLS header to determine how the packet is routed.
  • Egress LSR receives MPLS packets, strips off any labels, and performs a native IP route lookup.

Label Format


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|         Label            |  Exp  | S |       TTL       |
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


  • Label: label value (20 bits)
  • Exp: experimental use, currently used for QoS (3 bits)
  • S: Bottom of Stack (1 bit)
  • TTL: Time To Live (8 bits)
  • Multiple labels can be imposed in an MPLS header. The last label has the S bit set to 1.
  • TTL has the same purpose as in IP.

Label Operations

  • Push: Adds a new label on top of the packet.
  • Swap: Replaces the top label of a label stack with a new label.
  • Pop: Removes the top label of a label stack.
  • Multiple Push: Adds multiple labels to the top of the label stack.
  • Swap and Push: Replaces the top label with a new label and then pushes a new label to the top of the stack.
  • Penultimate Hop Popping (PHP): Removing the top label at the second last router in the MPLS network. This prevents the egress LSR from performing an unnecessary MPLS lookup, only to realize that it needs to send the packet using native IP, and then refer to its routing table to make the actual forwarding decision.

Label Distribution Protocol (LDP)

  • LDP is a method to dynamically build and maintain the LSPs between the LSRs.
  • LSRs exchange label information using LDP.
  • The label bindings received by LDP are stored in the LIB.
  • The LIB in turns feeds the LFIB which defines the label operation (pop, swap, or push).
  • LDP is automatically run on interfaces with mpls ip enabled (CEF and LDP globally must also be enabled).
  • LDP sends Hellos to discover neighbors.
  • LDP Hello messages are UDP (646) messages that are sent on the links to the “all routers on this subnet” multicast address 224.0.0.2.
  • Default timers: Hello = 5 seconds, Hold = 15 seconds.
  • LSRs that are running LDP have an LDP Identifier, or LDP ID.
  • This LDP ID is a 6-byte field that consists of 4 bytes identifying the LSR uniquely and 2 bytes identifying the label space that the LSR is using.
  • The first 4 bytes of the LDP ID are an IP address taken from an operational interface on the router.
  • If loopback interfaces exist, the highest IP address of the loopback interfaces is taken for the LDP ID. If no loopback interfaces exist, the highest IP address of a regular interface is taken.
  • The LDP ID needs to be present in the routing table of the LDP neighboring routers. If it is not, the LDP session is not formed.
  • If there is no route for that IP address in the routing table, the LDP session is not established.
  • If two LSRs have discovered each other by means of the LDP Hellos, they attempt to establish an LDP session between them. One LSR tries to open a TCP connection—to TCP port 646—to the other LSR.
  • After the LDP session has been set up, it is maintained by either the receipt of LDP packets or a periodic keepalive message. Each time the LDP peer receives an LDP packet or a keepalive message, the keepalive timer is reset for that peer (default 180 seconds).

MPLS Ping

  • IP ping is insufficient for verifying the correct MPLS oepration.
  • IP ping verifies connectivity on the IP level but it does not verify whether the LSP is broken.
  • If LDP is broken between two LSR, IP ping indicates that there is no problem.
  • LSPs can break for any number of reasons, while the IP connectivity remains fine. For example: 
  1. The LDP session is down.
  2. MPLS is not enabled on one LSR (or one interface).
  3. The LFIB has a wrong entry for the LSP (wrong in/out label or wrong out-going next-hop information).
  4. The software and hardware LFIB have a discrepancy.
  • For some of these problems, the packets become unlabeled; others are label-switched, but in a
    wrong way.
  • MPLS ping detects problems in the forwarding plane, but it also checks the control plane against the information in the data plane. 
  • MPLS ping is similar to IP ping in that it also uses an echo request and echo reply. 
  • That is where the similarities stop, though. MPLS ping has different packet formats altogether and returns more troubleshooting information.
  • An MPLS echo request is a UDP packet with a destination port of 3503 and a source port chosen by the sender. 
  • It has a Router Alert option. 
  • To prevent the packet from switching any further as an IP packet if the LSP is broken but the IP path is still fine, the IP TTL of the packet is set to 1 and the destination IP address of the packet is from the range 127.0.0.0/8.
  • An LSR never forwards such an IP packet if the LSP is broken.
  • The destination of the packet and which label stack is pushed onto the packet is derived from the IP address that the user command or a software component provides.

MPLS Traceroute

  • The goal of traceroute is to test the path, whereas the goal of ping is to test the connectivity.
  • An MPLS traceroute is nothing more than an MPLS echo request. 
  • The difference with MPLS ping is that MPLS traceroute sends several MPLS echo request packets with increasing MPLS TTL. 
  • The first MPLS LSP traceroute probe has MPLS TTL 1, and for every subsequent probe, the TTL is increased by 1.

Friday, March 20, 2015

CCIE OCG: OSPF (Chapter 9), Part III

OSPF Configuration

The example configuration has the following design goals in mind:
  • The OSPF process IDs do not have to match on separate routers, but best practice recommends using the same process IDs across the network.
  • Using the network command to match interfaces.
  • Configuring S1's RID as 1.1.1.1.
  • Setting priorities on the backbone LAN to favor S1 and S2 to become the DR/BDR.
  • Configuring a minimal dead interval of 1 second, with Hello multiplier of 4, yielding a 250-ms Hello interval on the backbone LAN.


R1#
interface FastEthernet0/0
  ip address 10.1.1.1 255.255.255.0
  ip ospf dead-interval minimal hello-multiplier 4
!
router ospf 1
  area 3 nssa no-summary
  area 4 stub no-summary
  area 5 stub
  network 10.1.0.0 0.0.255.255 area 0
  network 10.3.0.0 0.0.255.255 area 3
  network 10.4.0.0 0.0.255.255 area 4
  network 10.5.0.0 0.0.255.255 area 5

R2#
interface FastEthernet0/0
  ip address 10.1.1.2 255.255.255.0
  ip ospf dead-interval minimal hello-multiplier 4
  ip ospf 2 area 0
!
router ospf 2
  area 5 stub

R3#
router ospf 1
! R3 should omit the no-summary keyword, because R3 is not an ABR.
  area 3 nssa
  network 10.0.0.0 0.255.255.255 area 3

R4#
router ospf 1
  area 4 stub
  network 10.0.0.0 0.255.255.255 area 4

S1#
interface Vlan1
  ip address 10.1.1.3 255.255.255.0
  ip ospf dead-interval minimal hello-multiplier 4
  ip ospf priority 255
!
router ospf 1
  router-id 7.7.7.7
  network 10.1.0.0 0.0.255.255 area 0

S2#
interface Vlan1
  ip address 10.1.1.4 255.255.255.0
  ip ospf dead-interval minimal hello-multiplier 4
  ip ospf priority 254
!
router ospf 1
  network 10.0.0.0 0.255.255.255 area 0



OSPF Costs and Clearing the OSPF Process

How OSPF chooses OSPF interface costs:
  1. Set the cost per neighbor using the neighbor <ip-add> cost <value> command. This is only valid on OSPF point-to-multipoint non-broadcast network types.
  2. Set the cost per interface using the ip ospf cost <value> under the interface.
  3. Allow the cost to default based on interface bandwidth and the OSPF Reference Bandwidth (Ref-BW) (default 10^5 Kbps). The formula is Ref-BW / bandwidth (Kbps).
  4. Default based on bandwidth, but change Ref-BW using the auto-cost reference-bandwidth <value> command within the OSPF process.
  5. The IOS interface bandwidth is kept in Kbps and the auto-cost reference-bandwidth units are Mbps.
  6. When choosing the best routes to reach a subnet, OSPF also considers whether a route is intra-area route, inter-area route, E1/N1 route, or E2/N2 route.

Alternatives to the OSPF network Command

  • As of Cisco IOS Software Release 12.3(11)T, OSPF configuration can completely omit the network command, instead relying on the ip ospf <pid> area <area-id> interface subcommand.
  • With the network command, OSPF advertises stub networks for any secondary IP subnets that are matched by the command.
  • The ip ospf area interface subcommand causes any and all secondary subnets on the interface to be advertised as stub networks - unless the optional secondaries none parameter is included.
  • Regardless of the network or ip ospf area command, OSPF will always establish adjacencies over an interface only using the primary IP address. OSPF will never use secondary addresses to establish an adjacency.


OSPF Filtering

  • Intra-area route filtering presents some special challenges with link-state routing.
  • Link-state protocols do not advertise routes - they advertise topology information.
  • SPF loop prevention relies on each router in the same area having an identical copy of the LSDB for that area.
  • Only the router that has originated an LSA is ever allowed to modify its contents.
  • Three major types of OSPF filtering:
  1. Filtering routes, not LSAs: Using the distribute-list command, a router can filter the routes that its SPF process is attempting to add to its routing table, without affecting the LSDB.
  2. ABR Type 3 LSA filtering: A process of preventing an ABR from creating particular Type 3 summary LSAs.
  3. Using the area range no-advertise option: Another process to prevent an ABR from creating specific Type 3 summary LSAs.

Filtering Routes Using the distribute-list Command

  • For RIP and EIGRP, the distribute-list command can be used to filter incoming and outgoing routing updates.
  • With OSPF, the distribute-list in command filters what ends up in the IP routing table, and only on the router on which the command is configured.
  • Note that the redistribute command does control what enters and leaves the LSDB.
  • The following rules govern the use of distribute-lists for OSPF:
  1. The inbound direction applies to the results of SPF - the routes to be installed into the routing table.
  2. The outbound direction applies only to redistributed routes and only on an ASBR; it selected which redistributed routes shall be advertised.
  3. The inbound logic does not filter inbound LSAs; it instead filters the routes that SPF chooses to add to the routing table.
  4. If the distribute-list includes the incoming interface parameter, the incoming interface is checked as if it were the outgoing interface of the route.
  • The distribute-list route-map allows a much greater variety of matching parameters, and much more detailed logic.


OSPF ABR LSA Type 3 Filtering

  • ABRs do not forward Type 1 and 2 LSAs from one area into another, but instead create Type 3 LSAs for each subnet defined in Type 1 and 2 LSAs.
  • Type 3 LSAs do not contain detailed information about the topology of the originating area; instead, each Type 3 LSA represents a subnet, and a cost from the ABR to that subnet.
  • Type 3 LSAs can be filtered where they would normally be created.
  • By filtering at the ABR, before the Type 3 LSA is injected into another area, the requirement for identical LSDBs inside the area can be met, while still filtering LSAs.
  • Configured using the area <area-id> filter-list prefix <name> in|out command.
  • When in is configured, IOS filters prefixes going into the configured area.
  • When out is configured, IOS filters prefixes coming out of the configured area.


Filtering Type 3 LSAs with the area range Command

  • The area range command performs route summarization at ABRs, telling a router to cease advertising smaller subnets in a particular address range, instead creating a single type 3 LSA whose address and prefix encompass the smaller subnets.
  • When the area range command includes the not-advertise keyword, not only are the smaller component subnets not advertised as type 3 LSAs, but the summary route is also not advertised as a type 3 LSA either.
  • As a result, this command has the same effect as the area filter-list command with the out keyword, filtering the LSA from going out to any other areas.


Virtual Link Configuration

  • OSPF requires that each non-backbone area be connected to the backbone area (area 0).
  • OSPF virtual links overcome the limitation of needing a physical connection to the backbone.
  • A virtual link allows a pair of possibly remote routers to create a targeted OSPF session across the IP network.
  • A virtual link endpoint becomes an ABR, with a full copy of area 0's LSDB entries.
  • A virtual link is not a tunnel for data packets; rather, it is a targeted session that allows two remote routers within a single area to become fully adjacent and synchronize their LSDBs.
  • The virtual link is internally represented as an unnumbered point-to-point link between the two endpoint routers and exists in the backbone area, regardless of the area through which it is created.
  • The area through which the virtual link is created is called a transit area and it must be a regular area.
  • As no tunneling is involved, packets routed through this transit area are forwarded based on their true destination addresses, requiring the transit area to know all networks in the OSPF domain, intra-area, inter-area, and external.
  • The area virtual link commands point to the other router's RID, and the transit area over which the virtual link exists.
  • Timers and authentication can be set on the area virtual-link command.
  • It is important to remember that the virtual links themselves are in area 0.

R1#
router ospf 1
  router-id 1.1.1.1
  area 3 virtual-link 3.3.3.3

R3#
router ospf 1
  router-id 3.3.3.3
  area 3 virtual-link 1.1.1.1



Configuring Classic OSPF Authentication

  • Classically three authentication types: none, clear-text, and MD5.
  • SHA-1 recently added (new configuration).
  • Classic OSPF authentication differs significantly from RIPv2 and EIGRP.
  • The basic rules for configuring OSPF authentication are as follows:
  1. Three types available: type 0 (none), type 1 (clear text), and type 2 (MD5).
  2. Enabled per interface using the ip ospf authentication interface subcommand.
  3. The default authentication is type 0 (no authentication).
  4. The default can be redefined using the area authentication under the OSPF process.
  5. The keys are always configured as interface subcommands.
  6. Multiple MD5 keys with different key IDs are allowed per interface, which allows for graceful key migration where a new key can be added without disrupting the adjacencies. The method is simple: To sign sent packets, OSPF always uses the key that was added as the last one on the interface (regardless of the key number). To authenticate the received packets, it uses the key ID that is indicated in the packet.
  • The keys are stored in clear text in the configuration, unless the service password-encryption command is added.

Configuring Extended Cryptographic OSPF Authentication

  • Starting with IOS Release 15.4(1)T, OSPF also supports SHA-HMAC authentication.
  • SHA-HMAC uses key chains similarly to EIGRP or RIPv2.
  • In addition, the key chain definition has been enhanced to select a particular cryptographic algorithm for a particular key.
  • Each key in the key chain must have a cryptographic algorithm configured using a per-key cryptogprahic-algorithm command. Failure to do so will result in OSPF not using that key.
  • Each key in a key chain can be configured with the send-lifetime and accept-lifetime keywords to limit its usability to a particular timeframe. If multiple keys in the key chain are eligible to sign egress packets, the key with the highest key ID will be used. This is different from RIPv2 and EIGRP that select the key with the lowest key ID.
  • The key rollover procedure as used by classic OSPF is not used with key chains. To sign egress packets, OSPF will always use the valid key with the highest key ID in the key chain. To authenticate ingress packets, OSPF will try to use the key indicated in the received packet. There is no key migration pahse of sending multiple OSPF packets signed with different valid keys.
  • The extended cryptographic authentication is enabled per interface using the ip ospf authentication key-chain <name>. Configuring the extended cryptographic authentication using the area OSPF process level command is not supported.
  • Using the extended cryptographic authentication on virtual links is accomplished using the area <area-id> virtual-link <router-id> key-chain <name>.
  • MD5 authentication is one of the supported cryptographic algorithms in key chains. An OSPF router configured for MD5 authentication using the classic commands will be able to interoperate with a router configured using the new key chain style, provided the cryptographic algorithm for the keys in the key chain is MD5. When the new key chain style configuration is used, passwords configured with the ip ospf message-digest-key commands will be ignored.

key chain OSPF
 key 1
  cryptographic-algorithm hmac-sha-256
  key-string CC1E
!
interface GigabitEthernet0/0
 ip ospf authentication key-chain OSPF

R1# show ip ospf interface gi0/0
GigabitEthernet0/0 is up, line protocol is up
! Lines omitted for brevity.
Neighbor Count is 1, Adjacent neighbor count is 1
Adjacent with neighbor 10.0.12.2 (Backup Designated Router)
Suppress hello for 0 neighbor(s)
Cryptographic authentication enabled
Sending SA: Key 1, Algorithm HMAC-SHA-256 - key chain OSPF

  • OSPF authentication is a good place for tricky CCIE lab questions - ones that can be solved in a few minutes if you know all the intricacies.

Protecting OSPF Routers with TTL Security Check

  • Protection against DoS attacks on the control plane.
  • Receiving an OSPF packet outside a virtual link or sham link with its TTL less than 255 is a possible indication of a malicious activity. Such packets can be dropped.
  • Activated either on a per-interface basis using the ip ospf ttl-security interface level command, or globally for all interfaces in a particular OSPF process using the ttl-security all-interfaces command.
  • If activated globally, individual interfaces can be exempted using the ip ospf ttl-security disable interface level command.
  • When active, all OSPF packets sourced by that interface have their TTL set to 255, and only packets received with a TTL of 255 are accepted.
  • Both commands have an optional hops <1-254> argument that allows relaxing the TTL Security Check.
  • Setting the hop-count to a particular value makes the TTL Security Check accept OSPF packets with their TTL in the range from 255 down to 255 - hop-count.
  • If ttl-security all-interface hops 100, OSPF accepts all packets with their TTL in the range from 255 down to 155, inclusive.
  • Setting the hop-count to 254 effectively disables the TTL Security check.
  • If the hop-count is not specified, the value of 1 is automatically assumed.
  • The hop-count influences what OSPF packets will be accepted; it has no impact on the TTL of OSPF packets originated by the router, which will remain at 255.
  • The minimum hop-count of 1 might be surprising, considering that OSPF packets sourced by directly connected neighbors will have their TTL set to 255, and there is no reason to allow OSPF packets with a TTL of 254.
  • However, IOS-based Cisco routers exhibit a peculiar behavior in that they appear to decrement the TTL received OSPF packets before handling them over to the OSPF process.
  • Whenever an OSPF packet is received by a router, its TTL is first decremented by 1 (this decrement is skipped if the packet's TTL is equal to 1), and the packet is then passed to OSPF and to TTL Security Check, which will act based on this decremented TTL value.
  • Neither the ttl-security all-interface nor the ip ospf ttl-security have any impact on configured virtual or sham links.
  • The protection is activated with the area virtual-link ttl-security hops or the area sham-link ttl-security hops command. The hop-count argument is mandatory.
  • The hop-count value should be based on the longest possible intra-area path (in terms of number of routers) between the link endpoints.
  • Interfaces toward routers that do not support TTL Security Check shall be configured with the ip ospf ttl-security disable command.

Tuning OSPF Performance

Apart from Hello and Dead timers, OSPF can be significantly tuned in many other ways.

Tuning the SPF Scheduling with SPF Throttling

  • After a router receives an updated LSA, it needs to schedule its SPF to process the update.
  • It is ideal to wait some time for more updated LSAs to arrive, and process multiple updates in a single run.
  • By default, Cisco routers will schedule an SPF run 5 seconds after receiving an updated LSA, and if an updated LSA arrives after this SPF run, the subsequent delay will grow up to 10 seconds.
  • The scheduling of SPF runs can be controlled by a feature called SPF Throttling.
  • SPF Throttling defines a variable-length wait interval between two consecutive SPF runs.
  • Three parameters: spf-start, spf-hold, and spf-max-wait.
  • spf-start defines the initial wait interval before an SPF computation.
  • spf-hold defines a wait time between subsequent SPF runs, and its value doubles for each consecutive SPF run.
  • spf-max-wait is the maximum time between two SPF runs (doubling the spf-hold value is capped at spf-max-wait), and also defines a period during which the network must be stable for the wait interval to be set back to spf-start and the spf-hold to its preconfigured value.
  • If the network has been stable for the last spf-hold period but not for the entire spf-max-wait since the last SPF run, the wait interval returns to the spf-start value but the subsequent wait will still be set to twice the previous spf-hold value.
  • Example (spf-start = 10 sec, spf-hold = 15 sec, and spf-max-wait = 100 sec):
  1. An updated LSA arrives at time T. The router schedules the nearest SPF run at T+10.
  2. Another updated LSA arrives at time T+2. The router stores it in its LSDB and continues waiting.
  3. At T+10, the router runs the SPF and sets the next wait interval to 15 secs (spf-hold). If another updated LSA arrives within 15 seconds since this SPF runs, the nearest SPF will be run at T+25.
  4. One or more updated LSAs indeed arrive between T+10 and T+25. At T+25, the router runs the SPF and sets the next wait interval to twice the previous spf-hold value, that is, 30 sec. If another updated were to arrive within 30 seconds since this SPF run, the nearest SPF will be run at T+55. The network is considered stable if no topology change is detected within 100 seconds since this SPF run, that is, until T+125.
  5. During the next 30 seconds, no updated LSAs arrive. The wait interval is reset back to spf-start, that is, 10 seconds. The nework is not considered stable, though, because 100 seconds since the last SPF has not elapsed yet; therefore, spf-hold remains at 30 seconds.
  6. At T+80, an updated LSA arrives. The router schedules the nearest SPF run at T+90 and waits until this period expires.
  7. At T+90, the router runs SPF and sets the next wait interval to twice the previous spf-hold value, that is, 60 seconds. If another updated LSA arrives within 60 seconds since thi SPF run, the nearest SPF will be run at T+150. The network wil be considered if no topology change is detected within 100 seconds since this SPF run, that is, until T+190.
  8. During the next 60 secs, no updated LSAs arrive. The wait interval is reset back to spf-start, that is, 10 sec. The nework is not considered stable, though, because 100 seconds since the last SPF has not elapsed yet; therefore, spf-hold remains at 60 secs.
  9. No updated LSA arrives till T+190. As a result, the network is considered stable and the spf-hold is set to its initial value of 15 secs. Any topology change detected after this moment will be handled like the beginning of this scenario.
  • Configuration: timers throttle spf <spf-start> <spf-hold> <spf-max-wait>.
  • All arguments are indicated in milliseconds.


Tuning the LSA Origination with LSA Throttling

  • Control the rate at which a particular LSA might be reoriginated by its originating router.
  • The same idea as with SPF Throttling.
  • Three parameters: start-interval, hold-interval, and max-interval.
  • The hold-time will be reset to its configured value only if the LSA was not required to be updated for the entire max-interval since its last update.
  • By defaul, Cisco routers are configured to originate an updated LSA immediately and delay its subsequent origination by 5 seconds and not to progressively increase this interval.
  • start-interval = 0, hold-interval and max-interval = 5000 milliseconds.
  • Configuration: timers throttle lsa all <start-interval> <hold-interval> <max-interval>.
  • The values are again expressed in milliseconds.
  • A router can also be configured to ignore the same LSA upon arrival if it appears to arrive too often.
  • Configuration: timers lsa arrival <msec>.
  • If two or more same LSAs arrive less than <msec> apart, only the first one is accepted an the remaining LSAs are dropped.
  • The default setting is 1000 milliseconds.
  • Obviously, the value of the minimum LSA arrival interval should be smaller than the neighbor's initial hold interval in LSA throttling.
  • Otherwise, a neighbor would be allowed to send an updated LSA sooner than this router would be willing to accept it.


Incremental SPF

  • The SPF calculation can be augmented so that after a topology change only the affected part of the shortest-path tree is recalculated.
  • Activated using the simple ispf command (no additional arguments or parameters).

router ospf 1
 ispf


OSPFv2 Prefix Suppression

  • Maintaining transit link prefixes in LSDBs and routing table is, at least from the connectivity standpoint, largely useless.
  • Not advertising these prefixes can possibly save a significant amount of memory and CPU cycles without impairing the network connectivity.
  • Suppressing transit link prefixes is different for Type 1 and Type 2 LSAs.
  • Keep in mind that the goal of this mechanism is to suppress transit link prefixes, that is, the IP network addresses used on these links, not the transit links themselves.
  • Transit links describe the connections between routers and must continue to be advertised; otherwise, SPF would be unable to construct the shortest-path tree.
  • Type 1 LSA describes a router and its adjacencies (links) to its neighboring objects.
  • There are four possible link types that can be described by a Type 1 LSA:
  1. Point-to-point link to another router: This is a transit link pointing toward the other router's RID. It contains no addressing information and will not be influenced by the prefix suppression mechanism.
  2. Link to a transit network: This is a transit link pointing toward the transit network's DR IP address. While it refers to an IP address of the DR, it contains no further addressing information such as network mask, and will not be influenced by the prefix suppression mechanism.
  3. Stub network: This entry describes the IP prefix used either in a true stub network or a prefix used on a point-to-point link to another router. A router can suppress all stub network entries in a Type 1 LSA that correspond to IP prefixes used on point-to-point links.
  4. Virtual router: This is a virtual transit point-to-point link pointing toward a virtually adjacent router's RID. It contains no addressing information and will not be influed by the prefix suppression mechanism.
  • Therefore, in Type 1 LSAs, suppressing the transit link prefixes is accomplished by omitting stub network entries that contain prefixes on point-to-point interfaces to other routers.
  • The IP prefix of the network can be computed by bitwise ANDing the Link State ID of the LSA and the netmask carried in its payload. Neither of these two fields can be removed from the type 2 LSA without making its format incompatible.
  • To routers that implement RFC 6860, a Type 2 LSA advertising the netmask of 255.255.255.255 is a signal that the LSA contains no IP prefix information. Routers not implementing this RFC will install a host route toward that network’s DR. While the advantage of saving routing table space is lost on such routers, no interoperability issues will be introduced.
  • Configuration: prefix-suppression under the OSPF process.
  • This command will cause the router to suppress all prefixes on all its OSPF-enabled interfaces except loopbacks, secondary IP addresses, and prefixes on passive interfaces.
  • Also possible to active on a per-interface basis: ip ospf prefix-suppression.
  • If the prefix suppression is activated globally, the interface is exempted by using the ip ospf prefix-suppression disable command.

OSPF Graceful Restart (GR)

  • Allows a router to restart while its neighbors continue to forward packets to the restarting router as if it was up and running.
  • "routing through a failure" vs. "routing around a failure"
  • Cisco implemented its own version of graceful restart before RFC 3623 that is called Non-Stop Forwarding (NSF).
  • Cisco supports both NSF and GR; both area configured using nfs commands.
  • Two classes of devices involved in GR/NSF.
  • restart mode = the router undergoing the graceful restart.
  • helper mode = its directly connected neighbors.
  • The neighbors must ignore the lack of Hellos for an indicated grace period, continue to consider the router fully adjacent and report it as fully adjacent in their Type 1 and 2 LSAs, and continue to consider the router a DR for the segment if it was elected as the DR before the graceful restart.
  • Neighbors pretend that the router undergoing a graceful restart is up and running.
  • Only routers with specific hardware can perform the graceful restart themselves because of the obvious need to have forwarding hardware autonomous and independent from the main CPU.
  • NSF-aware device can act only as a helper device.
  • NSF-capable device can act as a helper device and also perform a graceful restart themselves.
  • The following conditions must be true:
  1. The router's hardware construction allows the control plane to restart while the line cards continue to forward packets based on the last version of their forwarding database.
  2. The router whose OSPF process is restarting must notify its neighbors that the restart is happening by sending a "grace LSA", which is a Type 9 opaque LSA with link-local flooding scope, containing the estimated duration of restart (the grace period), the reason of the restart, and on multiaccess networks, the IP address of the restarting router.
  3. The LSA database remains stable during the restart.
  4. All the neighbors support, and are configured for, graceful restart helper mode.
  5. The restart takes place within a specific grace period.
  6. During restart, the neighboring fully adjacent routers must operate in helper mode.
  • Both Cisco and IETF NSF awareness are enabled by default in Cisco IOS.
  • Disable: nsf [cisco | ietf] helper disable under the routing process.


OSPF Graceful Shutdown

  • Allows the OSPF process to update the neighbors that the router is going down.
  • Using a simple shutdown command under the OSPF process, the router will immediately:
  1. Drop all OSPF adjacencies.
  2. Flush all LSAs it has originated (flood them with the MaxAge 3600 seconds).
  3. Send out Hello packets to its neighbors with the DR/BDR fields set to 0.0.0.0 and an empty neighbor list, prompting the neighbors' adjacency states to fall back to the Init state.
  4. Stop sending and receiving OSPF packets.
  • Also on a per-interface basis: ip ospf shutdown.
  • In that case, the router will immediately:
  1. Drop all OSPF adjacencies over that particular interface.
  2. Flood updated LSAs that no longer include that particular interface and adjacencies through other interfaces if any.
  3. Send the neighbors' adjacencies to the Init state.
  4. Stop sending and receiving OSPF packets over that particular interface.
  • Revert back by removing the shutdown or ip ospf shutdown command.