Transcript IP Address
IP Addressing & Subnetting
IP Address
IP Classes
A,B,C,D,E
All IP addresses are composed of two parts :
Network (or prefix)
Host (or Node)
IP versions
IPv4
IPv6
IP Version
IPv4
IP address : 32bits , 4 octets of 8bits
4 294 967 296 possibilities 232
Example :
192 .168.10.1 (base 10)
11000000.10101000.00001010.00000001(base 2)
Classless & Classful IP Addressing
Problems with IPv4
Not enough IP addresses
Slow Packet Handling
Not enough security
Classful Vs Classless Address
Classful Addressing:
No such name, when classless addressing system
came into existence then named as Classful.
Each of the IP address belongs to a particular class
that's why they are classful addresses.
All the IP addresses that are available are divided
into the five classes A,B,C,D and E.
Class A,B and C address are frequently used
Class D is for Multicast and is rarely used (IP TV)
Class E is reserved and is not currently in use.
Classful Addressing
(Disadvantages)
It limits the flexibility and number of
addresses
Don’t send subnet information – sends
complete network address.
Router supply to, its own locally config. subnet
mask.
You have the same subnet mask in a classful
network address.
Classful Vs Classless Address
Classless Addressing:
Classless addressing system is also known as
CIDR (Classless Inter-Domain Routing).
Classless addressing is a way, to allocate and
specify the Internet addresses used in inter-
domain routing.
More flexible than Classful IP Addresses.
Classless Address
If you needs more than 254 host machines
Use class B address
i.e. far fewer than the 65,534 host addresses
Now if you needs only 1000 IP addresses.
64534 IP addresses get wasted.
For this reason, the Internet was, until the
arrival of CIDR, running out of address space
much more quickly than necessary.
CLASSFUL ADDRESSING
Classful IP Addressing
Only pass the Network address and not pass
subnet mask
i;e; 10.0.0.0
Example: RIP v1, IGRP
It follow the IP classes (A,B,C,E,F)
All range of IPs have the same of subnet mask
Default subnet mask
Classless Address
CIDR effectively solved the problem
With a new & more flexible way to specify N/W
addresses in routers.
A CIDR network address looks like this: 192.30.250.0/15
"192.30.250.0" is the network address and
"15" specifies that the first 15 bits are the
network part of the address.
Leaving the last 17 bits for host address.
Classless protocol sends subnet.
Classless IP Addressing
Classless IP Addressing
Pass both network address and subnet mask
i;e 1.5.0.0 255.255.0.0
Example; RIPv2, EIGRP, OSPF, ISIS
It does not follow the IP classes (A,B,C)
Different subnet mask of networks
Do not use default subnet mask
IPv6
IP address : 128bits, 8 quartets of 4 hexadecimal
2128 possibilities
Example :
1FFF:0000:0A88:85A3:0000:0000:AC1F:8001
(base 16)
IP Address Classes
Class A
Class B
Class C
IP Address Classes
Class A : 8bits for Network
24 bits for Host
Example : 10.50.49.13 255.0.0.0
Class B : 16bits for Network
16bits for Host
Example : 172.16.1.23 255.255.0.0
Class C : 24bits for Network
Example : 192.168.1.34 255.255.255.0
8bits for Host
IP Address Classes
IP Addresses
Four 8-bit numbers (Hierarchical)
18.26.0.1
network
32-bits
host
Specifies both network and host
Number of bits allocated to specify network varies
Three classes:
A
0 net
1 7
B
host
24 bits
C
1 0 net
host
110
net
host
2
16 bits
3
21
8 bits
14
Binary Representation of IP
00000000.00000000.00000000.00000000
Network
Host
Host
Host
00000000.00000000.00000000.00000000
Network Network
Host
Host
00000000.00000000.00000000.00000000
Network Network Network
Host
Private address :
Class A
Class B
Class C
Range : 10.0.0.0 – 10.255.255.255
Host can’t be 0, so 10.0.0.0 invalid.
Last IP is broadcast so 10.255.255.255 invalid
Range : 172.16.0.0 – 172.31.255.255
128.0.0.1 is valid as host ID is 1, 128.0.255.0 ???
Range : 192.168.0.0 – 192.168.255.255
192.0.0.0 ????? & 192.0.0.255 ????
Writing Conventions
Writing conventions
Examples :
192.168.1.34 255.255.255.0
192.168.1.34 /24
Discussion
Is
Is
Is
Is
Is
Is
Is
99.0.0.0 valid IP address ?
99.0.255.0 valid IP address ?
192.100.1.0 valid IP address ?
192.0.0.255 valid IP address ?
156.0.0.1 valid IP address ?
188.0.255.0 valid IP address ?
188.0.254.255 valid IP address ?
Binary to Decimal Conversion
128
64
32
16
1
0
0
1
0
1
1
1
1
1
8
4
2
1
0
0
1
0
1
0
1
1
1
1
1
1
1
1
1
1
0
0
0
1
0
1
1
1
1
1
0
1
1
0
0
0
0
1
0
0
1
1
1
0
0
0
0
0
0
1
0
0
1
1
0
0
0
1
0
1
1
1
1
0
0
0
1
1
1
1
0
0
0
0
0
0
1
1
1
0
1
1
0
0
0
0
0
1
1
1
255
146
Binary to Decimal Conversion
128
64
32
16
8
4
2
1
0
0
0
1
1
0
1
1
1
0
1
0
1
0
1
0
0
1
1
0
1
1
1
1
1
1
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
1
0
1
0
1
0
1
0
0
1
1
1
1
1
0
0
0
0
0
0
0
1
1
1
1
1
0
1
1
0
1
1
1
0
0
0
0
0
0
255
Decimal to Binary Conversion
128
64
32
16
8
4
2
1
255
239
32
10
13
224
192
178
202
240
1
1
1
0
1
1
1
1
0
0
1
0
0
0
0
0
Subtraction, or with leading bits. If less than 8
remainder zeros will come to left
IP Address Class Identification
IP Address
10.250.1.1
150.10.15.0
192.14.2.0
148.17.9.1
193.42.1.1
126.8.156.0
220.200.23.1
230.230.45.58
177.100.18.4
Class
__A__
__B__
_____
_____
_____
_____
_____
_____
_____
IP Address
119.18.45.0
249.240.80.78
199.155.77.56
117.89.56.45
215.45.45.0
199.200.15.0
95.0.21.90
33.0.0.0
158.98.80.0
219.21.56.0
Class
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
Network & Host Identification
Circle the Network
Portion of IP Addresses
177.100.18.4
119.18.45.0
209.240.80.78
199.155.77.56
117.89.56.45
215.45.45.0
192.200.15.0
95.0.21.90
33.0.0.0
Circle the Host Portion of
IP Addresses
10.15.123.50
171.2.199.31
198.125.87.177
223.250.200.222
17.45.222.45
126.201.54.231
191.41.35.112
155.25.169.227
192.15.155.2
Network & Host Identification
Circle the Network
Portion of IP Addresses
158.98.80.0
217.21.56.0
10.250.1.1
150.10.15.0
192.14.2.0
148.17.9.1
193.42.1.1
126.8.156.0
220.200.23.1
Circle the Host Portion of
IP Addresses
123.102.45.254
148.17.9.155
100.25.1.1
195.0.21.98
25.250.135.46
171.102.77.77
55.250.5.5
218.155.230.14
10.250.1.1
Default Subnet Masks
177.100.18.4
119.18.45.0
191.249.234.191
223.23.223.109
10.10.250.1
126.123.23.1
223.69.230.250
192.12.35.105
77.251.200.51
___255.255.0.0_________
___255.0.0.0___________
______________________
______________________
______________________
______________________
______________________
______________________
______________________
Default Subnet Masks
189.210.50.1
88.45.65.35
128.212.250.254
193.100.77.83
125.125.250.1
1.1.10.50
220.90.130.45
134.125.34.9
95.250.91.99
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
____________________
ANDING with Default Subnet
Mask
IP address is convoy by subnet mask.
IP & Class issues are clear.
Computer determines the Network & Subnet
Portion of an IP address by ANDING IP address
with subnet mask.
ANDING equations:
1
1
0
0
AND
AND
AND
AND
1
0
1
0
=
=
=
=
1
0
0
0
ANDING with Default Subnet
Mask
IP Address
192.100.10.33
WHAT YOU SEE.
Address Class:
Network Portion:
Host Portion:
C
192 . 100 . 10 . 33
192 . 100 . 10 . 33
Computer AND the IP Address and Subnet Mask
in binary
1 1 0 0 0 0 0 0 . 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 1=(192 . 100 . 10 . 33)
1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 0 0 0 0 0 0 0 0=(255 . 255 . 255 . 0)
1 1 0 0 0 0 0 0 . 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 0 0 0 0 0 0=(192 . 100 . 10 . 0)
ANDING with the default subnet mask helps
computer to figure out the network portion of
the Address.
Subnetting
Subnetting
What is the subnetting ?
Sub-division of a network in a many other
smaller Networks
Subnetting is used to subdivide a single class
of network in to multiple smaller networks.
Subnetting
Aim of subnetting
The increase of many broadcast domain
Advantages of Subnetting:
The routing process simplified using subnets.
The
routers
don’t
fully
identify
each
individual address from a N/W & route them.
Identify a given network using the Subnet
address and route.
Subnetting
The Subnet hides the internal; network numbers
by giving out the main number to the routers.
The routing tables become much shorter by using
Subnet addresses, data flow also becomes faster.
Information about Subnetting
Part of an IP address without subnetting
Network
Host
Part of an IP address with subnetting
Network
Subnetwork
Host
General method (Subnetting)
Classic method in 6 steps
Take sufficent number of bits
Calculate the new subnetwork mask
Identify the different IP address range
Identify the un-usable IP address range
Identify broadcast and network address
Determine the IP address range usable by hosts
General method (Subnetting)
Calculate number of hosts
Calculate the number of bits necessary to
have enough hosts
Network
Subnetwork
Host
Example
We search to obtain a subnetwork for 12
hosts.
12 in binary give : 0000 1100, so we must
have 4 bits (16 possibilities) for 12 hosts
General method (Subnetting)
Calculate the number of bits that we want to
obtain the necessary number of subnetworks
Network
Subnetwork
Host
Example
We want 9 subnetworks
9 in binary give : 0000 1001, so we
must use 4 bits to have the necessary
number of subnetworks
2n-2 Rule (Subnetting)
We wish to subdivide a class C address in 9
subnetworks of 12 hosts
Mask
32 bits
Network
24 bits
Host
Subnetwork
+
4 bits
+
4bits
[1111 1111 . 1111 1111 . 1111 1111] . [1111] [0000]
The new mask to obtain this is also
255.255.255.240
Magic Number (Subnetting)
Brief calculation
A subnet mask
The number of host per subnet
Formula
256 = subnet mask + subnet length
Magic Number (Subnetting)
Example
IP Address : 200.200.200.0
Subnet mask : 255.255.255.224 (or /27)
Formula
256 – 224 = 32
Range of 32
Number of hosts per subnet: 32 – 2 = 30 hosts
Number of subnets : 23 = 8
ANDING with Custom Subnet
Masks
Single Large Network
192.100.10.0
Divide into five smaller networks
192.100.10.16,
192.100.10.32,
192.100.10.48,
192.100.10.64,
192.100.10.80
Outside world see still a large network 192.100.10.0
Internal routers, computers sees 5 smaller N/Ws.
ANDING with Custom Subnet
Masks
This can only be done with a custom subnet
mask.
Custom subnet mask borrows bits from host portion
of the IP address to create a sub-network.
The computer still AND the IP address with
custom subnet mask to identify the network
portion and which subnet it belongs to.
ANDING with Custom Subnet
Mask
IP Address:
Custom Subnet Mask:
Address Ranges:
192.10.10.0
192.100.10.0
255.255.255.240
to 192.100.10.15
192.100.10.128 to 192.100.10.143
192.100.10.16 to 192.100.10.31
192.100.10.144 to 192.100.10.159
192.100.10.32 to 192.100.10.47
192.100.10.160 to 192.100.10.175
192.100.10.48 to 192.100.10.63
192.100.10.176 to 192.100.10.191
192.100.10.64 to 192.100.10.79
192.100.10.192 to 192.100.10.207
192.100.10.80 to 192.100.10.95
192.100.10.208 to 192.100.10.223
192.100.10.96 to 192.100.10.111
192.100.10.224 to 192.100.10.239
192.100.10.112 to 192.100.10.127
192.100.10.240 to 192.100.10.255
ANDING with Custom Subnet
Mask
1 1 0 0 0 0 0 0 . 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 1 (192.100.10.33)
1 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 . 1 1 1 1 1 1 1 1 . 1 1 1 1 0 0 0 0 (255.255.255.240)
1 1 0 0 0 0 0 0 . 1 1 0 0 1 0 0 . 0 0 0 0 1 0 1 0 . 0 0 1 0 0 0 0 0 (192.100.10.32)
SNW
HOST
The ANDING process shows which range of IP
addresses this particular address falls into
Custom Subnet Masks Problem
Number of needed subnets:
Number of usable hosts:
Network Address:
Address class
Default subnet mask
Custom subnet mask
Total number of subnets
Total number of host add
Number of usable add
Number of bits borrowed
14
14
192.10.10.0
_______C__________
___255.255.255.0 ___
___255.255.255.240__
_______16__________
_______16__________
_______14__________
_______04__________
Solution Work Space.
256 128 64 32 16 8 4 2
Number of Hosts
Number of
Hosts
Number of
Subnets
#Bits
256
128
64
32
16
8
4
2
4
8
16
32
64
128 256
128
64
32
16
8
4
2
1
0
0
0
0
0
0
0
192 . 10 . 10 . 0
2
Binary Values
Borrowed Bits
Custom Subnet Masks Problem
Number of needed subnets:
Number of usable hosts:
Network Address:
Address class
Default subnet mask
Custom subnet mask
Total number of subnets
Total number of host add
Number of usable add
Number of bits borrowed
1000
60
165.100.0.0
_______B__________
___255.255.0.0 _____
___________________
___________________
___________________
___________________
___________________
Borrowed Bits
32
16
8
4
2
1
128
64
32
16
8
4
2
0
0
0
0
0
0
0
0
0
0
0
0
0
1
64
0
0
128
0
100
165
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
Number of
Subnets
Number of
Hosts
Binary Values
Custom Subnet Masks Problem
Number of needed subnets:
Number of usable hosts:
Network Address:
Address class
Default subnet mask
Custom subnet mask
Total number of subnets
Total number of host add
Number of usable add
Number of bits borrowed
126
131,070
118.0.0.0
_______A__________
___255.0.0.0__ _____
___________________
___________________
___________________
___________________
___________________
Borrowed Bits
217 = No. of Hosts
4
2
1
0
0
16
0
0
32
0
8
64
0
0
128
0
32
0
1
64
0
0
128
0
2
1
0
0
2
0
4
4
0
0
8
0
8
16
0
0
32
0
16
64
0
0
128
0
118
4194304
2097152
1048576
524288
262144
131072
65536
32768
16384
8192
4096
2048
1024
512
256
128
64
32
16
8
4
2
2
4
8
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
131072
262144
524288
1048576
2097152
4194304
Number of
Subnets
Number of
Hosts
Binary Values