IP Addressing and
Subnetting
Computer Networks
A N U RAG G OYA L
10321210121
Introduction to IP Addressing
•IP Addressing is a numerical label assigned to each device connected to a
computer network, serving two main purposes: host or network interface
identification and location addressing.
•IPv4, the most commonly used version, uses a 32-bit address space.
•An IP address consists of four sets of numbers, separated by periods, and
each set represents a specific part of the address.
•IPv4, the most commonly used version, uses a 32-bit address space.
IP Address Classes
8 bits 8 bits 8 bits 8 bits
CLASS A: Network Host Host Host
CLASS B: Network Network Host Host
CLASS C: Network Network Network Host
CLASS D: (Multicast)
CLASS E: (Research)
Binary representation of IP
Address
32 bits
Dotted
Decimal
Network Host
Maximum 255 255 255 255
1 8 9 16 17 24 25 32
Binary 11111111 11111111 11111111 11111111
128
8
4
2
1
64
32
16
128
8
4
2
1
64
32
16
128
8
4
2
1
128
8
4
2
1
64
32
16
64
32
16
Example
Decimal 172 16 122 204
Example
Binary 10101100 00010000 01111010 11001100
Determining available host
Addresses
Network Host
172 16 0 0
N
11
9
8
7
6
5
4
3
2
1
16
15
14
13
12
10
10101100 00010000 00000000 00000000 1
00000000 00000001 2
00000000 00000011 3
The formula to calculate number of host addresses
...
...
...
are= 2**N 11111111 11111101 65534
11111111 11111110 65535
N= no. of bit length of host address
11111111 11111111 65536
- 2
2N-2 = 216-2 = 65534 65534
Subnet Masks
•Subnet masks are used to divide IP addresses into network and host portions.
• A subnet mask uses a combination of ones (1) and zeros (0) to indicate the
network portion and host portion of an IP address, respectively.
•The number of ones in a subnet mask determines the size of the network,
while the number of zeros represents the size of the hosts within the
network.
172.16 . 2 . 160 172.16 . 2 . 160
Network Host Network Subnet Host
CIDR Notation
•CIDR (Classless Inter-Domain Routing)
notation is an efficient way to represent
IP addresses and subnet masks.
•CIDR combines the IP address and
subnet mask using a forwarding slash (/)
followed by the number of network bits
in the address.
•For example, an IP address of
192.168.0.1 with a subnet mask of
255.255.255.0 can be represented as
192.168.0.0/24.
Subnetting Basics
Subnetting is the process of dividing a network into smaller subnetworks,
allowing for better network management and addressing efficiency.
Subnets can be created by borrowing bits from the host portion of an IP
address.
Properly subnetted networks can reduce network congestion and improve
security. Network Host
172.16.2.160 10101100 00010000 00000010 10100000
255.255.0.0 11111111 11111111 00000000 00000000
10101100 00010000 00000000 00000000
Network
Number 172 16 0 0
Subnet Mask with Subnets
Network Subnet Host
172.16.2.160 10101100 00010000 00000010 10100000
255.255.255.0 11111111 11111111 11111111 00000000
10101100 00010000 00000010 00000000
128
192
224
240
248
252
254
255
Network
Number 172 16 2 0
Network number extended by eight bits
Continued..
Network Subnet Host
172.16.2.160 10101100 00010000 00000010 10100000
255.255.255.192 11111111 11111111 11111111 11000000
10101100 00010000 00000010 10000000
128
192
224
240
248
252
254
255
128
192
224
240
248
252
254
255
Network
Number 172 16 2 128
Network number extended by ten bits
IPv6 Addressing
• IPv6 is the successor to IPv4, designed to address the limited address
space of IPv4.
• An IPv6 address is represented as eight groups of four hexadecimal digits,
separated by colons.
• IPv6 provides significantly more address space and supports a more
efficient routing structure.
• The size of an IPv6 address is 128 bits, compared to 32 bits in IPv4. The
address space therefore has
2128=340,282,366,920,938,463,463,374,607,431,768,211,456 addresses (340
undecillion, approximately 3.4×1038).
Ipv4 vs Ipv6
THANK YOU