17-Routing Protocol Operation

Download

Table of Contents

Chapter 1 IP Routing Protocol Overview.. 1-1

1.1 Introduction to IP Route and Routing Table. 1-1

1.1.1 IP Route and Route Segment 1-1

1.1.2 Route Selection through the Routing Table. 1-2

1.2 Routing Management Policy. 1-4

1.2.1 Routing Protocols and Preferences. 1-4

1.2.2 Traffic Sharing and Route Backup. 1-5

1.2.3 Routes Shared Between Routing Protocols. 1-6

Chapter 2 Static Route Configuration. 2-1

2.1 Introduction to Static Route. 2-1

2.1.1 Static Route. 2-1

2.1.2 Default Route. 2-2

2.2 Static Route Configuration. 2-2

2.2.1 Configuration Prerequisites. 2-2

2.2.2 Configuring a Static Route. 2-2

2.3 Displaying the Routing Table. 2-3

2.4 Static Route Configuration Example. 2-4

2.5 Troubleshooting a Static Route. 2-5

Chapter 3 RIP Configuration. 3-1

3.1 RIP Overview. 3-1

3.1.1 Basic Concepts. 3-1

3.1.2 RIP Startup and Operation. 3-2

3.2 RIP Configuration Tasks. 3-3

3.3 Basic RIP Configuration. 3-4

3.3.1 Configuration Prerequisites. 3-4

3.3.2 Configuring Basic RIP Functions. 3-4

3.4 RIP Route Control 3-6

3.4.1 Configuration Prerequisites. 3-6

3.4.2 Configuring RIP Route Control 3-6

3.5 RIP Network Adjustment and Optimization. 3-10

3.5.1 Configuration Prerequisites. 3-10

3.5.2 Configuration Tasks. 3-10

3.6 Displaying and Maintaining RIP Configuration. 3-13

3.7 RIP Configuration Example. 3-13

3.8 Troubleshooting RIP Configuration. 3-15

Chapter 4 OSPF Configuration. 4-1

4.1 OSPF Overview. 4-1

4.1.1 Introduction to OSPF. 4-1

4.1.2 OSPF Route Calculation. 4-2

4.1.3 Basic OSPF Concepts. 4-2

4.1.4 OSPF Network Type. 4-4

4.1.5 OSPF Packets. 4-6

4.1.6 LSA Types. 4-7

4.1.7 OSPF Features. 4-8

4.2 OSPF Configuration Tasks. 4-8

4.3 Basic OSPF Configuration. 4-10

4.3.1 Configuration Prerequisites. 4-10

4.3.2 Basic OSPF Configuration. 4-10

4.4 OSPF Area Attribute Configuration. 4-11

4.4.1 Configuration Prerequisites. 4-12

4.4.2 Configuring OSPF Area Attributes. 4-12

4.5 OSPF Network Type Configuration. 4-13

4.5.1 Configuration Prerequisites. 4-13

4.5.2 Configuring the Network Type of an OSPF Interface. 4-13

4.5.3 Configuring an NBMA Neighbor 4-14

4.5.4 Configuring the DR Priority on an OSPF Interface. 4-14

4.6 OSPF Route Control 4-15

4.6.1 Configuration Prerequisites. 4-15

4.6.2 Configuring OSPF Route Summary. 4-15

4.6.3 Configuring OSPF to Filter Received Routes. 4-16

4.6.4 Configuring the Cost for Sending Packets on an OSPF Interface. 4-17

4.6.5 Configuring OSPF Route Priority. 4-17

4.6.6 Configuring the Maximum Number of OSPF Equal-Cost Routes. 4-18

4.6.7 Configuring OSPF to Import External Routes. 4-18

4.7 OSPF Network Adjustment and Optimization. 4-19

4.7.1 Configuration Prerequisites. 4-20

4.7.2 Configuring OSPF Timers. 4-20

4.7.3 Configuring the LSA transmission delay. 4-21

4.7.4 Configuring the SPF Calculation Interval 4-22

4.7.5 Disabling OSPF Packet Transmission on an Interface. 4-22

4.7.6 Configuring OSPF Authentication. 4-23

4.7.7 Configuring to Fill the MTU Field When an Interface Transmits DD Packets. 4-24

4.7.8 Enabling OSPF Logging. 4-24

4.7.9 Configuring OSPF Network Management System (NMS) 4-25

4.8 Displaying and Maintaining OSPF Configuration. 4-25

4.9 OSPF Configuration Example. 4-27

4.9.1 Configuring DR Election Based on OSPF Priority. 4-27

4.9.2 Configuring OSPF Virtual Link. 4-29

4.10 Troubleshooting OSPF Configuration. 4-30

Chapter 5 BGP Configuration. 5-1

5.1 BGP Overview. 5-1

5.1.1 BGP Message Type. 5-2

5.1.2 BGP Route Attributes. 5-5

5.1.3 BGP Routing Policy. 5-9

5.1.4 Problems in Large-Scale BGP Networks. 5-10

5.1.5 MP-BGP. 5-14

5.1.6 Protocol Standard. 5-15

5.2 BGP Configuration Tasks. 5-15

5.3 Basic BGP Configuration. 5-17

5.3.1 Configuration Prerequisites. 5-17

5.3.2 Configuring BGP Multicast Address Family. 5-17

5.3.3 Configuring Basic BGP Functions. 5-18

5.4 Configuring the Way to Advertise/Receive Routing Information. 5-19

5.4.1 Configuration Prerequisites. 5-19

5.4.2 Importing Routes. 5-20

5.4.3 Configuring BGP Route Aggregation. 5-21

5.4.4 Enabling Default Route Advertising. 5-21

5.4.5 Configuring the BGP Route Advertising Policy. 5-22

5.4.6 Configuring BGP Route Receiving Policy. 5-23

5.4.7 Disable BGP-IGP Route Synchronization. 5-24

5.4.8 Configuring BGP Route Dampening. 5-25

5.5 Configuring BGP Route Attributes. 5-26

5.5.1 Configuration Prerequisites. 5-26

5.5.2 Configuring BGP Route Attributes. 5-26

5.6 Adjusting and Optimizing a BGP Network. 5-29

5.6.1 Configuration Prerequisites. 5-30

5.6.2 Adjusting and Optimizing a BGP Network. 5-30

5.7 Configuring a Large-Scale BGP Network. 5-32

5.7.1 Configuration Prerequisites. 5-32

5.7.2 Configuring BGP Peer Group. 5-33

5.7.3 Configuring BGP Community. 5-34

5.7.4 Configuring BGP RR. 5-35

5.7.5 Configuring BGP Confederation. 5-35

5.8 Displaying and maintaining BGP. 5-36

5.8.1 Displaying BGP. 5-36

5.8.2 BGP Connection Reset 5-37

5.8.3 Clearing BGP Information. 5-38

5.9 Configuration Example. 5-38

5.9.1 Configuring BGP AS Confederation Attribute. 5-38

5.9.2 Configuring BGP RR. 5-40

5.9.3 Configuring BGP Routing. 5-42

5.10 BGP Error Configuration Example. 5-46

5.10.1 BGP Peer Connection Establishment Error 5-46

Chapter 6 IP Routing Policy Configuration. 6-1

6.1 IP Routing Policy Overview. 6-1

6.2 IP Routing Policy Configuration Tasks. 6-3

6.3 Route-Policy Configuration. 6-3

6.3.1 Configuration Prerequisites. 6-3

6.3.2 Defining a Route-Policy. 6-4

6.3.3 Defining if-match Clauses and apply Clauses. 6-4

6.4 ip-prefix Configuration. 6-6

6.4.1 Configuration Prerequisites. 6-7

6.4.2 Configuring an ip-prefix list 6-7

6.5 AS Path List Configuration. 6-8

6.6 Community List Configuration. 6-8

6.7 Displaying IP Routing Policy. 6-9

6.8 IP Routing Policy Configuration Example. 6-9

6.8.1 Configuring to Filter Received Routing Information. 6-9

6.9 Troubleshooting IP Routing Policy. 6-11

Chapter 7 Route Capacity Configuration. 7-1

7.1 Route Capacity Configuration Overview. 7-1

7.1.1 Introduction. 7-1

7.1.2 Route Capacity Limitation on the S5600 Series. 7-1

7.2 Route Capacity Configuration. 7-2

7.2.1 Configuring the Lower Limit and the Safety Value of the Switch Memory. 7-2

7.2.2 Enabling/Disabling Automatic Protocol Recovery. 7-2

7.3 Displaying Route Capacity Configuration. 7-3

 


Chapter 1  IP Routing Protocol Overview

 

&  Note:

When running a routing protocol, the Ethernet switch also functions as a router. The word “router” and the router icons covered in the following text represent routers in common sense and Ethernet switches running a routing protocol.

 

1.1  Introduction to IP Route and Routing Table

1.1.1  IP Route and Route Segment

Routers are used for route selection on the Internet. As a router receives a packet, it selects an appropriate route (through a network) according to the destination address of the packet and forwards the packet to the next router. The last router on the route is responsible for delivering the packet to the destination host.

A route segment is a common physical network interconnecting two nodes, which are deemed adjacent on the Internet. That is, two routers connected to the same physical network are adjacent to each other. The number of route segments between a router and any host on the local network is zero. In the following figure, the bold arrows represent route segments. A router is not concerned about which physical links compose a route segment. As shown in Figure 1-1, a packet sent from Host A to Host C travels through two routers over three route segments (along the broken line).

Figure 1-1 Route segment

The number of route segments on the path between a source and destination can be used to measure the "length" of the path. As the sizes of networks may differ greatly, the actual length of router segments may be different from each other. Therefore, you can put different weights to different route segments (so that, for example, a route segment can be considered as two segments if the weight is two). In this way, the length of the path can be measure by the number of weighted route segments.

If routers in networks are regarded as nodes in networks and route segments in the Internet are regarded as links in the Internet, routing in the Internet is similar to that in a conventional network.

Routing through the shortest route is not always the most ideal way. For example, routing across three high-speed LAN route segments may be much faster than routing across two low-speed WAN route segments.

1.1.2  Route Selection through the Routing Table

The key for a router to forward packets is the routing table. Each router maintains a routing table. Each entry in this table contains an IP address that represents a host/subnet and specifies which physical port on the router should be used to forward the packets destined for the host/subnet. And the router forwards those packets through this port to the next router or directly to the destination host if the host is on a network directly connected to the router.

Each entry in a routing table contains:

l           Destination address: It identifies the address of the destination host or network of an IP packet.

l           Network mask: Along with the destination address, it identifies the address of the network segment where the destination host or router resides. By performing “logical AND” between destination address and network mask, you can get the address of the network segment where the destination host or router resides. For example, if the destination address is 129.102.8.10 and the mask is 255.255.0.0, the address of the network segment where the destination host or router resides is 129.102.0.0. A mask consists of some consecutive 1s, represented either in dotted decimal notation or by the number of the consecutive 1s in the mask.

l           Output interface: It indicates through which interface IP packets should be forwarded to reach the destination.

l           Next hop address: It indicates the next router that IP packets will pass through to reach the destination.

l           Preference of the route added to the IP routing table: There may be multiple routes with different next hops to the same destination. These routes may be discovered by different routing protocols, or be manually configured static routes. The one with the highest preference (the smallest numerical value) will be selected as the current optimal route.

According to different destinations, routes fall into the following categories:

l           Subnet route: The destination is a subnet.

l           Host route: The destination is a host.

In addition, according to whether the network where the destination resides is directly connected to the router, routes fall into the following categories:

l           Direct route: The router is directly connected to the network where the destination resides.

l           Indirect route: The router is not directly connected to the network where the destination resides.

In order to avoid an oversized routing table, you can set a default route. All the packets for which the router fails to find a matching entry in the routing table will be forwarded through this default route.

Figure 1-2 shows a relatively complicated internet environment, the number in each network cloud indicate the network address and "R" represents a router. The router R8 is connected to three networks, and so it has three IP addresses and three physical ports. Its routing table is shown in Figure 1-2.

Figure 1-2 Routing table

The H3C S5600 Series Ethernet Switches (hereinafter referred to as S5600 series) support the configuration of static routes as well as a series of dynamic routing protocols such as RIP and OSPF. Moreover, the switches in operation can automatically obtain some direct routes according to interface status and user configuration.

1.2  Routing Management Policy

On an S5600 Ethernet switch, you can manually configure a static route to a certain destination, or configure a dynamic routing protocol to make the switch interact with other routers in the internetwork and find routes by routing algorithm. On an S5600 Ethernet switch, the static routes configured by the user and the dynamic routes discovered by routing protocols are managed uniformly. The static routes and the routes learned or configured by different routing protocols can also be shared among routing protocols.

1.2.1  Routing Protocols and Preferences

Different routing protocols may discover different routes to the same destination, but only one route among these routes and the static routes is optimal. In fact, at any given moment, only one routing protocol can determine the current route to a specific destination. Routing protocols (including static routing) are endowed with different preferences. When there are multiple routing information sources, the route discovered by the routing protocol with the highest preference will become the current route. Routing protocols and their default route preferences (the smaller the value is, the higher the preference is) are shown in Table 1-1.

In the table, “0” is used for directly connected routes, and “255” is used for routes from untrusted sources.

Table 1-1 Routing protocols and corresponding route preferences

Routing protocol or route type

Preference of the corresponding route

DIRECT

0

OSPF

10

STATIC

60

RIP

100

OSPF ASE

150

OSPF NSSA

150

UNKNOWN

255

BGP

256

 

Except for direct routing, you can manually configure the preferences of various dynamic routing protocols as required. In addition, you can configure different preferences for different static routes.

1.2.2  Traffic Sharing and Route Backup

I. Traffic sharing

The S5600 series support multi-route mode, allowing the configuration of multiple routes that reach the same destination and have the same preference. The same destination can be reached through multiple different routes, whose preferences are equal. When there is no route with a higher preference to the same destination, the multiple routes will be adopted. Then, the packets destined for the same destination will be forwarded through these routes in turn to implement traffic sharing.

II. Route backup

The S5600 series support route backup. When the primary route fails, the system automatically switches to a backup route to improve network reliability.

To achieve route backup, you can configure multiple routes to the same destination according to actual situation. One of the routes has the highest preference and is called primary route. The other routes have descending preferences and are called backup routes. Normally, the router sends data through the primary route. When line failure occurs on the primary route, the primary route will hide itself and the router will choose the one whose preference is the highest among the remaining backup routes as the path to send data. In this way, the switchover from the primary route to a backup route is implemented. When the primary route recovers, the router will restore it and re-select a route. And, as the primary route has the highest preference, the router will choose the primary route to send data. This process is the automatic switchover from the backup route to the primary route.

1.2.3  Routes Shared Between Routing Protocols

As the algorithms of various routing protocols are different, different routing protocols may discover different routes. This brings about the problem of how to share the discovered routes between routing protocols. The S5600 series can import (with the import-route command) the routes discovered by one routing protocol to another routing protocol. Each protocol has its own route redistribution mechanism. For details, see section 3.4.2  VII. "Configuring RIP to import routes” and section 4.6.7  "Configuring OSPF to Import External Routes".

 


Chapter 2  Static Route Configuration

 

&  Note:

When running a routing protocol, the Ethernet switch also functions as a router. The word “router” and the router icons covered in the following text represent routers in common sense and Ethernet switches running a routing protocol.

 

2.1  Introduction to Static Route

2.1.1  Static Route

Static routes are special routes. They are manually configured by the administrator. By configuring static routes, you can build an interconnecting network. The problem for such configuration is when a fault occurs on the network, a static route cannot change automatically to steer away from the fault point without the help of the administrator.

In a relatively simple network, you only need to configure static routes to make routers work normally. Proper configuration and usage of static routes can improve network performance and ensure sufficient bandwidth for important applications.

Static routes are divided into three types:

l           Reachable route: normal route. If a static route to a destination is of this type, the IP packets destined for this destination will be forwarded to the next hop. It is the most common type of static routes.

l           Unreachable route: route with the "reject" attribute. If a static route to a destination has the "reject" attribute, all the IP packets destined for this destination will be discarded, and the source hosts will be informed of the unreachability of the destination.

l           Blackhole route: route with “blackhole” attribute. If a static route destined for a destination has the “blackhole” attribute, the outgoing interface of this route is the Null 0 interface regardless of the next hop address, and all the IP packets addressed to this destination will be dropped without notifying the source hosts.

The attributes "reject" and "blackhole" are usually used to limit the range of the destinations this router can reach, and help troubleshoot the network.

2.1.2  Default Route

A default route is a special route. You can manually configure a default route by using a static route. Some dynamic routing protocols, such as OSPF, can automatically generate a default route.

Simply to say, a default route is a route used only when no matching entry is found in the routing table. That is, the default route is used only when there is no proper route. In a routing table, both the destination address and mask of the default route are 0.0.0.0. You can use the display ip routing-table command to view whether the default route has been set. If the destination address of a packet does not match any entry in the routing table, the router will select the default route for the packet; in this case, if there is no default route, the packet will be discarded, and an Internet control message protocol (ICMP) packet will be returned to inform the source host that the destination host or network is unreachable.

2.2  Static Route Configuration

2.2.1  Configuration Prerequisites

Before configuring a static route, perform the following tasks:

l           Configuring the physical parameters of the related interface

l           Configuring the link layer attributes of the related interface

l           Configuring an IP address for the related interface

2.2.2  Configuring a Static Route

Table 2-1 Configure a static route

Operation

Command

Description

Enter system view

system-view

Add a static route

ip route-static ip-address { mask | mask-length } { interface-type interface-number | next-hop } [ preference value ] [ reject | blackhole ] [ description text | detect-group group number ]*

Required

By default, the system can obtain the route to the subnet directly connected to the router.

Delete all static routes

delete static-routes all

Optional

This command deletes all static routes, including the default route.

 

&  Note:

l      If the destination IP address and the mask of a route are both 0.0.0.0, the route is the default route. Any packet for which the router fails to find a matching entry in the routing table will be forwarded through the default route.

l      Do not configure the next hop address of a static route to the address of an interface on the local switch.

l      Different preferences can be configured to implement flexible route management policy.

 

2.3  Displaying the Routing Table

After the above configuration, use the display command in any view to display and verify the static route configuration.

Table 2-2 Display the routing table

Operation

Command

Description

Display routing table summary

display ip routing-table

You can execute the display command in any view.

 Display routing table details

display ip routing-table verbose

Display the detailed information of a specific route

display ip routing-table ip-address [ mask ] [ longer-match ] [ verbose ]

Display the routes in a specified address range

display ip routing-table ip-address1 mask1 ip-address2 mask2 [ verbose ]

Display the routes discovered by a specified protocol

display ip routing-table protocol protocol [ inactive | verbose ]

Display the tree-structured routing table information

display ip routing-table radix

Display the statistics of the routing table

display ip routing-table statistics

 

2.4  Static Route Configuration Example

I. Network requirements

As shown in Figure 2-1, the masks of all the IP addresses in the figure are 255.255.255.0. It is required that all the hosts/Ethernet switches in the figure can interconnect with each other by configuring static routes.

II. Network diagram

Figure 2-1 Static route configuration

III. Configuration procedure

 

&  Note:

Before the following configuration, make sure that the Ethernet link layer works normally and the IP addresses of the VLAN interfaces have been configured correctly.

 

Perform the following steps on the switch:

# Configure static routes on SwitchA.

[SwitchA] ip route-static 1.1.3.0 255.255.255.0 1.1.2.2

[SwitchA] ip route-static 1.1.4.0 255.255.255.0 1.1.2.2

[SwitchA] ip route-static 1.1.5.0 255.255.255.0 1.1.2.2

# Configure static routes on SwitchB.

[SwitchB] ip route-static 1.1.2.0 255.255.255.0 1.1.3.1

[SwitchB] ip route-static 1.1.5.0 255.255.255.0 1.1.3.1

[SwitchB] ip route-static 1.1.1.0 255.255.255.0 1.1.3.1

# Configure static routes on SwitchC.

[SwitchC] ip route-static 1.1.1.0 255.255.255.0 1.1.2.1

[SwitchC] ip route-static 1.1.4.0 255.255.255.0 1.1.3.2

Perform the following steps on the host::

# Configure the default gateway of Host A to 1.1.5.1. Detailed configuration procedure is omitted.

# Configure the default gateway of Host B to 1.1.4.1. Detailed configuration procedure is omitted.

# Configure the default gateway of Host C to 1.1.1.1. Detailed configuration procedure is omitted.

Now, all the hosts/switches in the figure can interconnect with each other.

2.5  Troubleshooting a Static Route

Symptom: The switch is not configured with a dynamic routing protocol. Both the physical status and the link layer protocol status of an interface are UP, but IP packets cannot be normally forwarded on the interface.

Solution: Perform the following procedure.

Use the display ip routing-table protocol static command to view whether the corresponding static route is correctly configured.

Use the display ip routing-table command to view whether the static route is valid.

 


Chapter 3  RIP Configuration

 

&  Note:

When running a routing protocol, the Ethernet switch also functions as a router. The word “router” and the router icons covered in the following text represent routers in common sense and Ethernet switches running a routing protocol.

 

3.1  RIP Overview

Routing information protocol (RIP) is a simple interior gateway protocol (IGP) suitable for small-sized networks.

3.1.1  Basic Concepts

I. RIP

RIP is a distance-vector (D-V) algorithm-based protocol. It exchanges routing information through UDP packets.

RIP uses hop count (also called routing cost) to measure the distance to a destination address. In RIP, the hop count from a router to its directly connected network is 0, and that to a network which can be reached through another router is 1, and so on. To restrict the time to converge, RIP prescribes that the cost is an integer ranging from 0 and 15. The hop count equal to or exceeding 16 is defined as infinite; that is, the destination network or host is unreachable.

To improve performance and avoid routing loop, RIP supports split horizon. Besides, RIP can import routes from other routing protocols.

II. RIP routing database

Each router running RIP manages a routing database, which contains routing entries to all the reachable destinations in the internetwork. Each routing entry contains the following information:

l           Destination address: IP address of a host or network.

l           Next hop address: IP address of an interface on the adjacent router that IP packets should pass through to reach the destination.

l           Interface: Interface on this router, through which IP packets should be forwarded to reach the destination.

l           Cost: Cost for the router to reach the destination.

l           Routing time: Time elapsed after the routing entry is updated last time. This time is reset to 0 whenever the routing entry is updated.

III. RIP timers

As defined in RFC 1058, RIP is controlled by three timers: Period update, Timeout, and Garbage-collection.

l           Period update timer: This timer is used to periodically trigger routing information update so that the router can send all RIP routes to all the neighbors.

l           Timeout timer: If a RIP route is not updated (that is, the switch does not receive any routing update packet from the neighbor) within the timeout time of this timer, the route is considered unreachable.

l           Garbage-collection timer: An unreachable route will be completely deleted from the routing table if no update packet for the route is received from the neighbor before this timer times out.

3.1.2  RIP Startup and Operation

The whole process of RIP startup and operation is as follows:

l           Once RIP is enabled on a router, the router broadcasts or multicasts a request packet to its neighbors. Upon receiving the packet, each neighbor running RIP answers a response packet containing its routing table information.

l           When this router receives a response packet, it modifies its local routing table and sends an update triggering packet to the neighbor. Upon receiving the update triggering packet, the neighbor sends the packet to all its neighbors. After a series of update triggering processes, each router can get and keep the updated routing information.

l           By default, RIP sends its routing table to its neighbors every 30 seconds. Upon receiving the packets, the neighbors maintain their own routing tables and select optimal routes, and then advertise update information to their respective neighbors so as to make the updated routes known globally. Furthermore, RIP uses the timeout mechanism to handle the timeout routes to ensure real-time and valid routes.

RIP is commonly used by most IP router suppliers. It can be used in most campus networks and the regional networks that are simple and less disperse. For larger and more complicated networks, RIP is not recommended.

3.2  RIP Configuration Tasks

Table 3-1 RIP configuration tasks

Configuration task

Description

Related section

Configuring basic RIP functions

Enabling RIP

Required

Section 3.3.2  I. Enabling RIP globally and on the interface of a specified network segment

Setting the RIP operating status on an interface

Optional

Section 3.3.2  II. Setting the RIP operating status on an interface

Specifying a RIP version

Optional

Section 3.3.2  III. Specifying the RIP version on an interface

Configuring RIP route control

Setting the additional routing metrics of an interface

Optional

Section 3.4.2  I. Setting the additional routing metrics of an interface

Configuring RIP route summary

Optional

Section 3.4.2  II. Configuring RIP route summary

Disabling the receiving of host routes

Optional

Section 3.4.2  III. Disabling the receiving of host routes

Configuring RIP to filter incoming/outgoing routes

Optional

Section 3.4.2  IV. Configuring RIP to filter incoming/outgoing routes

Setting RIP preference