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

Unit 3 Routing Algorithms Computer Networks

The document discusses various aspects of the network layer including design issues, routing algorithms, congestion, internet protocols, and quality of service. It covers topics such as shortest path routing, flooding, distance vector routing, link state routing, and routing for mobile hosts. Specific routing algorithms like Dijkstra's algorithm and flooding are explained in detail.

Uploaded by

SAUMIL SHAH
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

Unit 3 Routing Algorithms Computer Networks

The document discusses various aspects of the network layer including design issues, routing algorithms, congestion, internet protocols, and quality of service. It covers topics such as shortest path routing, flooding, distance vector routing, link state routing, and routing for mobile hosts. Specific routing algorithms like Dijkstra's algorithm and flooding are explained in detail.

Uploaded by

SAUMIL SHAH
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 78

UNIT-3

Network layer
Dr. Pushpendra Singh Sisodia

1
Network Layer
• Design issues
• Routing
• Congestion
• Internetworking
• Internet Protocols
• Multimedia or QoS
2
Design Issues
• The network layer or layer 3 of the OSI model is
concerned delivery of data packets from the
source to the destination across multiple hops or
links. The design issues can be elaborated under
four heads −
• Store − and − Forward Packet Switching
• Services to Transport Layer
• Providing Connection Oriented Service
• Providing Connectionless Service
3
Store − and − Forward Packet Switching
• The network layer operates in an environment that uses
store and forward packet switching. The node which has a
packet to send, delivers it to the nearest router.
• The packet is stored in the router until it has fully arrived
and its checksum is verified for error detection.
• Once, this is done, the packet is forwarded to the next
router. Since, each router needs to store the entire packet
before it can forward it to the next hop, the mechanism is
called store − and − forward switching

4
Services to Transport Layer
• The network layer provides service to its
immediate upper layer, namely transport layer,
through the network − transport layer interface.
The two types of services provided are −
• Connection − Oriented Service − In this service, a
path is setup between the source and the
destination, and all the data packets belonging to
a message are routed along this path.

5
Services to Transport Layer

• Connectionless Service − In this service, each


packet of the message is considered as an
independent entity and is individually routed
from the source to the destination.

6
Services to Transport Layer

The objectives of the network layer while providing


these services are −
•The services should not be dependent upon the
router technology.
•The router configuration details should not be of a
concern to the transport layer.
•A uniform addressing plan should be made
available to the transport layer, whether the
network is a LAN, MAN or WAN
7
Providing Connection Oriented
Service
• In connection oriented services, a path or route called
a virtual circuit is setup between the source and the
destination nodes before the transmission starts.
• All the packets in the message are sent along this route. Each
packet contains an identifier that denotes the virtual circuit to
which it belongs to.
• When all the packets are transmitted, the virtual circuit is
terminated and the connection is released.
• An example of connection − oriented service is MultiProtocol
Label Switching (MPLS).

8
Virtual circuits
– Routes chosen at connection time
– Connection identified by a virtual circuit number (VCn)
– Primary service of subnet is connection-oriented

4
Transport 7 Transport
Network Network
Data Link Data Link
Physical Physical

9
Providing Connectionless Service
• In connectionless service, since each packet is transmitted
independently, each packet contains its routing information
and is termed as datagram.
• The network using datagrams for transmission is called
datagram networks or datagram subnets.
• No prior setup of routes are needed before transmitting a
message.
• Each datagram belong to the message follows its own
individual route from the source to the destination.
• An example of connectionless service is Internet Protocol or
IP.

10
Network Layer
• Design issues
• Routing
• Congestion
• Internetworking
• Internet Protocols
• Multimedia or Qos
11
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

12
Routing algorithms
• Desirable properties
– Correctness } all algorithms

– Simplicity
– Robustness: able to cope with  hard to achieve
• changes in topology, load 
• hardware and software failures
– Stability

• Converge to equilibrium
– Fairness } conflicting
– Optimality

13
Routing algorithms
• Desirable properties (cont.) Conflict!
– Fairness
– Optimality

14
Routing algorithms
• Taxonomy
– Non adaptive
• Routing decisions computed in advance, off-line and
downloaded
– Adaptive
• To changes in
– Topology
– Load
• Get information
– Locally
– From adjacent routers
– From all routers

15
Routing algorithms
Optimal path from I to K over J
• Optimality principle
I  d1 distance
 K
d2
d1 + d2 is minimal
J  d3
Other path from J to K
d3 > d 2
Set of all optimal routes as
• from all sources to a given d1 + d3 > d 1 + d 2
destination is a tree: sink tree

16
Routing algorithms
• Optimality principle: sink tree
Destination

17
Routing: shortest path
• Algorithm of Dijkstra: shortest path in graph
– Graph
• Node = router
• Arc = communication line
– Metric
• Number of hops
• Geographic distance
• Mean queueing and transmission delay

18
Routing: shortest path

Initial node

Elements of algorithm:
• Mark all nodes as free: 
• Mark initial node as selected: 
• repeat till destination is selected:
• Label all free nodes reachable from selected nodes with shortest
distance to a selected node
• Select free node with shortest distance to a selected node and
mark it as selected

19
Routing: shortest path

20
Routing: flooding
• Every packet is sent out on every outgoing line except the one
it arrived at

21
Routing: flooding
• Every packet is sent out on every outgoing line
except the one it arrived at

22
Routing: flooding
• Every packet is sent out on every outgoing line
except the one it arrived at

23
Routing: flooding
• Every packet is sent out on every outgoing line
except the one it arrived at

24
Routing: flooding
• Every packet is sent out on every outgoing line
except the one it arrived at
• Duplicates!! How to limit?
– Hop counter
• Decrement in each router
• Discard packet if counter is 0
• Initialisation?
– Sequence number in packet
• Avoid sending the same packet a second time
• Keep in each router per source a list of packets already seen
• Useful?

25
Routing: flooding
• Every packet is sent out on every outgoing line
except the one it arrived at
• Sometimes useful
– Robust algorithm: e.g. military applications
– Broadcast
– Comparison purposes: always shortest path
• Selective flooding
– Use only those lines that are going approximately in
right direction
– Still working?
26
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

27
Routing: distance vector
• Adaptive algorithm
– Exchange of info only with neighbours
• Data to be available in each router
– Routing table: per destination
• Distance
• Outgoing line
– Distance to all neighbours

28
Routing: distance vector
• Algorithm
– At each step within a router:
• Get routing tables from neighbours
• Compute distance to neighbours
• Compute new routing table
– Characteristics:
• Iterative
• Asynchronous
• Distributed

29
30
31
32
Routing: link state
• Learning about neighbours:
– Upon boot of router
• Send HELLO packet on each point-to-point line
• Routers are supposed to send reply with a globally
unique name

33
Routing: link state
Algorithm:

• Measuring line cost


– Measure round-trip delay of HELLO Packet and its
reply
Yes! preference for unloaded
– Take load into account? Arguments both ways:
line
No! oscillations are possible

34
Routing: link state
Algorithm:

• Building link state packets o When to build?


• periodically
– Packet containing: • when significant events occur
• Identity of sender
• Sequence number + age
• For each neighbour: name + distance

35
Routing: link state
Algorithm:
• Distributing link state packets
– Trickiest part of algorithm
• Arrival time for packets different
• How to keep consistent routing tables
– Basic algorithm
• Flooding +
• Sequence number (in each packet) to limit duplicates
– Manageable problems
• Wrap around of sequence numbers:
• Wrong sequence number used:
– lost in case of crash
– Corruption

36
Routing: link state
Algorithm:

• Distributing link state packets


– Basic algorithm
– Manageable problems
– Refinements
• Link state packets are not forwarded immediately
• During holding time:
– duplicates are discarded
– Old packets are thrown out

37
Network Layer
Packet buffer for router B
o ACK flag: ACK to send
o Send flag: packet to forward

38
Routing: link state
Algorithm:

• Computing new routes:


– With a full set of link state packets, a router can:
• Construct the entire subnet graph
• Run Dijkstra’s algorithm to compute the shortest path
to each destination
– Problems for large subnets
• Memory to store data
• Compute time

39
Routing: link state
• Usage:
– IS-IS protocol
• Designed for DECnet, adopted by ISO
• In use also in Internet
• Supports multiple network layer protocols
– OSPF protocol used in Internet
– Common features:
• Self-stabilizing method of flooding link state updates
• Concept of a designated router on a LAN
• Method of computing and supporting path splitting and multiple metrics

40
41
42
43
44
45
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

46
Hierarchical routing
• When network size increases…
– Larger stables
– More CPU time needed to
compute …
– More bandwidth needed

47
Hierarchical routing
• Solution?

48
Hierarchical routing

• Routers grouped in regions


• Each routers knows how to reach:
– Other routers in its own group  Smaller tables
– Other regions  Longer paths

49
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

50
Broadcast routing
• Send message to all other hosts:
– Update distributed database
– Distribute weather reports
– Distribute live radio/TV programs
• Poor methods:
– Send a distinct packet to each destination
• List of addresses needed
• High usage of bandwidth
– Flooding
• Too many packets
– Multidestination routing
• Each packet contains a list of destination
• On each line a single packet

51
Broadcast routing
• Best method: use sink tree
o Broadcast source =
root of sink tree
o Forwarding on sink tree
lines
o Excellent use of bandwidth
o Source tree must be
known at each
intermediate node
Which sink tree?
How many sink trees?

52
Broadcast routing
• Sink tree approximation: reverse path
forwarding

if a packet arrives on line used for traffic to source of broadcast


then forward packet on all lines, except the one it arrived on
else discard packet

53
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

54
Multicast routing
• Send a message to a well-
defined group
– Large in size
– Small compared to network
as a whole
• Group management
– Create and destroy groups
– Process can leave and join
a group
How will routers know
about groups? • algorithm

55
Multicast routing

source

• Algorithm • Pruning:
– Source computes spanning – Link state routing
• Each router knows full topology
tree
– Distance vector routing
– Remove lines that do not
• Reverse path forwarding +
lead to hosts of group
• PRUNE messages to remove
( = pruning) arcs

56
Multicast routing

source

• Pruning:
– Link state routing
• Each router knows full topology
– Distance vector routing
• Reverse path forwarding +
• PRUNE messages to remove
arcs

57
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

58
Routing for Mobile Hosts
• Model of world: WAN + LANs, wireless cells
o Move from time to time
o Use network when connected
• Migratory users
• Roaming users
o Compute on the run
o Maintain connections as they
move around

59
Routing for Mobile Hosts
• Foreign agent: keeps track of • Home agent: keeps track of users
users: – whose home is in the area
– who are currently visiting the – who are currently visiting
area another area

Permanent home location


Permanent home address

60
Routing for Mobile Hosts
• How does it work?
– Registration procedure with foreign agents
– Sending packets
– Leaving an area
• Registration procedure with foreign agent
– Announcing existence of foreign agent
• Broadcast by foreign agent
• Broadcast query by arriving mobile user
– Mobile user gives to foreign agent
• Home address
• Current data link address
• Security information
– Foreign agent contacts home agent of user

61
Routing for Mobile Hosts
• Registration procedure with foreign agent (cont.)
– Announcing existence of foreign agent
– Mobile user gives to foreign agent
– Foreign agent contacts home agent of user
• Identity of user
• Security info
• Network address of foreign agent
– Home agent
• Checks security info
• Sends ack to foreign agent
– Foreign agent
• Stores state
• Informs mobile user

62
Routing for Mobile Hosts
• Sending a packet to a mobile user
– Home address is used  packet routed to home LAN
– Packet intercepted by home agent
 address of user  address of home agent!
– Packet forwarded to the foreign agent
• Encapsulation – tunneling
– Foreign agent forwards packet to mobile user
• Which protocol, address used?
– Sender is given address of foreign agent
• Encapsulation – tunneling used, required?

63
Routing for Mobile Hosts

Home agent

Foreign agent

64
Routing for Mobile Hosts
• Leaving an area
– Announced by user  deregistration
– Automatic detection by foreign agent
• Various different schemes:
– Protocol carried out by routers or hosts
– Routers along the way intercept and redirect traffic
– Visitor gets temporary address to off-load foreign agent
– Modify original packet instead of encapsulation
– Security aspects: authentication?

65
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

66
Routing in Ad Hoc Networks
• Ad Hoc Network = routers are mobile
– No fixed topologies
– No fixed or known neighbors
– Valid paths can disappear at any time
– Node = router + host
– Routing quite different from routing in wired networks
• Examples
– Military vehicles on a battlefield
– Fleet of ships at see
– People with notebooks (lacking 802.11)
• AODV = Ad hoc On-demand distance vector routing
– On-demand: route computed when needed
– Distance vector for mobile world
– Taking into account limited bandwidth + low battery life

67
Routing in Ad Hoc Networks
• Graph presentation
– Node
– Arc = nodes connected
can communicate directly by radio
• Routing table:
– Line for known routes
– Can be valid or invalid
• A wants to send a packet
– To H: forward to D Dest Next Distance Other
– To I: start route discovery broadcasting hop fields
a route request packet B B 1 …

C B 2 …

H D 3 …

68
Routing in Ad Hoc Networks
• Route request packet:

 Source & destination address: e.g. IP address


 Request ID:
• local counter incremented for each new route request packet broadcasted
• allows to discard duplicate requests at other nodes
 Source sequence #
• counter to distinguish old routes to destination from new ones
 Destination sequence #
• most recent sequence counter of destination seen by source

69
Routing in Ad Hoc Networks
• Processing a route request packet
– duplicate request?
• Yes: discard
– Fresh route to destination known?
• Fresh = local destination sequence # >= destination sequence # in
request
• Yes: send route reply packet
– No fresh route to destination is known!
• Store info from route request in reverse route table; to enable the
forwarding of route reply packets
• Increment hop count
• Rebroadcast route request

70
Routing in Ad Hoc Networks
• Processing a route request packet
– Duplicate request?
– Fresh route to destination known?
– No fresh route to destination is known!

71
Routing in Ad Hoc Networks
• Processing a route request packet
– Duplicate request?
– Fresh route to destination known?
– No fresh route to destination is known!

o (a) Range of A's broadcast.


o (b) After B and D have received A's broadcast.
o (c) After C, F, and G have received A's broadcast.
o (d) After E, H, and I have received A's broadcast.
Shaded nodes are new recipients. Arrows show possible reverse routes.

72
Routing in Ad Hoc Networks
• Route reply packet
– Returned by
• Intermediate node knowing a fresh route
• Destination node

 Destination sequence#
– Number known by sender of reply packet
 Hop count
– Set to length of path known by sender of reply packet
– For destination = 0

73
Routing in Ad Hoc Networks
• Route maintenance
– Detect that neighbors are not reachable anymore
• Broadcast Hello packet periodically
• Failure to send packet
– Cleanup routing table

– Additional field in routing table: active neighbor


• Nodes that have offered path to destination in recent past

74
Routing in Ad Hoc Networks
• Route maintenance

Node G goes down!


– Routing table of D

75
Routing in Ad Hoc Networks
• Route maintenance

– New routing table of D:


• Delete routes with G as next hop
• Delete G as active neigbor

76
Routing Algorithms
• Properties
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State routing
• Hierarchical routing
• Broadcast routing
• Multicast routing
• Routing for mobile hosts
• Routing in Ad Hoc Networks
• Node Lookup in Peer-to-Peer Networks

77
Peer-to-Peer Networks
• Peer-to-Peer
How can a user networkfind a node that
– Large number
contains theof users
info he is looking for,
in– Usually permanent wired
the absence of connections
a centralized
– In contact to
database orshare resources
even a centralized index?
• Interesting features
–Totally distributed storage system!
Distributed
– Symmetric
– No central control or hierarchy
Routing?
– Users will not know each other
– Users will not know where to find what they are looking for

78

You might also like