TCS 222 Week_3_Routing_and_Packet_Forwarding
TCS 222 Week_3_Routing_and_Packet_Forwarding
3
Forwarding:
Network Specific vs Host Specific
4
Routing Table I
The routing table is at the heart of making routing decisions.
A routing table is analogous to a distribution map in package
delivery.
Whenever a node needs to send data to another node on a
network, it must first know where to send it.
If the node cannot directly connect to the destination node, it has
to send it via other nodes along a route to the destination node.
Each node needs to keep track of which way to deliver various
packages of data, and for this it uses a routing table.
A routing table is a database that keeps track of paths, like a
map, and uses these to determine which way to forward
traffic.
5
Routing Table II
Directly connected routes—
These routes come from the
active router interfaces.
Routers add a directly
connected route when an
interface is configured with an
IP address and is activated.
Remote routes—These are
remote networks connected to
other routers. Routes to these
networks can be either
statically configured or
dynamically learned through
dynamic routing protocols.
6
Routing Table Sources I
Entries in the routing table can be added as follows:
Local route interfaces—Added when an interface is configured
and active. This entry is only displayed in IOS 15 or newer for
IPv4 routes and all IOS releases for IPv6 routes.
Directly connected interfaces—Added to the routing table
when an interface is configured and active.
Static routes—Added when a route is manually configured and
the exit interface is active.
Dynamic routing protocol—Added when routing protocols
that dynamically learn about the network, such as EIGRP and
OSPF, are implemented and networks are identified.
7
Routing Table Sources II
The sources of the routing table entries are identified by a code. The
code identifies how the route was learned. For instance, common codes
include the following:
i. L—Identifies the address assigned to a router’s interface. This allows
the router to efficiently determine when it receives a packet for the
interface instead of being forwarded.
ii. C—Identifies a directly connected network.
iii. S—Identifies a static route created to reach a specific network.
iv. D—Identifies a dynamically learned network from another router
using EIGRP.
v. R—Identifies a dynamically learned network from another router
using RIP
vi. O—Identifies a dynamically learned network from another router
using the OSPF routing protocol.
8
Routing Table Entries
A host or router has a routing table with an entry for
each destination
A routing table entry refers to a reachable subnetwork
Each entry includes
Subnet prefix (and usually prefix length)
Metric to subnet from local router
Next hop router address + interface to that router
Routing Process
I. The router uses its routing table to determine the best path to
forward the packet.
II. When the router receives a packet, it examines its destination
IP address and searches for the best match with a network
address in the router's routing table.
III. The routing table also includes the interface to be used to
forward the packet.
IV. Once a match is found, the router encapsulates the IP
packet into the data link frame of the outgoing or exit interface,
and the packet is then forwarded toward its destination.
10
Load balancing in Routing
Individual routing protocols uses metrics to determine the
best route to the destination.
So what happens when two or more routes to the same
destination have identical metric values?
How will the router decide which path to use for packet
forwarding?
In this case, the router does not choose only one route.
Instead, the router "load balances" between these
equal cost paths.
The packets are forwarded using all equal-cost paths.
11
Administrative Distances (AD)
Routers learn about adjacent networks that are directly connected and about remote networks by using
static routes and dynamic routing protocols.
In fact, a router might learn of a route to the same network from more than one source.
The router must choose which route to install. So, how does a router determine which route to install in
the routing table when it has learned about the same network from more than one routing source? This is
the purpose of AD
AD defines the preference of a routing source. AD is an integer value from 0 to 255. The lower the value
the more preferred the route source. An AD of 0 is the most preferred. Only a directly connected network
has an AD of 0, which cannot be changed.
.
Anatomy of Remote Network Entry
A1 A2 A3 A4 A5 A6 A7
Legend Name Description
A1 Route Source Identifies how the route was learned.
A2 Destination Network Identifies the IPv4 address of the remote network.
A3 Administrative Identifies the trustworthiness of the route source.
Distance Lower values indicate preferred route source.
A4 Metric Identifies the value assigned to reach the remote network. Lower
values indicate preferred routes.
A5 Next Hop Identifies the IPv4 address of the next router to forward the packet
to.
A6 Route Timestamp Identifies how much time has passed since the route was learned.
A7 Outgoing Interface Identifies the exit interface to use to forward a packet toward the
13 final destination.
Locating and Maintaining
Routing Tables
Routing decisions can be made by a central routing process
Called centralized routing
Sometimes used in connection oriented public networks
16
Static vs. Dynamic Routing
Tanenbaum
5.2 Routing Algorithms
(4th edition) Multicast Routing
(covered in 400 Level)
Stallings
12. Routing in Switched Networks
(7th edition)