IP Addressing
Dr. Joby P P
Professor & Head CSE
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 1
IP Addressing
• IP address is an address having information about how to reach a
specific host
• An IP address is a 32 bit unique address having an address space of 232
• (IPv4)
Two notations
Dotted decimal notation
Hexadecimal notation
1.The value of any byte is between 0 and 255 (both included).
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 2
Classful IP Addressing
The 32 bit IP address is divided into five sub-classes.
Class A, Class B, Class C, Class D Class E
Class D – Multicast
Class E – Research Purpose
The order of bits in the first octet determine the classes of IP address
Network ID
Host ID
The class of IP address is used to determine the bits used for network ID
and host ID and the number of total networks and hosts possible in that
particular class
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 3
General Format
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 4
Class A
Large number of hosts
• The network ID is 8 bits long
• The host ID is 24 bits long
IP addresses in class A ranges
from 1.x.x.x – 126.x.x.x
•2^7-2= 126 network ID (2 address is subtracted because 0.0.0.0
and 127.a.b.c are special address.)
•2^24 – 2 = 16,777,214 host ID
• Default subnet mask for class A is 255.x.x.x.
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 5
Class B
Medium-sized to Large-sized networks
• The network ID is 16 bits long
• The host ID is 16 bits long
IP addresses in class B ranges
from 128.0.x.x – 191.255.x.x
• 2^14 = 16384 network address
• 2^16 – 2 = 65534 host address
• Default subnet mask for class B is 255.255.x.x.
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 6
Class C
Small-Sized Networks
•The network ID is 24 bits long.
•The host ID is 8 bits long.
IP addresses in class C ranges from
192.0.0.x – 223.255.255.x.
•2^21 = 2097152 network address
•2^8 – 2 = 254 host address
Default sub-net mask for class C is 255.255.255.x.
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 7
Summary
Default Subnet No of No of Hosts
IP Class Range
Mask Networks Per Network
A 1-126 255.0.0.0 126 16,777,214
B 128-191 255.255.0.0 16,384 65,534
C 192-223 255.255.255.0 2,097,152 254
D Multicast
E Reserved
Address Depletion
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 8
Classless Interdomain Routing (CIDR)
Classless addressing – Designed to overcome address depletion problem
No Classes
Address are in Blocks
Allocation of IP Addresses more efficient
Subnetting
Dividing a large block of addresses into several contiguous sub-blocks and
assigning these sub-blocks to different smaller networks is called subnetting
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 9
Example: Address : 200.12.22.39/28, Find the first and last address in
the block
11001000. 00001100. 00010110. 00100111 (address)
11111111. 11111111. 11111111. 11110000
First Address
(32-28=4) last 4 bits 0
11001000. 00001100. 00010110. 00100000
200.12.22.32
Last Address
last 4 bits 1
11001000. 00001100. 00010110. 00101111
200.12.22.47
No of Addresses:
232-28 = 24 =16
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 10
Subnetting
• Number of subnets
• Subnet address
• Broadcast address
• Number of hosts in a subnet
• First Host ID
• Last Host ID
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 11
Class C Network Subnetting
No of Network Router Broadcast No of IP
Subnet Mask
Subnets Address Address Address Addresses
1 255.255.255.0 x.y.z.0 x.y.z.1 x.y.z.255 253
255.255.255.128 x.y.z.0 x.y.z.1 x.y.z.127 125
2
255.255.255. x.y.z.128 x.y.z.129 x.y.z.255 125
255.255.255.192 x.y.z.0 x.y.z.1 x.y.z.63 61
255.255.255. x.y.z.64 x.y.z.65 x.y.z.127 61
4
255.255.255. x.y.z.128 x.y.z.129 x.y.z.191 61
255.255.255. x.y.z.192 x.y.z.193 x.y.z.255 61
03/25/2021 MODERN COMPUTER NETWORKS SJCET CSE 12