2. IP Address
• IP address is a logical address given to each and
every device in a network.
• It is used to identify specific device in the network.
• However, an IP address can represent a complete
network, a specific host, or the broadcast address
of the network.
• It is divided into Network portion/Prefix and Host
portion.
• There are two versions of IP address: IPv4 and IPv6
Network Set of devices
Host A specific device on the network
3. IP Version 4
• An IPv4 address is 32 bits long — 4 separate bytes.
• It is represented in dotted-decimal notation — each byte
represents a decimal number separated by a period.
• Network ID: First IP of a range. All 0’s in the host portion.
Reserved for identifying the complete network.
• Broadcast Address: Last IP of a range. All 1’s in the host
portion. Used to send broadcast to all within the same
network.
• Valid IP: Lies between the Network and Broadcast
addresses. Only these can be assigned to the hosts.
IPv4 Address Range
0.0.0.0
to
255.255.255.255
4. Subnet Mask
• A separate 32-bit pattern to Identify the division of
the network and the host portion of an address.
• It says where to look for these portions in a given
address.
Valid
Subnet Masks
5. Subnet Mask (contd.)
• In CIDR notation, the number of 1’s in the mask’s
binary version is counted from the left and that
number is appended to the end of the base address
following a slash (/).
• Subnet masks are used to make routing decisions.
• The Default Subnet Mask is the number of bits that
are reserved by the address class. Using the default
mask will accommodate only one network subnet
in the relative class.
• A Custom Subnet Mask can be defined by an
administrator to accommodate many network
subnets.
8. Types of IPv4 Address
Private IP Address
• Hosts that do not require access to the Internet can
use private addresses.
• These are not routed by Internet routers.
Class Range CIDR Block # of Hosts
Class A
10.0.0.0 to
10.255.255.255 10.0.0.0/8 16777216
Class B
172.16.0.0 to
172.31.255.255 172.16.0.0/16 1048576
Class C
192.168.0.0 to
192.168.255.255 192.168.0.0/24 65536
9. Types of IPv4 Address (contd.)
Public IP Address
• Globally unique addresses that are recognized on
the Internet.
Real IP Address
• Public addresses which are registered through the
IANA.
10. Types of IPv4 Address (contd.)
Special IP Addresses
• 127.X.X.X — “loopback”
Used by hosts to direct traffic to themselves and for testing
purpose.
• 0.0.0.0 — “this host on this network”
Used during DHCP initialization phase. Host uses IP for
communication with DHCP server but has no address
assigned so far.
• 0.X.X.X — “invalid/unspecified”
11. Classfull Addressing
• The ‘Class’ identifies the default point of separation.
• IP addresses, left in their classful state, yield exactly
one subnet.
# of networks
and hosts in the
classfull scheme
12. Classless Addressing
• Formal name is Classless Inter-Domain Routing (CIDR).
• The class privilege was removed from the distribution
to compensate for the address depletion.
• Instead of having three distinct address classes, this
mechanism allows the division between prefix and
suffix to occur on an arbitrary bit boundary.
• To do so, the addressing scheme stores a 32-bit
subnet mask along with each address.
13. Subnetting
• Subnetting is the process of dividing a single network
into multiple smaller networks.
• It helps in minimizing the wastage of IP address.
• It offers containment of broadcast traffic within subnetwork which
improves network performance.
• In many cases, subnets are created to serve as physical or geographical
separations.
14. Subnetting (contd.)
• Each subnet is a non-physical description/ID for a
physical subnetwork – usually a switched network
of host containing a single router in a multi-router
network.
• A router is necessary for devices on different
networks and subnets to communicate.
• Each router interface must have an IPv4 host
address that belongs to the network or subnet that
the router interface is connected to.
• Devices on a network and subnet use the router
interface attached to their LAN as their default
gateway.
15. Subnetting (contd.)
• Creating sub-networks is the act of taking bits from the host
portion of the address and reserving them to define the
subnet address instead.
• Clearly this will result in fewer bits being available for
defining hosts.
• Subnetting can be performed in two ways:
FLSM (Fixed Length Subnet Masking)
VLSM (Variable Length Subnet Masking)
• Subnetting is done based on requirement.
Requirement of
Hosts
2 𝐻 − 2 ≥ 𝑅𝑒𝑞𝑢𝑖𝑟𝑒𝑚𝑒𝑛𝑡
Requirement of
Networks
2 𝑁 ≥ 𝑅𝑒𝑞𝑢𝑖𝑟𝑒𝑚𝑒𝑛𝑡
18. FLSM – Example 3
• A service provider has given you the Class C network range 209.50.1.0
Your company must break the network into 20 separate subnets.
19. FLSM – Example 4
• Your company would like to break the Class B private IP address range
172.16.0.0 into as many subnets as possible, provided that they can get
at least 300 clients per subnet.
20. FLSM – Example 5
• You are given the IP address 192.168.1.58/28 Identify the original range
of addresses (the subnet) that this IP address belongs to.
27. FLSM – Example 10
An ISP is granted a block of addresses starting with
190.100.0.0/16. The ISP needs to distribute these
addresses to three groups of customers as follows:
• The first group has 64 customers; each needs 256
addresses.
• The second group has 128 customers; each needs
128 addresses.
• The third group has 128 customers; each needs 64
addresses.
Design the subblocks and find out how many
addresses are still available after these allocations.
28. FLSM – Example 10 (contd.)
For Group-1, each customer needs 256 addresses. This means 8 bits are needed
to define each host. The prefix length is 32 - 8 = 24.
The addresses are:
1st Customer: 190.100,0.0/24 ---------- 190.100.0.255/24
2nd Customer: 190.100.1.0/24 ---------- 190.100.1.255/24
..........
64th Customer: 190.100.63.0/24 -------190.100.63.255/24
Total = 64 x 256 = 16,384
For Group-2, each customer needs 128 addresses. This means 7 bits are needed
to define each host. The prefix length is 32 - 7 = 25.
The addresses are:
1st Customer: 190.100.64.0/25 -------- 190.100.64.127/25
2nd Customer: 190.100.64.128/25 -------- 190.100.64.255/25
........
128th Customer: 190.100.127.128/25 -------- 190.100.127.255/25 3.
Total = 128 x 128 = 16,384
29. FLSM – Example 10 (contd.)
For Group-3, each customer needs 64 addresses. This means 6 bits are needed to
each host. The prefix length is 32 - 6 = 26.
The addresses are:
1st Customer: 190.100.128.0/26 ---- 190.100.128.63/26
2nd Customer: 190.100.128.64/26 ---190.100.128.127/26
........
128th Customer: 190.100.159.192/26 ---- 190.100.159.255/26
Total = 128 x 64 = 8192
# of granted addresses
to the ISP: 65536
# of allocated addresses
by the ISP: 40960
# of available
addresses: 24576
30. VLSM
• VLSMs can use subnet masks with different lengths for
different router interfaces.
• Allows a network space to be divided in unequal parts.
• Subnet mask will vary depending on how many bits have
been borrowed for a particular subnet.
• Used frequently if public address are used internally or
unplanned growth needs to be accommodated inside of a
site.
• Results in less waste on smaller subnets where fewer
addresses are necessary.
Subnetting a subnet
39. VLSM – Example 2
• For 100 hosts:
2^h-2>=100, hence h=7 (host bits)
Hence value is 8+8+8+(8-7)=25
Hence subnet mask is
11111111.11111111.11111111.10000000
i.e.255.255.255.128
Block size is 2^7=128 hence the range is
192.168.1.0/25 to 192.168.1.127/25 for 100 hosts
Given the no of hosts as 100, 50 20 & 6. Find IP
addresses and subnet mask for 192.168.1.0
40. VLSM – Example 2 (contd.)
• For 50 hosts:
2^h-2>=50, hence h=6 (host bits)
Hence value is 8+8+8+(8-6)=26
Hence subnet mask is 11111111.11111111.11111111.11000000
i.e.255.255.255.192
Block size is 2^6=64 hence the range is
192.168.1.128/26 to 192.168.1.191/26 for 50 hosts
• For 20 hosts:
2^h-2>=20, hence h=5 (host bits)
Hence value is 8+8+8+(8-5)=27
Hence subnet mask is 11111111.11111111.11111111.11100000
i.e.255.255.255.224
Block size is 2^5=32 hence the range is
192.168.1.192/27 to 192.168.1.223/27 for 20 hosts
41. VLSM – Example 2 (contd.)
• For 6 hosts:
2^h-2>=6, hence h=3 (host bits)
Hence value is 8+8+8+(8-3)=29
Hence subnet mask is
11111111.11111111.11111111.11111000 i.e.255.255.255.248
Block size is 2^3=8 hence the range is
192.168.1.224/29 to 192.168.1.231/29 for 6 hosts
• Complete range:
192.168.1.0/25 to 192.168.1.127/25 for 100 hosts
192.168.1.128/26 to 192.168.1.191/26 for 50 hosts
192.168.1.192/27 to 192.168.1.223/27 for 20 hosts
192.168.1.224/29 to 192.168.1.231/29 for 6 hosts
42. Supernetting
• It provides route updates in the most efficient way possible by
advertising many routes in one advertisement instead of individually.
• Its purpose is to reduce the size of routing tables on routers to save
memory, which also shortens the amount of time IP requires to parse
the routing table when determining the best path to a remote network.
• It works only if the network is designed properly.
• By creating contiguous blocks of addresses to specific areas of a
network, one can then easily summarize the network and keep route
updates with a routing protocol to a minimum.
• If IP subnets are carelessly handed out to any location on the network,
there will no longer be any summary boundaries.