Unit 3 CN
Unit 3 CN
Network Layer
► Isolation algorithm: It is an algorithm that obtains the routing information by using local
information rather than gathering information from other nodes.
Initializations :
The array dist[] contains the shortest path from s to every other node.
Dijkstra’s Algorithm: Example
Output: 0 4 12 19 21
11 9 8 14
Step Step Step
1: 2: 3:
Step
Step 5:
4:
Outp 0 4 12 19 21 11 9
ut: 8 14
Distance Vector Routing
Algorithm
A router transmits its distance vector to each of its neighbors
in a routing packet.
Each router receives and saves the most recently received
distance vector from each of its neighbors.
A router recalculates its distance vector when:
► It receives a distance vector from a neighbor
containing different information than before.
► It discovers that a link to a neighbor has gone down.
Dx(y) = Estimate of least cost from x to y
C(x,v) = Node x knows cost to each neighbor v
Dx = [Dx(y): y ∈ N ] = Node x maintains distance vector
Node x also maintains its neighbors' distance vectors
For each neighbor v, x maintains Dv = [Dv(y): y ∈ N ]
Distance vector routing Algorithm : Example
NOTE
Some ISPs do not provide static IP addresses.
Static IP Addresses are more costly than dynamic IP Addresses.
2. Dynamic IP Address-
► Dynamic IP Address is a temporarily assigned IP
Address to a network element.
► It can be assigned to a different device if it is not in
use.
► DHCP or PPPoE assigns dynamic IP addresses.
IP Address Format
1. Network ID represents the IP Address of the network and is
used to identify the network.
00000001.10100000.00001010.11110000
(Binary Representation)
OR
1.160.10.240
(Decimal Representation)
IP Addressing
Classful Addressing
Class A
If the 32 bit binary address starts with a bit 0, then IP Address belongs
to class A
In class A IP Address,
The first 8 bits are used for the Network ID.
The remaining 24 bits are used for the Host ID.
Total number of IP Addresses available in class A
= Numbers possible due to remaining available 31
bits
= 231
Total number of networks available in class A
= Numbers possible due to remaining available 7 bits
in the Net ID – 2
= 27 – 2= 126
From here,
Range of 1st octet = [0, 127]
Uses
Class A is used by big organizations like NASA, Pentagon
etc.
Class B
If the 32 bit binary address starts with bits 10, then IP Address
belongs to class B
In class B IP Address,
The first 16 bits are used for the Network ID.
The remaining 16 bits are used for the Host ID.
Total number of IP Addresses available in class B
= Numbers possible due to remaining available 30 bits
= 230
Uses
Class B is used by organizations requiring medium
size networks like IRCTC, banks etc.
Class C
If the 32 bit binary address starts with bits 110, then IP Address
belongs to class C.
In class C IP Address,
The first 24 bits are used for the Network ID.
The remaining 8 bits are used for the Host ID.
Total number of IP Addresses available in class C
= Numbers possible due to remaining available 29 bits
= 229
Uses
Class C is used by organizations requiring small to
medium size networks.
For example- engineering colleges, small universities,
small offices etc
Class D
If the 32 bit binary address starts with bits 1110, then IP
Address belongs to class D.
Uses
Class D is reserved for multicasting.
In multicasting, there is no need to extract host address
from the IP Address.
This is because data is not destined for a particular host.
Class E
If the 32 bit binary address starts with bits 1111, then IP
Address belongs to class E
Total number of IP Addresses available in class E
= Numbers possible due to remaining available 28 bits
= 228
Uses
Class E is reserved for future or experimental purposes.
IPV6
Format of an IPv6 address
An IPv6 address is 128 bits long and is arranged in eight groups, each
of which is 16 bits.
Each group is expressed as four hexadecimal digits and the groups are
separated by colons.
The network component is the first 64 bits of the address and is used for routing.
The node component is the later 64 bits and is used to identify the address of
the interface. It is derived from the physical, or MAC address, using the 64-bit
extended unique identifier (EUI-64) format defined by the Institute of Electrical
and Electronics Engineers (IEEE).
The network component can be split even further into a block of 48 bits and a
block of 16 bits.
The lower 16-bit section is controlled by network administrators and is used for
subnets on an internal network.
FE80:CD00:0:0CDE:1257:0:211E:729C
Subnetting
and
Internetworking
IP Subnetting
In networking,
► The process of dividing a single network into multiple sub
networks is called as subnetting.
► The sub networks so created are called as subnets.
Example-
Following diagram shows the subnetting of a big single
network into 4 smaller subnets-
Contd.,
Advantages
The two main advantages of subnetting a network are
⮚ It improves the security.
⮚ The maintenance and administration of subnets is easy.
Subnet ID
⮚ Each subnet has its unique network address known as its
Subnet ID.
⮚ The subnet ID is created by borrowing some bits from the
Host ID part of the IP Address.
⮚ The number of bits borrowed depends on the number of
subnets created.
Types of Subnetting
Contd.,
1. Fixed Length Subnetting
Fixed length subnetting also called as classful subnetting
divides the network into subnets where-
⮚ All the subnets are of same size.
⮚ All the subnets have equal number of hosts.
⮚ All the subnets have same subnet mask.
2. Variable Length Subnetting
Variable length subnetting also called as classless subnetting
divides the network into subnets where-
⮚ All the subnets are not of same size.
⮚ All the subnets do not have equal number of hosts.
⮚ All the subnets do not have same subnet mask.
Subnetting Examples
Consider, we have a big single network having IP Address
200.1.2.0.
We want to do subnetting and divide this network into 2
subnets.
Clearly, the given network belongs to class C.
Contd.,
For creating two subnets and to represent their subnet IDs,
we require 1 bit.
So,
⮚ We borrow one bit from the Host ID part.
⮚ After borrowing one bit, Host ID part remains with only
7 bits.
Contd.,
Contd.,
Contd.,
Contd.,
Example-02:
Consider-
We have a big single network having IP Address 200.1.2.0
We want to do subnetting and divide this network into 4
subnets.
Clearly, the given network belongs to class C.
Contd.,
Contd.,
Contd.,
Contd.,
Contd.,
Disadvantages of Subnetting-
During subnetting,
⮚ We have to face a loss of IP Addresses.
⮚ This is because two IP Addresses are wasted for each
subnet.
⮚ One IP address is wasted for its network address.
⮚ Other IP Address is wasted for its direct broadcasting
address.
⮚ After subnetting, the communication process becomes
complex
Problem-01:
Suppose a network with IP Address 192.16.0.0. is divided
into 2 subnets, find number of hosts per subnet.
► Subnet Address
► First Host ID
► Last Host ID
► Broadcast Address
Contd.,
Thank You…