Unit - 3
Unit - 3
GTU #3150710
Unit-4:
Network Layer
network network
transport layer. data link
physical
data link
physical
value in arriving
packet’s header
0111 1
3 2
12 22 32
1 3
2
VC number
interface
number
Forwarding table in
router:Incoming interface Incoming VC # Outgoing interface Outgoing VC #
1 12 3 22
2 63 1 18
3 7 2 17
1 97 3 87
… … … …
application application
5. data flow begins 6. receive data
transport transport
network 4. call connected 3. accept call
1. initiate call network
data link 2. incoming call
data link
physical physical
application application
transport transport
network 1. send datagrams 2. receive datagrams network
data link data link
physical physical
State Information None other than router table containing Route established at setup, all packets follow
destination network same route.
Effect of Router Failure Only on packets lost during crash All virtual circuits passing through failed router
terminated.
Congestion Control Difficult since all packets routed Simple by pre-allocating enough buffers to each
independently router resource requirements virtual circuit at setup, since maximum number of
can vary. circuits fixed.
lookup,
link forwarding
line layer switch
termination protocol fabric
(receive)
queueing
It performs the physical layer function of terminating an incoming physical link at a router.
It performs link-layer functions needed to interoperate with the link layer at the other side of
the incoming link; this is represented by the middle boxes in the input and output ports.
A lookup function is performed at the input port; this will occur in the rightmost box of the
input port.
memory
input output
port memory port
(e.g., (e.g.,
Ethernet) Ethernet)
system bus
Like traditional computers, with switching between input and output ports being done under
direct control of the CPU (routing processor).
Packet signalled a routing processor via an interrupt then copied from the input port into
processor memory.
bus
datagram
switch buffer link
fabric layer line
protocol termination
queueing (send)
It buffers packets received from the switching fabric and transmits these packets on the
outgoing link.
Packets can be lost due to congestions lacks of buffers.
When a link is bidirectional, an output port will typically be paired with the input port for that
link on the same line card.
link layer
physical layer
172 16 254 1
1 1 0
Fix 21 Bit Network 8 Bit Host
ID ID
11100000 – 11101111
224 - 239
Class D has IP address rage from 224.0.0.0 to 239.255.255.255.
Class D is reserved for Multicasting.
In multicasting data is not destined for a particular host, that is why there is no need to extract
host address from the IP address, and Class D does not have any subnet mask.
Class A 0 8 24 128 (27) 16,777,216 (224) 2,147,483,648 (231) 0.0.0.0 127.255.255.255 255.0.0.0 /8
Class B 10 16 16 16,384 (214) 65,536 (216) 1,073,741,824 (230) 128.0.0.0 191.255.255.255 255.255.0.0 /16
2,097,152
Class C 110 24 8 256 (28) 536,870,912 (229) 192.0.0.0 223.255.255.255 255.255.255.0 /24
(221)
223.1.3.1 223.1.3.2
223 1 1 1
Prof. Maulik D. Trivedi #3150710(CN) Unit 4 – Network Layer 36
Subnet
Subnet: high order bits defines subnet 223.1.1.0/24
223.1.2.0/24
Host: low order bits defines host 223.1.1.1
223.1.3.1 223.1.3.2
223.1.3.0/24
Network consisting of 3 subnets
Broadcast address - A special address used to send data to all hosts in the network.
The broadcast address uses the highest address in the network range.
E.g.: 10.0.0.255
Host addresses - The addresses assigned to the end devices in the network.
E.g.: 10.0.0.1
DHCP
223.1.1.0/24
server
223.1.1.1 223.1.2.1
223.1.2.0/24
223.1.3.1 223.1.3.2
223.1.3.0/24
Prof. Maulik D. Trivedi #3150710(CN) Unit 4 – Network Layer 47
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 DHCP68server!
dest: 255.255.255.255,
Here’s an yiaddrr:
IP address you can use
223.1.2.4
transaction ID: 654
lifetime: 3600 secs
DHCP request
src: 0.0.0.0, 68
dest:: 255.255.255.255, 67
Broadcast: OK. I’ll take that
yiaddrr: 223.1.2.4
IP
address!
transaction ID: 655
lifetime: 3600 secs
DHCP ACK
src: 223.1.2.5, 67
Broadcast:255.255.255.255,
dest: OK. You’ve got 68 that IP
yiaddrr: 223.1.2.4
address!
transaction ID: 655
lifetime: 3600 secs
10.0.0.4
10.0.0.2
138.76.29.7
10.0.0.3
IPv4 IPv6
32 bit length 128 bit length
Fragmentation is done by sender and Fragmentation is done only by sender
forwarding routers
No packet flow identification Packet flow identification is available within the IPv6 header
using the Flow Label field
Address Resolution Protocol (ARP)is available to Address Resolution Protocol (ARP) is replaced with
map IPv4 addresses to MAC addresses Neighbor Discovery Protocol
1 Initialization:
2 N' = {u}
3 for all nodes v
4 if v adjacent to u
5 then D(v) = c(u,v)
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) + c(w,v) )
13 /* new cost to v is either old cost to v or known
14 shortest path cost to w plus cost from w to v */
15 until all nodes in N'
5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
v w
u z
x y
4-63
Prof. Maulik D. Trivedi #3150710(CN) Unit 4 – Network Layer 63
Distance Vector Algorithm – Cont…
each node:
recompute estimates
from
from
y ∞ ∞ ∞ y 2 0 1
z ∞ ∞ ∞ z 7 1 0
Dx(z) = min{c(x,y) +
node y cost to
table x y z Dy(z), c(x,z) + Dz(z)}
x ∞ ∞ ∞ = min{2+1 , 7+0} = 3
2 0 1
from
y
z ∞ ∞ ∞ y
2 1
node z cost to
table x y z x z
7
x ∞∞ ∞
from
y ∞ ∞ ∞
z 7 1 0
time
Prof. Maulik D. Trivedi #3150710(CN) Unit 4 – Network Layer 65
Distance Vector Algorithm - Example
node x cost to cost to cost to
table x y z x y z x y z
x 0 2 7 x 0 2 3 x 0 2 3
from
from
y ∞ ∞ ∞ y 2 0 1 y
from
2 0 1 y
z ∞ ∞ ∞ z 7 1 0 z 2 1
3 1 0
node y
x z
cost to cost to cost to 7
table x y z x y z x y z
x ∞ ∞ ∞ x 0 2 7 x 0 2 3
from
y 2 0 1 from y 2 0 1 y
from
2 0 1
z ∞ ∞ ∞ z 7 1 0 z 3 1 0
x ∞∞ ∞ x 0 2 7 x 0 2 3
from
from
y y 2 0 1
from
y ∞ ∞ ∞ 2 0 1
z z 3 1 0 z 3 1 0
7 1 0
time
Prof. Maulik D. Trivedi #3150710(CN) Unit 4 – Network Layer 66
Difference: LS and DV Routing Algorithm
Distance Vector Protocol Link State Protocol
Entire routing table is sent as an update Updates are incremental & entire routing table is not sent as
update
Distance vector protocol send periodic update at every Updates are triggered not periodic
30 or 90 second
Update are broadcasted Updates are multicasted
Updates are sent to directly connected neighbour only Update are sent to entire network & to just directly connected
neighbour
Routers don't have end to end visibility of entire Routers have visibility of entire network of that area only.
network.
It is prone to routing loops No routing loops
Thank
You