0% found this document useful (0 votes)
35 views

COMP347 Tutorial Week 4

This document provides a detailed example of subnetting a class B IP address network into 6 subnets. It walks through the steps to determine the subnet mask, define the subnet IDs and valid host ID ranges for each subnet, and calculate the broadcast address for each subnet. Key steps include determining the number of subnet bits needed based on the number of subnets, defining the subnet mask, calculating the subnet and broadcast addresses, and finding the range of valid host IDs per subnet.

Uploaded by

Azeem Talib
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

COMP347 Tutorial Week 4

This document provides a detailed example of subnetting a class B IP address network into 6 subnets. It walks through the steps to determine the subnet mask, define the subnet IDs and valid host ID ranges for each subnet, and calculate the broadcast address for each subnet. Key steps include determining the number of subnet bits needed based on the number of subnets, defining the subnet mask, calculating the subnet and broadcast addresses, and finding the range of valid host IDs per subnet.

Uploaded by

Azeem Talib
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

COMP347 Tutorial Week 4

1. In class A, class B, and class C IP addresses, which octets represent the network
ID and which represent the host ID?

2. Which numbers are invalid as a network ID and why?

3. Which numbers are invalid as a host ID and why?

4. Which address class(es) will allow you to have more than 1,000 hosts per
network?

5. Write the address class next to each IP address.

a) 3.3.57.0
b) 200.200.5.2
c) 191.107.2.10
d) 127.0.0.1

6. Review the following IP addresses. Circle the portion of the IP address that would
be invalid if it were assigned to a host (if assigned as a unique host id), and then
explain why it is invalid?

a) 131.107.256.80
b) 231.200.1.1
c) 0.127.4.100
d) 127.1.1.1
e) 198.121.254.255
f) 255.255.255.255

7. What is the purpose of a subnet mask? When is a default subnet mask used? When
is it necessary to define a custom subnet mask?

8. Determine whether the following destination IP address belongs to a host on a


local network or a remote network.

Source (Host) IP address: 10011001 10101010 00100101 10100011


Subnet Mask: 11111111 11111111 00000000 00000000
Destination IP Address: 11011001 10101010 10101100 11101001
9. In the following scenario, identify hidden IP addressing problems, and explain the
possible effects caused by the problem.

IP address: 193.177.73.255
Default gateway: 109.128.0.1

IP address: 109.128.1.1 IP address: 109.128.5.35


Default gateway: 109.128.0.1 Default gateway: 109.128.0.1

A B C

109.128.0.1
109.0.0.0
Router

147.103.0.1
D E F

IP address: 108.128.17.0 IP address: 109.128.0.1


Default gateway: 109.128.0.1 Default gateway: 109.128.0.1

IP address: 109.128.5.35
Default gateway: 109.128.0.2
Subnetting Procedure: An example.

There is a class B address x.y.0.0. We require 6 subnets.


Default subnet mask for Class B address: 255.255.0.0.

Step One: Defining Subnet Mask

We now follow the following steps to define the subnet mask:


a) We have determined the number of physical segments in our network (six).
If the all zeroes and all ones subnets are excluded, there are two additional
subnet IDs required (that are not used – all zeroes and all ones), so the maximum
subnet number required is the number of physical segments plus 1; in our
example, this would be seven which is 111 in binary.
If the all zeroes and all ones subnets are included, the maximum subnet number
required is the number of physical segments minus 1; in our example, this is five.
Convert the maximum subnet number required to binary: 101.
b) Count the number of bits required to represent the maximum subnet number in
binary. Representing seven (or five) in binary requires three bits.
c) We need to take these three bits from the host id section of the IP addresses.
d) Using a binary representation of the subnet mask, fill the required number of bits
with 1, starting with the high (left-most) bit, and convert to decimal. For example,
in this case, three bits are required; therefore, configure the first three bits of the
host ID (third octet of the IP address) as the subnet ID. Our third octet of subnet
mask is 1110000.
The decimal value for this is 224.
The entire subnet mask in binary is 11111111.11111111.11100000.00000000
Therefore the subnet mask for this class B address is: 255.255.224.0

Step two: Defining Subnet IDs.


We will define the subnet IDs by running though all the possible binary numbers in
the subnet bits. In this case, there are 3 bits, so the binary subnet IDs are 000, 001,
010, 011, 100, 101, 110, 111. However, these three bits are the high bits of an octet,
so we are really looking at octets 00000000, 00100000, 01000000, 01100000, … The
following procedure calculates the octets directly in decimal.
e) Determine the number of possible subnets.
The number of possible subnet IDs is 2 raised to the power of the number of
subnet bits. In our example, that is 23 = 8.
If the all zeroes and all ones subnets are excluded, the number of possible
subnets is 2 less than this, i.e. 6.
f) Write the binary value of the number 1 subnet: it has a 1 bit in the lowest subnet
bit position, zero elsewhere. In our example, this is 00100000. Convert this to
decimal: 32. This is the subnet number increment – the difference in the octest
from one subnet to the next. (This calculation is the same as raising 2 to the
power of the number of zero bits in the subnet mask octet).
g) Starting with zero, repeatedly add the subnet number increment until the next
number is 256. This lists the subnet numbers as follows:
Subnet 0: x.y.0.0 (All 0s; may be disallowed)
Subnet 1: x.y.32.0
Subnet 2: x.y.64.0
Subnet 3: x.y.96.0
Subnet 4: x.y.128.0
Subnet 5: x.y.160.0
Subnet 6: x.y.192.0
Subnet 7: x.y.224.0 (All 1s; may be disallowed)
h) Defining subnet numbers
In general, there are eight subnets (two invalid). They will be numbered 0 through
7. In other words, if we have to define subnet #n, we need to place the binary
representation of n into the bits of the subnet-number field. For example, to define
subnet #6, simply place the binary representation of 6 (110) into the 3-bits of the
subnet-number field. This yields x.y.192.0 as listed above.

Step Three: Defining Host Ids


i) The subnet IDs are IP addresses with zero for the host number. If you add 1 in the
lowest bit position of the last octet, you get the first host ID in the subnet. If you
subtract one from the start of the next subnet, you get the broadcast addresses for
the current subnet; subtract one again to get the last host ID.

j) The following table gives valid range of host IDs for this class B subnet using 3
bits for the subnet mask. Note that subnets 0 (000) and 7 (111) may be excluded.

Bit Values Decimal Values Beginning Values Ending Values


00000000 0 x.y.0.1 x.y.31.254
00100000 32 x.y.32.1 x.y.63.254
01000000 64 x.y.64.1 x.y.95.254
01100000 96 x.y.96.1 x.y.127.254
10000000 128 x.y.128.1 x.y.159.254
10100000 160 x.y.160.1 x.y.191.254
11000000 192 x.y.192.1 x.y.223.254
11100000 224 x.y.224.1 x.y.255.254

k) To determine the number of hosts per subnet, raise 2 to the power of number of
host ID bits, and then subtract 2. This is because the host number field of an IP
address cannot contain all 0 bits or all 1 bits. In this case, 213-2=8190 hosts per
subnet.
- The all-0s host number identifies the base network (or subnetwork number),
while
- all-1s host number represents the broadcast address for the network (or
subnetwork).
l) In general, to define the address assigned to host #n of a particular subnet, simply
place the binary representation of n into the subnet’s host-number field. For
example, to define the address, assigned to host 15 on subnet 3, simply place the
binary representation of 15 (01111) into the allocated bits of subnet 3’s host
number field.
x.y.01100000.00001111
Similarly, host 8190: x.y.011 11111.11111110

Step Four: Defining broadcast address for each subnet


m) The broadcast address for a subnet #n is the all 1’s host address (see also step (i)
above). For example, the broadcast address for subnet #3 is:
x.y.01111111.11111111

You might also like