Вы находитесь на странице: 1из 11

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/268369074

MATHEMATICS IN IP-SUBNETTING

Article

CITATIONS READS

0 2,892

3 authors, including:

Mayuri Bapat Shital Ghotekar


MAEER’s Arts, Commerce and Science College Savitribai Phule Pune University
3 PUBLICATIONS   0 CITATIONS    1 PUBLICATION   0 CITATIONS   

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Mayuri Bapat on 26 May 2016.

The user has requested enhancement of the downloaded file.


Bulletin of the Marathwada Mathematical Society
Vol. 12, No. 1, June 2011, Pages 1–10.

MATHEMATICS IN IP-SUBNETTING

Mayuri Bapat, Vaishali Amberwadikar and Shital Ghotekar.


MIT Arts, Commerce and Science College, Alandi (D), Pune–412 105.
E-mail : Bapat.mayuri@gmail.com

1 INTRODUCTION

IP Subnetting is considered to be the most confusing aspect in Networking.


To perform IP subnetting we use mathematical topics like Graph Theory, Trans-
port Nerwork, Graph Theory Model of OSPF, Queuing Theory, Trigonometry and
Geometry along with other operations like Power, Addition and subtraction etc.
This paper is precisely focusing on “how” IP Subnetting is derived using above
mathematical theories and functions. This paper includes walk through with an
example using Class C network to show how mathematical functions are used in
deriving IP subnetting. This paper also gives an idea how network of computers is
mapped using mathematical theories. 1

2 BASIC DEFINITIONS

What is an IP address? IP address is a numeric identifier assigned to each ma-


chine on an IP network. It is also called as a software address because it is assigned
to the Operating System. It is changeable. There are two prevalent notations to
show an IP address.
What notations used to denote the IP address?

1. Dotted Decimal Notation


IP addresses are usually written in decimal form with a decimal point separating
the octet. Each octet is often referred to as a byte (8 bits).
Example : 117.149.29.2.

2. Binary Notation
In binary notation, the IP address is diplayed as 32 bits. For example : 01110101
10010101 00011101 00000010
1
Keywords:Network, IP Subnetting, Graph Theory, Transport Network, Communication Net-
work.

1
2 Mayuri Bapat, Vaishali Amberwadikar and Shital Ghotekar

It is assumed that readers are familier with binary numbers and binary con-
version of a decimal number.
What are the IP Address classes? The range of 0 to 255 is divided into
five address classes. The range is 0 to 255 because 26 = 256 and each number or
character is represented by 8 bits.

* Class A - Supports 16,777,216 hosts on each network,(Range 0 to 127)


* Class B - Supports 65,536 hosts on each network,(Range 128 to 191)
* Class C - Supports 256 hosts on each network,(Range 192 to 223)
* Class D - Reserved for specific uses and not assigned to hosts.(Range
224 to 239)
* Class E - Reserved for specific uses and not assigned to hosts.(Range
240 to 255)

What is Network Address? It is the first address on the subnet and it is


essential to identify the network. In the class C network192.168.10.0 is the network
address.
What is Broadcast address? Broadcast Address- It is the last IP address on
the network and used to send packets to every host on the subnet. In the class C
network 192.168.10.255 is the broadcast network.
What is subnet? A subnet is a portion of a network that shares a common
address component with other portions of the network. On TCP/IP networks,
subnets are defined as all devices whose IP addresses have the same prefix.
How to Determine Number of Hosts and Subnets ? Following formulae are
used for Subnetting:

• The number of subnets =2n , where n is the number of 1 bits in the host part.

• The number of hosts = 2n − 2, where n is the number of unmasked bits. In


the preceding

• Block Size = 256−Subnet Mask.

3 AN EXAMPLE

The following example shows how mathematical operations are used in IP


Subnetting.
Given an IP address of 192.168.10.95 and subnet mask of 255.255.255.192.
What is the network address asociated with this subnet?
Solution: First convert subnet mask to their binary equivalents. In the example
above, I have separated the host portion of the address from the network portion.
The network portion appears in red, while the host portion appears in blue.

i .e.Subnet Mask:11111111.11111111.11111111.11000000.
Mathematics in IP-Subnetting 3

Next we want to figure out exactly how many subnets are in network of this class
C. To do this, we count the number of ones (1 s) contained in the host portion of
our subnet mask. In the address above, the 1 bits are 2. We now compute 2 to the
2 nd power to determine how many subnets are in network. 22 = 4.
Next, we want to figure out exactly how many IP addresses i. e. valid hosts
are in each subnet of this class C. To do this, we count the number of zeros(0 s)bits
contained in the host portion of our address. In the address above the “magic
number is 6, since we have 6 host bits. We now compute 2 to the 6th power to
determine how many Valid IP addresses are in each subset : 26 − 2 = 62.
Notice that we created 4 subnets containing 64 IPaddresses in each. Remember
however, that you can only assign 62 of these addresses to hosts, as the first and
last IP addresses of the subnet are the network address and broadcast address,
respectively.
Block Size : 256-192= 64.
Now that you know that there are 62 hosts in each subnet of class C 192.168.10.*
you can begin to make a chart of the subnet blocks in the class C, keeping in mind
that the first IP address in a Class C starts with zero :

Subnet Blocks in Class C 192.168.14.* with subnet mask of 255.255.255.


192 :

192.168.10.0 to 192.168.10.63
192.168.10.64 to 192.168.10.127
192.168.10.128 to 192.168.10.191
192.168.10.192 to 192.168.10.255.

In this way we are using simple mathematics in IP Subnetting.


In the following sections, we describe, how different branches of mathematics
are used in IP Subnetting.

4 GRAPH THEORY
Graphs are the mathematical constructs best suited to represent networks. A
network in its simplest form is a set of nodes or vrtices joined together in pairs by
edges. In the context of communication networks, vertices are Atonomous Systems,
routers,switches, computers, workstations whereas the edges are links connecting
a pair of such vertices. A set of connected links leading from an origin node to a
destination node is referred to as a “path. Consider a fixed or static routing protocol
in that for each OD pair, the same unique path always carries the traffic between
origin and destination and vice-versa. The path length or OD (Origin Destination)
distance is measured as the number of links connecting an OD pair. The problem
is to infer the topology (tree) and its internal nodes given the path measurements
4 Mayuri Bapat, Vaishali Amberwadikar and Shital Ghotekar

or distance between every OD pairs in network.


A natural way to model the topology of a communications network is as an
undirected graph consisting of nodes and links, for the purpose of analysing topology,
we ignore any variation in the type of links. Robustness of the topology will come
from the presence of alternate paths, which ensure that communication remains
possible inspite of damage to the network. If graph has n nodes, then we say that
the graph has size n. If a node has d outgoing links, we say that the node has degree
d. The minimum degree dmin of the graph is the smallest of the node degrees, and
the maximum degree dmax of the graph is the largest of the node degrees.
Mapping of Graph Theory with Network:
1. In creating a graph we are using nodes, similarly to create a network nodes
(Computers) are used. An edge e = (u, v) is a pair of connected computers.

2. In graph we are using a line to connect a node. In network we are using trans-
mission media to connect the computers.

3. The Concept Acyclic or undirected graph maps with the Star Topology in netr-
working.

4. Consider Cyclic Graph/Directed graph which maps with Ring topology in net-
working.

Fig 4.1:Star Topology


Fig 4.2:Ring Topology

in the ring topology 1 is ancestor of 2 & 2 is succof 1. This is mapped with


in-degree and out degree of a vertex.
Graph theory model of OSPF: Open Shortest Path First (OSPF) is one of the
most commonly used protocols for routing within an AS. Since AS networks consists
of hundreds, if not thousands, of subnets, scalability can be an issue. Thus, OSPF
suppots a two-level hierarchical routing scheme by dividing the network into areas
Mathematics in IP-Subnetting 5

known as OSPF areas. To avoid unnecessary grouth of routing tables, addresses


that fall within one subnet are aggregated. However, this aggregation has a trade-
off; it can result on loosing information about the shortest path between routers.
When syudying OSPF, autonomous systems are represented as undirected weighted
graphs.
OSPF makes use of graph theory model of network topology to calculate the
shortest path. Each node or corresponding to a gateway in OSPF topological dia-
gram, or corespond to a network. Not at network physical connection two entity,
then OSPF had directed one pairs between two nodes on behalf of entity picture,
there is one at each side “Right”. OSPF, according to setting up routing table
along the principle of spending the minimum route and transmitting the datagram.
OSPF use Dijkstras famous Shortest Path First (SPF) algorithm to determine all
best paths for a given topology. Dijkstras famous Shortest Path First (SPF) algo-
rithm is generally used in graph theory and was not invented especially for the IP
routing.
Dijkstras Algorithm uses the following formula to calculate the shortest path :

λ(v) = min{λ(v), λ(b) + w(vb)}

where

λ(v) is Source Vertex


λ(b) is adjacent vertex to the source
w(vb) is the weight from source to adjacent vertex

Mapping of Dijkstras Algorithm with Networking : In networking to find


out the best path between sender router and receiving router, routing algorithms
are used. One of them is OSPF i. e. Open Shortest Path First. The same algorithm
is also used in mathematics is known as Dijkstras Algorithm.
Communication Networks: A collection of computers that are connected via
a communication network can be naturally modeled as a graph in a few different
ways.
First, we could have a node for each computer and an edge joining u and
v if there is a direct physical link connecting them. Reaching back into ancient
history a bit, one can find such images of the Internet from a time when it had
only a few nodes. Alternately, for studying the large scale structure of the Internet,
people often define a node to be the set of all machines controlled by a single Internet
Sevice Provider, with an edge joining u and v if there is a direct peering relationship
between them–roughly, an agreement to exchange data under the standard protocol
that governs global Internet routing.
Note that this latter Network is more “virtual one than the former, since the
links indicate a formal agrement in addition to a physical connection. In studying
wireless networks, one typically defines a group where the nodes are computing
6 Mayuri Bapat, Vaishali Amberwadikar and Shital Ghotekar

device situated at locations in physical space and there is an edge from u to v if v


is close enough to u to receive a signal from it.
Note that it;s often useful to view such a graph as directed, since it may be
the case that v can hear u’s signal but u cannot v’s signal ( if, for example, u has a
stronger transmitter).
These graphs are also interesting from a geometric perspective, since they
roughly correspond to putting down points in the plane and then joining pairs
that are close together.
Transport Network: Graph can be used as a model for a network of pipelines
through which some commodity is transported from one place to another. The
general problem in such a transport network (also called as flow network) is to
maximize the flow and minimize the cost of a prescribed flow. This is an operational
research problem and can be solved by linear programming, but the graph theory
approach has been found to be computationally more efficient.
A simple, connected, weighted, digraph G is called a transport (or flow) network
if the weight associated with every directed edge in G is nonnegative number. In a
transport network this number represents the capacity of the edge (i. e. Bandwidth)
and is designated as ci,j for the edge directed from I to J.
The capacity ci,j can be thought as the maximal amount of some commodity
(such as water, gas, electrical energy, electromagnetic signals, number of cars, bits
of information etc.) that can be transported from station i to j. Then a natural
question is : What is the maximal amount of commodity flow from a given vertex
s to another specified vertex t via the entire network ? To formulate such questions
the concepts like Maximal flow, Max-flow Min-Cut Theorems are used.

Mapping of Transport Network with Network: In networking we are send-


ing the data in the form of packets from source to destination. Here the pipeline
in nothing but the bandwidth i. e. available channel through which the data is
transferred. The problem of flow control is also occured in networking.

5 QUEUING THEORY

The monitoring of the network traffic based on queuing theory Network traf-
fic monitoring is an important way for network performance analysis and monitor.
Queuing Theory, also called Random Service Theory, is a branch of Operation Re-
search in Mathematics, it is a subject which researchers use in the random regulation
of queuing phenomenon, and builds up the mathematics model by analyzing the data
of the network. Through the prediction of the system, we can reveal the regulation
about the queuing probability and choose the optimal method for the system.
Adopting Queuing Theory to estimate the network traffic, which becomes the
important way of network performance prediction, analysis and estimation. Through
this way, we can imitate the true network, it is useful and reliable for organizing
monitoring and defending the network.
Mathematics in IP-Subnetting 7

In network communication, from sending, transferring to receiving data pro-


ceeding of the data coding, decoding and to the higher layer, with all these processes,
we can find a simple queuing model. According to the Queuing Theory, this corre-
spond procedure can be abstracted as Queuing theory model, like Fig. 5.1 showing
to us.Supposing this kind of simple data transmitting system satisfies the queue
model M/M/1.
In model M/M/1, the two M’s represent the sending process of the sender
and the receiving process of the receiver separately. They both follow the Markov
process, also keep to Poisson Distribution, while the number 1 stands for the channel.
Using N (t) = t as the length of the queue at the moment t, the probability of the
queue whose length is n, can be shown as

pn(t) = p[N (t) = n]

Service System in Queuing Theory: The service is provided by a service facility


(or facilities). This may be a person (a bank teller, a barber, a machine elevator,
gasoline pump), or a space (airport runway, parking lot, hospital bed), to mention
just a few. A service facility may include one person or several people operating as
a team.
There are two aspects of a service system—(a) the configuration of the service
system and (b) the speed of the service.

a) Configuration of the service system : The customers’ entry into the service
system depends upon the queue conditions. If at the time of customers’ arrival, the
server is idle then the customer is served immediately. Otherwise the customer is
asked to join the queue, which can have several configurations. By the configuration
of the service system we mean how the service facilities exist. Service systems are
usually classified in terms of their number of channels, or number of servers.

i Single Server – Single Queue– The models that involve one queue – one
service station facility are called single server models where customer waits
till the service point is ready to take him for servicing. Students arriving at a
library counter is an example of a single server facility.

Single Server – Single Queue Model

This is mapped with one-to-one relationship and PPP (point-to-point) Pro-


tocol is used for this type of queue.

ii Single Server – Several Queues– In this type of facility there are several
queues and the customer may join any one of these but there is only one ser-
vice channel.
8 Mayuri Bapat, Vaishali Amberwadikar and Shital Ghotekar

Single Server – Several Queues

This is mapped with one- to many relationship and it is used in Star topology
in networking.

iii Several (Parallel) Servers – Single Queue– In this type of model there is
more than one server and each server provides the same type of facility. The
customers wait in a single queue until one of the service channels is ready to
take them in for servicing.

Several (Parallel) Servers – Single Queue Model

This is mapped with many-to-one relationship and it is used in Distributed


services.

iv Several Servers – Several Queues– This type of model consists of several


servers where each of the servers has a different queue. Different cash counters
in an electricity office where the customers can make payment in respect of
their electricity bills provide an example of this type of model.

Several (Parallel) Servers – Several Queues Model

The above type of service is nothing but the many-to-many relationship and
it is used in Mesh topology of networking.
Mathematics in IP-Subnetting 9

v Service facilities in series– In this, a customer enters the first station and
gets a portion of service and then moves on to the next station, gets some
service and then again moves on to the next station · · · and so on, and fi-
nally leaves the system, having received the complete service. For example,
machining of a certain steel item may consist of cutting, turning, knurling,
drilling, grinding and packaging operations, each of which is performed by a
single server in a series.

Multiple Servers in a series.

b) Speed of Service: In a queueing system, the speed with which service is


provided can be expressed in either of two ways– as service rate and as service time.
• The service rate describes the number of customers serviced during a particular
time period.

• The service time indicates the amount of time needed to serve a customer.

• Service rates and times are reciprocal of each other and either of them is
sufficient to indicate the capacity of the facility.
Thus if a system can attend, on an average 15 processes in an hour, the service
rate would be expressed as 15 processes/hour and service time would be equal to 4
minutes/process. Generally, we consider the service time only.
If these service times are known exactly, the problem can be handled easily.
But, as generally happens, if these are different and not known with certainty, we
have to consider the distribution of the service times in order to analyze the queu-
ing system, Generally, the queuing models are based on the assumption that service
times are exponentially distributed about some average service time.

Note : In networking speed of service is defined as date rate or baud rate. The
concepts of TTL (Time To Live) and timeout are in networking and not used in
queuing theory of mathematics.

6 TRIGONOMETRY AND GEOMETRY

Provide the physical layout of an office, company or building LAN, and de-
termine the locations of network drops and cable lengths. make efficient use of the
cable to reduce costs (presuming approximately $ 1 per foot for cable). Avoid doors,
lighting(RF interference), etc.
10 Mayuri Bapat, Vaishali Amberwadikar and Shital Ghotekar

The problem requires to explore the linear geometry of the space and to deter-
mine optimum (low use) cable lengths. Trigonometry can also be used to calculate
such things as stresses on cable and cable runs when they are not properly sup-
ported. That is, to explore the vector analysis which can increase the load on a
support member when weights are placed off center.
Geometry can be used to determine volume of network enclosures and cooling
supply systems.

References
[1] Adrew S. Tanenbaum, Computer Networks.3rd Ed., Prentice Hall.

[2] Behrouz A Forouzan, Data Communication and Networking.4th Ed., Mc-


GrawHill.

[3] Behrouz A Forouzan, TCP/IP Protocol Suite.3rd Ed., Mc-GrawHill.

[4] Chris Uriarte, IP Subnetting and Related Topics A Tutorial.

[5] Narsingh Deo, Graph Theory with application to engineering and computer
science.

[6] V. Yegnanaryanan and G. K. Umamahesswari, Graphs in Communica-


tion Networks.

View publication stats

Вам также может понравиться