0% found this document useful (0 votes)
26 views8 pages

Automation and Detailed Analysis of Subnetting Problems Using Mathematical Modeling

The document discusses the automation and detailed analysis of subnetting problems using mathematical modeling, aiming to simplify the cumbersome process of subnetting in networking. It proposes an application that accurately calculates subnetting information, thereby reducing human error and improving network performance. The paper outlines the mathematical principles behind subnetting, including the classification of IP addresses and the calculation of subnet masks.

Uploaded by

ahsanramzan70
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)
26 views8 pages

Automation and Detailed Analysis of Subnetting Problems Using Mathematical Modeling

The document discusses the automation and detailed analysis of subnetting problems using mathematical modeling, aiming to simplify the cumbersome process of subnetting in networking. It proposes an application that accurately calculates subnetting information, thereby reducing human error and improving network performance. The paper outlines the mathematical principles behind subnetting, including the classification of IP addresses and the calculation of subnet masks.

Uploaded by

ahsanramzan70
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/ 8

International Journal of Pure and Applied Mathematics

Volume 118 No. 20 2018, 807-814


ISSN: 1311-8080 (printed version); ISSN: 1314-3395 (on-line version)
url: http://www.ijpam.eu
Special Issue
ijpam.eu

AUTOMATION AND DETAILED ANALYSIS OF SUBNETTING PROBLEMS USING


MATHEMATICAL MODELING

1
Deepank Dixit, 2Gautam Kumar, 3Rajeev Tiwari, 4Abhineet Anand
1
(Student), 1,3CIT, UPES, Dehradun
2,4
SCSE, Galgotias University, Greater Noida
1
[email protected], [email protected]
3
[email protected], [email protected]

Abstract: The existing subnetting techniques require routers within it. The design of TCP/IP IPv4 addressing
us to list all network ranges one by one by setting one scheme doesn’t allow the authorities to assign these
of the bits to on or off. It is always a cumbersome task many public IP address for one organization because
to represent the network ranges in binary and later that would go far beyond our exploitation boundaries of
converting it to decimal. The objective is to develop an IPv4 addresses.1
application to automate the process of by displaying all Subnetting brings with itself a myriad of advantages.
the information of the network (pertaining to Security, Limitations, Speed network transfers and
subnetting) that one needs to know. The applications of improved performance in isolation are only a few of
subnetting are ubiquitous in the realm of networking. them2. Above mentioned almighty routers can require
The mentioned approach presents much easier way of that a WAN link connecting two networks must itself
designing networks by outlining subnets through the form a separate subnet. Troubleshooting, diagnosing,
network. and fixing problems in a TCP/IP internetwork typically
This approach, however, insures to bring solutions require thorough familiarity with subnetting.
to more than 95% of the subnetting problems. There are Subnetting can improve network performance by
a number of ways in which this particular approach can splitting up collision and broadcast domains3. It reflects
be molded but the beauty is that all we have to care organizational structure and help support security
about is one unique outcome because that is what policies. Subnets can be treated in a manner that they
captures the essence of the network. Therefore, solution define administrative units and hence support the
to any subnetting problem can be crosschecked through structuring and delegation of administrative tasks.
online resources. Network traffic control, congestion The process of subnetting involves a series of
avoidance, preservation of address space and enhanced moderately complex mathematical steps, executing
network security are amongst the most remarkable which with precision, demands the supervision of a
advantages of segregating the network. network engineer. A major stumbling block to
successful subnetting is often a lack of understanding
Keywords: Automation, Modeling, Network, Address of the underlying binary math. In fact, the principles of
Space, Segregation subnetting are difficult to grasp without artistic mastery
of binary arithmetic, logic, and binary/decimal
1. Introduction conversions. However skilled an engineer might be,
there is always a slim possibility of calculation mistake.
Subnetting is one of the many vital parts of networking. This paper proposes the idea of an automated system
It is logical subdivision of an IP network. Subnetting is which calculates the subnetting information of a
the practice of dividing a network into two or more network. Such a system would not be prone to
networks. Dividing a large network into subnets mathematical errors, thereby providing the reliable
representing administration responsibility for each information that shapes our network.
subnet can make administration of a large network
easier. Subnetting has a rather vigorous impact in the
realm of networking. Loosely writing, one simple way
to look at the Internet could be that the Internet is a
collection of routers, routers upon routers, a whole web
of routers. The thing about router is that every interface
of a router represents a unique network and an
organization may contain from a few up to hundreds of

807
International Journal of Pure and Applied Mathematics Special Issue

all the network bits to 1s and host bits to 0s7. In TCP/IP


addressing scheme, it is defined how many bits make
up the network portion and how many the host portion.
For example: A class C address has 24 bits
dedicated to define the network portion which gives us
a network ID. Rest 8 bits are for determining the
number of hosts. These 8 bits are what we call the host
bits. In this 32 bit number that places itself in 4 octets,
each octet, as the name explains itself, has 8 bits.
NNNNNNNN.NNNNNNNN.NNNNNNNN.HHHHH
HHH
(N shows the reserved place for a network bit and H for
host bit.)
By setting all 24 network bits to 1s and 8 host bits to
0s, we learn that the subnet mask is-
11111111.11111111.11111111.00000000
This, however, is the binary representation of subnet
Figure 1. Two local area networks (on different mask. The decimal representation will be
subnets) connected by a router 255.255.255.0.
Thus, the default subnet mask of a class C address is
Figure 1 is a trivial network diagram which shows 255.255.255.0 which reveals that the first 3 octets have
how two absolutely resembling intra-networks do all of their bits set to 1. Last octet however, is the one
belong to different network prefix4. This also with all bits set to 0. This is how a subnet mask
schematically expounds upon one innate property of the determines the total number of network bits and host
router which is having different network ID at its each bits in a type /class of a network7.
interface. Module 1
The figure very elegantly explains the inevitability IP Subnetting(General)
of subnetting even in this small network. We have two Procedure:
sub-networks here- LAN1 and LAN2. It is router’s job To be able to have a machine capable of performing the
to connect two different networks, which is what it mathematical calculations just as a network engineer or
does here. But for every such network in a vast a student would do, except here with absolute accuracy,
network, unique public IP addresses cannot be it is required to do the step wise analysis of the
assigned. Therefore, we’ll have to do the subnetting. problem.
Before getting to the root of subnetting, we must first This module consists of three sub-modules:
revise the fundamentals of TCP/IP scheme. I. Determines the number of total networks or the
TCP/IP IPv4 Addressing Scheme: number of hosts required in a sub-network
The IP addressed in network world is divided in 5 II. Calculates the new subnet mask
different sized classes5. Microsoft TCP/IP supports III. Finds the increment
class A, B and C addresses to be assigned to hosts. The increment defines the size of a block (sub-network)
Each IP address is of 32 bits. These bits are either set to which allows us to find the network ranges and network
1 or set to 0.These classes are formed only to ranges allow us to determine the network ID and the
distinguish between the respective number of 0s and 1s broadcast ID of the respective sub-network.
in the IP address. 1 in turn represents the network bit
and 0 denotes for the host bit. This also allows us to 2. Proposed Mathematical Model
determine the total number of possible networks and
the number of hosts. A user is prompt to enter an IP address. The class of the
Understanding of subnet masks comes in handy entered IP address is first determined. In order to
when it comes to explore the concepts of subnetting6. deduce the class of the IP, first octet is examined
There are custom subnet masks which will be explored keeping in mind the predefined structure of classful IP
as the discussion becomes richer but each class has its addresses. Once the entered address is known to be
own unique default subnet mask. The subnet mask, belonging to a particular class, the corresponding
same as an IP address is 32 bits long. Even the subnet mask is figured with the help of the reference
rudimentary rule of 1 being considered as network bit Table 1.
and 0 as host bit is same. Under class-based network
addressing, each class has a unique subnet mask which
masks an IP address and divides it into network address
and host address. The subnet mask is formed by setting

808
International Journal of Pure and Applied Mathematics Special Issue

Table 1 invokes the calculation of further mathematical


problem which is to subnet the network based upon this
latest entry made by the user, which throughout the
Corresponding Range of Subnet Mask module is denoted as hpn.
Class the First Algorithm1(a)(Calculates the number of host bits and
Octet network bits):
A 1-126 255.0.0.0 or /8 nhb = log (hpn+2) / log (2)
B 128-191 255.255.0.0 or nhb is the decimal value of number of host bits. The
/16 ceiling value of this obtained value is to be taken,
C 192-223 255.255.255.0 which is calculated using ceil () function.
or/24 Thus, number of host bits after subnetting = ceil(nhb)
Follows from it, instantly the number of total
From here on there are two ways flow of execution assignable hosts per sub-network using the formula 2ceil
(nhb)
and respective mathematical calculation may go along .
(i.e. either on the basis of number of hosts per network Number of subnet bits after subnetting = db - ceil
or on the basis of required number of networks) 9. (nhb)
Either way, the network is being segmented into db here is the aforementioned number of default
smaller ones. The number of networks is increasing, host bits. The newly defined number of hosts per sub-
meaning the number of network bits are growing, network by the user alters the default number of host
which is only possible at the expanse of the available bits and thus emerges a new number that we calculated
host bits10.The number of predefined host bits and to be nhb. Rest of the bits in the default host bits (0s)
network bits in each class is mentioned in Table 2. are then converted to network bits (1s). Therefore,
subtracting of number of calculated host bits from the
Table 2 default host bits yields the number of new network bits
with the formula db - ceil (nhb).
The number of total sub-networks is2db-ceil (nhb).
Corresponding Number Number of Evidently, subnetting is performed at the cost of the
Class of Host Network Bits default number of host bits13. Hosts bits are sacrificed
Bits in order to obtain more networks (sub-networks).
A 24 8 (B) On the basis of required number of networks:
B 16 16 The approach to calculate the host bits and network bits
C 8 24 is almost as same as the above one with a few
differences in mathematical formulation.The
These host bits are the ones that are at the heart of formulation below is written considering the first and
subnetting process11, which in the module, for the sake the last subnet as valid subnets.
of avoiding ambiguity in calculation, are used as Algorithm 1(b)(Calculates the number of host bits and
default bits (db). After all, these are the default number network bits):
of bits that are going to be exploited in subnetting. nsb=log(snw) / log(2)
Subnetting can be performed in two ways which nsb is the fraction value of number of subnet bits.
originate from the fundamental network requirement of Number of subnetbits = ceil (nsb)
the organization. It can be the required number of hosts These are the number of bits that needs to be
per network or the required number of networks that changed to 1. These bits were originally in the default
allows us to perform the further calculations. subnet mask as host bits (0s) but since the network
Any one of these approaches to segment a network scenario demands more number of networks, some host
is not any less or more popular than the other12. In fact, bits need to be sacrificed and converted into network
it all depends upon the requirement of the network bits (1s).
infrastructure. Therefore, a detailed analysis of both the Total number of sub-networks = 2ceil (nsb)
approaches is in order. Number of host bits = db – ceil (nsb)
I.(A) On the basis of required number of hosts per Total number of valid hosts = 2(db-ceil (nsb))–2
network: For the sake of simplicity, let’s say number of host
The user is prompt to enter the number of hosts bits and number of network bits are stored in var1 and
required per sub-network in his network scenario. At var2 respectively (for algorithm 1(a) and 1(b) both).
this point, the knowledge about the class of the IP, II. Calculation of new Subnet Mask:
default subnet mask of corresponding class, number of nsmhere is used as an abbreviation for New Subnet
host bits and number of network bits is gathered. All Mask or Custom Subnet Mask. A separate sub-module
this information helps present the basic layout of the for the nsm is designed asits calculation is
concerned network. The number of required hosts comparatively tricky and needs to be carried out
cautiously.

809
International Journal of Pure and Applied Mathematics Special Issue

Algorithm 2(Calculates the new subnet mask): segregated into several smaller ones. The important
(i)For Class C IP address: information to be gained is at what position in the
db = 8 original one range of the total host does the barrier need
Change var2 number of bits to 1 from most to be placed, so as to discover ranges of each individual
significant bit side in the increment octet(4th sub-network. This sub-module computes this sensitive
octet).These 1s are contiguous and followed by var1 problem.
number of 0s. Every sub-network has its own network ID and a
The new subnet mask will be calculated using the broadcast ID14. The first address among the total
formula- 255.255.255. number of hosts per sub-network is used to denote the
db= 8 shows that the IP address is of class C and first network identity and the last one for the broadcast ID.
three octets (i.e.255.255.255) in the default subnet However, implementing logic of finding ranges through
mask of class C must be preserved. Bits of octet four coding is comparatively arduous; calculation for ranges
are to be altered. Therefore, change is made in the of sub-network is rather trivial. The complexity
fourth octet of the default subnet mask. increases as we transit from class C to class A
(ii)For Class B IP address: calculations. Increment Octet is another parameter
db = 16 which is crucial in penning down these ranges. Since
There are two cases: there are four octets, it is important to know from
Case 1- 1 <= var2 <= 8 which octets begins the ranging mechanism.
Change var2 number of bits to 1 from most significant Mathematical formulation to find increment varies
bit side in 3rd octet. from class to class. Even there are several cases within
The new subnet mask will be calculated using the a class depending upon the number of network/host bits
formula- that are needed to be altered. The value of increment
255.255. .0 octet follows directly from the values of var1 and var2
Case 2- 9 <= var2 <= 15 with little bit of mental calculation. Increment is
Change var2 number of bits to 1 from most significant denoted as inc and increment octet as incOct.
bit side in 4th octet. Algorithm 3(calculates range of sub-networks):
The new subnet mask will be calculated using the (i) Class C
formula- inc = 2var1
255.255.255. incOct = 4
(ii) Class B
(iii)For Class A IP address: Case 1- 1 ≤ var2 ≤ 8
db = 24 inc = 28-var2 incOct = 3
There are three cases: Case 2- 9 ≤ var2 ≤ 15
Case 1- 1 <= var2 <= 8 inc = 216-var2
Change var2 number of bits to 1 from most significant incOct = 4
bit side in 2nd octet. (iii) Class A
The new subnet mask will be calculated using the Case 1-1 ≤ var2 ≤ 8
formula- inc = 28-var2 incOct = 2
255. .0.0 Case 2-9 ≤ var2 ≤ 16
Case 2- 9 <= var2 <= 16 inc = 216-var2
Change var2 number of bits to 1 from most significant incOct = 3
bit side in 3rd octet. Case 3-17 ≤ var2 ≤ 23
The new subnet mask will be calculated using the inc = 224-var2
formula- incOct = 4
255.255. .0 Module 2
Case 3- 17 <= var2 <= 23 Reverse Engineering Subnetting
Change var2 number of bits to 1 from most significant Although, the subnetting style that seems to be mostly
bit side in 4th octet. dealt with is the one above analyzed, it is not the
The new subnet mask will be calculated using the entirety of the situation. The most common style of
formula- subnetting is performed in reverse engineering
255.255.255. manner15. It calls for working out our problems
III. Calculation of increment to find ranges of Sub- backwards.
networks: This type of subnetting mostly proves useful to
Increment is the important parameter to calculate troubleshoot network configuration errors. In most
ranges of the sub-networks. It allows us to determine cases we want to know what network a host belongs to
the segmentation structure of sub-networks. After all, or which network is this host a part of16. Determining
initially there was one network which is now whether a particular host is on the same network as the
other or not, becomes easy with reverse engineering

810
International Journal of Pure and Applied Mathematics Special Issue

such problems. There are times when we want to check If Q5 = 0


the validity of the IP address with a particular subnet R6=R7 = 0
mask17. Figuring out these problems with this approach If Q5 ≠ 0
is time efficient, accurate and reliable. Q6 = Q5 / 2 and R6 = Q5 - 2Q6
Procedure: If Q6 = 0
To reverse engineer a subnet problem it is crucial to R7 = 0
find out the increment that was used to calculate the If Q6 ≠ 0
range of the sub-networks. The way, it is done it rather Q7 = Q6 / 2 and R7 = Q6 - 2Q7
straightforward with the binary/decimal calculation. And Q8 = 0
There are several ways to find the increment with the This way, all the values from R0 to R7 are known.
help of the entered custom subnet mask. Each octet of a These 8 bits when put together yield the binary
valid subnet mask consists of one of three types of representation of the decimal value. Thus, the binary
decimal values. Two of these are 255 and 0. Three of value is found. Now, the increment is to be calculated.
the four octets have the decimal value as either 255 or To find the increment, among these 8 bits (R1 through
0. The remaining one octet is what is known as non- R7),the lowest network bit is to be translated to its
255/non-zero octet. The job is to find out the non- decimal value18. This is the increment that the network
255/non-zero octet value. Once the value is known, it is designers used to build the concerned network.
then converted into binary to find out the increment. The computation of the range can be done using
Mathematical Formulation: Algorithm 3 Module 1. Thus, the sub-network which
Since the required value is the decimal value of the the entered IP address belongs to is displayed along
non-255/non-zero octet in binary, let’s say the resulting with details of all other sub-networks.
binary 8 bit representation is-
R7 R6 R5 R4 R3 R2 R1 R0
Say, Q is the decimal value of non-255/non-zero octet.

Qn € Iand Rn € I
Q0 = Q/2 and R0 = Q - 2Q0

If Q0 = 0
R1=R2=R3=R4=R5=R6=R7 = 0

If Q0 ≠ 0
Q1 = Q0 / 2 and R1 = Q0 - 2Q1

If Q1 = 0
R2=R3=R4=R5=R6=R7 = 0

If Q1 ≠ 0
Q2 = Q1 / 2 and R2 = Q1 - 2Q2

If Q2 = 0
R3=R4=R5=R6=R7 = 0

If Q2 ≠ 0
Q3 = Q2 / 2 and R3 = Q2 - 2Q3

If Q3 = 0
R4=R5=R6=R7 = 0 3. Simulation and Results

If Q3 ≠ 0 The idea of subnet simulating can be implemented in


Q4 = Q3 / 2 and R4 = Q2 - 2Q3 various programming languages; however procedural
languages are always a good choice to begin with the
If Q4 = 0 logic development for mathematical calculations. Once
R5=R6=R7 = 0 logic is built, one can initiate to write the codes in the
preferred language. Figure 2 is the workflow process
If Q4 ≠ 0 diagram followed by the snapshots of logic testing
Q5 = Q4 / 2 and R5 = Q4 - 2Q5 results from both modules which present an overview

811
International Journal of Pure and Applied Mathematics Special Issue

of how the flow of execution is driven in program can prove greatly useful for education purposes.
Students can verify their sub-netting results to make
(a)Module 1 sure whether or not they got the correct answer.
Module 1 solves IP subnetting problem by general
approach. User is prompt to enter an IP address. References
Validity of this IP address is checked. Then, the user is
prompt to choose the type of subnetting problem that [1] Todd Lammle Subnetting class C network
needs to be solved. Once all the inputs are taken, with address www.techrepublic.com/article/subnetting-
the help of algorithms mentioned in Module one: aclass-c-network-address/, Date accessed:
Subnetting procedure, the layout of the sub-netted 24/05/2001.
network is made available to user on screen. Run time
interface for Module 1 is attached in . [2] Jeremy Cioara-Exam Prep CCNA 2nd Edition,
ISBN-13: 978-0-7897-3713-7
https://www.amazon.com/CCNA-Exam-Prep-640-802-
2nd/.../07897371

[3] Andrew S. Tanenbaum-Computer Networks,


Fifth Edition, ISBN-13: 978-0-13-212695-3.1944.

[4] Basha S, AhmedN. Department of Quality


Assurance, Mazoon University College, Muscat),
Automation of Sub-Netting Problems- International
Journal of Engineering Science Invention.2016.

(b) Module 2 [5] Academy Delmar, Subnetting via


This module solves the subnetting problem by reverse TCP/IPhttp://academy.delmar.edu/Courses/ITSC1405/e
engineering method. Values of an IP address and a Books/Win2K03 (ServerSecretsBook)/Chapter 07.pdf
subnet mask is inputted. This subnet mask is the one
that network designers decided to structure the [6] IPv4 Addressing and Subnetting v1.41 – Aaron
network. Mathematical formulation mentioned in Balchunas http://www.routeralley.com
Module two helps to compute the corresponding sub- /guides/ipv4.pdf,Date accessed: 2013.
network ranges and display them to the user. Run time
interface for Module 2 is attached in Figure 4. [7] Met M H, GunesG, Sarac K. ―Inferring
Subnets in Router-level Topology Collection Studies,
7th ACM conference on Internet measurement, USA,
2007, pp. 1-6.

[8] Richker J .IP Subnetting for the Masses .2008.

[9] Tech-faq, 127.0.0.1- what are its uses and why


it is important http://www.tech-faq.com/127-0-0-
1.html.Date accessed: 11/5/2016.

[10] Demand Media, Importance of


subnetting,http://yourbusiness.azcentral.com/importanc
esubnetting-20038.html,Date accessed:2016.
4. Conclusion
[11] BG Expert: IP addresses. www.bgpexpert.
No organization today is devoid of the impact of
com/addressespercountry.php.Date accessed:
subnetting. It is inevitable, after all. Network traffic
18/06/2016.
control, congestion avoidance, preservation of address
space and enhanced network security are amongst the
[12] Brien M, Posey P. Subnetting to Increase
most remarkable advantages of segregating the
Performance .2015.
network. The paper thoroughly explores the various
features of this tool and presents the entire subnetting
[13] IP Addressing and Subnetting for New
layout of the network. Not only does this tool help
Usershttp://www.cisco.com/c/en/us/support/docs/ip/rou
network engineers to crosscheck their performed
ting-information-protocol-rip/13788-3.html
operations while troubleshooting the network, it also

812
International Journal of Pure and Applied Mathematics Special Issue

[14] Solving the Mysteries of Subnetting


https://d12vzecr6ihe4p.cloudfront.net/media/966006/w
p-solving-the-mysteries-of-subnetting.pdf

[15] Neural subnet design by direct


polynomialmappinghttp://ieeexplore.ieee.org/abstract/d
ocument/165606/?reload=true

[16] Advanced ‘folding the paper’ subnetting


concepts http://www.ebrahma.com/2014/12/advanced-
folding-paper-subnetting-concepts/

[17] Math of IP Subnetting and Subnet Masks -


DigiPro Digital Productions http://www.digipro.
com/Papers/IP_Subnetting.shtml

[18] Subnetting Networks Research Paper


http://essayzoo.org/research-paper/apa/technology
/subnetting-networks.php

[19] T. Padmapriya and V.Saminadan, “Improving


Performance of Downlink LTE-Advanced Networks
Using Advanced Networks Using Advanced feedback
Mechanisms and SINR Model”, International
Conference on Emerging Technology (ICET), vol.7,
no.1, pp: 93, March 2014.

[20] S.V.Manikanthan and K.srividhya "An


Android based secure access control using ARM and
cloud computing", Published in: Electronics and
Communication Systems (ICECS), 2015 2nd
International Conference on 26-27 Feb. 2015,
Publisher: IEEE, DOI: 10.1109/ECS.2015.7124833.

[21] Rajesh.M., and J. M. Gnanasekar. &quot; An


optimized congestion control and error management
system for OCCEM.&quot; International Journal of
Advanced Research in IT and Engineering 4.4 (2015):
1-10.

[22] J.PRATHYUSHA, G.SANDHYA &


V.KRISHNA REDDY, “An Improvised Partition-
Based Workflow Scheduling Algorithm”, International
Innovative Research Journal of Engineering and
Technology ISSN NO: 2456-1983.Volume 2, Issue 4
June 2017. 120-123.

813
814

You might also like