Routing Algorithms 1663584102198
Routing Algorithms 1663584102198
Network Layer:
Delivery, Forwarding,
and Routing
22.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
22-1 DELIVERY
22.2
Figure 22.1 Direct and indirect delivery
22.3
22-2 FORWARDING
22.4
Figure 22.2 Route method versus next-hop method
22.5
Figure 22.3 Host-specific versus network-specific method
22.6
Figure 22.4 Default method
22.7
Figure 22.5 Simplified forwarding module in classless address
22.8
Note
22.9
Example 22.1
Solution
Table 22.1 shows the corresponding table.
22.10
Figure 22.6 Configuration for Example 22.1
22.11
Table 22.1 Routing table for router R1 in Figure 22.6
22.12
Example 22.2
Solution
The router performs the following steps:
1. The first mask (/26) is applied to the destination
address. The result is 201.4.22.0, which does not
match the corresponding network address.
2. The second mask (/25) is applied to the destination
address. The result is 201.4.22.0, which does not
match the corresponding network address (row 2).
22.14
Example 22.3 (continued)
22.15
Example 22.4
Solution
This time all masks are applied, one by one, to the
destination address, but no matching network address is
found. When it reaches the end of the table, the module
gives the next-hop address 180.70.65.200 and interface
number m2 to ARP. This is probably an outgoing
package that needs to be sent, via the default router, to
someplace else in the Internet.
22.16
Figure 22.7 Address aggregation
22.17
Figure 22.8 Longest mask matching
22.18
Example 22.5
The second local ISP has divided its block into 4 blocks
and has assigned the addresses to four large
organizations.
The third local ISP has divided its block into 16 blocks
and assigned each block to a small organization. Each
small organization has 256 addresses, and the mask is
/24.
There is a sense of hierarchy in this configuration. All
routers in the Internet send a packet with destination
address 120.14.64.0 to 120.14.127.255 to the regional
ISP.
22.20
Figure 22.9 Hierarchical routing with ISPs
22.21
Figure 22.10 Common fields in a routing table
22.22
Example 22.6
22.23
Example 22.6 (continued)
22.25
Figure 22.11 Configuration of the server for Example 22.6
22.26
22-3 UNICAST ROUTING PROTOCOLS
A routing table can be either static or dynamic. A
static table is one with manual entries. A dynamic
table is one that is updated automatically when there is
a change somewhere in the Internet. A routing
protocol is a combination of rules and procedures that
lets routers in the Internet inform each other of
changes.
Topics discussed in this section:
Optimization
Intra- and Interdomain Routing
Distance Vector Routing and RIP
Link State Routing and OSPF
Path Vector Routing and BGP
22.27
-1 INTRODUCTION
Unicast routing in the Internet, with a large number of routers and a huge
.28
.1.1 General Idea
In unicast routing, a packet is routed, hop by hop, from its source to its destination by
the help of forwarding tables. The source host needs no forwarding table because it
delivers its packet to the default router in its local network. The destination host needs
no forwarding table either because it receives the packet from its default router in its
local network. This means that only the routers that glue together the networks in the
.29
.1.2 Least-Cost Routing
When an internet is modeled as a weighted graph, one of the ways to interpret the best
route from the source router to the destination router is to find the least cost between
the two. In other words, the source router chooses a route to the destination router in
such a way that the total cost for the route is the least cost among all possible routes.
.30
Figure .1: An internet and its graphical representation
.31
Figure .2: Least-cost trees for nodes in the internet of Figure 4.56
.32
Figure 22.12 Autonomous systems
22.33
-2 ROUTING ALGORITHMS
Several routing algorithms have been designed in the past. The differences between
these methods are in the way they interpret the least cost and the way they create the
.34
Figure 22.13 Popular routing protocols
22.35
.2.1 Distance-Vector Routing
.37
•A least-cost tree is a combination of least-cost paths from
the root of the tree to all destinations.
•These paths are graphically glued together to form the tree.
•Distance-vector routing unglues these paths and creates a
distance vector, a one-dimensional array to represent the
tree.
•Note that the name of the distance vector defines the root,
the indexes define the destinations, and the value of each cell
defines the least cost from the root to the destination.
•A distance vector does not give the path to the destinations
as the least-cost tree does; it gives only the least costs to the
destinations.
•Each node in an internet, when it is booted, creates a very
rudimentary distance vector with the minimum information
the node can obtain from its neighborhood.
.38
•The node sends some greeting messages out of its
interfaces and discovers the identity of the immediate
neighbors and the distance between itself and each
neighbor
•makes a simple distance vector by inserting the
discovered distances in the corresponding cells and
leaves the value of other cells as infinity.
•For example, node A thinks that it is not connected to node G because the corresponding
cell shows the least cost of infinity.
•To improve these vectors, the nodes in the internet need to help each other by exchanging
information.
•After each node has created its vector, it sends a copy of the vector to all its immediate
neighbors.
.39
Figure .4: The distance vector corresponding to a tree
.40
Figure .5: The first distance vector for an internet
.41
Figure .6: Updating distance vectors
.42
Figure 22.14 Distance vector routing tables
22.43
Figure 22.15 Initialization of tables in distance vector routing
22.44
Note
22.45
Figure 22.16 Updating in distance vector routing
22.46
Table .1: Distance-Vector Routing Algorithm for A Node
.47
Figure .7: Two-node instability
.48
Figure 22.17 Two-node instability
22.49
Figure 22.18 Three-node instability
22.50
.3.2 Routing Information Protocol
The Routing Information Protocol (RIP) is one of the most widely used intradomain
RIP was started as part of the Xerox Network System (XNS), but it was the Berkeley
Software Distribution (BSD) version of UNIX that helped make the use of RIP
widespread.
.51
22.52
Figure .14: Internet structure
.53
Figure .15: Hop counts in RIP
1 hop (N4)
.54
Figure .16: Forwarding tables
.55
Figure .17: RIP message format
.56
Example .1
Figure .18 shows a more realistic example of the operation of RIP in an autonomous system. First, the
figure shows all forwarding tables after all routers have been booted. Then we show changes in some
tables when some update messages have been exchanged. Finally, we show the stabilized forwarding
.57
Figure .18: Example of an autonomous system using RIP (Part I)
.58
Figure .18: Example of an autonomous system using RIP (Part II)
.59
Figure .18: Example of an autonomous system using RIP (Part III)
.60
Figure 22.19 Example of a domain using RIP
22.61
Figure 22.20 Concept of link state routing
22.62
Figure 22.21 Link state knowledge
22.63
Figure 22.22 Dijkstra algorithm
22.64
Figure 22.23 Example of formation of shortest path tree
22.65
22.66
Table 22.2 Routing table for node A
22.67
Figure .8: Example of a link-state database
.68
Figure .9: LSPs created and sent out by each node to build LSDB
.69
Table .2: Dijkstra’s Algorithm
.70
.3.3 Open Shortest Path First
Open Shortest Path First (OSPF) is also an intradomain routing protocol like RIP, but
it is based on the link-state routing protocol we described earlier in the chapter. OSPF
.71
Figure .19: Metric in OSPF
Total cost: 4
Total cost: 7
Total cost: 12
.72
Figure .: Forwarding tables in OSPF
.73
Figure .21: Areas in an autonomous system
.74
Figure .22: Five different LSPs (Part I)
.75
Figure .22: Five different LSPs (Part II)
.76
Figure .23: OSPF message formats (Part I)
Attention
.77
Figure .23: OSPF message formats (Part II)
Attention
.78
Figure 22.24 Areas in an autonomous system
22.79
Figure 22.25 Types of links
22.80
Figure 22.26 Point-to-point link
22.81
Figure 22.27 Transient link
22.82
Figure 22.28 Stub link
22.83
Figure 22.29 Example of an AS and its graphical representation in OSPF
22.84
Figure 22.30 Initial routing tables in path vector routing
22.85
Figure 22.31 Stabilized tables for three autonomous systems
22.86
Figure 22.32 Internal and external BGP sessions
22.87
22-4 MULTICAST ROUTING PROTOCOLS
22.88
Figure 22.33 Unicasting
22.89
Note
22.90
Figure 22.34 Multicasting
22.91
Note
22.92
Figure 22.35 Multicasting versus multiple unicasting
22.93
Note
22.94
Note
22.95
Figure 22.36 Shortest path tree in unicast routing
22.96
Note
22.97
Figure 22.37 Source-based tree approach
22.98
Note
22.99
Figure 22.38 Group-shared tree approach
22.100
Note
22.101
Figure 22.39 Taxonomy of common multicast protocols
22.102
Note
22.103
Note
22.104
Note
22.105
Figure 22.40 Reverse path forwarding (RPF)
22.106
Figure 22.41 Problem with RPF
22.107
Figure 22.42 RPF Versus RPB
22.108
Note
22.109
Figure 22.43 RPF, RPB, and RPM
22.110
Note
22.111
Figure 22.44 Group-shared tree with rendezvous router
22.112
Figure 22.45 Sending a multicast packet to the rendezvous router
22.113
Note
22.114
Note
22.115
Note
22.116
Note
22.117
Note
22.118
Figure 22.46 Logical tunneling
22.119
Figure 22.47 MBONE
22.120