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

Lab 06

The document discusses IP addressing and subnetting. It defines IP addresses and their types, and explains MAC addresses. It also covers IP address classes, subnet masks, subnetting, and CIDR notation. The goal is to understand configuring IP addresses and subnets in a local network.

Uploaded by

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

Lab 06

The document discusses IP addressing and subnetting. It defines IP addresses and their types, and explains MAC addresses. It also covers IP address classes, subnet masks, subnetting, and CIDR notation. The goal is to understand configuring IP addresses and subnets in a local network.

Uploaded by

nomanbsit
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Lab-06 Introduction to Network IP

Lab 06: Introduction to Network IP


6.1 Objective

Having completed this experiment, you will be able to:


1. To Configure IP Address in a system in LAN (TCP/IP Configuration)
2. To configure DNS to establish interconnection between system
3. Differentiate between Classes of IP address
4. Sub netting

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:

Figure 6.1: Mac Address Format

IT-310 LAB MANUAL By Nosheen Anwar 73 | P a g e


Lab-06 Introduction to Network IP

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.

The IP address classes are:


Class A, 0-127 – e.g. 10.50.13.40. For large networks with many devices.
Class B, 128-191 – e.g. 130.5.4.77. For medium-sized networks.
Class C, 192-223 – e.g. 192.168.5.10. For small networks with the small number of hosts.
Class D, 224-239 – e.g. 224.0.0.5. For multicast addresses.
Class E, 240-255 – e.g. 241.0.0.1. Experimental.

Reserved addresses (used for special purposes):


0.0.0.0/8 – used to communicate with the network the device is on.
127.0.0.0/8 – loopback addresses.
169.254.0.0/16 – link-local addresses (APIPA).

An IP address consists of 32 bits. These bits are divided into two parts:

Network bits – identify a particular network.

Host bits – identify a host on the network.

Rules for IP4 Addressing

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.

Table 6.1 List of Address Class

Class Address Range Supports


Class A 1.0.0.1 to 126.255.255.254 Supports 16 million hosts on each of 127 networks
Class B 128.1.0.1 to 191.255.255.254 Supports 65,000 hosts on each of 16,000 networks.
Class C 192.0.1.1 to 223.255.254.254 Supports 254 hosts on each of 2 million networks.
Class D 224.0.0.0 to 239.255.255.255 Reserved for multicast groups.
Class E 240.0.0.0 to 254.255.255.254 Reserved.

IT-310 LAB MANUAL By Nosheen Anwar 74 | P a g e


Lab-06 Introduction to Network IP

3. Grouping of IP addresses into different classes.


a) Class A, B, C, D, E
4. Default Subnet mask it is used to identify the network part from the host part. Put binary one
for the parts that represent network part and zero for the part that represent host part.
a. Class A: 255.0.0.0
b. Class B: 255.255.0.0
c. Class C: 255.255.255.0
d. We can’t have mix of 1s and 0s in subnet mask. Only consecutive 1s is followed by
consecutive 0s
5. Invalid IP address
a. If the network part is all 0s, the address belongs to class A. But this is an invalid IP
address because for an IP address all the network or host part should not be all 1s or all
0s.
0.0.0.0 is not valid. Routers use it internally
b. If the network part is all 1s, this address belongs to class E. But due to presence of all 1s,
it is not valid. This represent broadcast to all networks.
i. 255.255.255.255 is not valid.

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.

Why Use Subnetting

Here are three reasons why you may want to use subnetting:

IT-310 LAB MANUAL By Nosheen Anwar 75 | P a g e


Lab-06 Introduction to Network IP

1. Conservation of IP addresses: Imagine having a network of 20 hosts. Using a Class C


network will waste a lot of IP addresses (254-20=234). Breaking up large networks into
smaller parts would be more efficient and would conserve a great amount of addresses.
2. Reduced network traffic: The smaller networks that created the smaller broadcast
domains are formed, hence less broadcast traffic on network boundaries.
3. Simplification: Breaking large networks into smaller ones could simplify fault
troubleshooting by isolating network problems down to their specific existence.

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

Classless Interdomain Routing (CIDR)

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

IT-310 LAB MANUAL By Nosheen Anwar 76 | P a g e


Lab-06 Introduction to Network IP

# of 1’s equals 24, so the CIDR of this subnet mask is 24

Another example:

For subnet mask

255 . 255 . 255 . 224 = 1111 1111 . 1111 1111 . 1111 1111 . 1110 0000

It can be written as /27, since # of 1’s in it is 27.

How to create Subnets?

Before you start, you have to answer these questions:

 How Many Subnets?

(2x) x: number of masked bits.

 How Many Hosts per Subnet?

(2y - 2) y: number of remaining bits in host side or unmasked bits.


Why -2???

 What are the valid Subnets?

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

IT-310 LAB MANUAL By Nosheen Anwar 77 | P a g e


Lab-06 Introduction to Network IP

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.

So, with this in mind, these subnets have been created:

Table 6.1:

Network ID First Valid Host Last Valid Host Broadcast ID


204.17.5.0 204.17.5.1 204.17.5.30 204.17.5.31
204.17.5.32 204.17.5.33 204.17.5.62 204.17.5.63
204.17.5.64 204.17.5.65 204.17.5.94 204.17.5.95
204.17.5.96 204.17.5.97 204.17.5.126 204.17.5.127
204.17.5.128 204.17.5.129 204.17.5.158 204.17.5.159
204.17.5.160 204.17.5.161 204.17.5.190 204.17.5.191
204.17.5.192 204.17.5.193 204.17.5.222 204.17.5.223
204.17.5.224 204.17.5.225 204.17.5.254 204.17.5.255

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:

0, 64, 128, 192

Table 6.2:

IT-310 LAB MANUAL By Nosheen Anwar 78 | P a g e


Lab-06 Introduction to Network IP

Network ID First Valid Host Last Valid Host Broadcast ID


192.168.10.0 192.168.10.1 192.168.10.62 192.168.10.63
192.168.10.64 192.168.10.65 192.168.10.126 192.168.10.127
192.168.10.128 192.168.10.129 192.168.10.190 192.168.10.191
192.168.10.192 192.168.10.193 192.168.10.254 192.168.10.255

How to Subset a Class C Address Using the Binary Method

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.

Figure 6.2: Host part division

Let's use IP address 192.168.10.44 with subnet mask 255.255.255.248 or /29.

STEP 1: Convert to Binary:

IT-310 LAB MANUAL By Nosheen Anwar 79 | P a g e


Lab-06 Introduction to Network IP

Figure 6.3: Binary Conversion

STEP 2: Calculate the Subnet Address

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.

Figure 6.4: Subnet mask calculation

STEP 3: Find Host Range

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:

IT-310 LAB MANUAL By Nosheen Anwar 80 | P a g e


Lab-06 Introduction to Network IP

Figure 6.5: Fining Host range

IT-310 LAB MANUAL By Nosheen Anwar 81 | P a g e


Lab-06 Introduction to Network IP

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.

Figure 6.6: Calculation subnet and Host

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.

Table 6.1: IP address with subnet mask

In Slash notation In binary notation In decimal notation


00001010.00001010.00001010.00001010 10.10.10.10
10.10.10.10/8
11111111.00000000.00000000.00000000 255.0.0.0
10101100.10101000.00000001.00000001 172.168.1.1
172.168.1.1/16
11111111.11111111.00000000.00000000 255.255.0.

IT-310 LAB MANUAL By Nosheen Anwar 82 | P a g e


Lab-06 Introduction to Network IP

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.

Figure 6.7: FLSM and VLSM

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.

How to Calculate Subnets


Subnets and Hosts
Borrow 2 bits
S S H H H H H H
S SHHHHHH
# of subnets = 22 = 4
Subnet mask = 2 bits = 128 + 64 = 192

IT-310 LAB MANUAL By Nosheen Anwar 83 | P a g e


Lab-06 Introduction to Network IP

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?

Q3. Identify invalid IP address:


Circle the portion of the IP address that would be invalid if it were assigned to a host, and
then explain why it is invalid.
a) 131.107.256.80
b) 222.222.255.222
c) 231.200.1.1

IT-310 LAB MANUAL By Nosheen Anwar 84 | P a g e


Lab-06 Introduction to Network IP

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?

Q6: What is the full subnet mask for address 172.16.5.10/28?

Q7: Which two statements describe the IP address 10.16.3.65/23?

1. The subnet address is 10.16.3.0 255.255.254.0.


2. The lowest host address in the subnet is 10.16.2.1 255.255.254.0.
3. The last valid host address in the subnet is 10.16.2.254 255.255.254.0.
4. The broadcast address of the subnet is 10.16.3.255 255.255.254.0.

IT-310 LAB MANUAL By Nosheen Anwar 85 | P a g e


Lab-06 Introduction to Network IP

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

IT-310 LAB MANUAL By Nosheen Anwar 86 | P a g e

You might also like