• Aucun résultat trouvé

Link State Routing

Dans le document Ivan Marsic (Page 70-74)

Datagram Fragmentation and Reassembly

1.4.2 Link State Routing

Problems related to this section: Problem 1.25 → ?

A key problem of routing algorithms is finding the shortest path between any two nodes, such that the sum of the costs of the links constituting the path is minimized. The two most popular algorithms used for this purpose are Dijkstra’s algorithm, used in link state routing, and Bellman-Ford algorithm, used in distance vector routing. The link state routing is presented first, followed by the distance vector routing; Section 1.4.5 describes the path vector routing, which is similar to the distance vector routing.

Application Headers of the fragment datagrams

IP Headers of the fragment datagrams

IP layer

Figure 1-39: IP datagram fragmentation at Router B of the network shown in Figure 1-38.

The fragments will be reassembled at the destination (Host D) in an exactly reverse process.

The key idea of the link state routing algorithm is to disseminate the information about local connectivity of each node to all other nodes in the network. Once all nodes gather the local information from all other nodes, each node knows the topology of the entire network and can independently compute the shortest path from itself to any other node in the network. This is done by iteratively identifying the closest node from the source node in the order of increasing path cost (Figure 1-40). At the kth step we have the set N′k(A) of k closest nodes to node A (“confirmed nodes”) as well as the shortest distance DX from each node X in N′k(A) to node A. Of all paths connecting some node not in N′k(A) (“unconfirmed nodes”) with node A, there is the shortest one that passes exclusively through nodes in N′k(A), because c(X, Y) ≥ 0. Therefore, the (k + 1)st closest node should be selected among those unconfirmed nodes that are neighbors of nodes in Nk(A). These nodes are marked as “tentative nodes” in Figure 1-40.

When a router (network node A) is initialized, it determines the link cost on each of its network interfaces. For example, in Figure 1-40 the cost of the link connecting node A to node B is labeled as “7” units, that is c(A, B) = 7. The node then advertises this set of link costs to all other nodes in the network (not just its neighboring nodes). Each node receives the link costs of all nodes in the network and, therefore, each node has a representation of the entire network. To advertise the link costs, the node creates a packet, known as Link-State Advertisement (LSA) or Link-State Packet (LSP), which contains the following information:

• The ID of the node that created the LSA

• A list of directly connected neighbors of this node, with the link cost to each one

• A sequence number for this packet

• A time-to-live for this packet

Tentat

Figure 1-40: Illustration of finding the shortest path using Dijkstra’s algorithm.

In the initial step, all nodes send their LSAs to all other nodes in the network using the mechanism called broadcasting. The shortest-path algorithm, which is described next, starts with the assumption that all nodes already exchanged their LSAs. The next step is to build a routing table, which is an intermediate step towards building a forwarding table. A routing table of a node (source) contains the paths and distances to all other nodes (destinations) in the network. A forwarding table of a node pairs different destination nodes with appropriate output interfaces of this node (recall Figure 1-34(b)).

The link state routing algorithm works as follows. Let N denote the set of all nodes in a network.

In Figure 1-41, N = {A, B, C, D}. The process can be summarized as an iterative execution of the following steps

1. Check the LSAs of all nodes in the confirmed set N′ to update the tentative set (recall that tentative nodes are unconfirmed nodes that are neighbors of confirmed nodes)

2. Move the tentative node with the shortest path to the confirmed set N′. 3. Go to Step 1.

The process stops when N′ = N. Here is an example:

Example 1.3 Link State Routing Algorithm

Consider the network in Figure 1-41(a) and assume that it uses the link state routing algorithm.

Starting from the initial state for all nodes, show how node A finds the shortest paths to all other nodes in the network. The figure below shows how node A’s link-state advertisement (LSA) is broadcast through the network.

Figure 1-41: Example network used for illustrating the routing algorithms.

Assume that all nodes broadcast their LSAs and each node already received LSAs from all other nodes in the network before it starts the shortest path computation, as shown in this figure:

7

Table 1-2 shows the process of building a routing table at node A of the network shown in Figure 1-41(a). Each node is represented with a triplet (Destination node ID, Path length, Next hop). The node x maintains two sets (recall Figure 1-40): Confirmed(x) set, denoted as N′, and Tentative(x) set. At the end, the routing table in node A contains these entries: {(A, 0, −), (C, 1, C), (B, 2, C), (D, 3, C)}.

Every other node in the network runs the same algorithm to compute its own routing table.

To account for failures of network elements, the nodes should repeat the whole procedure periodically. That is, each node periodically broadcasts its LSA to all other nodes and recomputes Table 1-2: Steps for building a routing table at node A in Figure 1-41. Each node is represented with a triplet (Destination node ID, Path length, Next hop).

Step Confirmed set N ′ Tentative set Comments

0 (A, 0, −) ∅ Initially, A is the only member of Confirmed(A), so examine A’s LSA.

1 (A, 0, −) (B, 10, B), (C, 1, C)

A’s LSA says that B and C are reachable at costs 10 and 1, respectively. Since these are currently the lowest known costs, put on Tentative(A) list.

2 (A, 0, −), (C, 1, C) (B, 10, B) Move lowest-cost member (C) of Tentative(A) into Confirmed set. Next, examine LSA of newly confirmed member C.

3 (A, 0, −), (C, 1, C) (B, 2, C),

(D, 8, C) Move lowest-cost member (B) of Tentative(A) into Confirmed, then look at B’s LSA.

5 (A, 0, −), (C, 1, C), (B, 2, C)

(D, 3, C) Because D is reachable via B at cost 1+1+1=3, replace the Tentative(A) entry for D.

6 (A, 0, −), (C, 1, C),

(B, 2, C), (D, 3, C) ∅ Move lowest-cost member (D) of Tentative(A) into Confirmed. END.

its routing table based on the received LSAs.

Dans le document Ivan Marsic (Page 70-74)