You are on page 1of 9

SUBNETTING

ABSTRACT:
A large at IP network is created in a switched layer-2 network by adjusting the
subnet masks of hosts such that these hosts can communicate directly with other
hosts without the use of an intermediate router. The layer-2 switches are configured
with user-selected IP subnets and monitor and analyze multicast packets to learn
the mapping between IP subnets and switch ports. The layer-2 switches selectively
forward the multicast packets based on the learned mappings between IP subnets
and ports. After the destination host responds to the forwarded multicast, a direct
connection is established between the source and destination hosts using the media
access control addresses of both hosts.

INTRODUCTION:
This document gives you basic information needed in order to configure your
router for routing IP, such as how addresses are broken down and how subnetting
works. You learn how to assign each interface on the router an IP address with a
unique subnet.
When talking about IP addressing, it is important to understand what the word
network means. A network is a group of computing devices connected together
by some telecommunications medium. It may be as small as a work group in the
accounting department or as large as all of the computers in a large company. An
IP address is an address used in order to uniquely identify a device on an IP
network. The address is made up of 32 binary bits, which can be divisible into a
network portion and host portion with the help of a subnet mask. The 32 binary bits
are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and
separated by a period (dot). For this reason, an IP address is said to be expressed in
dotted decimal format (for example, 172.16.81.100). The value in each octet ranges
from 0 to 255 decimal, or 00000000 - 11111111 binary. And this is sample shows
an IP address represented in both binary and decimal. 10.
1.
23.
19
(decimal) 00001010.00000001.00010111.00010011 (binary).These octets are
broken down to provide an addressing scheme that can accommodate large and
small networks. There are five different classes of networks, A to E. This document

focuses on addressing classes A to C. Note that class D addresses are used for
special purposes and class E addresses are reserved for future use.
Figure 1 shows the significance in the three high order bits and the range of
addresses that fall into each class. For informational purposes, Class D and Class E
addresses are also shown.

In a Class A address, the first octet is the network portion, so the Class A example
in Figure 1 has a major network address of 1.0.0.0 - 127.255.255.255. Octets 2, 3,
and 4 (the next 24 bits) are for the network manager to divide into subnets and
hosts as he/she sees fit. Class A addresses are used for networks that have more
than 65,536 hosts (actually, up to 16777214 hosts!). In a Class B address, the first
two octets are the network portion, so the Class B example in Figure 1 has a major
network address of 128.0.0.0 - 191.255.255.255. Octets 3 and 4 (16 bits) are for
local subnets and hosts. Class B addresses are used for networks that have between
256 and 65534 hosts. In a Class C address, the first three octets are the network

portion. The Class C example in Figure 1 has a major network address of


192.0.0.0 - 223.255.255.255. Octet 4 (8 bits) is for local subnets and hosts - perfect
for networks with less than 254 hosts. RFC 950 August 1985 Internet Standard Sub
netting Procedure For example, the Internet address might be interpreted as:
<network-number><subnet-number><host-number> where the <network-number>
field is as defined by IP [3], the <host-number> field is at least 1-bit wide, and the
width of the <subnet-number> field is constant for a given network. No further
structure is required for the <subnet-number> or <host-number> fields. If the width
of the <subnet-number> field is zero, then the network is not sub netted (i.e., the
interpretation of [3] is used). For example, on a Class B network with a 6-bit wide
subnet field, can address would be broken down like this: Since the bits that
identify the subnet are specified by a bitmask, they need not be adjacent in the
address. However, we recommend that the subnet bits be contiguous and located as
the most significant bits of the local address. Special Addresses: From the Assigned
Numbers memo [9]: "In certain contexts, it is useful to have fixed addresses with
functional significance rather than as identifiers of specific hosts. When such usage
is called for, the address zero is to be interpreted as meaning "this", as in "this
network". The address of all ones are to be interpreted as meaning "all", as in "all
hosts". For example, the address 128.9.255.255 could be interpreted as meaning all
hosts on the network 128.9. Or, the address 0.0.0.37 could be interpreted as
meaning host 37 on this network." It is useful to preserve and extend the
interpretation of these special addresses in subnetted networks. This means the
values of all zeros and all ones in the subnet field should not be assigned to actual
(physical) subnets. In the example above, the 6-bit wide subnet field may have any
value except 0 and 63. Internet Standard Subnetting Procedure Please note that
there is no effect or new restriction on the addresses of hosts on non-subnetted
networks. Changes to Host Software to Support Subnets In most implementations
of IP, there is code in the module that handles outgoing datagrams to decide if a
datagram can be sent directly to the destination on the local network or if it must
be sent to a gateway. Quantity called my_ I p_ mask. This is a bit-mask with bits
set in the fields corresponding to the IP network number, and additional bits set
corresponding to the subnet number field.
It may or may not be necessary to modify the "gateway to" function, so that it too
takes the subnet field bits into account when performing comparisons. To support
multiply-connected hosts, the code can be changed to Internet Standard Subnetting

Procedure keep the "my_ip_addr" and "my_ip_mask" quantities on a per-interface


basis; the expression in the conditional must then be evaluated for each interface.
2.3. Finding the Address Mask how can a host determine what address mask is in
use on a subnet to which it is connected? The problem is analogous to several other
"bootstrapping" problems for Internet hosts: how a host determines its own
address, and how it locates a gateway on its local network. In all three cases, there
are two basic solutions: "hardwired" information, and broadcast-based protocols.
Hardwired information is that available to a host in isolation from a network. It
may be compiled-in, or (preferably) stored in a disk file. However, for the
increasingly common case of a diskless workstation that is boot loaded over a
LAN, neither hardwired solution is satisfactory. Instead, since most LAN
technology supports broadcasting, a better method is for the newly-booted host to
broadcast a request for the necessary information. For example, for the purpose of
determining its Internet address, a host may use the "Reverse Address Resolution
Protocol" (RARP) [4]. However, since a newly-booted host usually needs to gather
several facts (e.g., its IP address, the hardware address of a gateway, the IP address
of a domain name server, the subnet address mask), it would be better to acquire all
this information in one request if possible, rather than doing numerous broadcasts
on the network. The mechanisms designed to boot diskless workstations can also
load per-host specific configuration files that contain the required information
(e.g., see RFC-951 [8]). It is possible, and desirable, to obtain all the facts
necessary to operate a host from a boot server using only one broadcast message.
In the case where it is necessary for a host to find the address mask as a separate
operation the following mechanism is provided: To provide the address mask
information the ICMP protocol [5] is extended by adding a new pair of ICMP
message types, "Address Mask Request" and "Address Mask Reply", analogous to
the "Information Request" and "Information Reply" ICMP messages. These are
described in detail in Appendix I. The intended use of these new ICMP messages is
that a host, when booting, broadcast an "Address Mask Request" message. A
Mogul & Postel RFC 950 August 1985 Internet Standard Subnetting Procedure
gateway (or a host acting in lieu of a gateway) that receives this message responds
with an "Address Mask Reply". If there is no indication in the request which host
sent it (i.e., the IP Source Address is zero), the reply is broadcast as well. The
requesting host will hear the response, and from it determine the address mask.
Since there is only one possible value that can be sent in an "Address Mask Reply"
on any given LAN, there is no need for the requesting host to match the responses

it hears against the request it sent; similarly, there is no problem if more than one
gateway responds. We assume that hosts reboot infrequently, so the broadcast load
on a network from use of this protocol should be small. If a host is connected to
more than one LAN, it might have to find the address mask for each. One potential
problem is what a host should do if it cannot find out the address mask, even after
a reasonable number of tries.
Three interpretations can be placed on the situation:
1. The local net exists in (permanent) isolation from all other nets.
2. Subnets are not in use, and no host can supply the address mask.
3. All gateways on the local net are (temporarily) down. The first and second
situations imply that the address mask is identical with the Internet network
number mask. In the third situation, there is no way to determine what the proper
value is; the safest choice is thus a mask identical with the Internet network
number mask. Although this might later turn out to be wrong, it will not prevent
transmissions that would otherwise succeed. It is possible for a host to recover
from a wrong choice: when a gateway comes up, it should broadcast an "Address
Mask Reply"; when a host receives such a message that disagrees with its guess, it
should change its mask to conform to the received value. No host or gateway
should send an "Address Mask Reply" based on a "guessed" value. Finally, note
that no host is required to use this ICMP protocol to discover the address mask; it
is perfectly reasonable for a host with non-volatile storage to use stored
information (including a configuration file from a boot server).
The Basic Fixed Length Mask To help the IP device understand the subnetting used
in the network, IP designers described the process of using a subnet mask in
RFC950.For IT Professionals Only This memo discusses the utility of "subnets" of
Internet networks, which are logically visible sub-sections of a single Internet
network. For administrative or technical reasons, many organizations have chosen
to divide one Internet network into several subnets, instead of acquiring a set of
Internet network numbers. This memo specifies procedures for the use of subnets.
These procedures are for hosts (e.g., workstations). The procedures used in and
between subnet gateways are not fully described. Important motivation and
background information for a subnetting standard is provided in RFC-940.
What the Mask Does Simply stated, the mask is used to indicate the location of the
subnet field in an IP address. What does that mean? In the previous figures,

153.88.0.0 is the network address. It is a class B address, which means that the first
sixteen bits of the address is the network number. James machine is in the
153.88.240.0 subnet. How do we determine that? James is in the 153.88.0.0
network. The administrator reserved the next eight bits to hold the subnet number.
In the preceding example, James is in the 240 subnet. If James IP address were
153.88.240.22, James would be in the 153.88.0.0 network, in the 240 subnet of that
network, and would have a host address of 22 in that subnet. All devices within the
153.88.0.0 network with a third octet of 240 are assumed to be on the same
physical network and in the same subnet, the 240 subnet.
The subnet mask is used to interpret addresses to understand how they are
subnetted. The mask is made up of 32 bits, just like the IP address. There are
certain masks that are natural or default to the three classes of addresses.
Base 103 102 101 100
Decimal 1000 100 10 1
1245
1245 1000 200 40 5
Base 27 26 25 24 23 22 21 20
Decimal 128 64 32 16 8 4 2 1
11001011
11001011 128 64 0 0 8 0 2 1
IT Professionals Only Subnet masks frequently contain a reference to 255. The
255 reference simply indicates that all eight bits of that portion of the mask contain
a 1. For instance, the binary representation of the mask 255.0.0.0 is
11111111000000000000000000000000.The
mask
255.255.0.0
is
11111111111111110000000000000000.
The default or natural mask for the class A address is 255.0.0.0. In this case the
mask indicates that the first eight bits represent the network number and must be
used when evaluating a class A address for subnetting. If a device has a class A
address assigned and has a mask of 255.0.0.0, there is no subnetting in that
network. If a device has a class A address and has a mask that is not 255.0.0.0, the
network has been subnetted and the device is in a subnet of the class A network.
Figure 2.13 Addresses with no subnetting. In Figure 2.13, the 125.0.0.0 network
has been subnetted. The mask is not the default mask so we know that the network
has been subnetted. What does the rest of the mask mean? As stated earlier, the
mask is used to indicate the location of the subnet field in an IP address. Lets look
at what makes up a mask. Components of a Mask The mask is a 32-bit binary

number that is expressed in dotted decimal notation. By default, the mask contains
two fields, the network field and the host field. These correspond to the network
number and the locally administered part of the network address. When you
subnet, you are adjusting the way you view the IP address. If you are working with
a class B network and are using the standard mask, there is no subnetting. For
example, in the address and mask in Figure 2.14 the network is indicated by the
first two 255 entries and the host field is indicated by the ending 0.0. Figure 2.14
Class B address with standard mask. The network number is 153.88 and the host
number is 4.240. In other words, the first sixteen bits are the network number and
the remaining sixteen bits are the host number. When we subnet a network we
increase the hierarchy from network and host to network, subnet and host. If we
were to subnet the 153.88.0.0 network with a subnet mask of 255.255.255.0, we
will be adding an additional piece of information. Our view changes in that we will
be adding a subnet field. As with the previous example, the 153.88 is still the
network number. With a mask of 255.255.255.0, the third octet is used to tell us
where the subnet number is located. The subnet number is .4 and, finally, the host
number is 240. Figure 2.15 Subnet mask fields. The locally administered portion of
the network address can be subdivided into subnet works by using the mask to tell
us the location of the subnet field. We allocate a certain number of bits to the
subnet field and the remainder is then the new host field. In Figure 2.15, we took
the 16-bit host field that comes with a class B address and broke it down into an 8bit subnet field and an 8-bit host field. Binary Determination of Mask Values How
do you determine which mask to use? On the surface it is a fairly simple process.
You first determine how many subnets are required in your network. This may
require you to do a lot of research into the network architecture and design. Once
you know how many subnets you will need, you can decide how many subnet bits
are needed to provide you with a subnet field big enough to hold the number of
subnets you need. When a network is in the design phase, the network
administrator discusses the design with the address administrator. They conclude
that there will be a total of 73 subnets in the current design and that a class B
address
88.0.0.0 255.0.0.0 No subnetting
125.0.0.0 255.255.255.0 Subnetting
153.88.4.240 255.255.0.0
255.255.255.0 for a class B net work
255 255 255 0
11111111 11111111 11111111 00000000.

To develop the subnet mask, we need to know how big the subnet field must be.
The locally administered portion of a class B address contains 16 bits. Remember
that the subnet field is a portion of these 16 bits. The challenge is to determine how
many bits are required to store the decimal number 73. Once we know how many
bits are needed to store the decimal number 73, we can determine what the mask
should be. The first step is to convert the decimal number 73 to binary. The number
of bits in the binary number is seven. So we need to reserve the first seven bits of
the locally administered portion of the subnet mask for the subnet field and the
remainder will be the host field. In the preceding example we are reserving the first
seven bits for the subnet field, indicated by the one bits, and the remainder to the
host field, indicated by the zero bits. If we convert this binary information into
decimal for the subnet mask and add it to the portion of the mask for the network
number, we will have the entire subnet mask necessary. Remember, 255.255.0.0 is
the default mask for a class B address. We have replaced the locally administered
portion of the mask, the .0.0, with the 254.0 that depicts the subnetting scheme.
The 254.0 portion tells the software that the first seven bits of the locally
administered portion of the address is the subnet field and the remainder is the host
field. Of course, if the subnet mask numbers change, the interpretation of the
subnet field changes.
References:
[1] Mogul, J., "Internet Subnets", RFC-917, Stanford University, October 1984.
[2] Postal, J., "Multi-LAN Address Resolution", RFC-925, USC/Information
Sciences Institute, October 1984.
[3] Postel, J., "Internet Protocol", RFC-791, USC/Information Sciences Institute,
September 1981.
[4] Finlayson, R., T. Mann, J. Mogul, M. Theimer, "A Reverse Address
Resolution Protocol", RFC-903, Stanford University, June 1984.
[5] Postel, J., "Internet Control Message Protocol", RFC-792,
USC/Information Sciences Institute, September 1981.
[6] Mogul, J., "Broadcasting Internet Datagrams", RFC-919, Stanford
University, October 1984.

[7] GADS, "Towards an Internet Standard Scheme for Subnetting",


RFC-940, Network Information Center, SRI International,
April 1985.
[8] Croft, B., and J. Gilmore, "BOOTP -- UDP Bootstrap Protocol",
RFC-951, Stanford University, August 1985.

You might also like