Anda di halaman 1dari 15

IP Addressing and Subnetting

There are various aspects to IP addressing, including
calculations for constructing an IP address, classes of IP
addresses designated for specific routing purposes, and
public versus private IP addresses. There are also two
different types of IP addresses: IP version 4 (IPv4) and
IP version 6 (IPv6). The 32-bit IPv4 address type is
currently the most common, but the 128-bit IPv6
address is also in use, and will probably become the
more common address type over time. This lesson
describes 32-bit IPv4 addressing, except where IPv6 is
explicitly identified.
An IP address is a numeric identifier assigned to each
machine on an IP network. It designates the specific
location of a device on the network.

Bit - A bit is one digit, either a 1 or a 0.
Byte - A byte is 8 bits.
Octet - An octet, made up of 8 bits, is just an ordinary
8-bit binary number.
Network address - This is the designation used in
routing to send packets to a remote network - for
example,,, and
Broadcast address - The address used by
applications and hosts to send information to all nodes
on a network is called the broadcast address.
Examples include, which is all
networks, all nodes;, which is all
subnets and hosts on network; and, which broadcasts to all subnets and
hosts on network

It is a 32 bit dotted decimal number with 4 octets, each octet of 8

It is divided into two portions, Network and host portion
IP addresses must be unique in a network
32 bits divided into 4 octets
Each octet has a decimal value range of 0 to 255.
The network portion cannot be all 0s nor all 1s
The first octet cannot be 127 (network), this is reserved for
The host portion cannot be all 0s this defines the network
The host portion cannot be all 1s this defines a broadcast in that
particular network
The IP address defines a general broadcast
Although IP addresses are stored as binary numbers, they are
usually displayed in human-readable notations, such as (for IPv4)
The original designers of TCP/IP defined an IP address as a 32-bit
number and this system, now named Internet Protocol Version 4
(IPv4), is still in use today.

One of IPs core functions is to provide logical

addressing for hosts. An IPaddress provides a
hierarchical structure to separate networks. Consider
the following address as an
An IP address is separated into four octets:
First Octet
Second Octet
Third Octet
Fourth Octet
Each octet is 8 bits long, resulting in a 32-bit IP
address. A computer understands an IP address in its
binary form; the above address in binary would look as
First Octet

Second Octet Third Octet


IP Address Classes
To accommodate different sizes of networks and aid in classifying them, IP
addresses are divided into categories called classes. This topic describes
the IP address classes and the structure of the IP addresses within them.
Assigning IP addresses to classes is known as classfull addressing. The
classes were determined during the early days of the Internet by the
Internet Assigned Numbers Authority (IANA).Each IP address is broken
down into a network ID and the host ID. In addition, a bit or bitsequence at
the start of each address determines the class of the address. The figure
shows threeof the five IP address classes, which are used LAN, MAN and
WAN as follow

Private vs Public Addresses

The rapid growth of the Internet resulted in a shortage
of IPv4 addresses. Inresponse, the powers that be
designated a specific subset of the IPv4 address space
to be private, to temporarily alleviate this problem.
A public address can be routed on the Internet. Thus,
devices that should be Internet accessible (such as web
or email servers) must be configured with public
addresses.A private address is only intended for use
within an organization, and cannever be routed on the
internet. Three private addressing ranges were
allocated, one for each IPv4 class:
Class A -
Class B -
Class C -

What is Subnet Mask?

An IP address has two components, the network part and the host part.
Really, IP address is a combination of IP address and Subnet mask and the
purpose of subnet mask is to identify which part of an IP address is the
network part and which part is the host part. Subnet mask is also a 32 bit
number where all the bits of the network part are represented as "1" and
all the bits of the host part are represented as "0".
If we take an example for a Class C network,, the address
part and the subnet mask can be represented as below:
Table: Subnet Mask Example
For a Class C IP address, the first three octets are used to represent the
Network part and the last octet is used to represent the host part. From
the above table, we can see all "1" in the network part and all "0" in the
host part. When this subnet mask is converted to a decimal, it will become



Address Part


Subnet Mask


What is CIDR?
Classless Inter-Domain Routing (CIDR) merges or
combine network addresses of sameclass into one single address
to reduce the size of the routing table. It is done on core router to
reduce the size of routing table. It is implemented by ISP
(internet service providers).CIDR is simplified method of
representing a subnet mask. CIDR identifies the number of binary
bits set to a 1 (or on) in a subnet mask, preceded by a slash.
Consider the following subnet mask:
The first 28 bits of the above subnet mask are set to 1. To
represent this in CIDR notation: /28
Consider this next example:
The above address/subnet mask can be represented as
follows using CIDR: /24


Subnet Mask

Wildcard Mask

No of IPs


























It is the process of breaking down an IP
network into smaller sub-networks called
It is essentially the modification of a single IP
network to create two or more logically visible
It changes the subnet mask of the local
network number to produce an even number
of smaller network numbers, each with a
corresponding range of IP addresses. How many subnets and hosts-per-subnet

you can create with a subnet mask of
First of all you have to specify which class this
network belongs to. According to Table 1, it belongs
to class A (simply, class A ranges from 1 to 126)
and its default subnet mask is Therefore
if we use a subnet mask of, it means
we borrowed 16 bits (to convert from 0 to 1). = 1111 1111.0000 0000.0000
0000 = 1111 1111.1111 1111.1111
1111.0000 0000
Now use our above formulas to find the
The number of newly created subnets = 216 =
65536 (with 16 is the borrowed bits)
The number of hosts per subnet = 28 2 = 254

Exercise 2
Your company has just been assigned the network
How many subnets and hosts-per-subnet you can create with a
subnet mask of
Solution Belongs to class B with the default subnet mask of But is the subnet mask of strange?
Ok, lets write all subnet masks in binary: = 1111 1111.1111 1111.1000 0000.0000
This is a valid subnet because all bit 1s and 0s are
successive. Comparing to the default subnet mask, we
borrowed only 1 bit: = 1111 1111.1111 1111.0000 0000.0000
The number of newly created subnets = 21 = 2 (with 1 is the
The number of hosts per subnet = 215 2 = 32766 (with 15 is
the bit 0s left in the subnet mask)

Exercise 3
Your company has just been assigned the network
How many subnets and hosts-per-subnet you can create with a
subnet mask of
In this exercise, your company was given a subnetted network
from the beginning and it is not using the default subnet mask. So
we will compare two subnet masks above:
/28 = 1111 1111.1111 1111.1111 1111.1111 0000
(= = 1111 1111.1111 1111.1111 1111.1111 1100
(= /30)
In this case we borrowed 2 bits. Therefore:
? The number of newly created subnets = 22 = 4 (with 2 is the
borrowed bits)
? The number of hosts per subnet = 22 2 = 2 (with 2 is the bit
0?s left in the subnet mask)
Because two subnet masks (/28 & /30) only affect the 4th octet so
we dont care about the first three octets. In the 4th octet we are
allowed to change 2 bits (in the green box) of the IP address to