Chapter-4 Ip Address and Subnetting
Chapter-4 Ip Address and Subnetting
• What is IP?
• An Internet Protocol address is also known as IP address. It is a
numerical label which assigned to each device connected to a
computer network which uses the IP for communication.
• IP address act as an identifier for a specific machine on a particular
network.
• The IP address is also called IP number and internet address. IP
address specifies the technical format of the addressing and packets
scheme.
• Most networks combine IP with a TCP (Transmission Control
Protocol). It also allows developing a virtual connection between a
destination and a source.
IP version-6 address
• IPv4 was the first version of IP. It was deployed for production in the
ARPANET in 1983.
• Today it is most widely used IP version.
• It is used to identify devices on a network using an addressing system.
• The IPv4 uses a 32-bit address scheme allowing to store 2^32 addresses
which is more than 4 billion addresses.
• Till date, it is considered the primary Internet Protocol and carries 94% of
Internet traffic.
• Example Ip-v4:
• 10.0.0.0
• 176.168.0.0
• 192.168.0.0
Subnetting
• To break up a giant network into a bunch of smaller ones is called subnetting.
• Creating subnetworks is essentially the act of taking bits from the host
portion of the address and reserving them to define the subnet address
instead. It will result in fewer bits being available for defining your hosts.
To create a subnet, fulfill these three steps:
1. Determine the number of required network IDs:
- One for each LAN subnet
-One for each wide area network connection
2. Determine the number of required host IDs per subnet:
-One for each TCP/IP host
-One for each router interface
3. Based on the above requirements, create the following:
- A unique subnet mask for your entire network
-A unique subnet ID for each physical segment
-A range of host IDs for each subnet
Subnet Masks
A subnet mask is a 32-bit value that allows the device that’s
receiving IP packets to distinguish the network ID portion
from the host ID portion of the IP address. This 32-bit subnet
mask is composed of 1s and 0s, where the 1s represent the
positions that refer to the network subnet addresses.
Power of 2
Decimal values in a mask and their binary equivalents
Decimal Binary
0 00000000
128 10000000
192 11000000
224 11100000
240 11110000
248 11111000
252 11111100
254 11111110
255 11111111
Classless Inter-Domain Routing (CIDR)
It’s basically the method that Internet service providers (ISPs) use to allocate a
number of addresses to a companies. It uses the slash notation that represents
the number of 1s in the subnet mask.
192.168.10.32/28. This is telling you what your subnet mask is. The slash
notation (/) means how many bits are turned on (1s).
Subnet Mask CIDR representation
• 255.0.0.0 /8
• 255.255.0.0 /16
• 255.255.128.0 /17
• 255.255.192.0 /18
• 255.255.224.0 /19
• 255.255.240.0 /20
• 255.255.248.0 /21
• 255.255.252.0 /22
• 255.255.254.0 /23
• 255.255.255.0 /24
Subnetting Class C Addresses
In a Class C address, only 8 bits are available for defining the
hosts. Remember that subnet bits start at the left and move to
the right, without skipping bits. This means that the only Class C
subnet masks can be the following:
Binary Decimal CIDR
• 00000000= 0 /24
• 10000000= 128 /25
• 11000000= 192 /26
• 11100000= 224 /27
• 11110000= 240 /28
• 11111000= 248 /29
• 11111100= 252 /30
Subnetting Formulas
• How many subnets? 2x = number of subnets. x is the number of masked
bits.
• Number of host bits = 32 – number of network bits
• How many hosts per subnet? 2y – 2 = number of hosts per subnet. y is the
number of unmasked bits, or the 0s.
• What are the valid subnets? 256 – subnet mask = block size, or
increment number.
• Number of borrowed bits = network bits – default subnet bit(for class full
addressing)
• First host address is obtained adding one at the last octet of a subnet or
by turning every host bit of a subnet to 1 except the last one.
• Last host address can be obtained by adding number of hosts to subnet
ID or by turning every host bit of a subnet to 1 except the last one.
• Broadcast address is obtained by turning all the host bits in a subnet to 1.
Subnetting class C address
1. Address: 192.168.10.0/25
Subnet Mask: 255.255.255.128
No. Of subnets= , Here n is bits for subnetting which is 1,
=2
No of hosts= -2= 128-2= 126
Block Size= 256-128= 128, Subnets: 0,128
Address: 192.168.10.0/30
Subnet Mask: 255.255.255.252
No. Of subnets= =64 , Bits taken for subnetting = 6
No of hosts= -2= 4-2= 2, Host bits=2
Block Size= 256-252=4
Subnets: 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40,…..…
No. Network Address First IP Last IP Broadcast
Address: 172.16.0.0/24
Subnet Mask: 255.255.255.0
No. Of subnets= =256 , Here n=8 ,
No of hosts= -2= 256-2= 254 (8bits)
Block Size= 256-255=1
Subnets: 0.0, 1.0,2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, …………
No. Network Address First IP Last IP Broadcast
1. 172.16.0.0 172.16.0.1 172.16.0.254 172.16.0.255
2. 172.16.1.0 172.16.1.1 172.16.1.254 172.16.1.255
3. 172.16.2.0 172.16.2.1 172.16.2.254 172.16.2.255
Subnetting Practice class B
Address: 172.16.0.0/28
Subnet Mask: 255.255.255.240
No. Of subnets= =4096 , Here n=12 ,
No of hosts= -2= 16-2= 14 (4bits)
Block Size= 256-240=16
Subnets: 0.0, 0.16,0.32,0.48,0.64,0.80,0.96 …………
Address: 172.16.0.0/30
Subnet Mask: 255.255.255.252
No. Of subnets= =16384 , Here n=14 ,
No of hosts= -2= 4-2= 2 (2bits)
Block Size= 256-252=4
Subnets: 0.0, 0.4, 0.8, 0.12, 0.16, 0.20, 0.24, …………
Routing table
172.16.12.0/24 172.16.12.0/24
172.16.13.0/24
172.16.14.0/24
172.16.15.0/24 Routing table
172.16.13.0/24
172.16.12.0/22