DJ4-6 Hierarchical routing

Table of contents

1. The basic concept of hierarchical routing

2. Intra-domain routing

1、RIP*

2、OSPF

3. Inter-domain routing selects BGP

1. AS interconnection

2. AS inter-domain routing task

3. Example: set forwarding table on 1d

4. Example: Choose among multiple ASs

5. BGP session and advertisement

6. Spread reachable information

7. Path attributes and BGP routing

8. BGP route selection

9. BGP message

10. BGP Routing Strategy: Customer VS Provider

11. Why different protocols are used for intra-AS routing and inter-AS routing


1. The basic concept of hierarchical routing

Divide the entire network into several areas, and realize the management autonomy of these areas.

Autonomous System AS: A collection of all routers in an area.

  • Routers within the same AS run the same routing protocol -- an intra-area routing protocol.
  • Routers in different ASs can run different intra-area routing protocols.

Gateway router: A router at the edge of an AS that is directly connected to one or more routers in other ASs.

  • Run the inter-domain routing protocol BGP to interact with other gateway routers
  • Runs the intra-domain routing protocol IGP, interacting with all other routers in the same AS

Internal Router: Connects only to hosts and routers in its own AS.

2. Intra-domain routing

This "domain" refers to an autonomous system.

Use the intra-domain routing protocol IGP, also known as the Interior Gateway Protocol.

Standard intra-domain routing protocols are:

  • RIP: Routing Information Protocol
  • OSPF: Open Shortest Path First
  • IGRP: Interior Gateway Routing Protocol (owned by Cisco)

1、RIP*

The full name is Routing Information Protocol

  • Use distance vector algorithm
  • Set all link weights to 1
  • Measure of distance: hop count

Since the weight is 1, an optimal route is the one with the least total hops. In addition, RIP also stipulates that the number of hops cannot exceed 15 times, and once exceeded, it is considered unreachable, so the forwarding of the packet is given up.

RIP notification

RIP notification: Every 30 seconds, distance vectors are exchanged between neighbors through response messages.

Each advertisement contains a list of up to 25 destination subnets within the AS.

 

RIP link failure and recovery

If no notification is received after 180 seconds, it is considered that the neighbor is dead or the link is broken:

  1. Routing through the failed neighbor fails
  2. Send new announcements to other neighbors
  3. If the forwarding table changes, the neighbor sends a new advertisement
  4. Link failure information is quickly propagated throughout the network

Use poison reverse to prevent ping-pong loops (infinite distance = 16 hops)

2、OSPF

Open Shortest Path First: open means open and public.

  • Use Link State Algorithm
  • Each node has a topology map
  • Routing calculation using Dijkstra's algorithm

OSPF announcements

Each router in the AS broadcasts OSPF advertisements and sets an entry for its neighbor routers to record the link characteristics and costs of each neighbor.

  • OSPF advertisements are distributed throughout the autonomous system -- flooding
  • OSPF advertisements are carried directly over IP, neither TCP nor UDP

Advantages of OSPF over RIP

  • Security: All OSPF notifications require authentication to prevent malicious intrusions
  • Allows multiple paths with the same cost, whereas in RIP there is only one path
  • For each link, there are multiple consumption scales for different service types TOS

For example, the satellite link cost is set to "low" for best-effort forwarding, and set to high for real-time applications

  • Integrated unicast and multicast support: Multicast MOSPF uses the same link database as OSPF
  • Using Hierarchical OSPF in Large Areas

Hierarchical OSPF

Divide an AS into two levels.

Two levels of hierarchy: Backbone Areas and Local Areas.

  • Each router sends OSPF advertisements only within its own area
  • Each node has a detailed area topology: it only knows the direction to the network in other areas, that is, the shortest path

Border Router: Connects to other autonomous systems. 

Backbone router: limited to running the OSPF routing protocol in the backbone area, it is not an area border router itself.

Area border router: Summarizes the path to the internal network of the local area and announces it to other area border routers.

The area border router belongs to both the local area and the backbone area. It only tells the backbone router and the border router: which internal routers can I reach, but not how.

3. Inter-domain routing selects BGP

Border Gateway Protocol

BGP provides a means for each AS to:

  1. Obtain subnet reachability information from adjacent ASs
  2. propagate this reachability information to all routers inside the AS
  3. Based on this reachability information and the AS policy, determine a "good" route to the subnet

That is to allow a subnet to advertise its existence "I am here" to other parts of the Internet.

1. AS interconnection

The forwarding table is configured according to the intra-AS and inter-AS routing algorithms.

  • The route selection item in the AS domain is used for the route selection of the destination end in the domain
  • The route selection items in the AS domain and AS domain are used for the route selection of the destination end outside the domain

2. AS inter-domain routing task

Assuming that the router in AS1 receives a packet whose destination is outside AS1, the router needs to forward the packet to the gateway router, but which gateway router should be selected?

AS1 needs to know:

  • Which destinations can be reached through AS2 and AS3
  • Notify the reachability information to all routers in AS1

This is the task of inter-domain routing.

3. Example: set forwarding table on 1d

4. Example: Choose among multiple ASs

Please don't care about how the above picture is drawn. The current situation is: AS1's two gateway routers are respectively connected to AS3 and AS2, and both AS3 and AS2 can reach subnet x.

  • Now assume that AS1 knows through the inter-domain routing protocol that subnet x is reachable from both AS3 and AS2
  • In order to configure the forwarding table, router 1d must decide through which gateway to forward the packet to destination subnet x
  • This is also the job of intra-domain routing protocols
  • Hot potato routing: send the packet to the closest of the two routers

1d is which gateway router is closest to itself according to the intra-domain routing protocol.

5. BGP session and advertisement

  • BGP peers exchange routing information over semi-permanent TCP connections -- BGP sessions.
  • A BGP session has nothing to do with a physical link, that is, it does not always correspond to a certain physical link.

Because the gateway routers of two adjacent ASs may be connected by multiple physical links.

In BGP, packets are routed to CIDRized prefixes, where each prefix represents a subnet or a collection of subnets. For example, the x in the forwarding entry (x, I ) is a prefix (eg 138.16.68/22).

For example: when AS2 advertises a prefix to AS1, it means that AS2 tells AS1: I can forward all packets whose destination address prefix is ​​equal to this prefix. And AS2 is able to summarize these prefixes in its advertisement, letting AS1 know all the subnets it can forward to.

6. Spread reachable information

Note: BGP only propagates reachability information, and does not calculate an optimal path.

7. Path attributes and BGP routing

When an AS advertises a prefix, it includes BGP attributes in the advertisement.

  • AS-PATH: Contains the AS that has been notified by the announcement, in the form of AS 67 AS 17 .
  • NEXT-HOP: Point out the specific inter-AS border router to reach the next AS.

When a gateway router receives a BGP advertisement, it uses the input policy to decide whether to accept or discard the advertisement. 

ASs are only logically adjacent, so there may be multiple links from the current AS to the next AS.

8. BGP route selection

A router may know of multiple routes to the same prefix and must choose one.

  • exclusion rule
  • The route with the shortest AS-PATH: the least number of ASs passed
  • The route closest to the NEXT-HOP router: Hot Potato Router
  • Local preference value attribute: the route with the highest preference value is chosen

Mobile, Telecom, China Unicom, choose your favorite~

9. BGP message

BGP message exchange uses TCP

  • OPEN: Establish a TCP connection to the other party and authenticate the sender
  • UPDATE: Advertise new paths or revoke old paths
  • KEEPALIVE: Keep the connection alive when there are no UPDATES, and respond to OPEN requests
  • NOTIFICATION: Report the error of the previous message, also used to close the connection

10. BGP Routing Strategy: Customer VS Provider

A, B, C are the suppliers' networks, X, W, Y are the suppliers' customers' networks.

X does not want B to pass the route BXC from X to C, so X will not advertise the route XC to C to B.

11. Why different protocols are used for intra-AS routing and inter-AS routing

① Strategy

  • Inter-AS: Administrators want to control how traffic generated within the AS is routed, and what traffic flows through its own network.
  • Within the AS: Single administrator, so no policies are required.

② scale

  • Hierarchical routing saves the size and space of the forwarding table, thereby reducing the traffic of routing updates.

③ performance

  • In AS: Focus on performance.
  • Inter-AS: Policies may be more important than performance.

Guess you like

Origin blog.csdn.net/m0_64140451/article/details/130596470