LAB1
LAB1
This lab exercise focuses on the basics of IP subnet masks and their use with
TCP/IP networks. The subnet mask can be used to split up an existing network
into subnetworks, or subnets. Some of the primary reasons for subnetting are
the following:
• Reduce the size of the broadcast domains, which creates smaller networks with
less traffic
• Allow LANs in different geographical locations to communicate through routers
• Provide improved security by separating one LAN from another
Routers separate subnets, and determine when a packet can go from one subnet
to another. Each router a packet goes through is considered a hop. Subnet masks
help workstations, servers, and routers in an IP network determine if the
destination host for the packet they want to send is on their own network or
another network. This lab reviews the default subnet mask and then focuses on
custom subnet masks. Custom subnet masks use more bits than the default
subnet masks by borrowing these bits from the host portion of the IP address.
This creates a three-part address:
• The original network address
• The subnet address made up of the bits borrowed
• The host address made up of the bits left after borrowing some for subnets
Step 1: the structure of IP addresses
If an organization has a Class A IP network address, the first octet, or 8 bits, is
assigned and does not change. The organization can use the remaining 24 bits to
define up to 16,777,214 hosts on its network. This is a lot of hosts. It is not
possible to put all of these hosts on one physical network without separating
them with routers and subnets.
It is common for a workstation to be on one network or subnet and a server to be
on another. When the workstation needs to retrieve a file from the server it will
need to use its subnet mask to determine the network or subnet that the server
is on. The purpose of a subnet mask is to help hosts and routers determine the
network location where a destination host can be found. Refer to the table below
to review the following information:
Step 2 : the ANDing process
ANDing depends on the subnet mask. The subnet mask always uses all ones to
represent the network, or network + subnet, portion of the IP address. A default
subnet mask for a Class C network is 255.255.255.0 or
11111111.111111111.111111111.00000000. This is compared to the source IP
address bit for bit. The first bit of the IP address is compared to the first bit of the
subnet mask, the second bit to the second, and so on. If the two bits are both
ones, the ANDing result is a one. If the two bits are a zero and a one, or two zeros,
the ANDing result is a zero. Basically, this means that a combination of 2 ones
results in a one, anything else is a zero. The result of the ANDing process is the
identification of the network or subnet number that the source or destination
address is on.
Step 3 One Class C network with subnets using a custom subnet mask
This example uses a single Class C network address (200.1.1.0) and shows how a
Class C custom subnet mask can be used to determine which subnetwork (or
subnet) a host is on and to route packets from one subnetwork to another.
Remember that with a Class C network address, the first 3 octets, or 24 bits are
assigned as the network address. This leaves one octet, or 8 bits, for hosts. So,
each Class C network could have up to 254 hosts: • 28 = 256 – 2 = 254 Perhaps
less than 254 hosts, workstations and servers combined, are desired on one
network. This could be for security reasons or to reduce traffic. It can be done by
creating two subnetworks and separating them with a router. This will create
smaller independent broadcast domains and can improve network performance
and increase security. This is possible because these subnetworks will be
separated by one or more router. Assume at least two subnetworks will be
needed and that there will be at least 50 hosts per subnetwork. Because there is
only one Class C network address, only 8 bits in the fourth octet are available for
a total of 254 possible hosts. Therefore, a custom subnet mask must be created.
The custom subnet mask will be used to borrow bits from the host portion of the
address. The following steps help accomplish this:
1. The first step to subnetting is to determine how many subnets are needed. In
this case, its two subnetworks. To see how many bits should be borrowed from
the host portion of the network address, add the bit values from right to left until
the total is equal to or greater than the number of subnets needed. Because two
subnets are needed, add the one bit and the two bit, which equals three. This is
greater than the number of subnets needed. To remedy this, borrow at least two
bits from the host address starting from the left side of the octet that contains the
host address.
Network address: 200.1.1.0
4th octet Host address bits: 1 1 1 1 1 1 1 1
Host address bit values 128 64 32 16 8 4 2 1
(from right)Add bits starting from the right side, the 1 and the 2, until the sum is
greater than the number of subnets needed. Note: An alternate way to calculate
the number bits to be borrowed for subnets is to take the number of bits
borrowed to the power of 2. The result must be greater than the number of
subnets needed. As an example if 2 bits are borrowed the calculation is two to
the second power, which equals four. Since the number of subnets needed is two
this should be adequate.
2. After we know how many bits to borrow, we take them from the left side of the
of the host address, the 4th octet. Every bit borrowed from the host address bit
leaves fewer bits for the hosts. Even though the number of subnets is increased,
the number of hosts per subnet is decreased. Because two bits need to be
borrowed from the left side, that new value must be shown in the subnet mask.
The existing default subnet mask was 255.255.255.0 and the new custom subnet
mask is 255.255.255.192. The 192 results from adding the first two bits from the
left, 128 + 64 = 192. These bits now become 1s and are part of the overall subnet
mask. This leaves 6 bits for host IP addresses or 26 = 64 hosts per subnet. 4th
Octet borrowed bits for subnet: 1 1 0 0 0 0 0 0 Subnet bit values: (from left side)
128 64 32 16 8 4 2 1 With this information, the following table can be built. The
first two bits are the subnet binary value. The last 6 bits are the host bits. By
borrowing 2 bits from the 8 bits of the host address 4 subnets, 2^2, with 64 hosts
each, can be created. The 4 networks created are as follows:
• The 200.1.1.0 network
• The 200.1.1.64 network
• The 200.1.1.128 network
• The 200.1.1.192 network
The 200.1.1.0 network is considered unusable, and 200.1.1.192 is considered
unusable
TASK:1
Use the following information and the previous examples to answer the
following subnet-related questions
A company has applied for and received a Class C network address of
197.15.22.0. The physical network is to be divided into 4 subnets, which
will be interconnected by routers. At least 25 hosts will be needed per
subnet. A Class C custom subnet mask needs to be used and a router is
needed between the subnets to route packets from one subnet to another.
Determine the number of bits that need to be borrowed from the host
portion of the network address and the number of bits that will be left for
host addresses.
Use the table just developed to help answer the following questions:
1. Which octet(s) represent the network portion of a Class C IP address?
4. How many high-order bits were borrowed from the host bits in the
fourth octet?
5. What subnet mask must be used? Show the subnet mask in decimal and
binary.
6. What is the maximum number of subnets that can be created with this
subnet mask?
7. What is the maximum number of useable subnets that can be created
with this mask?
8. How many bits were left in the fourth octet for host IDs?
9. How many hosts per subnet can be defined with this subnet mask?
10. What is the maximum number of hosts that can be defined for all
subnets with this scenario?
11. Is 197.15.22.63 a valid host IP address with this scenario?
12. Why or why not?
13. Is 197.15.22.160 a valid host IP address with this scenario?