BSCS CN W22 Week12
BSCS CN W22 Week12
Week # 12
CS & IT Department
The University of
Lahore
Powerpoint Templates 1
ACKNOWLEDGMENTS
Mostly adopted from lecture slides by Behrouz
A. Forouzan.
http://www.inetdaemon.com/tutorials/internet/ip/routing/i
nterior_vs_exterior.shtml#sthash.dhDkYN0q.dpuf
Routing
Forwarding techniques
Concept of distance vector routing
2
Routing
The process of moving data from one network to
another is called routing
4
Delivery of a Packet
5
Delivery of a Packet: Direct delivery
In a direct delivery
Direct delivery occurs when the source and
destination of the packet are located on the
same physical network
6
Delivery of a packet: Indirect Delivery
In Indirect delivery
If the destination host is not on the same
network as the deliverer, the packet is delivered
indirectly
Note that
a delivery always involves one direct delivery
but zero or more indirect deliveries. 7
Direct and Indirect Delivery
8
Forwarding
Forwarding is the process of sending a packet on
its way while
Route method
Information about the complete route are
maintained
10
Forwarding Techniques
11
Forwarding Techniques
Network-specific versus host-specific
Host-specific has an entry for every destination
host connected to the same physical network
The destination host address is given in routing
table
Network-specific: A technique to reduce the routing
table and simplify the searching process
needs only one entry that defines the address of
the destination network itself
In other words, we treat all hosts connected to the
same network as one single entity
For example, if 1000 hosts are attached to the
same network, only one entry exists in the 12
Forwarding Techniques
Network-specific versus host-specific
13
Forwarding
Process
Assume that hosts and routers use classless addressing because
classful addressing can be treated as a special case of classless
addressing.
14
Forwarding Process
To solve the problem, we need to include the mask (/n) in the
table; we need to have an extra column that includes the mask
for the corresponding block.
A simple forwarding module for classless addressing is shown
15
Forwarding Process: Example
Make a routing table for router Rl, using the configuration in
the following figure
16
Forwarding Process: Example
Q: Show the forwarding process if a packet arrives at Rl
(Previous Figure) with the destination address 180.70.65.140.
Answer:
1: Applying the first mask (/26) does not match the
corresponding network address.
2: The second mask (/25) is applied to the destination address.
The result is 180.70.65.128, which matches the corresponding
network address.
The next-hop address (the destination address of the packet in
this case) and the interface number m0 are passed to ARP for
further processing.
17
Forwarding Process: Example
Q: Show the forwarding process if a packet arrives at Rl
(Previous Figure) with the destination address 201.4.22.35.
Answer:
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 (row 1).
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).
3. The third mask (/24) is applied to the destination address.
The result is 201.4.22.0, which matches the corresponding
network address.
The destination address of the packet and the
interface number m3 are passed to ARP.
18
Forwarding Process: Example
Q: Show the forwarding process if a packet arrives at Rl
(Previous Figure) with the destination address 18.24.32.78.
Answer:
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.
19
Autonomous Systems
Group of networks and routers under the authority of a
single administration is called an Autonomous System
Routing inside an autonomous system is called intra-domain
or Interior routing.
Routing between autonomous systems is called inter-domain
Exterior routing
20
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.
22
Popular Routing protocols
23
Interior Routing Protocols (IGP)
Routing inside an autonomous system
Categories
Distance vector protocols: router knows physically-connected
neighbors, link costs to neighbors, iterative process of
computation, exchange of partial information with neighbors
Routing Information Protocol (RIP)
24
Exterior routing Protocols (EGP)
Routing between autonomous systems
Examples of EGP
Border Gateway Protocol (BGP) [A Path vector
protocol]
25
Application of Exterior and Interior
Routing Protocols
Chapter 11 Interior Routing
Protocols
26
Metric of different Routing Protocols
Metric is the cost assigned for passing through
a network
The total metric of a particular route is equal to the
sum of the metrics of networks that comprise the route.
A router chooses the route with smallest metric.
27
Metric of different Routing Protocols
OSPF (Open Shortest Path First)
Administrator can assign cost for passing a
network based on type of service required.
OSPF allows each router to have more than one
routing table based on required type of service, such
as Maximum throughput or minimum delay.
28
Distance Vector Routing
Each node maintains a set of triples (Destination,
Cost, NextHop)
Node knows the cost to each neighbor
Directly connected neighbors exchange updates
periodically (on the order of several seconds -30s-)
whenever table changes (called triggered update)
Each update is a list of pairs:
(Destination, Cost)
Update local table if a better route is received
smaller cost
came from next-hop
Refresh existing routes; delete if timed out
29
Bellman-Ford Equation
Heart of distance vector routing
30
Bellman-Ford Equation
31
Distance Vector Corresponding to a Tree
33
Updating Distance Vectors
34
Distance Vector
Routing: Table
Initialization
35
Distance Vector Routing: Sharing
36
Distance Vector Routing: Updating
38
When to Share
Periodic Update
A node sends its routing table, normally 30 seconds,
in a periodic update
Triggered Update
A node sends its routing table to its neighbors any
time
when there is a change in its routing table
1. After updating its routing table, or
2. Detects some failure in the neighboring links
39
Count to Infinity
A problem with distance-vector routing is that
any decrease in cost (good news) propagates quickly,
but any increase in cost (bad news) will propagate
slowly.
42