0% found this document useful (0 votes)
21 views63 pages

Instructor Slides Unit 4 Part1

Uploaded by

kousthubh142
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)
21 views63 pages

Instructor Slides Unit 4 Part1

Uploaded by

kousthubh142
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/ 63

COMPUTER NETWORKS

TEAM NETWORKS
Department of Computer Science and Engineering
COMPUTER NETWORKS

Unit – 4 Network Layer and Internet Protocol

4.5 Introduction to Network Layer


Protocols
• DHCP
• ICMP
4.6 IPv6 Addressing
4.7 Introduction to Routing Algorithms
COMPUTER NETWORKS

Unit – 4 Network Layer and Internet Protocol

4.5 Introduction to Network Layer Protocols


• DHCP
• ICMP
4.6 IPv6 Addressing
4.7 Introduction to Routing Algorithms
COMPUTER NETWORKS
IP addresses: how to get one?

That’s actually two questions:


1. Q: How does a host get IP address within its network (host part
of address)?
2. Q: How does a network get IP address for itself (network part
of address)

How does host get IP address?


▪ hard-coded by sysadmin in config file (e.g., /etc/rc.config in UNIX)
▪ DHCP: Dynamic Host Configuration Protocol: dynamically get address from
as server
• “plug-and-play”
COMPUTER NETWORKS
DHCP: Dynamic Host Configuration Protocol

goal: host dynamically obtains IP address from network server


when it “joins” network
▪ can renew its lease on address in use
▪ allows reuse of addresses (only hold address while
connected/on)
▪ support for mobile users who join/leave network

DHCP overview:
▪ host broadcasts DHCP discover msg [optional]
▪ DHCP server responds with DHCP offer msg [optional]
▪ host requests IP address: DHCP request msg
▪ DHCP server sends address: DHCP ack msg
COMPUTER NETWORKS
DHCP client-server scenario

Typically, DHCP server will be


DHCP server co-located in router, serving
223.1.1.1
223.1.2.1
all subnets to which router is
attached
223.1.2.5
223.1.1.2
223.1.1.4 223.1.2.9

223.1.1.3
223.1.3.27 arriving DHCP client needs
223.1.2.2 address in this network

223.1.3.1 223.1.3.2
COMPUTER NETWORKS
DHCP client-server scenario

DHCP server: 223.1.2.5 DHCP discover Arriving client


src : 0.0.0.0, 68
Broadcast: is there a
dest.: 255.255.255.255,67
DHCPyiaddr:
server 0.0.0.0
out there?
transaction ID: 654

DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server! Here’s an IP
yiaddrr: 223.1.2.4
transaction
address youID:can
654use
lifetime: 3600 secs
The two steps above can
DHCP request be skipped “if a client
src: 0.0.0.0, 68 remembers and wishes to
dest:: 255.255.255.255, 67
Broadcast: OK. I would reuse a previously
yiaddrr: 223.1.2.4 allocated network address”
like totransaction
use this ID:
IP655
address!
lifetime: 3600 secs
[RFC 2131]

DHCP ACK
src: 223.1.2.5, 67
Broadcast: OK. You’ve
dest: 255.255.255.255, 68
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
COMPUTER NETWORKS
DHCP: more than IP addresses

DHCP can return more than just allocated IP


address on subnet:
▪ address of first-hop router for client
▪ name and IP address of DNS sever
▪ network mask (indicating network versus host portion
of address)
COMPUTER NETWORKS
DHCP: example

DHCP DHC ▪ Connecting laptop will use DHCP


P
to get IP address, address of first-
DHCP
DHCP UDP
DHCP IP hop router, address of DNS server.
Eth

▪ DHCP REQUEST message encapsulated


Phy
DHCP

in UDP, encapsulated in IP, encapsulated


DHCP DHC 168.1.1.1 in Ethernet
DHCP P

▪ Ethernet frame broadcast (dest:


DHCP UDP
DHCP IP router with DHCP
Eth server built into FFFFFFFFFFFF) on LAN, received at router
Phy router running DHCP server

▪ Ethernet demux’ed to IP demux’ed,


UDP demux’ed to DHCP
COMPUTER NETWORKS
DHCP: example

DHCP DHC ▪ DCP server formulates DHCP ACK


DHCP P containing client’s IP address, IP
DHCP

DHCP
UDP
IP
address of first-hop router for client,
Eth name & IP address of DNS server
Phy

▪ encapsulated DHCP server reply


DHCP DHC forwarded to client, demuxing up to
P
DHCP
DHCP UDP
DHCP at client
IP router with DHCP
▪ client now knows its IP address, name
DHCP
Eth server built into
DHCP
Phy router and IP address of DNS server, IP
address of its first-hop router
COMPUTER NETWORKS
IP addressing: last words…

Q: how does an ISP get block of addresses? Q: are there enough 32-bit IP
A: ICANN: Internet Corporation for Assigned addresses?
Names and Numbers ▪ ICANN allocated last chunk of IPv4
http://www.icann.org/ addresses to RRs in 2011
• allocates IP addresses, through 5 ▪ NAT (next) helps IPv4 address space
regional registries (RRs) (who may then exhaustion
allocate to local registries)
• manages DNS root zone, including ▪ IPv6 has 128-bit address space
delegation of individual TLD (.com, .edu,
…) management "Who the hell knew how much address
space we needed?" Vint Cerf (reflecting
on decision to make IPv4 address 32 bits
long)
COMPUTER NETWORKS

Unit – 4 Network Layer and Internet Protocol

4.5 Introduction to Network Layer


Protocols
• DHCP
• ICMP
4.6 IPv6 Addressing
4.7 Introduction to Routing Algorithms
COMPUTER NETWORKS
ICMP: Internet Control Message Protocol

▪ Used by hosts and routers to Type Code description


communicate network-layer 0 0 echo reply (ping)
information. 3 0 dest. network unreachable

▪ Typical use of ICMP is for error


3 1 dest host unreachable
3 2 dest protocol unreachable
reporting. 3 3 dest port unreachable

▪ Eg: “Destination network unreachable”


3 6 dest network unknown
3 7 dest host unknown
▪ ICMP messages – carried as IP 4 0 source quench (congestion
control - not used)
payloads. 8 0 echo request (ping)
▪ ICMP is often considered part of IP, but 9 0 route advertisement
10 0 router discovery
architecturally it lies just above IP. 11 0 TTL expired
▪ ICMP messages have a type and a code 12 0 bad IP header
field.
COMPUTER NETWORKS
ICMP: Internet Control Message Protocol

▪ Perform – Network diagnostics


▪ Utilities traceroute and ping – use ICMP.
▪ Other examples of ICMP messages:
• Source quench message (congestion)
• Parameter problem (bad IP header)
• Time exceeded message (TTL)
• Destination unreachable
• Redirection message
COMPUTER NETWORKS

Unit – 4 Network Layer and Internet Protocol

4.5 Introduction to Network Layer


Protocols
• DHCP
• ICMP
4.6 IPv6 Addressing
4.7 Introduction to Routing Algorithms
COMPUTER NETWORKS
Introduction to IPv6

▪ 128 bits address


▪ 340 undecillion address (340 + 33 digits)
▪ IPv6 address space is 296 times of the IPv4 address.
▪ Made up of eight 16-bit blocks (octet)
▪ Separated by ‘:’
▪ Hexadecimal, each hexadecimal character – 4 bits
340,282,366,920,938,463,374,607,431,768,211,456

Rules:
▪ Discard leading Zero(es)
▪ If two of more blocks contain consecutive zeroes,
omit them all and replace with double colon sign ::
COMPUTER NETWORKS
Introduction to IPv6

Colon hexadecimal
notation

Zero compression

CIDR address

Rule 1

Rule 2
COMPUTER NETWORKS
IPv6 Addressing

Show the unabbreviated colon hex notation for the following IPv6
addresses:
a. An address with 64 0s followed by 64 1s.
b. An address with 128 0s.
c. An address with 128 1s.
d. An address with 128 alternative 1s and 0s.

Solution
a. 0000:0000:0000:0000:FFFF:FFFF:FFFF:FFFF
b. 0000:0000:0000:0000:0000:0000:0000:0000
c. FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
d. AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA
COMPUTER NETWORKS
IPv6 Addressing

The following shows the zero contraction version of addresses in


previous example.

a. :: FFFF:FFFF:FFFF:FFFF
b. ::
c. FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
d. AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA:AAAA
COMPUTER NETWORKS
IPv6 Addressing

Show abbreviations for the following addresses:


a. 0000:0000:FFFF:0000:0000:0000:0000:0000
b. 1234:2346:0000:0000:0000:0000:0000:1111
c. 0000:0001:0000:0000:0000:0000:1200:1000
d. 0000:0000:0000:0000:0000:FFFF:24.123.12.6

Solution
a. 0:0:FFFF::
b. 1234:2346::1111
c. 0:1::1200:1000
d. ::FFFF:24.123.12.6
COMPUTER NETWORKS
IPv6 Addressing

Decompress the following addresses and show the complete


unabbreviated IPv6 address:
a. 1111::2222
b. ::
c. 0:1::
d. AAAA:A:AA::1234

Solution
a. 1111:0000:0000:0000:0000:0000:0000:2222
b. 0000:0000:0000:0000:0000:0000:0000:0000
c. 0000:0001:0000:0000:0000:0000:0000:0000
d. AAAA:000A:00AA:0000:0000:0000:0000:1234
COMPUTER NETWORKS
Three Address Types

▪ In IPv6, a destination address belong to:


▪ Unicast Address (one-to-one) –
defines a single interface (computer
or router)
▪ Multicast Address (one-to-many) –
also defines a group of computers,
each member of the group receives
a copy.
▪ Anycast Address (one-to-nearest) –
defines a group of computers that
all share a single address.
▪ Broadcast Address (one-to-all) – ×
COMPUTER NETWORKS
Address Space Allocation
COMPUTER NETWORKS
IPv6 Protocol: Rationale for Change

▪ Larger address space


▪ Better header format
▪ New options
▪ Allowance for extension
▪ Support for resource allocation
▪ Support for more security

checksum: removed entirely to reduce processing time at each hop


options: allowed, but outside of header, indicated by “Next Header” field
ICMPv6: new version of ICMP
fragmentation/reassembly: no
COMPUTER NETWORKS
IPv6 Datagram Format

Format of the base header


COMPUTER NETWORKS
Transition from IPv4 to IPv6

• not all routers can be upgraded simultaneously


• no “flag days”
• how will network operate with mixed IPv4 and IPv6 routers?

▪ tunneling: IPv6 datagram carried as payload in IPv4 datagram among


IPv4 routers (“packet within a packet”)
• tunneling used extensively in other contexts (4G/5G)

IPv4 header fields IPv6 header


fieldssource dest IPv4 payload
IPv4 source, dest addr IPv6
addr
UDP/TCP payload

IPv6 datagram
IPv4 datagram
COMPUTER NETWORKS
Tunneling and Encapsulation

A B Ethernet connects two E F


Ethernet connecting IPv6 routers
two IPv6 routers: IPv6 IPv6 IPv6 IPv6

IPv6 datagram
Link-layer frame The usual: datagram as payload in link-layer frame

IPv4 network A B E F
connecting two
IPv6 routers IPv6 IPv6/v4 IPv6/v4 IPv6

IPv4 network
COMPUTER NETWORKS
Tunneling and Encapsulation

A B Ethernet connects two E F


Ethernet connecting IPv6 routers
two IPv6 routers: IPv6 IPv6 IPv6 IPv6

IPv6 datagram
Link-layer frame The usual: datagram as payload in link-layer frame

IPv4 tunnel A B IPv4 tunnel E F


connecting IPv6 routers
connecting two
IPv6 routers IPv6 IPv6/v4 IPv6/v4 IPv6

IPv6 datagram
IPv4 datagram tunneling: IPv6 datagram as payload in a IPv4 datagram
COMPUTER NETWORKS
Tunneling
A B IPv4 tunnel E F
connecting IPv6 routers
logical view:
IPv6 IPv6/v4 IPv6/v4 IPv6

A B C D E F
physical view:
IPv6 IPv6/v4 IPv4 IPv4 IPv6/v4 IPv6

flow: X src:B src:B src:B flow: X


src: A dest: E dest: E src: A
dest: F
dest: E
dest: F
Flow: X Flow: X Flow: X
Src: A Src: A Src: A
Note source and data Dest: F Dest: F Dest: F data
destination
addresses! data data data

A-to-B: E-to-F:
B-to-C: C-to-D: D-to-E:
IPv6 IPv6
IPv6 IPv6 IPv6
inside inside inside
IPv4
COMPUTER NETWORKS
IPv6 Adoption

https://www.akamai.com/us/en/resources/our-thinking/state-of-the-internet
-report/state-of-the-internet-ipv6-adoption-visualization.jsp
COMPUTER NETWORKS

Unit – 4 Network Layer and Internet Protocol

4.5 Introduction to Network Layer


Protocols
• DHCP
• ICMP
4.6 IPv6 Addressing
4.7 Introduction to Routing Algorithms
COMPUTER NETWORKS
Routing Protocols

Routing protocol goal: determine “good” mobile network


paths (equivalently, routes), from sending hosts national or global ISP
to receiving host, through network of routers
• path: sequence of routers packets traverse application

from given initial source host to final transport


network
link
destination host physical
network network
link link

• “good”: least “cost”, “fastest”, “least physical physical

congested” network
link network
physical link

• routing: a “top-10” networking challenge! physical network


link
physical
datacenter
network

application
transport
network
enterprise link
network physical
COMPUTER NETWORKS
Routing Algorithms
COMPUTER NETWORKS
Routing Protocols

Graph abstraction: link costs


5
ca,b: cost of direct link connecting a and b
3
v w 5 e.g., cw,z = 5, cu,z = ∞
2
u 2 1 z
3
1 cost defined by network operator:
2
x 1
y could always be 1, or inversely related
to bandwidth, or inversely related to
congestion
graph: G = (N,E)
N: set of routers = { u, v, w, x, y, z }
E: set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }
COMPUTER NETWORKS
Routing Protocols

Routing algorithm classification


global: all routers have complete
topology, link cost info
• “link state” algorithms dynamic: routes change
How fast
do routes static: routes change more quickly
change? slowly over time • periodic updates or in
response to link cost
changes
decentralized: iterative process of
computation, exchange of info with neighbors
• routers initially only know link costs to
attached neighbors
• “distance vector” algorithms
global or decentralized information?
COMPUTER NETWORKS
Routing Protocols - Dijkstra’s link-state routing algorithm

Dijkstra’s link-state routing algorithm


▪centralized: network topology, link notation
costs known to all nodes
• accomplished via “link state ▪ cx,y: direct link cost from node
broadcast” x to y; = ∞ if not direct
neighbors
▪ D(v): current estimate of cost
• all nodes have same info
▪computes least cost paths from one of least-cost-path from source
node (“source”) to all other nodes to destination v
• gives forwarding table for that node ▪ p(v): predecessor node along
▪iterative: after k iterations, know
path from source to v
least cost path to k destinations ▪ N': set of nodes whose least-
cost-path definitively known
COMPUTER NETWORKS
Routing Protocols - Dijkstra’s link-state routing algorithm

1 Initialization:
2 N' = {u} /* compute least cost path from u to all other nodes */
3 for all nodes v
4 if v adjacent to u /* u initially knows direct-path-cost only to direct neighbors */
5 then D(v) = cu,v /* but may not be minimum cost! */
6 else D(v) = ∞
7
8 Loop
9 find w not in N' such that D(w) is a minimum
10 add w to N'
11 update D(v) for all v adjacent to w and not in N' :
12 D(v) = min ( D(v), D(w) + cw,v )
13 /* new least-path-cost to v is either old least-cost-path to v or known
14 least-cost-path to w plus direct-cost from w to v */
15 until all nodes in N'
COMPUTER NETWORKS
Routing Protocols - Dijkstra’s link-state routing algorithm
Dijkstra’s algorithm: an example

v w x y z
Step N' D(v),p(v) D(w),p(w) D(x),p(x) D(y),p(y) D(z),p(z)
0 u 2,u 5,u 1,u ∞ ∞
1 ux 2,u 4,x 2,x ∞
2 uxy 2,u 3,y 4,y
3 uxyv 3,y 4,y
4 uxyvw 4,y
5 uxyvwz
Initialization (step 0): For all a: if a adjacent to then D(a) = cu,a
5
3 find a not in N' such that D(a) is a minimum
v w 5 add a to N'
2
u 2 1 z update D(b) for all b adjacent to a and not in N' :
3 D(b) = min ( D(b), D(a) + ca,b )
1 2
x 1
y
COMPUTER NETWORKS
Routing Protocols - Dijkstra’s link-state routing algorithm
Example contd..
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y

resulting least-cost-path tree from u: resulting forwarding table in u:


destination outgoing link
v w
v (u,v) route from u to v directly
u z x (u,x)
y (u,x) route from u to all
x y w (u,x) other destinations
x (u,x) via x
COMPUTER NETWORKS
Routing Protocols - Dijkstra’s link-state routing algorithm
Another example:

v w x y z
D(v), D(w), D(x), D(y), D(z), x
9
Step N' p(v) p(w) p(x) p(y) p(z)

0 u 7,u 3,u 5,u ∞ ∞ 5 7


4
1 uw 6,w 5,u ∞ 8
2 uwx 6,w 11,w 14,x 3 w z
u y
2
3 uwx 10,v 14,x
3
v 7 4
4 uwxvy 12,y
5 uwxvyz v

notes:
▪ construct least-cost-path tree by tracing predecessor nodes
▪ ties can exist (can be broken arbitrarily)
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector algorithm


Based on Bellman-Ford (BF) equation (dynamic programming):
Bellman-Ford equation

Let Dx(y): cost of least-cost path from x to y.


Then:
Dx(y) = minv { cx,v + Dv(y) }

v’s estimated least-cost-path cost to y


min taken over all neighbors v of x direct cost of link from x to v
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Bellman-Ford: Example

Suppose that u’s neighboring nodes, x,v,w, know that for destination z:
Bellman-Ford equation says:
Dv(z) = 5 Dw(z) = 3 Du(z) = min { cu,v + Dv(z),
5
cu,x + Dx(z),
3
v w
5 cu,w + Dw(z) }
2
= min {2 + 5,
u 2 1 z
3 1 + 3,
1 2
x y 5 + 3} = 4
1
node achieving minimum (x) is next
Dx(z) = 3 hop on estimated least-cost path to
destination (z)
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector algorithm:

key idea:
▪ from time-to-time, each node sends its own distance vector estimate
to neighbors
▪ when x receives new DV estimate from any neighbor, it updates its
own DV using B-F equation:
Dx(y) ← minv{cx,v + Dv(y)} for each node y ∊ N

▪ under minor, natural conditions, the estimate Dx(y) converge to the


actual least cost dx(y)
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector algorithm:


each node: iterative, asynchronous: each local
iteration caused by:
wait for (change in local link ▪ local link cost change
cost or msg from neighbor) ▪ DV update message from neighbor

distributed, self-stopping: each


recompute DV estimates using node notifies neighbors only when
DV received from neighbor its DV changes
▪ neighbors then notify their
if DV to any destination has neighbors – only if necessary
changed, notify neighbors ▪ no notification received, no
actions taken!
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm
Distance vector: example
DV in a:
Da(a)=0
Da(b) = 8
Da(c) = ∞ a b c
8 1
Da(d) = 1

t=0 Da(e) = ∞
Da(f) = ∞ 1 1
Da(g) = ∞
▪ All nodes have Da(h) = ∞
distance estimates
Da(i) = ∞ A few asymmetries:
to nearest
▪ missing link
d e f
neighbors (only) 1 1
▪ larger cost
▪ All nodes send
their local
distance vector to 1 1 1
their neighbors

g h i
1 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector: Iteration

a b c
8 1

t=1 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector: Iteration

a
compute compute
b compute
c
8 1

t=1 1 1
All nodes:
▪ receive distance
vectors from
neighbors d
compute compute
e compute
f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g
compute h
compute compute
i
1 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector: Iteration

a b c
8 1

t=1 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector: Iteration

a b c
8 1

t=2 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1

49
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector: Iteration

compute
a compute
b compute
c
2 1

t=2 1 1
All nodes:
▪ receive distance
vectors from
neighbors d
compute compute
e compute
f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g
compute compute
h compute
i
8 1

50
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm

Distance vector: Iteration

a b c
8 1

t=2 1 1
All nodes:
▪ receive distance
vectors from
neighbors d e f
▪ compute their new 1 1
local distance
vector
▪ send their new 1 1 1
local distance
vector to neighbors

g h i
1 1
…. and so on
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford Distance Vector Routing Algorithm
DV in b: DV in c:
Dc(a) = ∞
Distance vector example: computation Db(a) = 8 Db(f) = ∞
Dc(b) = 1
Db(c) = 1 Db(g) = ∞
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 1
Da(d) = 1 Dc(g) = ∞

t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(h) = ∞
Dc(i) = ∞
▪ b receives DVs Da(g) = ∞ DV in e:
from a, c, e Da(h) = ∞ De(a) = ∞
Da(i) = ∞ De(b) = 1
d e f De(c) = ∞
1 1
De(d) = 1
Let’s next take a look at De(e) = 0
De(f) = 1
the iterative 1 1 1
De(g) = ∞
computations at nodes De(h) = 1
De(i) = ∞
g h i
1 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a bb c Dc(f) = ∞
8 compute 1
Da(d) = 1 Dc(g) = ∞

t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(h) = ∞
Dc(i) = ∞
▪ b receives DVs Da(g) = ∞ DV in e:
from a, c, e, Da(h) = ∞ De(a) = ∞
computes: e
Da(i) = ∞ De(b) = 1
d e f De(c) = ∞
1
Db(a) = min{cb,a+Da(a), cb,c +Dc(a), cb,e+De(a)} = min{8,∞,∞} =8 1
De(d) = 1
Db(c) = min{cb,a+Da(c), cb,c +Dc(c), c b,e +De(c)} = min{∞,1,∞} = 1
De(e) = 0
Db(d) = min{cb,a+Da(d), cb,c +Dc(d), c b,e +De(d)} = min{9,2,∞} = 2 De(f) = 1
1 1 1
Db(e) = min{cb,a+Da(e), cb,c +Dc(e), c b,e +De(e)} = min{∞,∞,1} = 1 De(g) = ∞
Db(f) = min{cb,a+Da(f), cb,c +Dc(f), c b,e +De(f)} = min{∞,∞,2} = 2
DV in b: De(h) = 1
Db(g) = min{cb,a+Da(g), cb,c +Dc(g), c b,e+De(g)} = min{∞, ∞, ∞} = ∞ Db(a) = 8 Db(f) =2 De(i) = ∞
g h 1Db(c) = 1 Db(g)i = ∞
1 ∞, 2} = 2
Db(h) = min{cb,a+Da(h), cb,c +Dc(h), c b,e+De(h)} = min{∞,
Db(d) = 2 Db(h) = 2
Db(i) = min{cb,a+Da(i), cb,c +Dc(i), c b,e+De(i)} = min{∞, ∞, ∞} = ∞ Db(e) = 1 Db(i) = ∞
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford
DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
DV in a: Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Da(a)=0 Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Da(b) = 8 Dc(e) = ∞
Da(c) = ∞ a b c Dc(f) = ∞
8 1
Da(d) = 1 Dc(g) = ∞

t=1 Da(e) = ∞
Da(f) = ∞ 1 1
Dc(h) = ∞
Dc(i) = ∞
▪ c receives DVs Da(g) = ∞ DV in e:
from b Da(h) = ∞ De(a) = ∞
Da(i) = ∞ De(b) = 1
d e f De(c) = ∞
1 1
De(d) = 1
De(e) = 0
De(f) = 1
1 1 1
De(g) = ∞
De(h) = 1
De(i) = ∞
g h i
1 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford DV in b: DV in c:
Dc(a) = ∞
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞ Dc(b) = 1
Db(d) = ∞ Db(h) = ∞ Dc(c) = 0
Db(e) = 1 Db(i) = ∞ Dc(d) = ∞
Dc(e) = ∞
a b c
compute Dc(f) = ∞
8 1
Dc(g) = ∞

t=1 1 1
Dc(h) = ∞
Dc(i) = ∞
▪ c receives DVs
from b computes:

db(a}} = 1 + 8 = 9
Dc(a) = min{cc,b+D e f
DV in c:
Dc(b) = min{cc,b+Db(b)} = 1 + 0 = 1
Dc(a) = 9
Dc(d) = min{cc,b+Db(d)} = 1+ ∞ = ∞ Dc(b) = 1
Dc(e) = min{cc,b+Db(e)} = 1 + 1 = 2 Dc(c) = 0
Dc(f) = min{cc,b+Db(f)} = 1+ ∞ = ∞ Dc(d) = 2
Dc(g) = min{cc,b+Db(g)} = 1+ ∞ = ∞ Dc(e) = ∞ * Check out the online interactive
Dc(f) = ∞ exercises for more examples:
g b(h)} = 1+ ∞ = ∞
Dc(h) = min{cbc,b+D h i http://gaia.cs.umass.edu/kurose_ross/interactive/
Dc(g) = ∞
Dc(i) = min{cc,b+Db(i)} = 1+ ∞ = ∞
Dc(h) = ∞
COMPUTER NETWORKS
DV in b:
Routing Protocols - Bellman-Ford
Db(a) = 8 Db(f) = ∞
Db(c) = 1 Db(g) = ∞
Db(d) = ∞ Db(h) = ∞ DV in e:
DV in d:
Db(e) = 1 Db(i) = ∞ De(a) = ∞
Dc(a) = 1
De(b) = 1
Dc(b) = ∞ a b c De(c) = ∞
Dc(c) = ∞ 8 1
De(d) = 1
Dc(d) = 0
t=1 Dc(e) = 1
1
Q: what is new DV computed in e at
1t=1?
De(e) = 0
De(f) = 1
▪ e receives DVs Dc(f) = ∞
De(g) = ∞
from b, d, f, h Dc(g) = 1
De(h) = 1
Dc(h) = ∞
De(i) = ∞
Dc(i) = ∞ d compute
e f DV in f:
1 1
DV in h: Dc(a) = ∞
Dc(a) = ∞ Dc(b) = ∞
Dc(b) = ∞ Dc(c) = ∞
Dc(c) = ∞ 1 1 1
Dc(d) = ∞
Dc(d) = ∞ Dc(e) = 1
Dc(e) = 1 Dc(f) = 0
Dc(f) = ∞ g h i Dc(g) = ∞
1 1
Dc(g) = 1 Dc(h) = ∞
Dc(h) = 0 Dc(i) = 1
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford

Distance vector: state information diffusion


Iterative communication, computation steps diffuses information through network:
t=0 c’s state at t=0 is at c only
a b c
8 1
c’s state at t=0 has propagated to b, and
t=1 may influence distance vector computations
up to 1 hop away, i.e., at b 1 1 t=1
t=2
c’s state at t=0 may now influence distance
t=2 vector computations up to 2 hops away, i.e.,
d e f
at b and now at a, e as well 1 1
c’s state at t=0 may influence distance vector
t=3 computations up to 3 hops away, i.e., at b,a,e
1 1 1 t=3
and now at c,f,h as well
c’s state at t=0 may influence distance vector
t=4 computations up to 4 hops away, i.e., at g h i
b,a,e, c, f, h and now at g,i as well 1 1
t=4
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford

Distance vector: link cost changes


1
link cost changes: y
▪node detects local link cost change
4 1
x z
▪ updates routing info, recalculates local DV 50

▪ if DV changes, notify neighbors

t0 : y detects link-cost change, updates its DV, informs its neighbors.


“good news t1 : z receives update from y, updates its table, computes new least
travels fast”
cost to x , sends its neighbors its DV.
t2 : y receives z’s update, updates its distance table. y’s least costs
do not change, so y does not send a message to z.
COMPUTER NETWORKS
Routing Protocols - Bellman-Ford
Distance vector: link cost changes
60
link cost changes: y
▪node detects local link cost change
4 1
x z
▪ “bad news travels slow” – count-to-infinity 50

•problem:
y sees direct link to x has new cost 60, but z has said it has a path at cost of 5. So
y computes “my new cost to x will be 6, via z); notifies z of new cost of 6 to x.
• z learns that path to x via y has new cost 6, so z computes “my new cost to
x will be 7 via y), notifies y of new cost of 7 to x.
• y learns that path to x via z has new cost 7, so y computes “my new cost to
x will be 8 via y), notifies z of new cost of 8 to x.
• z learns that path to x via y has new cost 8, so z computes “my new cost to
x will be 9 via y), notifies y of new cost of 9 to x.

▪see text for solutions. Distributed algorithms are tricky!
COMPUTER NETWORKS
Distance Vector vs Link State

Distance Vector Link State


Primary Send entire routing table to Only provides link state
principle its neighbors information

Learning about Learn about network only Learn about network from all
network from neighbors routers
Building the Based on inputs from only Based on complete database
routing table neighbors collected from all routers

Advertisement Sends periodic updates every Use triggered updates, only


30-90 seconds – Broadcasts when there is a change –
of updates updates Multicasts updates

Routing loops Vulnerable Less prone to routing loops


COMPUTER NETWORKS
Distance Vector vs Link State

Distance vector Link State


Convergence Slow Fast
(stabilization)
More CPU power and memory
Resources Less CPU power and memory required

Cost More than Distance vector


More scalable than distance
Scalability vector
Examples RIP, IGRP OSPF, IS-IS
COMPUTER NETWORKS
Suggested Readings
THANK YOU
TEAM NETWORKS
Department of Computer Science and Engineering

You might also like