4. IP Address
• An IP address is a 32-bit address.
• The IP addresses are unique.
• The address space of IPv4 is
232 or 4,294,967,296.(more than 4 billion)
• Represented in binary or decimal
5. CLASSFUL ADDRESSING
• IP addressing when started used the concept of
classes.
• This architecture is called classful addressing.
• Organizations can be of different sizes
• Require varying numbers of IP addresses on the Internet.
• A system was devised whereby the IP address space
would be divided into classes.
• Each class occupies some part of the whole
address space
• Some classes are for
• Large networks on the Internet
• Smaller organizations
•
Some classes are reserved for special purposes.
8. Class A
• Class A is divided into 128 blocks (27)
– Each block having different Netid
• First block covers addresses from
– 0.0.0.0 to 0.255.255.255 (netid 0)
• Second block covers addresses from
– 1.0.0.0 to 1.255.255.255 (netid 1)
• The last block covers addresses from
– 127.0.0.0 to 127.255.255.255 (netid 127)
• Each block in this class contains 16,777,216 addresses
• Class A addresses were designed for large
organizations with large number of hosts attached to
their network
– 16,777,216 too large, millions of class A addresses are wasted
9. Class B
• Class B is divided into 16384 blocks (214)
– Each block having different netid
• First block covers addresses from
– 128.0.0.0 to 128.0.255.255 (netid 128.0)
• The last block covers addresses from
– 191.255.0.0 to 191.255.255.255 (netid 191.255)
• Each block in this class contains 65,536 addresses
• Class B addresses were designed for medium size
organizations with thousands of hosts attached to
their network
– 65,536 is also too large for medium size organizations, many
of class B addresses are wasted
10. Class C
• Class C is divided into 2097152 blocks (221)
– Each block having different netid
• First block covers addresses from
– 192.0.0.0 to 192.0.0.255 (netid 192.0.0)
• The last block covers addresses from
– 223.255.255.0 to 223.255.255.255 (netid
223.255.255)
• Each block in this class contains 256 addresses
• Class C addresses were designed for small
organizations
– 256 is small for most organizations
11. Issues with Classful Addressing
• Flexibility in Internal addressing:
– Thousands of hosts connected to one large network
• Inefficient Use of Address Space:
– Wastage of limited IP address space.
• Router Table Entries:
– Increase in router table entries.
Example:
• Hosts needed by organization are 5000
• Hosts in B 65,536 and in C 256
– Organization with 5,000 hosts is in a dilemma
– It can only choose to either waste 90% of a Class B address
or use 20 different Class C networks.
– Replacing with 20 C networks will increase entries in routers
12. Subnetting
• To better meet the administrative and technical
requirements of larger organizations, the “classful”
IP addressing system was enhanced through a
technique known as subnet addressing or subnetting.
• A three-level hierarchy is created: networks, which
contain subnets, each of which then has a number of
hosts.
13. Subnetting
• Subnetting adds an additional level to the hierarchy
of structures used in IP addressing.
• IP addresses must be broken into three elements
instead of two.
• Network ID is unchanged
• The host ID into a subnet ID and host ID.
• These subnet ID bits are used to identify each
subnet within the network.
• Splitting the host ID into subnet ID and host ID, we
reduce the size of the host ID portion of the address
• Class A networks have 24 bits to split between the
subnet ID and host ID: class B networks have 16, and
class C networks only 8.
14. Subnetting
The more bits we use from the host ID for the subnet ID, the more
subnets we can have but the fewer hosts we can have for each subnet.
15. Subnet Mask
• In classful addressing without subnetting
– Routers use the first octet of the IP address to determine
what the class is of the address
– From class they know which bits are the network ID and
which are the host ID.
• In subnetting, the routers also need to know how that
host ID is divided into subnet ID and host ID.
– This division can be arbitrary for each network.
– There is no way to tell how many bits belong to each simply
by looking at the IP address.
– The additional information about which bits are for the
subnet ID and which for the host ID must be communicated
to devices that interpret IP addresses.
– This information is given in the form of a 32-bit binary
number called a subnet mask.
16. Determining the Subnet Mask
• The subnet mask is a 32-bit binary number
• It is created so that it has a one bit for each corresponding bit of
the IP address that is part of its network ID or subnet ID, and a
zero for each bit of the IP address’s host ID.
• The mask thus tells TCP/IP devices which bits in that IP address
belong to the network ID and subnet ID, and which are part of
the host ID.
17. Determining the Subnet Mask
• Suppose we have the Class B network 154.71.0.0.
• We decide to subnet this using 5 bits for the subnet
ID and 11 bits for the host ID.
• In this case, the subnet mask will have 16 ones for
the network portion (since this is Class B) followed by
5 ones for the subnet ID, and 11 zeroes for the host
ID.
• That's “11111111 11111111 11111000 00000000” in
binary, with the bits corresponding to the subnet ID
highlighted.
• Converting to dotted decimal, the subnet mask would
be 255.255.248.0
18. Determining the Subnet Mask
Example
• A company is granted the site address
210.70.64.0. The company needs six
subnets. What is the subnet Mask?
19. Determining the Subnet Mask
Solution
• Class C address
• 6 subnets means 3 bits in the subnet id
• 3 ones in the subnet mask
• 11111111 11111111 11111111 11100000
• 255.255.255.224 (decimal)
20. Using a Subnet Mask
• Suppose we have a host on a network with an IP of
154.71.150.42 and subnet mask 255.255.248.0
• A router needs to figure out which subnet this
address is on.
154.71.144.0 is the IP address of the subnet to which 154.71.150.42 belongs.
21. Designing a Subnet
•
•
•
•
Analyze the requirements
Determine the subnet mask
Each Subnet address
Host Addresses
Example:
• Network Address: 211.77.20.0
• 8 sub networks
• 32 hosts in each