Sei sulla pagina 1di 4

AIM : Implementation of subnetting and supernetting in Classful

addressing
THEORY :

In classful addressing, the IP address is divided into five classes: A, B,


C, D, E.
Each class occupies some part of the whole address space.

 Finding the class of an address:


We can find the class of an address when the address is
given either in binary or dotted decimal
0-127
notation. In binary, first few bits can
128-191
immediately tell the class ; in dotted-
decimal, value of first byte gives the 192-223
class of address. 224-239
0… 240-255
10… Octal 1 2 3 4
110… Byte 1 2 3
1110 4
… Class A
1111 Class B
… Class C
Class D
Class E

 NetID and HostID:


In classful addressing, an IP address in classes A,B & C is divided
into netid & hostid. These parts are of varying length, depending on class of
address.

Netid Hostid
Class A 1 3
Class B 2 2
Class C 3 1
Class D Multicast address Multicast address
Class E Reserved for future Reserved for future
use use

 SUBNETTING:
In subnetting, a network is divided into several smaller sub
networks(subnets) with each sub network having its own sub network address.
Subnetting increases the length of netid & decreases length of
hosted. When a network is subnetted, the first address in the subnet is the identifier
of subnet & is used by the router to route packets designed for that sub network
and uses the procedure : ANDing the given address with the subnet mask. We can
calculate the subnetid for each subnetwork as
nsub= n + log2S
Where n is the length of netid, nsub is length of each subnetid and S is
the no. of subnets which must be a power of 2.
EXAMPLE:
Following figure shows a network using class B address before
subnetting. We have just one network with almost 2^16 hosts. The whole network
is connected, through one single connection to one of the routers in the internet.
Note that we have shown /16 to show the length of the netid.

141.14.0.1 141.14.0.2 … 141.14.100.27 … 141.14.255.253


141.14.255.254

SWITC
H

To other To
other
network network

To the rest of Internet

Following figure shows the same network after subnetting. The whole network is still
connected to the Internet through same router. However the network has used a
private router to divide the network into four subnetworks. Each subnetwork can
now have almost 2^14 hosts. Note that /16 and /18 show the length of the netid
and subnetid.

141.14.0.1 … 141.14.31.29 … 141.14.63.254 141.14.64.1 … 141.14.90.27 … 141.14.127.254

Subnet 1
Subnet 2

141.14.128.1 … 141.14.142.37 … 141.14.191.254 141.14.192.1 … 141.14.233.47 …

141.14.255.254
Subnet 3
Subnet 4

Networ
k 141.14.0.0/16

Internet router
 SUPERNETTING:
In supernetting, several networks are combined to create a
supernetwork. A supernet mask is reverse of a subnet mask. A supernet mask for
class C has less 1’s than the default mask.
In supernetting, the no. of class C addresses that can be
combined to make a supernet needs to be a power of 2, which means that an
organization needing 7 blocks should be granted atleast 8 blocks(address wasting).
Another problem is , it really complicated the routing of packets
in the Internet.
The length of supernetid can be found by
nsuper=n- log2C
where n super is length of supernetid in bits, C is the no. of class C
blocks that are combined.

EXAMPLE:
Following figure shows the difference between a subnet mask and a
supernet mask. A subnet mask that divides a block into eight subblocks has three
more 1s (2^3= 8) than the default mask; a supernet mask that combines eight
blocks into one superblock has three less 1s than the default mask.

COMPARISON OF SUBNET, DEFAULT AND SUPERNET MASKS

Divide 1 class C block into 8 subblocks


Subnet 11111111 11111111 11111111 mask
nsub=24+3=27
11100000

Default mask 11111111 11111111 11111111


n=24 00000000

Supernet 11111111 11111111 11111000 mask


nsuper=24-3=21
00000000
Combine 8 class C blocks into superblock
CONCLUSION:

Thus, we have implemented subnetting and supernetting successfully.

Potrebbero piacerti anche