Course Home
CPSC 341 - Subnetting Exercise
Earl Rodd

Masks

Some software reports network masks using dotted decimal notation (e.g. 255.255.255.0) in which each 1 bit means that that bit is part of the subnet id and the 0 bits are the host id. Other software (most likely routers) uses the CIDR notation /24 to mean 24 bits are subnet id.

Convert these network masks to CIDR notation: The first one is done for you.

Network MaskCIDR Notation
255.255.255.0/24
255.255.252.0/_____
255.255.0.0/_____
255.0.0.0/_____
255.255.240.0/_____

Converting decimal to binary

There are two ways to convert decimal to binary, manual and using a calculator.

Manual

Divide by 16. This gives two base 16 numbers, the quotient and remainder. Convert each of these to binary. The quotient is the left most 4 bits and remainder the rightmost:

220 / 16 = 13(hex D) remainder 12 (hex C) 13(hex D) = 1101 12(hex C) = 1100 220 = 11011100

Use a calculator

Calculators include:

  1. The LINUX "bc" command.
  2. A phone app like the andoroid "RealCalc" calculator.
  3. A scientific calculator.

CIDR subnets

Create subnet masks in dotted decimal format for these subnets in CIDR notation. The first is done for you.

CIDR subnet IDNetmask
60.40.10.0/24255.255.255.0
60.40.10.0/16______.______.______.______
60.40.10.220/28______.______.______.______
10.20.30.252/30______.______.______.______

CIDR IP addresses

For each of the following CIDR format IP addresses, figure out the subnet ID and the host ID within that subnet. The first one is done for you.
CIDR IP AddressSubnet IDHost ID
130.150.10.50/24130.150.10.050
6.25.98.4/8_____._____._____.__________________
6.25.98.4/16_____._____._____.__________________
6.25.98.151/28_____._____._____.__________________

An Example

Go to a Windows machine and using the command

ipconfig /all | more
Note these values:

Answer these questions:

  1. How many bits are in the subnet address? ______

  2. Write the subnet address in CIDR format. ______________________

  3. Is the DHCP server on the same subnet? ______________

  4. Is the Default gateway on the same subnet? ________________

  5. Is the DNS server on the same subnet? __________________