0% found this document useful (0 votes)
32 views

Subnetting

subnet file

Uploaded by

prajwalpawar100k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Subnetting

subnet file

Uploaded by

prajwalpawar100k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Aim:

Write a program to demonstrate subnetting and find the subnet masks.

Theory:
Subnetting
Subnetting is a process of dividing large network into the smaller networks based on layer 3 IP
address. Every computer on network has an IP address that represent its location on network.
Two version of IP addresses are available IPv4 and IPv6. In this article we will perform
subnetting on IPv4.

IPv4

IP addresses are displayed in dotted decimal notation, and appear as four numbers separated by
dots. Each number of an IP address is made from eight individual bits known as octet. Each octet
can create number value from 0 to 255. An IP address would be 32 bits long in binary divided
into the two components, network component and host component. Network component is used
to identify the network that the packet is intended for, and host component is used to identify the
individual host on network.

IP addresses are broken into the two components:


Network component :- Defines network segment of device.
Host component :- Defines the specific device on a particular network segment

IP Classes in decimal notation


1. Class A addresses range from 1-126
2. Class B addresses range from 128-191
3. Class C addresses range from 192-223
4. Class D addresses range from 224-239
5. Class E addresses range from 240-254

● 0 [Zero] is reserved and represents all IP addresses.


● 127 is a reserved address and is used for testing, like a loop back on an interface.
● 255 is a reserved address and is used for broadcasting purposes
Subnet mask

Subnet mask is a 32 bits long address used to distinguish between network address and host
address in IP address. Subnet mask is always used with IP address. Subnet mask has only one
purpose, to identify which part of an IP address is network address and which part is host
address.
For example how will we figure out network partition and host partition from IP address
192.168.1.10 ? Here we need subnet mask to get details about network address and host address.
● In decimal notation subnet mask value 1 to 255 represent network address and value 0
[Zero] represent host address.
● In binary notation subnet mask ON bit [ 1] represent network address while OFF bit[0]
represent host address.

In decimal notation
IP address 192.168.1.10
Subnet mask 255.255.255.0

Network address is 192.168.1 and host address is 10.


In binary notation
IP address 11000000.10101000.00000001.00001010
Subnet mask 11111111.11111111.11111111.00000000

Network address is 11000000.10101000.00000001 and host address is 00001010

IP Default Subnet Network bits Host bits Total hosts Valid hosts
Class

A 255.0.0.0 First 8 bits Last 24 bits 16, 777, 216 16, 777, 214

B 255.255.0.0 First 16 bits Last 16 bits 65,536 65,534


C 255.255.255.0 First 24 bits Last 8 bits 256 254

Network ID

First address of subnet is called network ID. This address is used to identify one segment or
broadcast domain from all the other segments in the network.

Block Size

Block size is the size of subnet including network address, hosts addresses and broadcast
address.

Broadcast ID

There are two types of broadcast, direct broadcast and full broadcast.
Direct broadcast or local broadcast is the last address of subnet and can be heard by all hosts
in subnet.
Full broadcast is the last address of IP classes and can be heard by all IP hosts in network. Full
broadcast address is 255.255.255.255
The main difference between direct broadcast and full broadcast is that routers will not propagate
local broadcasts between segments, but they will propagate directed broadcasts.

Host Addresses

All address between the network address and the directed broadcast address is called host
address for the subnet. You can assign host addresses to any IP devices such as PCs, servers,
routers, and switches.

Single class C IP range can fulfill this requirement, still you have to purchase 2 class C IP range,
one for each network. Single class C range provides 256 total addresses and we need only 30
addresses, this will waste 226 addresses. These unused addresses would make additional route
advertisements slowing down the network.
With subnetting you only need to purchase single range of class C. You can configure router to
take first 26 bits instead of default 24 bits as network bits. In this case we would extend default
boundary of subnet mask and borrow 2 host bits to create networks. By taking two bits from the
host range and counting them as network bits, we can create two new subnets, and assign hosts
them. As long as the two new network bits match in the address, they belong to the same
network. You can change either of the two bits, and you would be in a new subnet.

Advantage of Subnetting

● Subnetting breaks large network in smaller networks and smaller networks are easier to
manage.
● Subnetting reduces network traffic by removing collision and broadcast traffic, that
overall improve performance.
● Subnetting allows you to apply network security polices at the interconnection between
subnets.
● Subnetting allows you to save money by reducing requirement for IP range.

Default subnet mask

Class Subnet Mask Format

A 255.0.0.0 Network.Host.Host.Host

B 255.255.0.0 Network.Network.Host.Host

C 255.255.255.0 Network.Network.Network.Host

Key terms to remembers


● A subnet is a smaller portion of large network treated as its own separate network. To
create subnet we borrow bits from host portion and assign them as network bits. This
mean more networks, fewer hosts.
● If the network bits on two addresses do not match, then the two packets are intended for
two separate networks.
● On a 32 bits IP address at least eight bits must belong to the network portion and at least
2 bits must belong to the host portion.
● Each IP address has a predefined IP class and that cannot be changed.
● Each class has a predefined default subnet mask that tell us the octets, which are already
part of the network portion, as well as how many bits we have available to work with.
● Whatever network class is it, we cannot change those bits that are already assigned.
● We cannot assign the network ID and the broadcast address to a host.
● Regardless how many bits are left in the host field, network ID and the broadcast address
must be reserved.
● Subnet bits start at the left and go to the right, without skipping bits.

Conclusion:
Successfully implemented the subnetting and subnet mask program.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy