IPv4 Addressing
Part TWO
Objectives:
Understanding Classless Interdomain
Routing (CIDR).
Understanding Variable Length Subnet
Mask (VLSM)
TCP/IP Utilities.
Classless Inter-Domain Routing (CIDR)
CIDR is a new addressing scheme for the Internet which allows for
more efficient allocation of IP addresses than the old Class A, B, and C
address scheme.
Under this scheme IP Addresses are specified using a combination of
an IP address and its associated network mask in a A.B.C.D/Prefix
format e.g. 192.168.12.0/24.
In the example /24 indicates that the number of 1’s in a subnet mask
24 i.e. the mask is 11111111.1111111.11111111.00000000 which
translates to 255.255.255.0.
CIDR Table!!!
CIDR Subnet Mask Block Size Usable IP’s
Value (Based on Last bit Position) (2h-2)
/30 255.255.255.252 4(Fourth Octet) 2
/29 255.255.255.248 8(Fourth Octet) 6
/28 255.255.255.240 16(Fourth Octet) 14
/27 255.255.255.224 32(Fourth Octet) 30
/26 255.255.255.192 64(Fourth Octet) 62
/25 255.255.255.128 128(Fourth Octet) 126
/24 255.255.255.0 1(Third Octet) 254
/23 255.254.0.0 2(Third Octet) 510
/13 255.248.0.0 8(Second Octet) 524826
Addressing Networks
(VLSM)
What you already know
n bits borrowed for subnetting gives you 2n subnets.
So 1 bit gives 2 subnets, 2 bits give 4 subnets, 3 bits give 8 subnets
and so on.
If you need 5 subnets, how many bits do you borrow?
If you need 10 subnets, how many bits do you borrow?
Guide Lines
When addressing networks we need to consider the number of IP
addresses required per subnet.
Ask yourselves the following questions
How many host bits do we need?
n bits can provide 2n addresses
One for network, one for broadcast
So 2n – 2 host addresses.
2n – 2 could be 2, 6, 14, 30, 62, 126, 254, 510, 1022, 2046 and so on.
Start with the Subnet that has the largest number of hosts moving
down
Go for a number big enough to give us enough addresses.
Test your Understanding!!!
How many subnets can you see in the diagram below?
Include point to point links.
Addressing example no VLSM
172.16.0.0/21
What we have and need
Given IP address 172.16.0.0/21
That’s 172.16.0.0 to 172.16.7.255
4 subnets needed:
Student LAN has 460 hosts
Instructor LAN has 64 hosts
Administrator LAN has 20 hosts
WAN has 2 hosts
Without VLSM – same size subnets
Biggest subnet has 460 hosts.
Formula for hosts is 2 n – 2
n = 9 gives 510 hosts (n = 8 gives only 254)
So 9 host bits needed.
That means 32 – 9 = 23 network bits
/23 or subnet mask 255.255.254.0
Network addresses
/23 so subnet mask in binary is
11111111 11111111 11111110.00000000
Octet 3 is the interesting one.
Value of last network bit in octet 3 is 2
So network numbers go up in 2s
172.16.0.0
172.16.2.0
172.16.4.0
172.16.6.0
Subnet with no VLSM
Network Subnet address Host range Broadcast
address
Student 172.16.0.0/23 172.16.0.1 - 172.16.1.255
172.16.1.254
Instructor 172.16.2.0/23 172.16.2.1 - 172.16.3.255
172.16.3.254
Admin 172.16.4.0/23 172.16.4.1 - 172.16.5.255
172.16.5.254
WAN 172.16.6.0/23 172.16.6.1 - 172.16.7.255
172.16.7.254
Addressing example with VLSM
172.16.0.0/22 is OK
What we have and need
Given IP address 172.16.0.0/22
That’s 172.16.0.0 to 172.16.3.255
4 subnets needed:
Student LAN has 460 hosts
Instructor LAN has 64 hosts
Administrator LAN has 20 hosts
WAN has 2 hosts
With VLSM
Student subnet has 460 hosts.
Formula for hosts is 2n – 2
n = 9 gives 510 hosts (n = 8 gives only 254)
So 9 host bits needed.
That means 32 – 9 = 23 network bits
/23 or subnet mask 255.255.254.0
Network address 172.16.0.0
Broadcast address 172.16.1.255
With VLSM
Instructor subnet has 64 hosts.
Formula for hosts is 2 n – 2
n = 7 gives 126 hosts (n = 6 gives only 62)
So 7 host bits needed.
That means 32 – 7 = 25 network bits
/25 or subnet mask 255.255.255.128
Network address 172.16.2.0
Broadcast address 172.16.2.127
With VLSM
Admin subnet has 20 hosts.
Formula for hosts is 2n – 2
n = 5 gives 30 hosts (n = 4 gives only 14)
So 5 host bits needed.
That means 32 – 5 = 27 network bits
/27 or subnet mask 255.255.255.224
Network address 172.16.2.128
Broadcast address 172.16.2.159
With VLSM
WAN subnet has 2 hosts.
Formula for hosts is 2n – 2
n = 2 gives 2 hosts
So 2 host bits needed.
That means 32 – 2 = 30 network bits
/30 or subnet mask 255.255.255.252
Network address 172.16.2.160
Broadcast address 172.16.2.163
Visually with VLSM
172.16.0.0 172.16.1.0 172.16.2.0 172.16.3.0
Instructor
Student
Admin
WAN
Case 2. Given 192.168.1.0/24
Subnet 192.168.1.0/24
2 subnets with 28 hosts each (largest)
5 host bits 25 - 2 = 30 would be just enough
But allow for expansion: 6 host bits give 62
Network bits 32 - 6 = 26
so /26 or subnet mask 255.255.255.192
Network Subnet address Host range Broadcast address
B 192.168.1.0/26 192.168.1.1 192.168.1.63
- 192.168.1.62
E 192.168.1.64/26 192.168.1.65 - 192.168.1.127
192.168.1.126
Subnet 192.168.1.1/24
1 subnets with 14 hosts
4 host bits 24 - 2 = 14 would be just enough
But allow for expansion: 5 host bits give 30
Network bits 32 - 5 = 27
so /27 or subnet mask 255.255.255.224
0-127 range already used
Network Subnet address Host range Broadcast address
A 192.168.1.128/27 192.168.1.129 - 192.168.1.159
192.168.1.158
Subnet 192.168.1.1/24
1 subnets with 7 hosts
4 host bits 24 - 2 = 14 is enough
Network bits 32 - 4 = 28
so /28 or subnet mask 255.255.255.240
0-159 range already used
Network Subnet address Host range Broadcast address
D 192.168.1.160/28 192.168.1.161 - 192.168.1.175
192.168.1.174
Subnet 192.168.1.1/24
1 subnets with 2 hosts
2 host bits 22 - 2 = 2 is enough
Network bits 32 - 2 = 30
so /30 or subnet mask 255.255.255.252
0-175 range already used
Network Subnet address Host range Broadcast address
C 192.168.1.176/30 192.168.1.177 - 192.168.1.179
192.168.1.178
Subnet plan with VLSM
Network Subnet address Host range Broadcast address
B 192.168.1.0/26 192.168.1.1 192.168.1.63
- 192.168.1.62
E 192.168.1.64/26 192.168.1.65 - 192.168.1.127
192.168.1.126
A 192.168.1.128/27 192.168.1.129 - 192.168.1.159
192.168.1.158
D 192.168.1.160/28 192.168.1.161 - 192.168.1.175
192.168.1.174
C 192.168.1.176/30 192.168.1.177 - 192.168.1.179
192.168.1.178
TCP/IP Utilities
Ipconfig/ifconfig: Used to verify the IP configuration of a computer
and its interface cards.
Usage:ipconfig -option
• Ping: Used to test IP configuration (identifies connection problems).
Usage: ping IP address/FQDN
Arp: Displays and modifies the IP-to-Physical address translation
tables used by address resolution protocol (ARP).
Usage: arp -option
Tracert: Verifies the route a packet takes to reach its destination.
Usage: tracert IP address/FQDN
THE END