No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Configuration Guide - IP Unicast Routing

CloudEngine 12800 and 12800E V200R002C50

This document describes the configurations of IP Unicast Routing, including IP Routing, Static Route, RIP, RIPng, OSPF, OSPFv3, IPv4 IS-IS, IPv6 IS-IS, BGP, Routing Policy, and PBR.

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
OSPF Fundamentals

OSPF Fundamentals

OSPF has the following functions:

  • Divides an Autonomous System (AS) into one or more logical areas.

  • Advertises routes by sending Link State Advertisements (LSAs).

  • Exchanges OSPF packets between devices in an OSPF area to synchronize routing information.

  • Encapsulates OSPF packets into IP packets and sends the packets in unicast or multicast mode.

Packet Types

Table 5-1 Packet types

Packet Type

Function

Hello packet

Hello packets are sent periodically to discover and maintain OSPF neighbor relationships.

Database Description (DD) packet

DD packets contain brief information about the local link-state database (LSDB) and thereby synchronize LSDBs on two devices.

Link State Request (LSR) packet

LSR packets are sent to request the required LSAs from neighbors.

LSR packets are sent only after DD packets are exchanged successfully.

Link State Update (LSU) packet

LSU packets are sent to transfer LSAs required by neighbors.

Link State Acknowledgement (LSAck) packet

LSAck packets are sent to acknowledge LSA receipts.

LSA Types

Table 5-2 LSA types

LSA Type

Function

Router-LSA (Type 1)

Describes the link status and link cost of a router. It is generated by every router and advertised in the area where the router resides.

Network-LSA (Type 2)

Describes the link status of all routers on the local network segment. Network-LSAs are generated by a designated router (DR) and advertised in the area where the DR resides.

Network-summary-LSA (Type 3)

Describes routes to a specific network segment in an area. Network-summary-LSAs are generated by an Area Border Router (ABR) and advertised in all areas except totally stub areas and Not-So-Stubby Areas (NSSAs).

ASBR-summary-LSA (Type 4)

Describes routes to an Autonomous System Boundary Router (ASBR). ASBR-summary-LSAs are generated by an ABR and advertised to all related areas except the area where the ASBR resides.

AS-external-LSA (Type 5)

Describes routes to a destination outside an AS. AS-external-LSAs are generated by an ASBR and advertised to all areas except stub areas and NSSAs.

NSSA-LSA (Type 7)

Describes routes to a destination outside an AS. NSSA-LSAs are generated by an ASBR and advertised in NSSAs only.

Opaque-LSA (Type 9/Type 10/Type 11)

Provides a universal mechanism for OSPF extension.

  • Type 9 LSAs are advertised only on the network segment where the interface originating Type 9 LSAs resides. Grace LSAs used to support GR are a type of Type 9 LSAs.
  • Type 10 LSAs are advertised inside an OSPF area. LSAs used to support TE are a type of Type 10 LSAs.
  • Type 11 LSAs are advertised within an AS. At present, there are no applications of Type 11 LSAs.

Router Types

Figure 5-1 lists common router types used in OSPF.

Figure 5-1 Router types

Table 5-3 Router types

Router Type

Description

Internal router

All interfaces on an internal router belong to the same OSPF area.

Area Border Router (ABR)

An ABR belongs to two or more areas, one of which must be the backbone area.

An ABR is used to connect the backbone area and non-backbone areas. It can be physically or logically connected to the backbone area.

Backbone router

At least one interface on a backbone router needs to belong to the backbone area.

Internal routers in Area 0 and all ABRs are backbone routers.

ASBR (AS Boundary Router)

An ASBR exchanges routing information with other ASs.

An ASBR does not necessarily reside on the border of an AS. It can be an internal router or an ABR. An OSPF device importing external routing information will become an ASBR.

Route Types

Inter-area and intra-area routes in an AS describe the internal network structure of the AS. AS external routes describe the routes to destinations outside an AS. OSPF classifies the imported AS external routes into Type 1 and Type 2.

Table 5-4 lists route types in descending order of priority.

Table 5-4 Route types

Route Type

Description

Intra-area route

Indicates routes within an area.

Inter-area route

Indicates routes between areas.

Type 1 external route

Type 1 external routes have high reliability.

Cost of a Type 1 external route = Cost of the route from a local router to an ASBR + Cost of the route from the ASBR to the destination of the Type 1 external route

Type 2 external route

Type 2 external routes have low reliability, and therefore OSPF considers that the cost of the route from an ASBR to the destination of a Type 2 external route is much greater than that of any internal route to the ASBR.

Cost of a Type 2 external route = Cost of the route from the ASBR to the destination of the Type 2 external route

Area Types

Table 5-5 Area types

Area Type

Function

Common area

By default, an OSPF area is a common area. Common areas include standard areas and backbone areas.

  • A standard area is the most common area and transmits intra-area routes, inter-area routes, and external routes.
  • A backbone area connects all the other OSPF areas. It is usually identified by Area 0.

Stub area

A stub area does not advertise AS external routes, but only intra-area and inter-area routes.

Compared with a non-stub area, routers in a stub area maintain fewer routing entries and transmit less routing information.

To ensure the reachability of AS external routes, the ABR in a stub area advertises Type 3 LSAs carrying default routes within the entire stub area. All AS external routes must be advertised by the ABR.

Totally stub area

A totally stub area does not advertise AS external routes or inter-area routes, but only intra-area routes.

Compared with a non-stub area, routers in a totally stub area maintain fewer routing entries and transmit less routing information.

To ensure the reachability of AS external routes and inter-area routes, the ABR in a totally stub area advertises Type 3 LSAs carrying default routes within the entire totally stub area. All AS external and inter-area routes must be advertised by the ABR.

NSSA

An NSSA can import AS external routes. An ASBR uses Type 7 LSAs to advertise the imported AS external routes to the entire NSSA. These Type 7 LSAs are translated into Type 5 LSAs on an ABR, and are then flooded in the entire OSPF AS.

An NSSA has the characteristics of the stub areas in the same AS.

An ABR in an NSSA advertises Type 7 LSAs carrying default routes within the entire NSSA. All inter-area routes must be advertised by the ABR.

Totally NSSA

A totally NSSA can import AS external routes. An ASBR uses Type 7 LSAs to advertise the imported AS external routes to the entire NSSA. These Type 7 LSAs are translated into Type 5 LSAs on an ABR, and are then flooded in the entire OSPF AS.

A totally NSSA has the characteristics of the totally stub areas in the same AS.

An ABR in a totally NSSA advertises Type 3 and Type 7 LSAs carrying default routes to the entire totally NSSA. All inter-area routes must be advertised by the ABR.

Network Types

Table 5-6 lists four OSPF network types that are classified based on link layer protocols.

Table 5-6 Network types

Network Type

Description

Broadcast

If a network uses Ethernet or Fiber Distributed Data Interface (FDDI) as the link layer protocol, OSPF defaults it to a broadcast network.

On a broadcast network:

  • Hello packets, LSU packets, and LSAck packets are usually transmitted in multicast mode. The address 224.0.0.5 is an IP multicast address reserved for an OSPF device; the address 224.0.0.6 is an IP multicast address reserved for an OSPF DR or backup designated router (BDR).

  • DD and LSR packets are transmitted in unicast mode.

Non-Broadcast Multi-Access (NBMA)

If a network uses frame relay (FR) or X.25 as the link layer protocol, OSPF defaults it to an NBMA network.

On an NBMA network, protocol packets such as Hello packets, DD packets, LSR packets, LSU packets, and LSAck packets are sent in unicast mode.

Point-to-Multipoint (P2MP)

OSPF does not default any network to a P2MP network regardless of its link layer protocol. Therefore, a P2MP network must be forcibly changed from another network type. It is a common practice to change a non-fully meshed NBMA network to a P2MP network.

On a P2MP network:

  • Hello packets are sent in multicast mode using the multicast address 224.0.0.5.

  • Other types of protocol packets, such as DD packets, LSR packets, LSU packets, and LSAck packets, are sent in unicast mode.

Point-to-point (P2P)

If a network uses PPP, HDLC, or LAPB as the link layer protocol, OSPF defaults it to a P2P network.

On a P2P network, protocol packets, such as Hello packets, DD packets, LSR packets, LSU packets, and LSAck packets, are sent in multicast mode using the multicast address 224.0.0.5.

Stub Area

Stub areas are specific areas where ABRs do not flood the received AS external routes. In stub areas, routers maintain fewer routing entries and transmit less routing information.

Configuring a stub area is optional. Not every area can be configured as a stub area. A stub area is usually a non-backbone area with only one ABR and is located on the AS border.

To ensure the reachability of the routes to destinations outside an AS, the ABR in a stub area generates a default route and advertises the route to non-ABRs in the same stub area.

When configuring a stub area, note that:

  • The backbone area cannot be configured as a stub area.

  • To configure an area as a stub area, you must configure stub area attributes on all routers in the area.

  • There should be no ASBR in a stub area, indicating that AS external routes cannot be transmitted in the stub area.

  • Virtual connections cannot cross a stub area.

NSSA

NSSAs are a special type of OSPF areas. There are many similarities between an NSSA and a stub area. Both of them do not advertise external routes received from other OSPF areas. The difference between them is that a stub area cannot import AS external routes, whereas an NSSA can import AS external routes and advertise them to the entire AS.

After an area is configured as an NSSA, an ABR in the NSSA generates a default route and advertises the route to other routers in the NSSA. This ensures the reachability of routes to destinations outside an AS.

When configuring an NSSA, note that:

  • The backbone area cannot be configured as an NSSA.
  • To configure an area as an NSSA, you must configure NSSA attributes on all routers in the area.
  • Virtual connections cannot cross an NSSA.

Neighbor State Machine

To exchange routing information on an OSPF network, neighbor routers must establish adjacencies. The differences between neighbor relationships and adjacencies are described as follows:
  • Neighbor relationship: After the local router starts, it sends a Hello packet on an OSPF interface to a remote router. After the remote router receives the packet, it checks whether the parameters carried in the packet are consistent with its own parameters. If the parameters carried in the packet are consistent with its own parameters, the local and remote routers establish a neighbor relationship.
  • Adjacency: After the local and remote routers establish a neighbor relationship, they exchange DD packets and LSAs to establish an adjacency.

OSPF has eight state machines: Down, Attempt, Init, 2-way, Exstart, Exchange, Loading, and Full.

  • Down: It is in the initial stage of setting up sessions between neighbors. The state machine is Down when a router fails to receive Hello packets from its neighbor before the dead interval expires.

  • Attempt: It occurs only on an NBMA network. The state machine is Attempt when a neighbor does not reply with Hello packets after the dead interval has expired. The local router, however, keeps sending Hello packets to the neighbor at every poll interval.

  • Init: The state machine is Init when a router receives Hello packets.

  • 2-way: The state machine is 2-way when the Hello packets received by a router contain its own router ID. The state machine will remain in the 2-way state if no neighbor relationship is established, and will become Exstart if a neighbor relationship is established.

  • Exstart: The state machine is Exstart when the two neighbors start to negotiate the master/slave status and determine the sequence numbers of DD packets.

  • Exchange: The state machine is Exchange when a router starts to exchange DD packets with its neighbor after the master/slave status negotiation is completed.

  • Loading: The state machine is Loading after a router has finished exchanging DD packets with its neighbor.

  • Full: The state machine is Full when the LSA retransmission list is empty.

OSPF Packet Authentication

OSPF supports packet authentication. Only the OSPF packets that have been authenticated can be received. If OSPF packets are not authenticated, a neighbor relationship cannot be established.

A router supports two authentication methods:

  • Area-based authentication

  • Interface-based authentication

When both area-based and interface-based authentication methods are configured, interface-based authentication takes effect.

OSPF Route Summarization

Route summarization means that an ABR in an area summarizes the routes with the same prefix into one route and advertises the summarized route to other areas.

Route summarization between areas reduces the amount of routing information to be transmitted, reducing the size of routing tables and improving device performance.

Route summarization can be carried out by an ABR or an ASBR:

  • Route summarization on an ABR:

    When an ABR in an area advertises routing information to other areas, it generates Type 3 LSAs by network segment. If this area contains consecutive network segments, you can run a command to summarize these network segments into one network segment. The ABR only sends one summarized LSA, and will not send the LSAs that belong to the summarized network segment specified in the command.

  • Route summarization on an ASBR:

    If the local device is an ASBR and route summarization is configured, the ASBR will summarize the imported Type 5 LSAs within the aggregated address range. After an NSSA is configured, the ASBR also summarizes the imported Type 7 LSAs within the aggregated address range.

    If the local device functions both as an ASBR and an ABR, the device summarizes the Type 5 LSAs that are translated from Type 7 LSAs.

OSPF Default Route

A default route has an all-0 destination address and an all-0 mask. If a router cannot find a route in its routing table for forwarding packets, it can forward packets using a default route. Due to hierarchical management of OSPF routes, the priority of a Type 3 default route is higher than that of a Type 5 or Type 7 default route.

OSPF default routes are usually used in the following cases:

  • An ABR advertises a default route through Type 3 Summary LSAs to instruct routers within an area to forward packets between areas.

  • An ASBR advertises a default route through Type 5 ASE LSAs or Type 7 NSSA LSAs to instruct routers in an AS to forward packets to other ASs.

OSPF default routes are advertised according to the following rules:
  • An OSPF router advertises an LSA that describes a default route only when an interface on the OSPF router is connected to a network outside the area.
  • If an OSPF router has advertised an LSA carrying information about a type of default route, the OSPF router does not learn this type of default routes advertised by other routers. This means that the OSPF router no longer calculates such routes received from other routers, but stores the LSAs describing such routes in its LSDB.
  • The route on which default external route advertisement depends cannot be a route in the local OSPF AS, namely, the one learned by the local OSPF process. This is because default external routes are used to guide packet forwarding outside an AS, whereas routes within an AS have next hops pointing to devices within the AS.

Table 5-7 lists rules for advertising default routes in different areas.

Table 5-7 Rules for advertising OSPF default routes in different areas

Area Type

Function

Common area

By default, devices in a common OSPF area do not automatically generate LSAs describing default routes, even if the common OSPF area has default routes.

When a default route on the network is generated by another routing process (not an OSPF process), the device that generates the default route must advertise the default route in the entire OSPF AS. (You need to run commands to configure an ASBR to generate a default route. After the configuration, the ASBR generates a Type 5 ASE LSA describing the default route and advertises the LSA to the entire OSPF AS.)

Stub area

A stub area does not allow AS external routes (Type 5 LSAs) to be transmitted within the area.

All routers within the stub area must learn AS external routes from the ABR. The ABR automatically generates a Summary LSA (Type 3 LSA) describing a default route and advertises it to the entire stub area. Then all routes to destinations outside an AS can be learned from the ABR.

Totally stub area

A totally stub area does not allow AS external routes (Type 5 LSAs) or inter-area routes (Type 3 LSAs) to be transmitted within the area.

All routers within the totally stub area must learn AS external routes and other areas' routes from the ABR. The ABR automatically generates a Summary LSA (Type 3 LSA) describing a default route and advertises it to the entire totally stub area. Then, all routes to destinations outside an AS and to destinations in other areas can be learned from the ABR.

NSSA

An NSSA allows its ASBRs to import a small number of AS external routes, but does not advertise ASE LSAs (Type 5 LSAs) received from other areas within the NSSA. This means that AS external routes can be learned only from ASBRs in the NSSA.

Devices in an NSSA do not automatically generate default routes.

Use either of the following methods as required:
  • If external routes to the outside of the AS need to be advertised through an ASBR in the NSSA and other external routes need to be through other areas, no operations are required. The ABR automatically generates a Type 7 LSA describing a default route and advertises this LSA in the entire NSSA.
  • If all external routes need to be advertised through an ASBR in the NSSA, you need to run commands to configure the ASBR to generate a Type 7 LSA describing a default route and advertise this LSA in the entire NSSA.

The difference between the two methods is as follows:

  • An ABR will generate a Type 7 LSA describing a default route regardless of whether the routing table contains a default route.
  • An ASBR will generate a Type 7 LSA describing a default route only when the routing table contains a default route.

A default route is flooded only in the local NSSA but not flooded in the entire OSPF AS. If routers in the local NSSA cannot find routes to the outside of the AS, the routers can forward packets to the outside of the AS through an ASBR. Packets of other OSPF areas, however, cannot be sent to the outside of the AS through this ASBR. Type 7 LSAs describing default routes will not be translated into Type 5 LSAs describing default routes and then flooded in the entire OSPF AS.

Totally NSSA

A totally NSSA does not allow AS external routes (Type 5 LSAs) or inter-area routes (Type 3 LSAs) to be transmitted within the area.

All routers within the totally NSSA must learn AS external routes from the ABR. The ABR automatically generates a Summary LSA describing a default route and advertises it to the entire totally NSSA. Then all external routes received from other areas and inter-area routes can be advertised within the totally NSSA.

OSPF Route Filtering

OSPF supports route filtering using routing policies. By default, OSPF does not filter routes.

Routing policies used by OSPF include route-policy, access-list, and prefix-list.

OSPF route filtering can be used for:

  • Importing routes

    OSPF can import routes learned by other routing protocols. You can configure routing policies to filter the imported routes so that OSPF can import only the routes that match specific conditions.

  • Advertising imported routes

    OSPF advertises the imported routes to its neighbors.

    You can configure filtering rules to filter the routes to be advertised. The filtering rules can be configured only on ASBRs.

    If OSPF imports a large number of external routes and advertises them to a device with a smaller routing table capacity, the device may restart unexpectedly. To address this problem, you can configure a limit on the number of LSAs that can be generated for imported external routes in an OSPF process.

  • Learning routes

    Filtering rules can be configured to allow OSPF to filter the received intra-area, inter-area, and AS external routes.

    After receiving routes, an OSPF device adds only the routes that match the filtering rules to the local routing table, but can still advertise all routes from the OSPF routing table.

  • Learning inter-area LSAs

    You can run a command to configure an ABR to filter the Summary LSAs entering the local area. This configuration takes effect only on ABRs because only ABRs can advertise Summary LSAs.

    Table 5-8 Differences between filtering for inter-area LSA learning and filtering for route learning

    Filtering for Inter-area LSA Learning

    Filtering for Route Learning

    Directly filters the LSAs entering the local area.

    Filters the routes that are calculated based on LSAs, but does not filter LSAs. This means that all incoming LSAs are learned, but only routes matching filtering conditions are added to the local routing table.

  • Advertising inter-area LSAs

    You can run commands to configure an ABR to filter outgoing Summary LSAs. This configuration takes effect only on ABRs.

OSPF Multi-Process

OSPF supports multi-process. Multiple OSPF processes can run on the same router, and they are independent from each other. Route exchanges between different OSPF processes are similar to route exchanges between different routing protocols.

Each interface on a router can belong to only one OSPF process.

A typical application of OSPF multi-process is that OSPF runs between PEs and CEs in a VPN, whereas OSPF is used as an IGP on the backbone of the VPN. Two OSPF processes on the same PE are independent from each other.

OSPF RFC 1583 Compatibility

RFC 1583 is an earlier version of OSPFv2.

When OSPF calculates external routes, routing loops may occur due to differences of route selection rules between RFC 2328 and RFC 1583. To prevent routing loops, both communication ends must use the same route selection rules.

  • If RFC 1583 compatibility is enabled, OSPF uses the route selection rules defined in RFC 1583.
  • If RFC 1583 compatibility is disabled, OSPF uses the route selection rules defined in RFC 2328.
OSPF calculates external routes based on Type 5 LSAs. If a router enabled with RFC 1583 compatibility receives a Type 5 LSA:
  • The router selects a route to the ASBR that originates the LSA or a route to the forwarding address (FA) described in the LSA.
  • The router selects external routes to the same destination.

By default, OSPF uses the route selection rules defined in RFC 1583.

OSPF Database Overflow

OSPF requires that devices in the same area have the same LSDB. As the number of routes increase continually, some devices cannot carry excess routing information due to limited system resources. This situation is called an OSPF database overflow.

You can configure stub areas or NSSAs to prevent resource exhaustion caused by increasing routing information. However, configuring stub areas or NSSAs cannot prevent an OSPF database overflow caused by a sharp increase in dynamic routes. To resolve this issue, you can set the maximum number of external routes supported by the LSDB. In this way, the size of the LSDB can be limited dynamically.

NOTE:
Each device in an OSPF AS must be configured with the same maximum number of external routes.

When the number of external routes in an LSDB reaches the maximum number, the device enters the overflow state and starts the overflow timer at the same time. The device automatically exits the overflow state after the overflow timer expires. Table 5-9 describes the operations performed by the device when it enters or exits the overflow state.

Table 5-9 Operations performed by a device when it enters or exits the overflow state

Phase

OSPF Processing Procedure

Staying at the overflow state

Deletes self-generated non-default external routes and stops advertising non-default external routes.

Discards newly received non-default external routes and does not reply with Link State Acknowledgment (LSAck) packets.

Checks whether the number of external routes is still greater than the configured maximum number when the overflow timer expires, and performs the following operation accordingly:

  • Restarts the timer if the number of external routes is still greater than the configured maximum number.
  • Exits the overflow state if the number of external routes is less than the configured maximum number.

Exiting the overflow state

Ends the overflow timer.

Advertises non-default external routes.

Accepts newly received non-default external routes and replies with LSAck packets.

Translation
Download
Updated: 2019-03-21

Document ID: EDOC1000166601

Views: 274563

Downloads: 161

Average rating:
This Document Applies to these Products

Related Version

Related Documents

Share
Previous Next