Professional Documents
Culture Documents
Computer Networks
Unit-4
Network Layer
3 2
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … …
…
VC routers maintain connection state information
Unit: 4 – Network Layer 9 Darshan Institute of Engineering & Technology
Virtual Circuit Setup
There are three identifiable phases in a virtual circuit:
1. VC setup
2. Data transfer
3. VC teardown
application application
5. data flow 6. receive data
transport transport
begins
4. call connected 3. accept
network network
data link 1. initiate call
2. incoming
call call
data link
physical physical
application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical
memor
y
system bus
table
ICMP protocol
● error reporting
● router “signaling”
link layer
physical layer
172 16 254 1
Class D not
not not not 268,435,456 224.0.0. 239.255.255.25 not
(multicas 1110 define not defined
defined defined defined (228) 0 5 defined
t) d
Class E not
not not not 268,435,456 240.0.0. 255.255.255.25 not
(reserved 1111 define not defined
defined defined defined (228) 0 5 defined
) d
223 1 1 1
Unit: 4 – Network Layer 33 Darshan Institute of Engineering & Technology
Subnet
223.1.1.0/2
▪ Subnet: high order bits defines 4 223.1.2.0/2
subnet 223.1.1.1 4
▪ Host: low order bits defines host
223.1.1.2 223.1.2.1
223.1.1.4 223.1.2.9
▪ To determine the subnets, detach
each interface from its host or 223.1.2.2
router. 223.1.1.3 223.1.3.27
✔ E.g.: 10.0.0.255
223.1.3.1 223.1.3.2
223.1.3.0/24
Unit: 4 – Network Layer 44 Darshan Institute of Engineering & Technology
DHCP – Cont…
▪ With dynamic addressing, a device can have a different IP address
every time it connects to the network.
▪ In some systems, the device's IP address can even change while it
is still connected.
▪ It allows reuse of addresses (only hold address while connected
“on”).
▪ It also support mobile users who want to join network.
DHCP offer
src: 223.1.2.5, 67
Broadcast: I’m a DHCP
dest: 255.255.255.255, 68
server!
yiaddrr:Here’s an IP
223.1.2.4
transaction
address youID:can
654use
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll take
yiaddrr: 223.1.2.4
that IP address!
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
dest: 255.255.255.255,
Broadcast: 68
OK. You’ve
yiaddrr: 223.1.2.4
got that IPID:
transaction address!
655
lifetime: 3600 secs
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
v w
u z
x y
recompute estimates
fro
fro
m
m
z ∞∞ ∞ z 1
7 1
0 Dx(z) = min{c(x,y) +
node y cost
table x to y Dy(z), c(x,z) + Dz(z)}
x z∞ ∞ ∞ = min{2+1 , 7+0} = 3
y 2 0
fro
m
z 1∞∞ ∞ y
2 1
node cost
z x to y x z
table z∞ ∞ ∞ 7
x
y ∞∞ ∞
fro
m
z 7 1 0
time
Unit: 4 – Network Layer 62 Darshan Institute of Engineering & Technology
Distance Vector Algorithm - Example
node x cost cost cost
table x to y x to y x to y
x z0 2 7 x z0
2 3 x z0 2 3
y ∞∞ ∞ y 2 0 y
fro
2 0 y
fro
m
m
fro
z ∞∞ ∞ z 1
m
7 1 z 1 2 1
3 1 0
node y cost
0 x z
cost cost 7
table x to y x to y xto y
x z∞ ∞ ∞ x z0 2 7
x z0 2 3
y 2 0 y 2 0 1 y 2 0 1
fro
fro
m
fro
z 1
m
∞∞ ∞ z 7 1 z 3 1 0
0
node cost cost cost
z x to y x to y xto y
table
x z∞ ∞ ∞ x z0 2 7 x z0 2 3
y y 2 0 1 y 2 0 1
fro
fro
∞∞ ∞
m
fro
m
m
z z 3 1 0 z 3 1 0
7 1 0
time
Unit: 4 – Network Layer 63 Darshan Institute of Engineering & Technology
Difference: LS and DV Routing Algorithm
Distance Vector Protocol Link State Protocol
Entire routing table is sent as an Updates are incremental & entire routing
update table is not sent as update
Distance vector protocol send Updates are triggered not periodic
periodic update at every 30 or 90
second
Update are broadcasted Updates are multicasted
Updates are sent to directly Update are sent to entire network & to just
connected neighbour only directly connected neighbour
Routers don't have end to end Routers have visibility of entire network of
visibility of entire network. that area only.
It is prone to routing loops No routing loops