IP Address & Subneting
IP Address & Subneting
1
What is IP address
Address
Host IP Address Network ID Host ID
Class
STOP
255.255.255.255
16
Directed broadcast address
192.168.20.0
192.168.20.255
Broadcast address
17
Example: 172.16.20.200/16
• According to RFC-1918.
• Organizations make use of the private Internet
address space for hosts that require IP
connectivity within their enterprise network, but
do not require external connections to the global
Internet.
• Class A: 10.0.0.0.
• Class B: 172.16.0.0 - 172.31.0.0.
• Class C: 192.168.0.0 - 192.168.255.0.
19
Example : Step 1
Address
Host IP Address Network ID Host ID Broadcast Address
Class
1) 150.100.255.255
2) 175.100.255.18
3) 195.234.253.0
4) 100.0.0.23
5) 188.258.221.176
6) 127.34.25.189
7) 224.156.217.73
8) 10.1.255.255
23
SUBNETTING
AND
CREATING A SUBNET
24
Why we need to divide network?
• 192.168.2.100 / 255.255.255.0.
• 11000000.10101000.00000010.01100100.
• 11111111.11111111.11111111.00000000.
• 11000000.10101000.00000010.01100100.
• Class C network:
– 24 bits for network portion.
– 0 bits for subnet portion.
– 8 bits for host portion.
• Subnet address: 192.168.2.0.
30
Subnet mask: Example
• 172.16.65.100 / 255.255.240.0.
• 10101100.00010000.01000001.01100100.
• 11111111.11111111.11110000.00000000.
• 10101100.00010000.01000001.01100100.
• Class B network:
– 16 bits for network portion.
– 4 bits for subnet portion.
– 12 bits for host portion.
• Subnet address: 172.16.64.0.
31
How many bits can I borrow?
• Boolean operators:
– AND.
– OR.
– NOT.
33
AND operator
1 AND 1 = 1
1 AND 0 = 0
0 AND 1 = 0
0 AND 0 = 0
34
OR operator
1 OR 1 = 1
1 OR 0 = 1
0 OR 1 = 1
0 OR 0 = 0
35
NOT operator
NOT 1 = 0
NOT 0 = 1
36
Boolean algebra examples
• Choose n = 4:
– Number of possible subnets is:
24 - 2 = 14
– Number of possible hosts on each subnet is:
2(16-4) - 2 = 4094
• Other choice n = 5 , n = 6 ?
43
Calculating a subnet: STEP 2 (Cont.)
Sub-network Broadcast
No Possible host address Use?
address address
.. .. .. .. ..
.. .. .. .. ..