Net LA-03EN Subnetting
Net LA-03EN Subnetting
2. Basic Definitions.
2.1. Two-level IPv4 addressing (Classes addressing).
IP Address. An IP address, which is 32-bits in length, IPv4 uses hierarchical addressing
scheme.
Class - the class of the network is determined by the first 4 bits of the address. IPv4
Addressing system is divided into five classes of IP Addresses – A, B, C, D, E, F. IPv4
hierarchy contains several classes of IP Addresses to be used efficiently in various
situations as per the requirement of hosts per network.
A single IP address can contain information about the network and ultimately the host. An
IP address, which is 32-bits in length, is divided into two (Network-Host) parts:
Network Host
This scheme enables the IP Address to be hierarchical where a network can have hosts.
Examples of IP Addresses:
17.16.2.15 = 00011101.00010000.00000010.00001111
178.68.128.168 = 10110010.01000100.10000000.10101000
217.20.147.94 = 11011001.00010100.10010011.01011110
The part highlighted by red refers to the network address and the other part refers to the
host address.
To find out how many bits pertain to the network address, the network equipment uses a
network class (and network mask in sub-netting).
Mask - Subnet mask is also 32 bits long used to describe which portion of the address
identifies the network and which portion of the address identifies the node.
In order to see how the mask helps you identify the network and node parts of the
address, convert the address and mask to binary numbers.
The network mask is applied only locally (where local means - on this particular network
segment).
If the IP address in binary is AND-ed with its Subnet Mask, the result yields the Network
address. For example, say the IP Address is 192.168.1.152 and the Subnet Mask is
255.255.255.0 then:
It can be identified now that 192.168.1.0 is the Network number and 192.168.1.152 is the
host on that network.
CIDR-notation - the modern standard form of specification of the network prefix is CIDR
notation, used for both IPv4 and IPv6. It counts the number of bits in the prefix and
appends that number to the address after a slash (/) character separator.
The number after / indicates the number of bits pertaining to the network address (subnet,
supernet). For example, an administrator have 192.168.1.0/24 network. The suffix /24
(pronounced as "slash 24").
Class A, B, C networks have default masks, also known as natural masks, as shown here:
Class A: 255.0.0.0 /8 = 11111111.00000000.00000000.00000000
Class B: 255.255.0.0 /16 = 11111111.11111111.00000000.00000000
Class C: 255.255.255.0 /24 = 11111111.11111111.11111111.00000000
The networks and hosts counts per class can be derived by this formula:
N = 2^n (Networks_count = 2^network_bits)
H = 2^h -2 (Hosts_count = 2^host_bits – 2)
When calculating hosts' IP addresses, 2 IP addresses are decreased because they cannot
be assigned to hosts, i.e. the first IP of a network is network number (all hosts bit = 0)
and the last IP is reserved for Broadcast IP (all hosts bit = 1).
Gateway Address. In addition to the network number and broadcast address, the subnet
usually contains a gateway, whose role is usually performed by one of the interfaces of the
router. Typically, the gateway receives the first address in the subnet from those
addresses that can be assigned to hosts.
A single IP address and mask (or suffix) can contain information about the network and its
sub-network and ultimately the host. An IP address, which is 32-bits in length, is divided
into three (Network-SubNetwork-Host) parts:
This scheme enables the IP Address to be hierarchical where a network can have many
sub-networks which in turn can have many hosts.
To find out how many bits pertain to the network address, the network equipment uses a
network class and network mask.
The formula for calculating the required number of bits for addressing S subnets.
s >= LOG2 (S), where s - number of bits, S - number of subnets,
VLSM procedure.
VLSM - Variable Length Subnet Masking.
CIDR is based on VLSM, which allows a network to be divided into variously sized
subnets, providing the opportunity to size a network more appropriately for local needs.
Variable-length subnet masks are mentioned in RFC 950. Accordingly, techniques for
grouping addresses for common operations were based on the concept of cluster
addressing.
The following procedure shows how VLSM can be used in order to allocate department-
wise IP addresses as mentioned in the example.
Step 1. Take the range of IP addresses allocated to your organization. For example,
192.168.1.0/24.
Step 6. Allocate the next highest range, i.e. Accounts. The requirement of 25 IPs can be
fulfilled with 192.168.1.192/27 (255.255.255.224) IP subnet, which contains 30 valid host
IPs. The network number of Accounts department will be 192.168.1.192. The last octet of
subnet mask is 11100000.
Step 7. Allocate the next highest range to Management. The Management department
contains only 5 computers. The subnet 192.168.1.224/29 with the Mask 255.255.255.248
has exactly 6 valid host IP addresses. So this can be assigned to Management. The last
octet of the subnet mask will contain 11111000.
In classic subnetting network was split into eight equal-size subnets; however, each
The easiest way to assign the subnets is to assign the largest first. For example:
netB: 204.15.5.0/27 host address range 1 to 30
netE: 204.15.5.32/27 host address range 33 to 62
netA: 204.15.5.64/28 host address range 65 to 78
netD: 204.15.5.80/28 host address range 81 to 94
netC: 204.15.5.96/30 host address range 97 to 98
Fig. 1. Illustrates how using VLSM helped save more than half of the address space.
On the Internet, there are many implementations of such calculators. Especially useful are
IP calculators for subnetworking for IPv6.
But, IP calculators do not know how to splitting networks into several different in size
subnets (look p.2.3.2.). This task will be solved by running the program multiple times with
manual processing of intermediate results, so you need to know the manual subnetting
techniques.
To train skills and check the results of manual calculations, it is recommended to learn
how to work with several IP/Subnetwork Calculators.
For example.
The source network and its subnets can be represented as a graph, the vertex of which
will be the source network, and each child node is obtained as a result of splitting the
network into two subnets:
Subnets graph.
Thus, the process of partitioning the source network into the required number of subnets
reduces to a dichotomous division of the original subnet.
Branching continues until a suitable logical subnet is found for each physical subnet. The
dichotomous subnetting method is conveniently represented in spreadsheets, for example,
Microsoft Excel.
Each merged cell represents a certain range of addresses, for example, a subnet with the
prefix 192.168.1.0/25, describes half of the entire network C, see Fig. 5.
The merged cells to the right are smaller blocks of network addresses, for example, a
subnet with the prefix /26 describes 1/4 of the network C.
We continue dividing in half in the following columns, down to the minimum necessary
block of addresses, for example, to subnets with the prefix /30, which describe subnets of
1/64 of the network C with 4 addresses in each.
This technique clearly represents the distribution of addresses and allows you to keep
records of the distribution of the address block available in the company.
A quick technique is convenient only when you break up networks with a small number of
nodes (class C networks), otherwise the technique becomes inefficient.
To quickly select the required parameters, you can use the tables from the cheat sheet by
IP Subnetting, see the materials for laboratory work.
We take 1 bit from the host portion to get 2 subnets, this will increase the prefix by one bit:
/25.
Now we need to write out 2 identical IP addresses of the network in binary form by
changing only the assigned bit (at the first subnet the assigned bit will be 0, and for the
second subnet = 1). The captured bit is highlighted in red.
Now write a decimal next to the binary form, and add a new prefix. Red marked the portion
of the subnet, and blue - the portion of the host. We get 2 subnets:
1) 11000000.10101000.00000001.00000000 = 192.168.1.0/25
2) 11000000.10101000.00000001.10000000 = 192.168.1.128/25
The host portion is now 7 bits. To calculate how many host addresses can be obtained
using 7 bits, you need to use the calculation formula for hosts: H=2^h-2, where h - number
of bits in the host portion.
H = 2^7 - 2 = 126 hosts.
For each subnet, we write out the subnet addresses (in the host portion all 0) and the
broadcast addresses in these subnets (in the host portion all 1):
11000000.10101000.00000001.00000000 = 192.168.1.0/25 (subnet 1);
11000000.10101000.00000001.01111111 = 192.168.1.127/25 (broadcast 1);
11000000.10101000.00000001.10000000 = 192.168.1.128/25 (subnet 2);
11000000.10101000.00000001.11111111 = 192.168.1.255/25 (broadcast 2).
We calculate by the formula how much we need to take a bit from the host:
LOG2(4=2^2)=2. The prefix changes from /24 to /26.
The host portion on each subnet is 6 bits. H = 26 - 2 = 62 hosts. Red - the portion of the
subnet, and blue - the portion of the host::
1) 11000000.10101000.00000001.00000000 = 192.168.1.0/26
2) 11000000.10101000.00000001.01000000 = 192.168.1.64/26
3) 11000000.10101000.00000001.10000000 = 192.168.1.128/26
4) 11000000.10101000.00000001.11000000 = 192.168.1.192/26
In this way, you can divide any network into equal-sized subnets.
When dividing a network into subnets, hosts located in different subnets can not interact at
the network level directly. For the interaction of such hosts, the enterprise needs a router
that forwards packets between subnets.
The enterprise network scheme has three routers, three switches and the specified
number of hosts in the segments is shown in Figure 6.
Let the provider allocate one block of IP addresses of class C 192.168.1.0/24 to the entire
company network. Required: spliting this block into 6 different in size subnets.
Each pair of routers is connected to each other by a separate subnet, so you need 3 more
subnets. Since such subnets contain only two hosts, it is sufficient for them to use the
subnet prefix /30:
Subnet D - 2 узла
Subnet E - 2 узла
Subnet F - 2 узла
The IP address block 192.168.1.0/24 In binary form (the network portion of class is
highlighted in red):
11000000.10101000.00000001.00000000 .
"/24" - network mask prefix (short mask entry). The complete network mask entry is
255.255.255.0. Binary form the network mask:
11111111.11111111.11111111.00000000
We have 8 bits available for dividing the network into subnets. When selecting the required
number of bits in the mask for a given number of nodes in the subnet, you can use the
formula h>=LOG2(H) or tables from the cheat sheet by IP Subnetting.
For the first subnet A, we need to allocate IP addresses for 101 nodes.
In the table "BIN to DEC" we see that having occupied in the mask
one bit of eight, we get 1 bit to the portion of the network (and this is
2 subnets) and 7 bits per address portion (01111111 = 127). 127 is
the total number of addresses in the network with the broadcast
account, which satisfies the required 101 (and even several
addresses remain in reserve).
If you select 2 bits, the number of hosts will be 63, which is less than
the required 101 nodes.
We change the mask from "/ 24" to "/ 25", in binary format it will be:
11111111.11111111.11111111.10000000).
Apply a new mask to our block (bit operation AND) and get 2 subnets
(the network portion is highlighted in red):
Subnet А - 11000000.10101000.00000001.00000000 (subnet 192.168.0.0/25)
Remain А - 11000000.10101000.00000001.10000000 (block 192.168.0.128/25)
We occupy one more bit at the address portion, leaving 6 (2^6-2=62). The mask becomes
one more /26, we apply it to our block and get two new subnets:
Subnet В - 11000000.10101001.00000000.10000000 (subnet 192.168.0.128/26)
Remain B - 11000000.10101001.00000000.11000000 (block 192.168.0.192/26)
By the table we see that it's enough for a portion of the node address of only two bits
(00000011 = 3), 2^2-2=2 addresses for two hosts.
In turn, for three, equally large subnets, two bits (2^2=4, a formula from a cheat sheet) are
also sufficient.
In total, in the IP address 32 bits, subtract the required 2 and get 30, so use the mask /30.
Now divide, for example, the first subnet into 2 subnets, i.e. select one more bit in the
extended network prefix. Thus. we get 2 subnets with a mask /19.
195.20.0.0/18
IP subnet/prefix Broadcast DEC Broadcast BIN Hosts count
195.20.0.0/19 195.20.31.255 195.20.00011111.11111111 8190
195.20.32.0/19 195.20.63.255 195.20.00111111.11111111 8190
Subnet mask 255.255.224.0
11111111.11111111.11100000.00000000
b) Replace the first 7 letters with their ordinal numbers in the alphabet, writing the numbers
as two-digit decimal numbers (with leading zero).
For example, 12 09 25 21 18 09 10.
c) Translate each decimal two-digit number into a binary 5-bit number (with leading zero).
For example, 01100 01001 11001 10101 10010 01001 01010.
Resulting 35 bits sequence: 01100010011100110101100100100101010.
d) The rightmost 3 bits of the sequence are put into the decimal number system, add 19
and get the subnet prefix (from 19 to 26).
For example,
Sequence: 01100010011100110101100100100101010
Bits for the prefix: 01100010011100110101100100100101010
e) The first 32 bits of the received sequence will be your version of the host IP address in
the binary representation.
For example,
Sequence: 01100010011100110101100100100101010
Bits for the IP-address: 01100010011100110101100100100101010
Your variant is the 7th digit from point 6.1.1.b), corresponds to the ordinal number of the
letter from 01 to 26.
For example, for LIYURIJS, you get variant 10 (line number).
Recommendations:
To count the number of nodes in a subnet, you need to perform 3 operations:
1) count the number of bits available for use in node identifiers;
2) translate this value written in units into a decimal format;
3) subtract one from the resulting number.
For example, for nodes IP address in the prefix-notation 192.168.1.79/26, we get answer:
192.168.1.79/26
Nr Parameters Value of Dot-Dec Value of Dot-Bin
a Address: 192.168.001.079 11000000.10101000.00000001.01 001111
b Class: C
c Netmask: 255.255.255.192 11111111.11111111.11111111.11 000000
d Wildcard: 000.000.000.063 00000000.00000000.00000000.00 111111
e Hosts: 62
f Network: 192.168.001.064 11000000.10101000.00000001.01 000000
g Gateway: 192.168.001.065 11000000.10101000.00000001.01 000001
h Host Min: 192.168.001.066 11000000.10101000.00000001.01 000010
i Host Max: 192.168.001.126 11000000.10101000.00000001.01 111110
j Broadcast: 192.168.001.127 11000000.10101000.00000001.01 111111
Learn how to use it to split IPv4 networks of classes A, B and C into subnets with an equal
number of nodes.
Verify the correct calculation of the IPv4 subnet parameters for your variant from 6.1.1.
Learn how to use it to split IPv6 networks into subnets with an equal number of nodes.
Be sure to consider the 4 subnets between the routers. In total, we get 7 subnets: A, B, C,
D, E, F, G. The subnet between the router D and the Internet is not necessary to describe,
as its parameters and addresses are determined by the Internet provider.
Draw a summary diagram of the enterprise network with labeled subnets, see the example
in 5.3.
For example,
Subnet A
Nr Parameters Value
a Subnet Address BIN: 11000000.10101000.00000001.01001111
b Subnet Address DEC: 192.168.001.079
c Subnet Prefix: 25
d Subnet mask BIN: 11111111.11111111.11111111.11 000000
e Subnet mask DEC: 255.255.255.192
f Subnet Broadcast: 192.168.001.127
g Subnet Gateway: 62
h Subnet Host Count Max: 34
i Subnet Host Count Use: 22
j Subnet Host Count Free: 12
Grade.