IP Addressing and Subnetting
IP Addressing and Subnetting
Ip Addressing
AKA logical address
Assigned by the network administrator to provide a way of grouping network devices.
REVIEW
Binary to Decimal / Decimal to Binary Conversion
Convert 157 to binary
Decimal
Binary
128
64
32
16
16
128
Hence, 128+16+8+4+1=157
128
64
32
16
128
64
Hence, 128+64+8+2=202
Therefore the binary equivalent of 202 is 11001010
Decimal
Binary
128
64
32
16
16
128
Hence, 128+16+8+1 = 153
128
64
32
16
128
64
32
Hence, 128+64+32+8+2+1=235
Therefore the decimal equivalent of 10011001 is 235
IP Address (Version 4)
32 bits logical address.
Used as the source and destination address of a device either in LAN or WAN.
255
00001010 . 11111111 .
1st Octet
2nd Octet
16
252
00010000 .
11111100
3rd Octet
4th Octet
Decimal Format
Binary Format
Classes of IP Address
Class
Range
Class A
0 - 127
Class B
Class C
192 - 223
Class D
224 - 239
Multicasting
Class E
240 - 255
Experimental
IP Addresses
Parts of IP Address
Network Portion (Network Identifier)
Used to Identify the network or group of an IP address.
Host Portion
Uniquely provides identity for a given device in the network.
Class A
N.H. H.H
Class B
N.N. H.H
Class C
N.N. N.H
Note: N stands for Network Portion
H stands for Host Portion
Example
s: 10.255.16.252
Class A
210.25.176.22
Class C
25.37.126.143
Class A
225.37.126.143
Class D
128.158.21.78
Class B
240.158.21.78
Class E
223.156.161.0
111.177.61.0
Class C
Class A
224.0.0.5
131.77.116.0
Class D
191.0.0.140
Class B
199.22.1.10
Class B
Class C
198.126.0.0
Class C
18.126.10.0
Class A
134.128.23.0
Class B
234.17.0.0
Class D
162.91.21.11
Class B
172.81.19.10
Class B
67.109.21.0
Class A
197.229.21.0
Class C
134.128.23.0
Class B
245.0.0.0
Class E
67.159.21.0
Class A
187. 9.0.3
Class B
214.108.0.0
Class C
219.8.81.111
Class C
Class
16,777,214
65,534
254
Types of IP Address
1. Network Address
Address that identifies the network or group of IP address.
All the bits in the host portion are set to zero 0.
Invalid IP address
2. Broadcast Address
Address used to send traffic to all hosts.
All the bits in the host portion are set to one 1.
Invalid IP address
3. Host Address
Valid Addresses assigned to all devices in the network
Addresses between the network and broadcast address.
Types of IP Address
Class
Network Address
A
14.0.0.0
correct
14.1.1.1
incorrect
14.20.0.0
incorrect
14.11.11.11
incorrect
14.20.21.0
incorrect
14.111.111.111
incorrect
14.255.255.255
correct
14.0.255.255
incorrect
128.0.0.0
correct
128.130.0.0 correct
128.130.18.0 incorrect
C
Broadcast Address
198.0.0.0
correct
198.60.0.0 correct
198.130.18.0 correct
128.255.255.255 correct
128.130.255.255 correct
128.130.18.255 incorrect
198.0.0.255
correct
198.60.255.255 correct
198.255.255.255 correct
.
.
.
0
0
X
.
.
.
0
0
0
BROADCAST ADDRESS
<0-127>
.
255
<128-191> .
X
<192-223> .
X
.
.
.
255
255
X
.
.
.
255
255
255
Types of IP Address
4. Reserved IP Address
A. Loopback Address
Used to check if the TCP/IP protocol is properly installed.
Used to check if the network interface card ip working.
127.X.X.X
B. Local Link address or the Automatic Private IP Address
(APIPA)
Automatically generated IP Address by the computer when the
DHCP server fails to send an IP address. Used for temporary
communication.
169.254.X.X
C. Subnet Mask
A subnet mask separates the IP address into the network and host addresses
(<network><host>).
It is called a subnet mask because it is used to identify network address of an IP address by
performing bitwise AND operation on the subnet mask.
Subnet Mask is made by setting network bits to all "1"s and setting host bits to all "0"s.
CIDR value
Class A
255.0.0.0
/8
11111111.00000000.00000000.00000000
Class B
255.255.0.0
/16
11111111.11111111.00000000.00000000
Class C
255.255.255.0
/24
11111111.11111111.11111111.00000000
ANDing
How to identify NETWORK ADDRESS
INPUT
X
0
1
0
1
Example:
IP Address: 172.16.32.211
Subnet Mask: 255.255.0.0
OUTPUT
Y
0
0
1
1
0
0
0
1
172.16.32.211 =
255.255.0.0
. 16
.0
.0
CATEGORIES OF IP ADDRESS
Public IP Address
Are those IP Addresses assigned by the IANA (Internet Assigned
Number Authority) or by the ISP (Internet Service Provider)
These addresses are used when connecting to the Internet or
Accessing a remote resource.
Private IP Address
Addresses used in the Local Area Network.
Free IP addresses
Not public routable
-Range of Private IP AddressesClass A
10.0.0.0
10.255.255.255
Class B
172.16.0.0
172.31.255.255
Class C
192.168.0.0 192.168.255.255
Public IP Address
Default Gateway
Public IP Address
Default Gateway
Default Gateway
Test Yourself
Given
172.23.25.0
192.168.21.
0
112.61.0.0
128.21.255.
255
201.1.20.0
171.31.0.25
5
10.0.255.25
Clas
s
B
C
A
Type
Host
Network
Host
Category
Private
Private
Subnet
Mask
255.255.0.0
Validit
Valid
y
Invalid 255.255.255.0
Public
Valid
255.0.0.0
Broadcast
Public
Invalid
255.255.0.0
Network
Public
Invalid 255.255.255.0
Host
Public
Valid
255.255.0.0
Host
Private
Valid
255.0.0.0
Subnetting
Process of dividing a single broadcast domain IP Address
into two or more subdomain, process of borrowing bits
from the host portion of a given IP Address.
The easy way:
Given:
192.168.1.0/24
Subnetting
STEPS:
1. Given the IP Address, count the number of broadcast domain/s.
2. Convert the number of broadcast domain into binary and count the number of
bits.
Where Borrowed Bits(BB)=number of binary bits
3.Determine the new subnetmask by adding the borrowed bits to the default
subnetmask.
4.Identify the Increment.
5. Identify the new Sub-networks.
Given:
192.168.1.0/24
1
4
2
3
Number of bits
= 3 bits
255.0.0.0
/8
11111111.00000000.00000000.00000000
Class B
255.255.0.0
/16
11111111.11111111.00000000.00000000
Class C
255.255.255.0
/24
11111111.11111111.11111111.00000000
11111111.11111111.11111111.00000000
11111111.11111111.11111111.11100000
No. of
Bits
128
128
11000000
64
192
11100000
32
224
11110000
16
240
11111000
248
11111100
252
11111110
254
11111111
255
Borrowed
Bits
Increment
128 64
32
16
End of Subnet
128 192 224 240 248 252 254 255
Mask
1st Octet
/1
2nd Octet
/9
/2
/3
/4
/5
/6
/7
/8
3rd Octet
4th Octet
192.
168.
1.
/27
8bits
8bits
8bits
3bits
255.
255.
255.
224
/27
Increment = 32
5. Increment ( )is the value of the lowest network bit available. This
value should be added in the octet where the borrowed bit is located to
identify the new subnetworks.
11111111.11111111.11111111.
128
64
32
16
= 32
11100000
Subnet 4
192.168.1.158 Last usable host
192.168.1.159 Broadcast Address
Subnet 5
192.168.1.190 Last usable host
192.168.1.191 Broadcast Address
Subnet 6
192.168.1.222 Last usable host
192.168.1.223 Broadcast Address
Subnet 7
192.168.1.254 Last usable host
192.168.1.255 Broadcast Address
Example 2
172.16.0.0/16
20 subnets =
/16
8bits
172.
8bits
16.
255.
255.
20 subnets
5 bits
5
/21
5bits
0.
248.
Increment=
172.16.0.0/21
172.16.8.0/21
172.16.16.0/21
172.16.24.0/21
0bits
0
/21
0
8
172.16.32.0/21
172.16.40.0/21
172.16.48.0/21
172.16.56.0/21
172.1664.0/21
172.16.72.0/21
172.16.80.0/21
172.16.88.0/21
E ND