0% found this document useful (0 votes)
24 views

Unit 7 Notes

Routing is the process routers use to determine the best path to send packets between networks. Routers maintain routing tables which contain routes learned either manually through static routes, or dynamically through routing protocols. Routers use these tables to determine the next hop and outgoing interface to use when forwarding packets. Autonomous systems group routers under a common administration and use interior routing protocols within the AS and exterior protocols between ASes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Unit 7 Notes

Routing is the process routers use to determine the best path to send packets between networks. Routers maintain routing tables which contain routes learned either manually through static routes, or dynamically through routing protocols. Routers use these tables to determine the next hop and outgoing interface to use when forwarding packets. Autonomous systems group routers under a common administration and use interior routing protocols within the AS and exterior protocols between ASes.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Introduction to Routing

Terminology
What is Routing?
As we briefly described in Unit 1, routing is the process that routers employ in order to figure out how to
reach destination networks.
The routing information a router learns about these network address prefixes is placed in the router routing
table. The router will depend on this table to identify which interface/port to use when forwarding packets.
If the destination network is directly connected, the router already should know the interface/port
to use when forwarding packets.
If the destination network is not directly connected, then the router must learn the best route (we
will spend some time discussing what we mean by best in the next unit) to use when forwarding
packets.
The routing information can be learned and entered as entries into the router routing table in the following
ways:
Manually configured by the network administrator. These are called Static Routes. The
administrator must manually update the static route entry if a failure occurs and/or a network
topology change takes place that will require the update.
Dynamically learned by the router executing a dynamic routing protocol. Unlike static routes
once the network administrator enables the dynamic routing protocol, entries in the routing table
are automatically updated by the routing protocol if a failure occurs and/or a network topology
change takes place that will require the update.
Routing Function
Routers develop a hop-by-hop mechanism by keeping track of next-hop information that enables a data
packet to find its destination
1
through the network. A router that does not have a direct physical connection
to the destination checks its routing table and forwards the packet to another next hop router that is closer to
the destination. The process repeats itself until the data packet finds its way through the network to its final
destination. For a sequence of packets destined to the same destination address, the hop-by-hop process is
done independently for each packet. However at a given hop along the path to the destination and typically
after figuring out the next-hop to forward the first packet in a sequence, a router typically caches that
information. This information will be used to forward the subsequent packets. The purpose of the caching
mechanism or some other smart mechanism is to speed up the forwarding of the subsequent packets by
avoiding a routing table lookup for each of the subsequent packets.
The routing function is composed of two independent but tightly coupled components:
The first component consists of the routers exchanging special routing protocol packets to describe
their local topology to one another. Each routing protocol represents its routing information differently,
and uses different rules in distributing and processing this information. The output of the routing
protocol computation is the routing table.
The second component relies on the existence of the routing table in the router. Each packet that
arrives at the router will have the IP address in its destination address field compared against each
entry in the routing table, and then will be forwarded to the best next hop. As we will see very shortly
in this unit, the comparison is done using the longest prefix match. The entry in the routing table with
the longest match of its leading bits with the destination address will be used.

1
The destination is identified by the IP address in the destination address of the packet..
Routing Domain
A routing domain is a set of routers that execute the same routing protocol, e.g., OSPF, RIP, IS-IS,
A network that is executing a single routing protocol will have a single routing domain. Most enterprise
networks will be running a single routing protocol. When more than one routing protocol is available, the
network will have multiple routing domains. A routing protocol that is executed inside a network is called
an Interior Gateway Protocol (IGP). Therefore a network may be running multiple IGPs. Examples of IGPs
are : Routing Information Protocol (RIP), Open Shortest Path First (OSPF), OSI Intermediate System-to-
Intermediate System (IS-IS).
Interior Gateway routing Protocols (IGP) can be classified into two main categories that we will discuss in
the next unit.
Distance Vector Routing protocols
Link State Routing protocols.
In general, link state routing protocols, such as OSPF and IS-IS, provide better router scalability than
distance vector routing protocols, such as RIP. Link state routing protocols can be used in bigger and more
complex topologies than distance vector routing protocols can be used.
External Gateway routing Protocols (EGP) were introduced because IGPs do not scale in networks that go
beyond the enterprise level. IGPs were never designed for the purpose of global internetworking because
they do not have the necessary hooks to segregate enterprises into different administrations that are
technically and politically independent from one another. Even with the better scalability properties link
state IGPs have over distance vector IGPs, they cannot by themselves provide a global connectivity
solution that is required for Internet interdomain routing. In very large networks and in case of route
fluctuations caused by link instabilities, link state retransmissions and recomputations are too large for any
router to handle.
Autonomous Systems: Interior Vs. Exterior Gateway routing Protocol s
An Autonomous System (AS) is a set of routers that are having a single routing policy and are running by a
single technical administration. The AS could be a collection of IGPs working together to provide interior
routing. To the outside world, the whole AS is viewed as one single entity. Each AS has an identifying
number, which is a 16-bit number. Routing information between ASs is exchanged via an Exterior Gateway
routing Protocol (EGP). Border Gateway Protocol-4 (BGP4) is the universally used EGB.
Each individual Administrative Domain has its own policies regarding who it will accept traffic from
and/or send traffic to. Which route prefixes are announced to each peer, and which route prefixes may be
received from each peer represent such routing policies.
Therefore by segregating the world into administrations, we had in effect divided what might have been a
huge network and created smaller and more manageable networks. Each of these smaller networks, called
AS, has its own set of rules and policies that will uniquely distinguish it from other ASs. Each AS can
execute its own set of IGPs, independent of IGPs in other domains.
A Note about terminology:
It is often referred to Interior Gateway routing Protocols (IGPs) as intradomain routing protocol and to
Exterior Gateway routing Protocols (EGPs) as interdomain routing protocols. In this context, domain refers
to administrative domain. Do not get it confused with routing domain (which we defined above as a set of
routers that execute the same routing protocol). An administrative domain, typically an ISP, may execute
more than one IGP (i.e., more than one routing domain) within their administrative domain.
A Note about Autonomous System Numbers:
The Internet Assigned Numbers Authority (IANA) is the umbrella responsible for allocating Autonomous
System numbers. Specifically, the American Registry for Internet Numbers (ARIN) has the jurisdiction for
assigning numbers for the Americas, Caribbean, and Africa. Reseaux IP Europeennes-Network Information
Center (RIPE-NIC) administers the AS numbers for Europe, and the Asia-Pacific-NIC (AP-NIC)
administers the AS numbers for the Asia-Pacific region.
An organization may not need an AS number for its network as long as it is not planning to use BGP-4
protocol. As we will discuss in Unit 9, a network may need not use BGP if its routing policy is a subset of
the routing policy of the Internet Service Provider (ISP) if it is connected to.
An IP Routing Exampl e
Assume Host X (IP address: 172.21.10.249) has traffic to send to Host Y (IP address: 172.21.10.117).
As we discussed in Unit 3, Host X finds out that the Host Y is remote (not on the local LAN
172.21.10.240/29). Host X is configured with an active default gateway. The IP address of the configured
default gateway is 172.21.10.246, which is the interface of Router RA on the 172.21.10.240/29).
Host X checks its ARP cache table to find the MAC address that corresponds to the IP address of the
default gateway 172.21.10.246.
If found, Host X encapsulates the packets in Ethernet frames with MAC source address equals to
the MAC address of its NIC (Network Interface Card) on the 172.21.10.240/29 LAN) and MAC
destination address equals the MAC address it retrieved from the cache table.
If not found, Host X initiates the ARP procedure we described in Unit 3 to find the MAC address
that corresponds to the IP address of the default gateway 172.21.10.246. Host X then uses the
encapsulation procedure as described above.
An IP Routing Exampl e (cntd)
Now we assume the packet is at Router RA.
The routing table at Router RA is as shown on the opposite page. In this example, we assume that the cost
to send traffic on an Ethernet LAN is 10 and on an FDDI is 1. This explains the column denoted as
metric in the table.
Router RA examines the IP address in the destination address field of the packet, which is 172.21.10.117
(IP address of Host Y). RA has to determine which interface it has to use to send the packets to the next
hop on its way to the destination. RA compares the destination address in the packet 172.21.10.117 with
each entry in the routing table. This is shown on the opposite page.
Longest Match is: 172.21.10.96/27 with Next-Hop: 172.21.10.237
Router RA has to send the packet to 172.21.10.237.
RA has 2 interfaces: 172.21.10.246/29 and 172.21.10.238/28.
Which interface RA will use to send the packet to the next-hop
172.21.10.237?
RA compares the IP address of the next-hop 172.21.10.237 with the IP address of each of its interfaces:
1010 1100. 0001 0101. 0000 1010. 1110 1101 172.21.10.237
1010 1100. 0001 0101. 0000 1010. 1111 0110 172.21.10.246
1010 1100. 0001 0101. 0000 1010. 1110 1101 172.21.10.237
1010 1100. 0001 0101. 0000 1010. 1110 1110 172.21.10.238
Longest match is 172.21.10.238.
Then the packet will be sent to the next-hop using the 172.21.10.238/28
interface
Packet is now at RB
Longest match on destination 172.21.10.117
Repeat the same computation (i.e., bitwise logical AND operation with each entry in the routing table) at
RB.
Longest Match is: 172.21.10.96/27 with Next-Hop: 172.21.10.68
RB has 3 interfaces: 172.21.10.237/28, 172.21.10.66/27, and 172.21.10.193/29.
Which interface RB will use to send the packet to the next-hop
172.21.10.68?
RB compares the IP address of the next-hop 172.21.10.68 with the IP address of each of its interfaces:
Applying mask 255.255.255.240 of interface 172.21.10.237/28 to the address of the next-hop 172.21.10.68:
1010 1100. 0001 0101. 0000 1010. 0100 0100 172.21.10.68
1010 1100. 0001 0101. 0000 1010. 1110 1101 172.21.10.237
1010 1100. 0001 0101. 0000 1010. 0100 0100 172.21.10.68
1010 1100. 0001 0101. 0000 1010. 0100 0010 172.21.10.66
1010 1100. 0001 0101. 0000 1010. 0100 0100 172.21.10.68
1010 1100. 0001 0101. 0000 1010. 1100 0001 172.21.10.193
Longest match is 172.21.10.66.
Then the packet will be sent to the next-hop using the 172.21.10.66/27
interface
Packet is now at RD
Longest match on destination 172.21.10.117
Repeat the same computation (i.e., bitwise logical end operation with each entry in the routing table) at RC.
Longest Match is: 172.21.10.96/27 with Next-Hop: 172.21.10.125 which is a
connected interface
IP Routing Exampl e (cntd)
Route Aggregation
Router RB announces the aggregate of 192.168.48/24, 192.168.49/24, and 192.168.51/24 as the aggregate
prefix of 192.168.48/22. Note that the address prefix 192.168.50/24 is included in the aggregate prefix
192.168.48/22 announced by Router RB, although RB does not know about 192.168.50/24. This is not a
good practice because problems may develop, as we will explain shortly.
Router C announces the 192.168.52/22 prefix.
Router A announces the aggregate of 192.168.48/22, 192.168.52/22, and 192.168.56/21 as the aggregate
prefix of 192.168.48/20).
Route Aggregation may cause Routing Loops
Route aggregation, if not configured properly, may result in routing loops. We will illustrate this
phenomenon by the example in the Figure on the opposite page.
RB is aggregating 192.168.48.0/23 and 192.168.51.0/24, and is announcing an aggregate 192.168.48/22.
Note that RB has no route to 192.168.50.0/24, which is part of the aggregate 192.168.48/22.
Assuming RA is announcing to the ATM network a default route 0.0.0.0/0.
Any packet with a destination that does not match any entry in RB or RC routing table will follow the
default route to RA.
Now a packet with destination 192.168.50.37 arrives at RA.
RA is receiving the aggregate route announcement 192.168.48/22 from RC; therefore it sends the
packet to RB.
RB does not have a route to the network 192.168.50.0/24.
RB sends the packet back to RA, following the default route.
RA, having a route to 192.168.48/22, sends the packet back to RB.
Homework Exercise:
Will the packets loop forever? Is there any mechanism that will stop the packets from looping
forever? Describe.
Rule:
A network must not follow a less specific route for a destination that matches one of its own aggregated
routes. A routing loop occurs when traffic circles back and forth, never reaching its final destination.
Default routes 0.0.0.0/0 are a special case of this rule. A network should not follow the default to
destinations that are part of one of its aggregated announcements.
Practical Tip:
To avoid looping, we usually configure a static route pointing to the aggregate route, 192.168.48/22 in this
case, with destination a Null interface on the Router RB.
Any packet going to the Null interface is discarded. The Null interface acts as a Pit Bucket.
So a packet with destination within an address prefix in the aggregate that does not have a route, will be
routed using the static route to the Null interface.
Note the static route is more specific than the default route 0.0.0.0/0 and will cause a match for the packet
with destination 192.168.50.37.
The Longest Prefix Matching Routing Rule
Routing to all destinations is always done on the longest match basis. A router that has to decide between
two different length prefixes of the same network will always follow the longer mask.
We will illustrate this phenomenon by the example in the Figure on the opposite page.
Router RA has the following entries in its routing table:
destination: 192.168.52/22 next-hop: Router RC
destination: 192.168.50/24 next-hop: Router RC
destination: 192.168.48/22 next-hop: Router RC
When attempting to deliver the packets for destination 192.168.50.37, Router RA will match the
destination with the longest prefix and will deliver the traffic via the path corresponding to the longest
prefix.
bitwise logical AND operation applied to routing table entry (192.168.52/22) and
address in packet destination address field (192.168.50.37):
1100 0000. 1010 1000. 0011 0100. 0000 0000 192.168.52/22
1100 0000. 1010 1000. 0011 0010. 0000 0000 192.168.50.37
bitwise logical AND operation applied to routing table entry (192.168.50/24) and
address in packet destination address field (192.168.50.37):
1100 0000. 1010 1000. 0011 0010. 0000 0000 192.168.50/24
1100 0000. 1010 1000. 0011 0010. 0000 0000 192.168.50.37
bitwise logical AND operation applied to routing table entry (192.168.48/22) and
address in packet destination address field (192.168.50.37):
1100 0000. 1010 1000. 0011 0000. 0000 0000 192.168.48/22
1100 0000. 1010 1000. 0011 0010. 0000 0000 192.168.50.37
The longest match is with the network prefix 192.168.50/24 with next-hop Router RC.
Wrong Aggregate Announcement causes Black Holes
Announcements of route aggregates tend to be tricky. Care must be taken when configuration may result in
announcing an aggregate route. An example of this phenomenon is illustrated by the example in the Figure
on the opposite page.
Assume router RA announces 192.168.50/23, which is an aggregate of 192.168.50/24 and 192.168.51/24
by mistake.
In this case, Router RA will have the following entries in its routing table:
destination: 192.168.52/22 next-hop: Router RC
destination: 192.168.50/23 next-hop: Router RC
destination: 192.168.48/22 next-hop: Router RC
As before when attempting to deliver the packets for destination 192.168.51.15, Router RA will match the
destination with the longest prefix and will deliver the traffic via the path corresponding to the longest
prefix.
bitwise logical AND operation applied to routing table entry (192.168.52/22) and
address in packet destination address field (192.168.51.15):
1100 0000. 1010 1000. 0011 0100. 0000 0000 192.168.52/22
1100 0000. 1010 1000. 0011 0011. 0000 1111 192.168.51.15
bitwise logical AND operation applied to routing table entry (192.168.50/23) and
address in packet destination address field (192.168.51.15):
1100 0000. 1010 1000. 0011 0010. 0000 0000 192.168.50/23
1100 0000. 1010 1000. 0011 0011. 0000 1111 192.168.51.37
bitwise logical AND operation applied to routing table entry (192.168.48/22) and
address in packet destination address field (192.168.51.15):
1100 0000. 1010 1000. 0011 0000. 0000 0000 192.168.48/22
1100 0000. 1010 1000. 0011 0011. 0000 1111 192.168.50.37
The longest match is with the network prefix 192.168.50/24 with next-hop Router RC.
When the packets reach router RF, they are dropped.
Homework Exercise:
Describe what will happen if router RF is configured with a default route 0.0.0.0/0 pointing to router
RC as next-hop.
The Longest Prefix Match Routing Rule (cntd)
Assume in the Figure on the opposite page that it was decided to connect Router RE and RF by a serial
point-to-point link, so that the network 192.168.50.0/24 can be reached from Router RA either via Routers
RB and RE or via Router RC. Router RF is announcing the address prefix 192.168.50.0/24 to both Router
RC and Router RE. As before Router RC is announcing the address prefix 192.168.50.0/24 to Router RC.
On the other hand, the administrator of Router RB, under the wrong assumption that the address prefix
192.168.50.0/24 is part of the aggregate 192.168.48/22, did not consider looking at the configuration of
Router RB to determine if anything needs to change as the result of adding this new connection. Here
where things start going wrong, or at least the expected result that network 192.168.50.0/24 will be reached
via the two paths did not happen.
Router RA is using the longest prefix match routing rule. Since there is a more specific announcement for
the address prefix 192.168.50.0/24 from Router RC, the path via router RC will always win. It has a longer
prefix match with the packet destination (192.168.50.37) than 192.168.48.0/22 for the path via Router RB.
The traffic to network 192.168.50.0/24 from Router RA will not use the path via Routers RB and RE unless
the announcement of the network prefix 192.168.50.0/24 to Router RA from Router RB stops. When
stopped, the entry 192.168.50.0/24 will be removed from Router RA routing table. The announcement will
stop either due to failure or due to router configuration changes by the network administrator. When
removed, Router RA will use the 192.168.48.0/22 entry in its routing table.
The longest Prefix Match Routing Rule
Announcement of a Less Specific Prefix from a Network Own Aggregate
In the Figure on the opposite page, Router RB is now announcing the address prefix 192.168.50/24 which
is a less-specific prefix that the aggregate prefix of 192.168.48/22 it is announcing. As a result, Router RA
will be now receiving identical routing updates with masks of equal lengths coming from Router RB and
Router RC. For traffic destined to 192.168.50.0/24, Router RA will pick one path or the other or both
depending on the load balancing techniques offered by the specific routing implementation. This topic is
beyond the scope of this presentation.

You might also like