0% found this document useful (0 votes)
20 views42 pages

BSCS CN W22 Week12

The document covers key concepts in computer networks, focusing on routing, forwarding techniques, and distance vector routing. It explains the processes of direct and indirect delivery of packets, the difference between routing and forwarding, and various routing protocols, including interior and exterior routing protocols. Additionally, it discusses the challenges of distance vector routing, such as the count to infinity problem and solutions like split horizon.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views42 pages

BSCS CN W22 Week12

The document covers key concepts in computer networks, focusing on routing, forwarding techniques, and distance vector routing. It explains the processes of direct and indirect delivery of packets, the difference between routing and forwarding, and various routing protocols, including interior and exterior routing protocols. Additionally, it discusses the challenges of distance vector routing, such as the count to infinity problem and solutions like split horizon.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Computer Networks

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

Week -12 Course Plan

 Routing
 Forwarding techniques
 Concept of distance vector routing

2
Routing
 The process of moving data from one network to
another is called routing

 Routing is unnecessary unless there are multiple


networks on different address ranges

 If there are different combinations of IP addresses


and subnet masks, So there are separate networks

 No need to run a routing protocol unless there are


multiple
networks
 and even then, manual static routes are easier
for small networks).
33
Routing
 Once we get beyond three routers, it's time to
start thinking about dynamic routing protocols.

 If we are connecting our networks to the Internet,


 we need to think about running more than
one kind of routing protocol

4
Delivery of a Packet

 The network layer supervises the delivery of


a packet

 The delivery of a packet to its final destination is


accomplished by using two different methods
of delivery
 Direct delivery
 Indirect delivery

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

 The sender can easily determine if the delivery


is direct
 It can extract the network address of
the destination (using the mask) and
 compare this address with the addresses of
the networks to which it is connected
 If a match is found, the delivery is direct

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

 The packet goes from router to router until


 it reaches the one connected to the
same physical network as its final
destination.

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

Routing is the process of deciding in which direction


to send traffic

Forwarding is the process of getting through


single interchange while

Routing is the process of planning trip from source


to destination

For routing, we need routing algorithm 9


Forwarding Techniques
Next-hop Vs route method

Next-Hop: A technique to reduce the contents of a


routing table
 The routing table holds only the address of the next
hop instead of information about the complete
route

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.

 In classless addressing, the routing table needs to have one


row
of information for each block involved.

Problem: The table needs to be searched based on the


network address (first address in the block)
 Unfortunately, the destination address in the packet gives no
clue about the network address.

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.

 This is probably an outgoing package that needs to be sent, via


the
default router, to someplace else in the Internet

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.

 A routing protocol is a combination of rules and


procedures that lets routers in the Internet inform
each other of changes

 Routing protocols are needed to create the


routing tables dynamically
21
Unicast Routing
 In unicast routing, the message is sent from one source
Protocols
to one destination (routed hop-by-hop).
 When a router receives a packet it forwards the packet
through only one of its ports (the one belonging to the
optimum path) as defined in routing table
 The packet may be discarded if the route couldn’t
be constructed

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)

Link State Protocols: all routers have complete topology, link


cost information
 Open Shortest Path First (OSPF)

24
Exterior routing Protocols (EGP)
 Routing between autonomous systems

 To get from place to place outside ones network(s), i.e. on


the Internet, one must use an Exterior Gateway Protocol.

 EGPs handle routing outside an Autonomous System and


get one from ones network, through ones Internet provider's
network and onto any other network.

 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.

RIP (Routing Information Protocol): the cost


of passing each network is one hop count
 If a packet passes through 10 networks to reach
the destination, the total cost is 10 hop counts.

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.

BGP (Border Gateway Protocol)


 Criterion is the policy, which is set by the administrator.

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

 Used to find the least cost (shortest distance) between a


source node, x, and a destination node, y, through some
intermediary nodes (a, b, c, . . .)
 when the costs between the source and the intermediary
nodes and the least costs between the intermediary nodes and
the destination are given.
Dxy = min{(cxa + Day), (cxb + Dby), (cxc + Dcy), …}

 In distance-vector routing, normally update an existing least


cost with a least cost through an intermediary node, such as z,
 if the latter is shorter.
 So the equation becomes simpler as Dxy = min{Dxy, (cxz + Dzy)}

30
Bellman-Ford Equation

31
Distance Vector Corresponding to a Tree

Do these distance vectors represent least-cost paths?

They do, considering the limited information a node has.

When we know only one distance between two nodes, it is the


cost.
least 32
Initial Distance Vector for an internet
in the Figure

33
Updating Distance Vectors

34
Distance Vector
Routing: Table
Initialization

35
Distance Vector Routing: Sharing

36
Distance Vector Routing: Updating

In distance vector routing, each node shares its routing table


with its immediate neighbors periodically and when there is a
change
37
Updating Routing Table
 If the next-node entry is different
 The receiving node chooses the row with the smaller cost
 If there is a tie, the old one is kept

 If the next-node entry is the same


 i.e. the sender of the new row is the provider of the old
entry
 The receiving node chooses the new row, even though the
new value is infinity.

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.

 For a routing protocol to work properly, if a link is broken


(cost becomes infinity),
 every other router should be aware of it immediately,
 but in distance-vector routing, this takes some time.

 The problem is referred to as count to infinity


 It sometimes takes several updates before the cost for
40
a broken link is recorded as infinity by all routers.
Count to Infinity: Two node loop

Most implementations define 16 as infinity


41
Solutions for Two-Node Instability
Split Horizon
 Split horizon is a method of preventing a routing loop in
a network.
 Simple principle: Information about the routing for a
particular packet is never sent back in the direction
from which it was received.
 So, instead of flooding the table through each
interface, each node sends only part of its table through
each interface

42

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy