Lab 06
Lab 06
6.2 Introduction
IP address
Each Network Interface Card (NIC or Network card) present in a PC is assigned one Network
address called as IP address [or Network address]. IP address is stand for internet protocol
address. IP address is assigned by the administrator of the network. No two PCs can have the
same IP address. IP address allows computers to send and receive information. There are four
types of IP addresses: public, private, static, and dynamic. While the public and private are
indicative of the location of the network—private being used inside a network while the public is
used outside of a network—static and dynamic indicate permanency. An IP address allows
information to be sent and received by the correct parties, which means they can also be used to
track down a user's physical location.
A static IP address is one that was manually created, as opposed to having been assigned. A
static address also does not change, whereas a dynamic IP address has been assigned by a
Dynamic Host Configuration Protocol (DHCP) server and is subject to change. Dynamic IP
addresses are the most common type of internet protocol addresses. Dynamic IP addresses are
only active for a certain amount of time, after which they expire. The computer will either
automatically request a new lease, or the computer may receive a new IP address.
There is a burned-in address on the NIC called as Physical Address [or MAC address or
Hardware address]. The MAC address of a network card indicates the vendor of that card and a
unique serial number. MAC addresses are 6 Bytes (48 bits) long. Every network card
manufacturer gets a universally unique 3-byte code called the Organizationally Unique Identifier
(OUI). Manufacturers agree to give all NICs a MAC address that begins with the assigned OUI.
The manufacturer then assigns a unique value for the last 3 bytes, which ensures that every MAC
address is globally unique.
In the following picture we can see the structure of a MAC address:
IP address classes
IP addresses are divided into five classes that are identified by the value of the first octet (the
first decimal number). The system of IP address classes was developed for the purpose of
Internet IP addresses assignment. The classes created were based on the network size. For
example, for the small number of networks with a very large number of hosts, the Class A was
created. The Class C was created for the numerous networks with the small number of hosts.
An IP address consists of 32 bits. These bits are divided into two parts:
1. Format of IP address IPv4 is made up of four parts, in the pattern as w.x.y.z. Each part has 8
binary bits and the values in decimal can range from 0 to 255.
2. IP address classes
IP addresses are divided into different classes. These classes determine the maximum number
of hosts per network ID. Only three classes are actually used for network connectivity. The
following table lists all of the address class.
c. If the host part is all 0s, this represents network address. This is not a valid IP address
d. If the host part is all 1s, this represents broadcast address. This is not a valid IP address.
e. We can’t use the IP address represented within private address range as part of public ip
address.
i. Class A: 10.0.0.0 to 10.255.255.255
ii. Class B: 172.16.0.0 to 172.31.255.255
iii. Class C: 192.168.0.0 to 192.168.255.255
f. 127.0.0.0 Network address is used for loop-back testing. This will help you to check the
network card of your own PC [localhost].
g. The validity of the IP address is also based on the subnet mask used provided.
6. Default subnet masks for standard IP address classes. The following table lists the default
subnet masks for each available class of TCP/IP networks.
Subnetting
Subnetting is the practice of dividing a network into two or more smaller networks. It increases
routing efficiency, enhances the security of the network and reduces the size of the broadcast
domain. A network with a total of 256 addresses (a Class C network). One of these addresses is
used to identify the network address and another one is used to identify the broadcast address on
the network. Therefore, we are left with 254 addresses available for addressing hosts.
Here are three reasons why you may want to use subnetting:
Subnet mask
Subnet mask is a 32-bit value that allows the receptionist of IP packet to distinguish network ID
portion in the IP address form the host ID portion.
Class A, B, and C networks have default masks, also known as natural masks, as shown here:
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
An IP address on a Class A network that has not been subnetted would have an address/mask
pair similar to: 8.20.15.1 255.0.0.0. To see how the mask helps you identify the network and
node parts of the address, convert the address and mask to binary numbers.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
Once you have the address and the mask represented in binary, then identifying the network and
host ID is easier. Any address bits which have corresponding mask bits set to 1 represent the
network ID. Any address bits that have corresponding mask bits set to 0 represent the node ID.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
--------------------------------------------------
net id | host id
netid = 00001000 = 8
hostid = 00010100.00001111.00000001 = 20.15.1
A notation that indicates how many 1's are set in the subnet mask. For example, IP address
192.168.1.1 with subnet mask 255.255.255.0 can be written as 192.168.1.1/24.
Remember:
255 . 255 . 255 . 0 = 1111 1111 . 1111 1111 . 1111 1111 . 0000 0000
Another example:
255 . 255 . 255 . 224 = 1111 1111 . 1111 1111 . 1111 1111 . 1110 0000
Block size = 2y
As mentioned above, subnetting allows you to create multiple logical networks that exist within
a single Class A, B, or C network. If you do not subnet, you are only able to use one network
from your Class A, B, or C network, which is unrealistic.
Each data link on a network must have a unique network ID, with every node on that link being a
member of the same network. If you break a major network (Class A, B, or C) into smaller
subnetworks, it allows you to create a network of interconnecting subnetworks. Each data link on
this network would then have a unique network/subnetwork ID.
In order to subnet a network, extend the natural mask using some of the bits from the host ID
portion of the address to create a subnetwork ID. For example, given a Class C network of
204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner:
204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000
-------------------------------------|sub|------
By extending the mask to be 255.255.255.224, you have taken three bits (indicated by "sub")
from the original host portion of the address and used them to make subnets. With these three
bits, it is possible to create eight subnets. With the remaining five host ID bits, each subnet can
have up to 32 host addresses, 30 of which can actually be assigned to a device since host ids of
all zero’s or all one’s are not allowed.
Table 6.1:
Remember:
It is forbidden to go even close to original network address!! You are allowed to use HOST bits
only...
Example:
192.168.10.15/26
This IP belongs to class C, [24 bits for network and 8 for host]
So masked bits = 26 – 24 = 2.
Subnets = 22 = 4.
Host bits = 8 - 2 = 6
Another way: 32 – 26 = 6.
Block size = 26 = 64.
Hosts per block = 64 – 2 = 62
Subnets:
Table 6.2:
Subset a Class C address with the binary method by following these four steps
1. Convert to binary.
2. Calculate the subset address.
3. Find host range.
4. Calculate the total number of subsets and the hosts per subnet.
We will use a Class C address, which takes 5 bits from the Host field for subnetting and leaves 3
bits for defining hosts as shown in figure 1 below. Having 5 bits available for defining subnets
means that we can have up to 32 (2^5) different subnets.
It should be noted that in the past using subnet zero (00000---) and all-ones subnet (11111---)
was not allowed. This is not true nowadays. Since Cisco IOS Software Release 12.0 the entire
address space including all possible subnets is explicitly allowed.
To calculate the IP Address Subnet, you need to perform a bit-wise AND operation (1+1=1, 1+0
or 0+1 =0, 0+0=0) on the host IP address and subnet mask. The result is the subnet address in
which the host is situated.
We know already that for subnetting this Class C address we have borrowed 5 bits from the
Host field. These 5 bits are used to identify the subnets. The remaining 3 bits are used for
defining hosts within a particular subnet.
The Subnet address is identified by all 0 bits in the Host part of the address. The first host
within the subnet is identified by all 0s and a 1. The last host is identified by all 1s and a 0. The
broadcast address is the all 1s. Now, we move to the next subnet and the process is repeated the
same way.
The following diagram clearly illustrates this process:
STEP 4: Calculate the Total Number of Subnets and Hosts Per Subnet
Knowing the number of Subnet and Host bits we can now calculate the total
number of possible subnets and the total number of hosts per subnet. We assume in
our calculations that all-zeros and all-ones subnets can be used. The following
diagram illustrates the calculation steps.
Slash Notation
It’s a compact representation of Subnet mask. In this notation a slash (/) sign and total
number of the on bits in subnet mask are written with IP address instead of full Subnet mask.
Following table lists some examples of IP addresses with Subnet mask in all three notations.
11000000.10101000.00000001.00000001 192.168.1.1
192.168.1.1/24
11111111.11111111.11111111.00000000 255.255.255.0
11000000.10101000.00000001.00000001 192.168.1.1
192.168.1.1/28
11111111.11111111.11111111.11110000 255.255.255.240
Type of Subnetting
There are two types of Subnetting FLSM and VLSM. In FLSM, all subnets have equal
number of host addresses and use same Subnet mask. In VLSM, subnets have flexible
number of host addresses and use different subnet mask.
FLSM is easy in implementation and simple in operation but wastes a lot of IP addresses.
VLSM is hard in implementation and complex in operation but utilizes maximum IP
addresses.
Range of hosts = 26 = 64
Range Useable Range
Network ID 0 – 63
64 – 127 65 – 126
128 – 191 129 – 190
Broadcast Address 192 – 255
6.3 Lab Tasks
Q1. Write the address class next to each IP address.
IP Address Class?
10.50.120.7
172.16.55.13
191.107.2.10
172.16.16.15
200.200.5.2
3.3.57.0
131.107.2.89
192.168.1.1
Q2. Which address (es) will allow only 254 hosts per network?
d) 126.1.0.0
e) 0.127.4.100
f) 190.7.2.0
g) 127.1.1.1
h) 198.121.254.255
i) 255.255.255.255
Q4. Which address class (es) will allow you to have more than 1000 hosts per network?
Q5. You have the following address: 192.16.5.133/29 How many total bits are being used to
identify the network, and how many total bits identify the host?
A. 1 and 3
B. 2 and 4
C. 1, 2 and 4
D. 2, 3 and 4
Q8: You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful
subnet mask would you use?
A. 255.255.255.192
B. 255.255.255.224
C. 255.255.255.240
D. 255.255.255.248