You are on page 1of 9

Outline

EEC-682/782
The Network Layer
Computer Networks I Network Layer Design Issues
Routing Algorithms
Lecture 11 Feedback
Anonymous email account
Wenbing Zhao username: eec682@yahoo.com
w.zhao1@csuohio.edu password: anyone
http://academic.csuohio.edu/zhao_w/teaching/eec682.htm Feedback so far:
(Lecture nodes are based on materials supplied by I speak too fast
Dr. Louise Moser at UCSB and Prentice-Hall)
Should points out what is more important
Use the black board when explaining problems

EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 2

Network Layer Connectionless Service


Main concern: end-to-end transmission Routing within a
Perhaps over many hops at intermediate nodes diagram subnet
Network Layer Design Issues Router has table
telling which outgoing
Services Provided to the Transport Layer
line to use for each
Routing possible destination
Congestion control router
Internetworking – connection of multiple networks Each datagram has
Goals – services should full destination
Be independent of subnet technologies address
Shield transport layer from number, type, topology of subnets When packet arrives,
Uniform network addresses across LAN/WAN router looks up
outgoing line to use
and transmits packet

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 3 Spring Semester 2005 - Wenbing Zhao 4

1
Connection-Oriented Service
Connection-Oriented Service
Routing within a virtual-circuit subnet - Each router must
remember where to forward packets for each currently open
Virtual Circuit (VC) passing through it
Each router must maintain a table with one entry per open VC
Each packet must contain VC number field in its header
Router must forward packet to correct router based on
Line on which it arrived and VC number

Problem: each machine chooses VC number independently when


connection set up
Same VC number is likely on two different paths through same
intermediate router
Solution: to create new outbound virtual circuit, choose lowest
circuit number not in use and overwrite circuit number in set up
packet with that number

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 5 Spring Semester 2005 - Wenbing Zhao 6

Comparison of Virtual-Circuit and Datagram Subnets Routing Algorithms

Desirable properties
Correctness, simplicity
Robustness to faults
Stability – converge to equilibrium
Fairness and optimality – hard to achieve both
Two classes
Non-adaptive (static) - Route computed in advance, off-line,
downloaded to routers
Adaptive (dynamic) - Route based on measurements or
estimates of current traffic and topology

EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 8

2
Routing Algorithms The Optimality Principle
Optimality principle – if router J is on the optimal path from
The Optimality Principle router I to router K, than the optimal path from J to K also
Shortest Path Routing falls along the same route
Sink tree – the set of optimal routes from all sources to a given
Flooding destination form a tree rooted at the destination
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 (skip)
(a) A subnet. (b) A sink tree for router B.
EEC-682: Computer Networks I EEC-682: Computer Networks I
Spring Semester 2005 - Wenbing Zhao 9 Spring Semester 2005 - Wenbing Zhao 10

Shortest Path Routing


Shortest Path Routing
Steps computing the shortest path from A to D, using
Dijkstra’s algorithm. The arrows indicate the working node.
Shortest in what sense?
Number of hops, geographical distance, least queueing and
transmission delay
Dijkstra’s Algorithm
Each node labeled with distance from source node along best
known path
Initially, no paths known all nodes labeled with infinity
As algorithm proceeds, labels may change reflecting
shortest path
Label may be tentative or permanent, initially, all tentative
When label represents shortest path from source to node,
label becomes premanent

EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 11

3
Flooding Distance Vector Routing
Idea: every incoming packet is sent out on every outgoing line Also called Bellman-Ford or Ford-Fulkerson. Used in ARPANET
except the one it arrived on Idea: each router maintains a table (a vector), giving best
Adv: flooding always chooses shortest path, no other algorithm known distance to each destination and which line to use to get
has shorter delay there
Disadv: generates lots of duplicates Table is updated by exchanging info with neighbors
Methods to damper this effect Table contains one entry for each router in network with
Preferred outgoing line to that destination
Header of each packet has hop counter that is decremented at
each hop; packet discarded when counter reaches 0 Estimate of time or distance to that destination

Source router puts sequence number in each packet it receives Once every T msec, router sends to each neighbor a list of
from its hosts estimated delays to each destination and receives same from those
neighbors
Each router has list for each source router telling which sequence
numbers originating at that source have already been seen A d(A,Y) Y At router A, for Z
Each list augmented with counter k, meaning all sequence numbers up
d(Y,Z) Compute d(A,X) + d(X,Z) and
through k have been seen
d(A,X) d(A,Y) + d(Y,Z), take minimum
If packet is duplicate, router discards it

X Z
EEC-682: Computer Networks I
d(X,Z) EEC-682: Computer Networks I
Spring Semester 2005 - Wenbing Zhao 13 Spring Semester 2005 - Wenbing Zhao 14

Distance Vector Routing Distance Vector Routing


Problems
Delay metric in ARPANET was queue length, did not consider
bandwidth of lines
Takes too long to converge upon router failure (count to infinity
problem)

Delay A to B 12ms, to C 25ms, to D 40ms


Delay J to A 8ms, to I 10ms, to H 12ms,
to K 6ms
Delay J
to A to G 8+18 = 26ms
to I to G 10+21 = 41ms
to H to G 12+6=18ms
to K to G 6+31=37ms

EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 15

4
Distance Vector Routing -
Distance Vector Routing - Exercise
Exercise
Going via B gives (11, 6, 14, 18, 12, 8).
Consider the subnet shown. Distance vector routing Going via D gives (19, 15, 9, 3, 9, 10).
is used, and the following vectors have just come in
Going via E gives (12, 11, 8, 14, 5, 9).
to router C:
from B: (5, 0, 8, 12, 6, 2);
Taking the minimum for each destination except C
from D: (16, 12, 6, 0, 9, 10); and
gives (11, 6, 0, 3, 5, 8).
from E: (7, 6, 3, 9, 0, 4). The outgoing lines are (B, B, –, D, E, B).
The measured delays to B, D, and E, are 6, 3, and 5,
respectively. What is C's new routing table? Give
both the outgoing line to use and the expected delay.

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 17 Spring Semester 2005 - Wenbing Zhao 18

Link State Routing – Used in Internet Learning about the Neighbors


Idea: Each router must do the following: When router is booted, sends “Hello” packet on each of its links
Discover its neighbors, learn their network address. Router at other end replies with its unique name
One LAN might connects to multiple routers, in which case, the
Measure the delay or cost to each of its neighbors. LAN is treated as a host
Construct a packet telling all it has just learned.
Send this packet to all other routers.
Compute the shortest path to every other router.

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 19 Spring Semester 2005 - Wenbing Zhao 20

5
Building Link State Packets
Measuring Line Cost
Packets contain identity of sender, sequence number, age, list of
neighbors and delay to that neighbor
Router sends “echo” packet When are link state packets constructed?
Router at other end sends it back immediately Periodically at regular intervals
Divide round trip by 2 to get one-way delay When link or nodes goes down or comes back

To take load into account, start timing when packet (a) A subnet. (b) The link state packets for this subnet.
enters back of queue
To ignore load, start timing when packet leaves front
of queue

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 21 Spring Semester 2005 - Wenbing Zhao 22

Distributing the Link State Packets Distributing the Link State Packets
Goal – all routers have same version of topology
Use flooding – source identifiers and sequence numbers to Router B’s data structure
recognize and discard duplicates Link state packet from A forwarded to C, F; acked to A
Problems Link state packet from E arrived twice, via EAB and EFB;
Finite range of sequence numbers, so must recycle them. Can result forwarded to C, acked to A, F
in different messages with same sequence number
Use 32-bit sequence numbers to avoid this problem
Router crashes and restarts with sequence number 0. Can result in
different messages with same sequence number
Use router incarnation numbers to avoid this problem
Sequence number may be corrupted
Solution – include age of packet in its header and decrement it
once per second; a packet is discarded when ago hits 0
Also use ACKS for link state packets for reliability

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 23 Spring Semester 2005 - Wenbing Zhao 24

6
Hierarchical Routing
Hierarchical Routing
Tradeoff: savings in memory space may result in longer path.
Usually, increase in mean path length not significant
As network size increases, more router memory used Optimal number of levels for N routers is ln N, with e ln N
to store routing table, more time to process routing routing table entries per router
tables, more bandwidth to transmit states reports
Use hierarchical structure similar to telephone
network
Regions: router knows details of how to route packets within
its region, does not know internals of other regions
Clusters of regions, zones of clusters, groups of zones

EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 25

Broadcast Routing Reverse Path Forwarding


Alternative strategies
Idea: if router gets packet on optimal (reverse) path
Source sends separate copy of packet to all destinations
to root, then it forwards the packet
Flooding
Example
Multidestination routing
Hop 1: I sends packets to F, H, J, N; each arrives on
Each packet contains either list of destinations, or bit map of
preferred path to I
desired destinations
Hop 2: F sends packets to A,D; H to E,K; J to G,O; N to M,O
When packet arrives at router, router determines set of
All are previously unvisited routers
output lines that are best routes to the destinations
All but E,K,O arrive on preferred path
Router generates new copy of packet for each of these output
lines Hop3: A sends packet to E; D to C,G; G to D; O to N; M to K
Only E,C,K arrive on preferred path
Spanning tree – the sink tree (no loops) rooted at source
that includes all routers Etc.
Router forwards copies of packet on all lines except line on Reasonably efficient, easy to implement
which it arrived, using reverse path forwarding
EEC-682: Computer Networks I EEC-682: Computer Networks I
Spring Semester 2005 - Wenbing Zhao 27 Spring Semester 2005 - Wenbing Zhao 28

7
Broadcast Routing - Exercise
Reverse Path Forwarding
Looking at the subnet shown below, how many packets
are generated by a broadcast from B, using
1 (a) reverse path forwarding?
2 (b) the sink tree?

3
4
5

Reverse path forwarding. (a) A subnet. (b) a Sink tree.


(c) The tree built by reverse path forwarding.

EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 29

Multicast Routing
Broadcast Routing - Exercise
2 Multicast to groups of hosts
B
Router must know which hosts are in which groups, compute
spanning trees
4 A C
When process sends multicast packet to group, router
examines its spanning tree and prunes it by removing all lines
10 F D I J that do not lead to hosts in the group

8 K H G H I N
D J I E

4 L L E F O H M O

G M Sink tree – 14 L H
Reverse Forwarding - 28
EEC-682: Computer Networks I EEC-682: Computer Networks I
Spring Semester 2005 - Wenbing Zhao 31 Spring Semester 2005 - Wenbing Zhao 32

8
Multicast Routing
Multicast Routing

Pruning
With link state routing, start at end of path and work
toward root. Remove all routers that do not belong to group
With distance vector routing (use reverse path forwarding)
When router with no hosts in group and no connection to other
routers, and receives multicast packet for group, it sends
PRUNE message to sender telling it not to send any more
multicasts for group
When router with no hosts in group has received PRUNE
messages on all its line, it also sends PRUNE message

(a) A network. (b) A spanning tree for the leftmost router.


(c) A multicast tree for group 1. (d) A multicast tree for group 2.
EEC-682: Computer Networks I EEC-682: Computer Networks I
Spring Semester 2005 - Wenbing Zhao 33 Spring Semester 2005 - Wenbing Zhao 34

Routing for Mobile Hosts Routing for Mobile Hosts


To route a packet to a mobile host, first must find mobile
Mobile have home location – permanent home address

EEC-682: Computer Networks I EEC-682: Computer Networks I


Spring Semester 2005 - Wenbing Zhao 35 Spring Semester 2005 - Wenbing Zhao 36

You might also like