M C S E  F O R E V E R

TCP/IP STUDY GUIDE

Home

E-mail

 

 

                                     
01/25/00

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Basic Knowledge

Back to Top

Class IP ADDRESS SUBNET MASK

A
B
C

       1  -- 126
   128  -- 191
   192  --  223

255.x.y.z
255.255.x.y
255.255.255.x

  7           6         5        4         3        2         1        0
2            2         2        2         2        2         2        2    
128     64       32     16         8        4         2        1

2^9   = 512    
2^10 = 1024
2^11 = 2048  (or 1024 X 2 = 2048)
2^12 = 4096...etc.

Sample of Subnet Mask of Class B:

255.255.252.0 or 11111111.11111111.11111100 .00000000

The last six 1's = Host Bits.
All zero's = Last Bits or Last Host Bits.

What do you have?

What can you find?

  • IP Address or Network IDs

  • Number of Subnets

  • Hosts/Subnet

  • Network IDs

  • CLASS A, B or C

  • Host Bits

  • Last Host Bits

  • Whether 2 or more IP addresses are in the same subnet.

Back to Top

QUESTIONS (PART1)

Back to Top

Q.1.1: Calculate the subnet mask and the number of hosts per subnet.

Given:

Network ID = 148.25.0.0
Subnets = 37

Find:

              Subnet Mask and Number of Hosts Per Subnet

Procedure:

1. Use the given subnets to find Host Bits
2. Use Host Bits to determine the subnet mask
3. Use the Last Bits to determine hosts/subnet

Solution:

37 lies between 64 and 32, i.e. 64....37....32
2^6 = 64.
2^6 - 2 = 62, which will allow you to create 37 subnets.
Therefore, Host Bits = 6.

Network ID indicates Class B.
Class B's Subnet Mask = 255.255.x.y
x.y =
11111100.00000000
where six 1's = Host Bits.

x = 255-3 = 252

Subnet Mask = 255.255.252.0

x.y = 11111100.00000000
Counting all zero's, Last Host Bits = 10.
2^10 -2 = 1024 - 2 = 1022 Hosts/Subnet.

Ans:

Subnet Mask = 255.255.252.0
Hosts/Subnet = 1022

WARNING! Make sure you double check that you can have enough Host Bits to serve your given number of subnets.

For example, if 7 is given as the number of subnets, then 7 lies between 8 and 4. However, 2^3 -2 = 6, which is less than 7. So, 7 should lie between 16 and 4. Make sure the given number of subnets is two numbers from the front number.


"LET'S LOOK AT ANOTHER ONE."

Q.1.2: Calculate the subnet mask and the number of hosts per subnet.

Given:

Network ID = 110.0.0.0
Subnets = 1000

Find

              Subnet Mask and Number of Hosts Per Subnet

Procedure:

1. Use given subnet to find Host Bits
2. Use Host Bits to determine subnet mask
3. Use Last Host Bits to determine Hosts/Subnet

Solution:

1000 lies between 1024 and 512, i.e. 1024....1000....512
2^10 = 1024, 2^9 = 512.
2^10 - 2 = 1022, which will allow you to create 1000 subnets.
Therefore, Host Bits = 10.

Network ID indicates Class A.
Class A's Subnet Mask = 255.x.y.z
x.y.z =
11111111.11000000.00000000
where all 1's = 10 Host Bits.

x.y.z  = 255.192.0

Subnet Mask = 255.255.192.0.

x.y.z = 11111111.11000000.00000000
Counting all zero's, Last Host Bits = 14.
2^14 -2 = 16,382 Hosts/Subnet.

Ans:

Subnet Mask = 255.255.192.0
Hosts/Subnet = 16,382

Back to Top

QUESTIONS (PART 2)

Back to Top

Q.2.1: Calculate subnet mask and the number of subnets.

Given:

Network = 154.25.0.0
Hosts/Subnet = 1500

Find:

             Subnet Mask and Number of  Subnets

Procedure:

1. Use given Hosts/Subnet to find Last Host Bits
2. Use Last Host Bits to determine the subnet mask
3. Use Host Bits to determine number of subnets

Solution:

Hosts/Subnet = 1500.
1500 lies between 2048 and 1024, i.e. 2048....1500....1024
2^11 = 2048 and 2^10 = 1024.
2^11 - 2 = 2046, which will allow you to create 1500 subnets.
Therefore, Last Host Bits = 11.

Network ID = 154.25.0.0, which is Class B.
Class B's Subnet Mask = 255.255.x.y
x.y = 11111
000.00000000 
where 11 zero's = Last Host Bits.

x.y = 248.0

Subnet Mask  = 255.255.248.0

x = 11111000
Counting all 1's, Host Bits = 5.
2^5 -2 =  30 Subnets.

Ans:

Subnet Mask = 255.255.248.0
Subnets = 30


"LET'S LOOK AT ANOTHER ONE."

Q.2.2: Calculate subnet mask and the number of subnets.

Given:

Network = 223.21.25.0
Hosts/Subnet = 14

Find

              Subnet Mask and Number of Subnets

Procedure:

1. Use given Hosts/Subnet to find Last Host Bits
2. Use Last Host Bits to determine the subnet mask
3. Use Host Bits to determine number of subnets

Solution:

Hosts/Subnet = 14
14 lies between 16 and 8, i.e. 16....14....8
2^4 = 16
2^4 - 2 = 14, which will allow you to create 14 subnets.

Therefore, Last Host Bits = 4.

Network ID indicates Class C.
Class C's Subnet Mask = 255.255.225.x
x = 1111
0000
where 4 zero's = Last Host Bits.

x = 240

Subnet Mask = 255.255.255.240

x = 11110000
Counting all 1's, Host Bits = 4.
2^4 -2 =  14 Subnets.

Ans:

Subnet Mask = 255.255.255.240
Subnets = 14


Back to Top

QUESTIONS (PART 3)

Back to Top

Given:

IP Address #1 = 198.53.147.45
IP Address #2 = 198.53.147.98

Find: Are these IP Addresses in the SAME subnet?

Procedure:

1. Use IP address to determine Class A, B or C
2. Apply appropriate Subnet Mask of this Class
3. Use AND'ing to obtain Network ID.
4. Compare Network IDs.

Solution:

11000110.00110101.10010011.00101101   = IP Address #1
11111111.11111111.11111111.
00000000   = Class C's Subnet Mask
11000110.00110101.10010011.
00000000   = Network ID #1

11000110.00110101.10010011.01100010   = IP Address #2
11111111.11111111.11111111.
00000000   = Class C's Subnet Mask
11000110.00110101.10010011.
00000000   = Network ID #2

Compare Network ID #1 and #2, they are the same. Therefore, both IP Addresses are in the same subnet.

Back to Top

Find Range of IP Addresses

Back to Top

Q: Given an IP Address of 191.168.55.80 and Subnet Mask of 255.255.224.0. Find the range of IP Addresses.

Given:

IP Address = 191.168.55.80
Subnet Mask = 255.255.224.0

Find: Range of IP Addresses

Solution:

IP Address = 191.168.55.80
Therefore, Network ID = 191.168.0.0

Subnet Mask = 255.255.224.0
224 = 11100000
where all 1's =  3 Host Bits.

Number of Subnets = 2^3 - 2 = 6

Number of Subnet

3rd Octet Subnet IDs
Not Usable
1
2
3
4
5
6
Not Usable
000 00000
001 00000
010 00000
011 00000
100 00000
101 00000
110 00000
111 00000
0
32
64
96
128
160
192
224

 

SUBNET

BINARY (x,y)

RANGES

Not Usable
1
2
3
4
5
6
Not Usable

000 00000.00000001- 000 11111.11111110
001 00000.00000001- 001 11111.11111110
010 00000.00000001- 010 11111.11111110
011 00000.00000001- 011 11111.11111110
100 00000.00000001- 100 11111.11111110
101 00000.00000001- 101 11111.11111110
110 00000.00000001- 110 11111.11111110
111 00000.00000001- 111 11111.11111110

0.1 - 31.254
32.1 - 63.254
64.1 - 95.254
96.1 - 127.254
128.1 - 159.254
160.1 - 191.254
192.1 - 223.254
224.1 - 225.254

How did you get 32 anyway?

Obtain 001 00000 from 3rd Octet above,

Binary = 0 0 1 0 0 0 0 0
         n = 7 6 5 4 3 2 1 0

2^n or 2^5 = 32

Note: The first and last subnets are not usable, because octet cannot be all 0's or all 1's.

Ans:

Subnet IDs                Start                             Finish_______
191.168.32.0            191.168.32.1             191.168.63.254
191.168.64.0            191.168.64.1             191.168.95.254
191.168.96.0            191.168.96.1             191.168.127.254

etc.

How did you get 32.1?
From 123.25.32.0, I added 1 to get 123.25.32.1.

How did you get 63.254?
From 123.25.64.0, I subtracted (or moved back) twice.
So, 64.0 --> 63.255 --> 63.254.

Further Note:

The Start and Finish Subnet IDs can be further evaluated as:

Start                            Finish                 
191.168.32.1             191.168.32.254
191.168.33.1             191.168.33.254
191.168.34.1             191.168.34.254   .....

191.168.63.1             191.168.63.254

You are not allowed to use 0 and 255, because an octet cannot be all 0's or all 1's. This is given by Mr. Liu, who wrote and pointed this out to me. This point, however, does not require for TCP/IP exam, which only requests for the start and finish of each Subnet ID.


Q: Given an IP Address of 123.25.68.2 and Subnet Mask of 255.255.240.0. Find the range of IP Addresses.

Given:

IP Address = 123.25.68.2
Subnet Mask = 255.225.240.0

Find: Range of IP Addresses

Solution:

240 = 11110000
So, you have 4 Host Bits.

0000 0000 --> Not Usable
0001 0000 = 16
0010 0000 = 32
0011 0000 = 48
0100 0000 = 64
0101 0000 
0110 0000 
0101 0000 ...etc.

Subnet IDs                Start                             Finish_______
123.25.16.0               123.25.16.1               123.25.31.254
123.25.32.0               123.25.32.1               123.25.47.254

How did you get 16.1?
From 123.25.16.0, I added 1 to get 123.25.16.1.

How did you get 31.254?
From 123.25.32.0, I subtracted (or moved back) twice.
So, 32.0 --> 31.255 --> 31.254.

Further Note:

The Start and Finish Subnet IDs can be further evaluated as:

Start                           Finish              
123.25.16.1              123.25.16.254
123.25.17.1              123.25.17.254
123.25.18.1              123.25.18.254 .....

123.25.31.1              123.25.31.254

You are not allowed to use 0 and 255, because an octet cannot be all 0's or all 1's. This is given by Mr. Liu, who wrote and pointed this out to me. This point, however, does not require for TCP/IP exam, which only requests for the start and finish of each Subnet ID.


Above questions deal with 3 Host Bits (224) and 4 Host Bits (240). Let's try 5 Host Bits (248).

Q: Given IP Address of 133.111.50.22 and Subnet mask of 255.255.248.0. Find the range of IP Addresses.

Given:

IP Address = 133.111.50.22
Subnet Mask = 255.255.248.0

Find: Range of IP Addresses

Solution:

248 = 11111000
So, you have 5 Host Bits.

00000 000 --> Not Usable
00001 000 = 8
00010 000 = 16
00011 000 = 24
00100 000 = 32
00101 000  etc.
00110 000
00111 000

Subnet IDs                Start                             Finish_______
133.111.8.0              133.111.8.1                133.111.15.254
133.111.16.0            133.111.16.1              133.111.23.254

How did you get 8.1?
From 133.111.8.0, I added 1 to get 133.111.8.1.

How did you get 15.254?
From 133.111.16.0, I subtracted (or moved back) twice.
So, 16.0 --> 15.255 --> 15.254.

Further Note:

The Start and Finish Subnet IDs can be further evaluated as:

Start                           Finish              
133.111.8.1              133.111.8.254
133.111.9.1              133.111.10.254 .....

133.111.15.1            133.111.15.254


"Let's try Class C!"

Given:

IP Address = 199. 55.240.0
Subnet Mask = 255.255.255.192

Find: Range of two subnets, A & B.

Solution:

192 = 11000000
So, you have 2 Host Bits.

00 000000 --> Not Usable
01 000000 = 64
10 000000 = 128
11 000000 --> (192) Not Usable

Subnet IDs                   Start                                Finish               
199.55.240.64             199.55.240.65             199.55.240.127
199.55.240.128           199.55.240.129           199.55.196.191

You don't need to deal with 0's and 255 for this question.


Go to TCP/IP Exam Questions below to view direct DRAG & DROP question from MCSE Exam.

Back to Top

TCP/IP Exam Questions

Back to Top

Q: Mr. XYZ is assigned with one Class B address. He plans to divide his company into 31 subnets. For future expansion, he plans to add another 26 subnets. He then hires you to be his newly employed network administrator. He tells you to create a subnet mask that could be used with 700 hosts/subnet. How do you proceed?

Given:

Class B
31 subnets
26 subnets for future expansion
700 Hosts/Subnet

Find:

Subnet Mask

Solution 1:

Given Hosts/Subnet will help you find the Last Host Bits.
700 Hosts/Subnet lies between 1024 and 512, i.e. 1024.....700.....512
where 2^10 = 1024 and 2^9 = 512
Therefore, Last Host Bits = 10.

Class B Subnet Mask = 255.255.x.y
where x.y = 11111100.00000000 = 252.0

Subnet Mask  = 255.255.252.0

Solution 2:

31 + 26 = 57 subnets.
57 lies between 64 and 32
where 2^6 = 64.
2^6 - 2 = 62, which will allow you to create 57 subnets.
Therefore, Host Bits = 6.

Class B = 255.255.x.y
where x.y = 11111100.000000 = 252.0

Subnet Mask  = 255.255.252.0


Q: You have a network whose Network ID is 139.103.0.0. You have to make at least 800 host IDs. Find the appropriate subnet mask that will provide the minimum number of hosts IDs with the maximum number of subnets?

Given:

Network ID = 139.103.0.0
Host IDs or Hosts/Subnet = 800

Find

Subnet Mask

Solution:

Hosts/Subnet = 800
800 lies between 1024 and 512, i.e. 1024...800...512
2^10 = 1024.
2^10 - 2 = 1022, which will allow you to create 800 subnets.
Therefore, Last Host Bits = 10

Network ID of 139.103.0.0 is a Class B.
Class B's Subnet Mask = 255.255.x.y
x.y = 11111100.00000000
where all 10 zero's = Last Host Bits.

x.y = 252.0

Subnet Mask = 255.255.252.0


Q: You have a Network ID of 152.111.0.0. You require at least 8 subnets. What is the appropriate subnet mask for the largest number of Host IDs?

Given:

Network ID = 152.111.0.0
Subnets = 8

Find:

Subnet Mask

Solution:

Subnets = 8
8 lies between 16 and 8, i.e. 16...8...4
where 2^4 = 16
2^4 - 2 = 14, which will allow you to create 8 subnets.
Therefore, Host Bits = 4

Network ID of 152.111.0.0 is in Class B.
Class B's Subnet Mask = 255.255.x.y
x.y = 11110000.00000000
where 4 one's = Host Bits.

x.y = 240.0

Subnet Mask = 255.255.240.0


Q:
    Subnet Mask             IP Address              Required No of Hosts
1. (drag and place)        165.6.0.0                                 240
2. (drag and place)        194.25.11.0                               11
3. (drag and place)        192.109.0.0                             300
4. (drag and place)        221.201.64.0                             50

This question has options :

255.255.255.0
255.255.0.0
255.255.254.0
255.255.255.240
255.255.255.192

    Subnet Mask             IP Address              Required No of Hosts
1. (drag and place)        165.6.0.0                                 240

Solution:

Hosts/Subnet = 240
240 lies between 256 and 128
2^8 = 256
Therefore, Last Host Bits = 8

IP Address indicates Class B.
Class B's Subnet Mask = 255.255.x.y
x.y = 11111111.00000000
where 8 zero's = Last Host Bits.

x.y = 255.0

Subnet Mask = 255.255.255.0

    Subnet Mask             IP Address              Required No of Hosts
2. (drag and place)        194.25.11.0                                11

Solution:

Hosts/Subnet = 11
11 lies between 16 and 8
2^4 = 16
Therefore, Last Host Bits = 4

IP Address indicates Class C.
Class C's Subnet Mask = 255.255.255.x
x = 11110000
where 4 zero's = Last Host Bits.

x = 240

Subnet Mask = 255.255.255.240

    Subnet Mask             IP Address              Required No of Hosts
3. (drag and place)        192.109.0.0                             300

Solution:

Hosts/Subnet = 300
300 lies between 512 and 256
2^9 = 512
Therefore, Last Host Bits = 9

IP Address indicates Class C.
Class C's Subnet Mask = 255.255.255.x
We need one extra zero bit from 3rd Octet.
255.255.x.y
x.y = 11111110.00000000
where 9 zero's = Last Host Bits.

x.y = 254.0

Subnet Mask = 255.255.254.0

    Subnet Mask             IP Address              Required No of Hosts
4. (drag and place)        221.201.64.0                              50

Solution:

Hosts/Subnet = 50
50 lies between 64 and 32
2^6 = 64
Therefore, Last Host Bits = 6

IP Address indicates Class C.
Class C's Subnet Mask = 255.255.255.x
x = 11000000
where 6 zero's = Last Host Bits.

x = 192

Subnet Mask = 255.255.255.192


Q: Drag & Drop Question:

Given 2 subnets, A & B. Drop appropriate IP Addresses to the given boxes.

     SUBNET A                 SUBNET B
   ___|____                      ____|____
  |                  |                    |                   |               
Start        Finish         Start         Finish

Given:

Network ID = 203.122.0.0
Subnet Mask = 255.255.240.0

Given Choices:

203.122.8.1
203.122.10.251
203.122.16.1
203.122.31.254
203.122.32.1
203.122.37.254
203.122.47.254

Find: Range of IP Addresses for Subnet A & B.

Solution:

Subnet Mask = 255.255.240.0
240 = 11110000
where all 1's =  4 Host Bits.

Number of Subnets = 2^4 - 2 = 14

Number of Subnet

3rd Octet Subnet IDs
Not Usable
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Not Usable
0000 0000
0001 0000
0010 0000
00110000
0100 0000
01010000
0110 0000
0111 0000
1000 0000
1001 0000
1010 0000
1011 0000
1100 0000
1101 0000
1110 0000
1111 0000
0
16
32
48
64
80

etc.

How did you get 16 anyway?

Obtain 0001 0000 from 3rd Octet above,

Binary = 0 0 0 1 0 0 0 0
         n = 7 6 5 4 3 2 1 0

2^n or 2^4 = 16

Note: The first and last subnets are not usable, because octet cannot be all 0's or all 1's.

Given Network ID = 203.122.x.y
We only need the start and finish IP Addresses of two subnets.

Ans:

Subnet   Subnet IDs           Start                      Finish                 
A             203.122.16.0      203.122.16.1       203.122.31.254
B             203.122.32.0      203.122.32.1       203.122.47.254

How did you get 16.1?
From 203.122.16.0, I added 1 to get 203.122.16.1.

How did you get 31.254?
From 203.122.32.0, I subtracted (or moved back) twice.
So, 32.0 --> 31.255 --> 31.254.

Further Note:

The Start and Finish Subnet IDs can be further evaluated as:

Start                           Finish              
203.122.16.1         203.122.16.254
203.122.17.1         203.122.17.254 .....

203.122.31.1         203.122.31.254

You are not allowed to use 0 and 255, because an octet cannot be all 0's or all 1's. This is given by Mr. Liu, who wrote and pointed this out to me. This point, however, does not require for TCP/IP exam, which only requests for the start and finish of each Subnet ID.

Back to Top

Charlie sez, "You're Welcome! "

Initial Publication, 4/99
By SiCharlie