mod5
mod5
→ Subnetting Problem
Dr.S.Sivakumar, Associate Professor Senior,
SENSE, VIT
Subnetting
• If an organization was granted a large block in class A or
B, it could divide the addresses into several contiguous
groups and assign each group to smaller networks (called
subnets) or, in rare cases, share part of the addresses
with neighbors.
• Subnetting increases the number of Is in the mask
• The Default mask can help us to find the netid and the
hostid
• For example, the mask for a class A address has eight 1s,
which means the first 8 bits of any address in class A
define the netid; the next 24 bits define the hostid
• This notation is also called slash notation or Classless
Interdomain Routing (CIDR) notation. The notation is
used in classless addressing
Subnetting Problem
1. Pattern followed in Subnet (1st row) is, each number is double that of
previous number
2. The 2nd row is no. of total host IDs for each new subnet. Row 2 is
reverse of row 1 (each no. is half of its previous no.) for example /27
means 27 bits network (3 bits ON & 5 bits OFF in 4th octet). Hence
(2^3=8 subnets) and so 32-27=5 & (2^5=32 hosts)
3. Row 3 indicates subnet mask. In this 3 subnets to be constructed, (no
option to choose 3) so the option is to choose 4 subnets which contains
64 total host IDs including network ID and Host ID.
4. Thus /26 is the new subnet mask for these 4 subnets as per the initial
table
SUBNETTING TABLE
Identified Subnet Mask for given problem as three subnets are required.
Provision is there for 4 subnets only. Hence /26 subnet mask has been chosen
Identifying Network ID and No. of Usable Hosts
2 192.168.4.64 /26 62
3 192.168.4.128 /26 62
4 192.168.4.192 /26 62
Identification of Broadcast ID ranges
Note → The last Host ID is reserved for Broadcast ID
• Therefore the Broadcast ID for the 1st subnet is 63. That is
192.168.4.63
• Broadcast ID for the 1st subnet is 192.168.4.63 (which was arrived
with reference to 2nd Network ID 64)
• Similarly the Broadcast ID for the 2nd subnet is 127.
• That is 192.168.4.127 (w.r.to 3rd Network ID 128)
• Broadcast ID for the 3rd subnet is 192.168.4.191
• Broadcast ID for the 4th subnet is 192.168.4.255
• Thus “Broadcast ID equals the next Network ID minus 1”
(OR)
Note→ Also once we know 1st Broadcast ID (63), we can simply add
64 to get 2nd Broadcast ID (127) and so on
Identification of Subnet’s Usable Host ID ranges
b) 221.34.7.82→ ?
Dotted-decimal notation and binary notation
Class A addresses were designed for large organizations with a large number of
attached hosts or routers
Class B addresses were designed for midsize organizations with tens of thousands of
attached hosts or routers
Class C addresses were designed for small organizations with a small number of
attached hosts or routers
No of blocks in Class A and B
• Internet Protocol
• Classful Addressing
• Subnetting
• Classless Addressing
Note
Note
Note
Figure 19.1 Dotted-decimal notation and binary notation for an IPv4 address
IP Addressing Structure
IP Addressing Structure
IP Addressing Structure
• Convert decimal to 8-bit binary
Example 19.1 19.11
Solution
We replace each group of 8 bits with its equivalent decimal
number and add dots for separation.
Example 19.2 19.12
Solution
We replace each decimal number with its binary equivalent
Example 19.3 19.13
Solution
a. There must be no leading zero (045).
b. There can be no more than four numbers.
c. Each number needs to be less than or equal to 255.
d. A mixture of binary notation and dotted-decimal
notation is not allowed.
19.14
Note
Network/Host Portions
• The 32 bits of the IP address are divided
into Network & Host portions, with the
octets assigned as a part of one or the
other.
Solution
a. The first bit is 0. This is a class A address.
b. The first 2 bits are 1; the third bit is 0. This is a class C
address.
c. The first byte is 14; the class is A.
d. The first byte is 252; the class is E.
19.21
Note
Note
Classless Addressing
• Overcome Address Depletion
• No concept of classes
• Address granted in blocks retained
(variable length prefix)
• Depending on Requirement
• Classful is special case of Classless addressing
19.28
Note
Set all
suffix bits
to 0s
Set all
suffix bits
to 1s
19.31
Note
Note
Note
18.34
Example 19.6 19.35
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 00100000
or
205.16.37.32.
19.36
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32 − 28 rightmost bits to 1, we get
11001101 00010000 00100101 00101111
or
205.16.37.47
Example 19.8 19.39
Solution
The value of n is 28, which means that number
of addresses is 2 32−28 or 16.
Example 19.9 19.40
Another way to find the first address, the last address, and
the number of addresses is to represent the mask as a 32-bit
binary (or 8-digit hexadecimal) number. This is
particularly useful when we are writing a program to find
these pieces of information. the /28 can be represented as
11111111 11111111 11111111 11110000
(twenty-eight 1s and four 0s).
Find
a. The first address
b. The last address
c. The number of addresses.
Example 19.9 (continued) 19.41
Solution
a. The first address can be found by ANDing the given
addresses with the mask. ANDing here is done bit by
bit. The result of ANDing 2 bits is 1 if both bits are 1s;
the result is 0 otherwise.
Example 19.9 (continued) 19.42
Note
18.65
Example 19.6 19.66
Solution
The binary representation of the given address is
11001101 00010000 00100101 00100111
If we set 32−28 rightmost bits to 0, we get
11001101 00010000 00100101 0010000
or
205.16.37.32.
19.67
Special Addresses
• A few addresses are set aside for specific purposes.
• Network addresses that are all binary zeros, all binary
ones & Network addresses beginning with 127 are
special Network addresses.
77
Subnetting
• Say Divide Large Block of Class A & B
Supernetting
• Time came when A & B depleted
• Demand for mid-size blocks
• But not meet requirements
• Say 1000 address
• 4 Class C blocks to create one supernetwork