Documente Academic
Documente Profesional
Documente Cultură
Example: 140.179.220.200
Every IP address consists of two parts, one identifying the network and one identifying the
node. The Class of the address and the subnet mask determine which part belongs to the
network address and which part belongs to the node address.
Address Classes:
There are 5 different address classes. You can determine which class any IP address is in by
examining the first 4 bits of the IP address.
Addresses beginning with 01111111, or 127 decimal, are reserved for loopback and for
internal testing on a local machine; [You can test this: you should always be able to ping
127.0.0.1, which points to yourself] Class D addresses are reserved for multicasting; Class E
addresses are reserved for future use. They should not be used for host addresses.
Now we can see how the Class determines, by default, which part of the IP address belongs
to the network (N, in blue) and which part belongs to the node (n, in red).
• Class A -- NNNNNNNN.nnnnnnnn.nnnnnnnn.nnnnnnnn
• Class B -- NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn
• Class C -- NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn
In the example, 140.179.220.200 is a Class B address so by default the Network part of the
address (also known as the Network Address) is defined by the first two octets (140.179.x.x)
and the node part is defined by the last 2 octets (x.x.220.200).
In order to specify the network address for a given IP address, the node section is set to all
"0"s. In our example, 140.179.0.0 specifies the network address for 140.179.220.200. When
the node section is set to all "1"s, it specifies a broadcast that is sent to all hosts on the
network. 140.179.255.255 specifies the example broadcast address. Note that this is true
regardless of the length of the node section.
Private Subnets
There are three IP network addresses reserved for private networks. The addresses are 10.0.0.0,
Subnet Mask 255.0.0.0, 172.16.0.0, Subnet Mask 255.240.0.0, and 192.168.0.0, Subnet Mask
255.255.0.0. These addresses are also notated 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16; this
notation will be explained later in this tutorial. They can be used by anyone setting up internal IP
networks, such as a lab or home LAN behind a NAT or proxy server or a router. It is always safe to
use these because routers on the Internet by default will never forward packets coming from these
addresses.
SUBNETTING
Subnetting is the process of dividing a network of any classful IP network (A, B, or C) into
smaller networks. Subnetting an IP Network can be done for a variety of reasons, including
organization, use of different physical media (such as Ethernet, FDDI, WAN, etc.),
preservation of address space, and security. The most common reason is to control network
traffic. In an Ethernet network, all nodes on a segment see all the packets transmitted by all
the other nodes on that segment. Performance can be adversely affected under heavy traffic
loads, due to collisions and the resulting retransmissions. A router is used to connect IP
networks to minimize the amount of traffic each segment must receive.
Subnet Masking:
Applying a subnet mask to an IP address allows you to identify the network and node parts of
the address. The network bits are represented by the 1s in the mask, and the node bits are
represented by the 0s. Performing a bitwise logical AND operation between the IP address
and the subnet mask results in the Network Address or Number.
For example, using our test IP address and the default Class B subnet mask, we get:
Additional bits can be added to the default subnet mask for a given Class to further subnet, or
break down, a network. When a bitwise logical AND operation is performed between the subnet mask
and IP address, the result defines the Subnet Address (also called the Network Address or Network
Number). There are some restrictions on the subnet address. Node addresses of all "0"s and all "1"s
are reserved for specifying the local network (when a host does not know its network address) and all
hosts on the network (broadcast address), respectively. This also applies to subnets. A subnet address
cannot be all "0"s or all "1"s. This also implies that a 1 bit subnet mask is not allowed. This restriction
is required because older standards enforced this restriction. Recent standards that allow use of these
subnets have superseded these standards, but many "legacy" devices do not support the newer
standards. If you are operating in a controlled environment, such as a lab, you can safely use these
restricted subnets.
To calculate the number of subnets or nodes, use the formula (2n-2) where n = number of bits
in either field, and 2n represents 2 raised to the nth power. Multiplying the number of subnets by the
number of nodes available per subnet gives you the total number of nodes available for your class and
subnet mask. Also, note that although subnet masks with non-contiguous mask bits are allowed, they
are not recommended.
Example:
--------------------------------------------------------
In this example a 3 bit subnet mask was used. There are 6 (23-2) subnets available with this
size mask (remember that subnets with all 0's and all 1's are not allowed). Each subnet has 8190 (213-
2) nodes. Each subnet can have nodes assigned to any address between the Subnet address and the
Broadcast address. This gives a total of 49,140 nodes for the entire class B address subnetted this way.
Notice that this is less than the 65,534 nodes an unsubnetted class B address would have.
You can calculate the Subnet Address by performing a bitwise logical AND operation
between the IP address and the subnet mask, then setting all the host bits to 0s. Similarly, you can
calculate the Broadcast Address for a subnet by performing the same logical AND between the IP
address and the subnet mask, then setting all the host bits to 1s. That is how these numbers are derived
in the example above.
CLASS C SUBNETTING
If all the bits in the host part are "0", that represents the network id.
If all the bits in the host part are "0" except the last bit, it is the first usable IP address.
If all the bits in the host part are "1" except the last bit, it is the last usable IP address.
If all the bits in the host part are "1", that represents the direct broadcast address.
All the IP addresses between the first and last IP addresses (including the first and last) can be
used to configure the devices
If we take an example for a Class C network, 192.168.10.0, the address part and the subnet mask can
be represented as below
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 decimals, it will become 255.2555.255.0.
The default subnet mask for a Class C network is 255.255.255.0, Class B network is 255.255.0.0 and
Class A network is 255.0.0.0
Consider the network shown above. If we include one bit from the host part to the network part, the
subnet mask is changed into 255.255.255.128. The single bit can have two values in last octet, either 0
or 1.
11000000.10101000.00001010.0 | 0000000
11111111.11111111.11111111.1 | 0000000
The network 192.168.10.0 is divided into two networks, each network has 128 total IP addresses and
126 usable IP addresses (two IP addresses are used in each subnet to represent the network id and the
broadcast id). The subnet mask for one bit subnetting is 255.255.255.128.
If we include two bits from the host part to the network part, the subnet mask is changed into
255.255.255.192. The two bits added to network part can have four possible values in last octet and
that are 00, 01, 10 and 11. That means, we can get four networks if we do a two bit subnetting.
11000000.10101000.00001010.00 | 000000
11111111.11111111.11111111.11 | 000000
The network 192.168.10.0 is divided into four networks, each network has 64 total IP addresses and
62 usable IP addresses (two IP addresses are used in each subnet to represent the network id and
the broadcast id). The subnet mask for two bit subnetting is 255.255.255.192
If we include three bits from the host part to the network part, the subnet mask is changed into
255.255.255.224. The three bits added to network part can have eight possible values in last octet and
that are 000, 001, 010, 011, 100, 101, 110 and 111. That means, we can get eight networks if we do a
three bit subnetting.
11000000.10101000.00001010.000 | 00000
11111111.11111111.11111111.111 | 00000
SN
Description Binaries Decimal
No
The network 192.168.10.0 is divided into eight networks, each network has 32 total IP addresses and
30 usable IP addresses (two IP addresses are used in each subnet to represent the network id and the
broadcast id). The subnet mask for three bit subnetting is 255.255.255.224.
If we include four bits from the host part to the network part, the subnet mask is changed to
255.255.255.240.
11000000.10101000.00001010.0000 | 0000
11111111.11111111.11111111.1111 | 0000
The four bits added to network part can have sixteen possible values in last (fourth) octet and that are
0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.
SN
Description Binaries Decimal
No
From the above examples, you can can clearly understand how to subnet a Class C subnet.
2 255.255.255.192 /26 4 62
3 255.255.255.224 /27 8 30
4 255.255.255.240 /28 16 14
5 255.255.255.248 /29 32 6
6 255.255.255.252 /30 64 2
CLASS B SUBNETTING
Remember, the first two octets of a Class B network is used to represent the network and the last two
octets are used to represent the host. The default format for a Class B IP address is
Network.Network.Host.Host.
Let us consider an example of Class B network 172.16.0.0 - 255.255.0.0. The binary representation of
the above network and subnet mask is
Once again,
If all the bits in the host part are "0", that represents the network id.
If all the bits in the host part are "0" except the last bit, it is the first usable IP address.
If all the bits in the host part are "1" except the last bit, it is the last usable IP address.
If all the bits in the host part are "1", that represents the direct broadcat address.
All the IP addresses between the first and last IP addresses (including the first and last) can be
used to configure the devices.
If we include one bit from the host part to the network part, the subnet mask is changed into
255.255.128.0 The single bit can have two values in third octet, either 0 or 1.
10101100.00010000.0 | 0000000.00000000
11111111.11111111.1 | 0000000.00000000
SN
Description Binaries Decimal
No
The network 172.16.0.0 is divided into two networks, each network has 32768 total IP addresses and
32766 usable IP addresses (two IP addresses are used in each subnet to represent the netwok id and
the broadcast id). The subnet mask for one bit subnetting is 255.255.128.0.
If we include two bits from the host part to the network part, the subnet mask is changed into
255.255.192.0. The two bits added to network part can have four possible values in third octet, 00, 01,
10, and 11.
10101100.00010000.00 | 000000.00000000
11111111.11111111.11 | 000000.00000000
That means, we can get four networks if we do a two bit subnetting.
SN
Description Binaries Decimal
No
The network 172.16.0.0 is divided into four networks, each network has 16384 total IP addresses and
16382 usable IP addresses (two IP addresses are used in each subnet to represent the netwok id and
the broadcast id). The subnet mask for one bit subnetting is 255.255.192.0.
CLASS B - 3 BIT SUBNETTING :
If we include three bits from the host part to the network part, the subnet mask is changed into
255.255.224.0 The three bits added to network part can have eight possible values in the third octet
and that are 000, 001, 010, and 011, 100, 101, 110 and 111.
10101100.00010000.000 | 00000.00000000
11111111.11111111.111 | 00000.00000000
SN
Description Binaries Decimal
No
The network 172.16.0.0 is divided into eight networks, each network has 8192 total IP addresses and
8190 usable IP addresses (two IP addresses are used in each subnet to represent the network id and the
broadcast id).
If we include four bits from the host part to the network part, the subnet mask is changed to
255.255.240.0.
10101100.00010000.0000 | 0000.00000000
11111111.11111111.1111 | 0000.00000000
The four bits added to network part can have sixteen possible values in third octet and that are 0000,
0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.
SN
Description Binaries Decimal
No
The network 172.16.0.0 is divided into sixteen networks, each network has 4096 total IP addresses
and 4094 usable IP addresses (two IP addresses are used in each subnet to represent the network id
and the broadcast id). The subnet mask is 255.255.240.0.
CLASS A SUBNETTING
Remember, the first octet of a Class A network is used to represent the network and the remaining
three octets are used to represent the host. The default format for a Class A IP address is
Network.Host.Host.Host.
Let us consider an example of Class A network 10.0.0.0 - 255.0.0.0. The binary representation of the
above network and subnet mask is
Once again,
If all the bits in the host part are "0", that represents the network id.
If all the bits in the host part are "0" except the last bit, it is the first usable IP address.
If all the bits in the host part are "1" except the last bit, it is the last usable IP address.
If all the bits in the host part are "1", that represents the direct broadcat address.
All the IP addresses between the first and last IP addresses (including the first and last) can be used to
configure the devices.
CLASS A - ONE BIT SUBNETTING
If we include one bit from the host part to the network part, the subnet mask is changed into
255.255.128.0 The single bit can have two values in second octet, either 0 or 1.
00001010.0 | 0000000.00000000.00000000
11111111.1 | 0000000.00000000.00000000
That means, we can get two subnets if we do a single bit subnetting. The subnet mask for one bit
subnetting is 255.128.0.0.
SN
Description Binaries Decimal
No
The network 10.0.0.0 is divided into two networks, each network has 8388608 total IP addresses and
8388606 usable IP addresses (two IP addresses are used in each subnet to represent the netwok id and
the broadcast id).
If we include two bits from the host part to the network part, the subnet mask is changed into
255.192.0.0. The two bits added to network part can have four possible values in second octet, 00, 01,
10, and 11.
00001010.00 | 000000.00000000.00000000
11111111.11 | 000000.00000000.00000000
That means, we can get four networks if we do a two bit subnetting. The subnet mask for two bit
subnetting is 255.192.0.0.
SN
Description Binaries Decimal
No
The network 10.0.0.0 is divided into four networks, each network has 4194304 total IP addresses and
4194302 usable IP addresses (two IP addresses are used in each subnet to represent the network id and
the broadcast id).
If we include three bits from the host part to the network part, the subnet mask is changed into
255.224.0.0 The three bits added to network part can have eight possible values in the second octet
and that are 000, 001, 010, and 011, 100, 101, 110 and 111.
00001010.000 | 00000.00000000.00000000
11111111.111 | 00000.00000000.00000000
That means, we can get eight networks if we do a three bit subnetting and the subnet mask will be
255.224.0.0.
SN
Description Binaries Decimal
No
The network 10.0.0.0 is divided into eight networks, each network has 2097152 total IP addresses and
2097150 usable IP addresses (two IP addresses are used in each subnet to represent the netwok id and
the broadcast id).
If we include four bits from the host part to the network part, the subnet mask is changed to
255.240.0.0.
00001010.0000 | 0000.00000000.00000000
11111111.1111 | 0000.00000000.00000000
The four bits added to network part can have sixteen possible values in second octet and that are 0000,
0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111.
SN
Description Binaries Decimal
No
The network 10.0.0.0 is divided into sixteen networks, each network has 1048576 total IP addresses
and 1048574 usable IP addresses (two IP addresses are used in each subnet to represent the netwok id
and the broadcast id).
From the above examples, you can clearly understand how to subnet a Class A network.
0 255.0.0.0 /8 1 16777214
1 255.128.0.0 /9 2 8388606
Here is another, more detailed, example. Say you are assigned a Class C network number of
200.133.175.0. You want to utilize this network across multiple small groups within an
organization. You can do this by subnetting that network with a subnet address.
We will break this network into 14 subnets of 14 nodes each. This will limit us to 196 nodes
on the network instead of the 254 we would have without subnetting, but gives us the
advantages of traffic isolation and security. To accomplish this, we need to use a subnet mask
4 bits long.
Recall that the default Class C subnet mask is:
Variable Length Subnet Masking (VLSM) is a way of further subnetting a subnet. Using Variable
Length Subnet Masking (VLSM) we can allocate IP addresses to the subnets by the exact need.
Variable Length Subnet Masking (VLSM) allows us to use more than one subnet mask within the
same network address space. If we recollect from the previous lessons, we can divide a network only
into subnets with equal number of IP addresses. Variable Length Subnet Masking (VLSM) allows to
create subnets from a single network with unequal number of IP addresses.
Example: We want to divide 192.168.10.0, which is a Class C network, into four networks, each with
unequal number of IP address requirements as shown below.
This type of division is not possible as described in previous lessons, since it divide the network
equally, but is possible with Variable Length Subnet Masking (VLSM).
Divide the two networks equally with 128 IP Addresses (126 usable IP addresses) in each network
using 255.255.255.128 subnet mask (192.168.10.0/25).
We will get two subnets each with 128 IP Addresses (126 usable IP addresses).
11000000.10101000.00001010.0 | 0000000
11111111.11111111.11111111.1 | 0000000
11000000.10101000.00001010.1 | 0000000
11111111.11111111.11111111.1 | 0000000
Divide second subnet (192.168.10.128/25) we got from the first division again into two Networks,
each with 64 IP Addresses (62 usable IP Addresses) using 255.255.255.192 subnet mask.
We will get two subnets each with 64 IP Addresses (62 usable IP Addresses).
11000000.10101000.00001010.1 | 0 | 000000
11111111.11111111.11111111.1 | 1 | 000000
2) 192.168.10.192/26
11000000.10101000.00001010.1 | 1 | 000000
11111111.11111111.11111111.1 | 1 | 000000
Divide 192.168.10.192/26 Network again into two Networks, each with 32 IP Addresses (30 usable IP
addresses) using 255.255.255.224 subnet mask
We will get two subnets each with 32 IP Addresses (30 usable IP addresses).
11000000.10101000.00001010.11 | 0 | 00000
11111111.11111111.11111111.11 | 1 | 00000
11000000.10101000.00001010.11 | 1 | 00000
11111111.11111111.11111111.11 | 1 | 00000
Now we have split the 192.168.10.0/24 network into four subnets using Variable Length Subnet
Masking (VLSM), with unequal number of IP addresses as shown below. Also note that when you
divide a network using Variable Length Subnet Masking (VLSM), the subnet masks are also different.
SUPERNETTING:
Supernetting is the method for combing two or more contiguous network address spaces to simulate a
single, larger, address space. You may remember, in Subnetting we are adding the bits from the host
part to the network part. But in Supernetting we do the reverse. Here in supernetting we add bits from
the network part to the host part. To supernet two contiguous networks is simple. Just convert the
networks in to binaries, compare the bits of the two networks. Till where you have the similiar bit
pattern, use a subnet mask bit of "1", and after that "0". Use the altered subnet mask for two networks.
That’s it!
For example, you may want to supernet the networks 192.168.10.0 and 192.168.11.0 to make a single,
large network. Following two lines are the conversions of the above network addresses to binaries and
the last line is the new subnet mask.
11000000.10101000.0000101 | 0.00000000
11000000.10101000.0000101 | 1.00000000
11111111.11111111.1111111 | 0.00000000
The changed subnet mask is 255.255.254.0 can be used to supernet 192.168.10.0 and 192.168.11.0.
The concept of supernetting is used in routing protocols for "route summarization".