Lab Manual: Electrical Engineering - IECS UST Bannu

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 70

LAB MANUAL

Department

Electrical Engineering - IECS UST Bannu


List of experiments
Subject: Computer Communication Networks

Labs Title
Lab-01 IP Addressing
Lab-02 Connecting Two PCs using Packet Tracer
Lab-03 Connecting Two LANs Using Switches
Lab-04 Connecting Two LANs Through Routers
Lab-05 Basic VLAN Configuration
Lab-06 DHCP Configuration
Lab-07 DNS Configuration
Lab-08 FTP Server Configuration
Lab-09 SMTP Server Configuration
Lab-10 Configuration of VOIP
Lab-11 Configuration of EIGRP Protocol
Lab-12 Network Simulation using Packet Tracer and router GUI mode

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 1

IP Addressing

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Objective:
The purpose of the lab is to introduce the concept of IP addressing and subnet masking.

Classless and Classful IP-Addressing


Classful Addressing
All IP addresses have a network and host portion. In classful addressing, the network portion
ends on one of the separating dots in the address (on an octet boundary). Classful addressing
divides an IP address into the Network and Host portions along octet boundaries. In the classful
addressing system all the IP addresses that are available are divided into the five classes A,B,C,D
and E, in which class A,B and C address are frequently used because class D is for Multicast and
is rarely used and class E is reserved and is not currently used.

Classless Addressing
Classless addressing uses a variable number of bits for the network and host portions of the
address. Classless addressing treats the IP address as a 32 bit stream of ones and zeroes, where
the boundary between network and host portions can fall anywhere between bit 0 and bit
31.Classless addressing system is also known as CIDR (Classless Inter-Domain Routing).Classless
addressing is a way to allocate and specify the Internet addresses used in inter-domain routing
more flexibly than with the original system of Internet Protocol (IP) address classes. CIDR
(Classless Internet Domain Routing), defines arbitrarily-sized subnets solely by base address and
number of significant bits in the address. A CIDR address of 192.168.0.0/24 defines a block of
addresses in the range 192.168.0.0 through 192.168.0.255, while 192.168.0.0/20 would define
a network 16 times as large - from 192.168.0.0 through 192.168.15.255.

Disadvantages of Classful IP Addressing


 Overly generous address allocation
Class A networks get over 16 million address
 Poor support for midsized networks
Class B is too big (65536)
Class C is too small (256)
 Routing Table Explosion.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Subnetting and Subnet Masking

Subnetting
Subnetting an IP network can be done for a variety of reasons, including organization, use of
different physical media (such is Ethernet, FDDI, WAN etc ), preservation of address space, and
security. The most common reason is to control network traffic. In an Ethernet network, all
nodes on a segment see all the packets transmitted by all the other nodes on that segment.
Performance can be adversely affected under heavy traffic loads, due to collisions and the
resulting retransmissions. A router is used to connect IP networks to minimize the amount of
traffic each segment must receive.

Subnet Masking
Applying a subnet mask to an IP address allows someone to identify the network and node
parts of the address. Performance a bitwise logical AND operation between the IP address and
the subnet mask results in the Network Address of Number.

Classes of IP Addresses used in Networking


IP stand for Internet Protocol which is a unique identifier for a node or host connection on an
IP network. An IP address is a 32 bit binary number usually represented as 4 decimal values,
each representing 8 bits, in the range 0 to 255 (known as octets) separated by decimal points.

Class A: addresses begin with 0xxx, or 1 to 126 decimal.


Class B: addresses begin with 10xx, or 128 to 191 decimal.
Class C: addresses begin with 110x, or 192 to 223 decimal.
Class D: addresses begin with 1110, or 224 to 239 decimal.
Class E: address begin with 1111, or 240 to 254 decimal.
Some IP Addresses and their class.

Address Class Address Class


210.23.67.102 C 134.223.156.89 B
66.23.148.0 A 127.0.0.1 Reserved for loop back
207.22.45.219 C 158.23.251.33 B
224.23.108.23 D 193.23.255.77 C
63.125.23.211 A 238.23.177.8 D
128.12.254.198 B 192.25.128.36 C
77.123.25.66 A 20.0.10.101 A

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 2

Connecting Two PCs using Packet Tracer

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
CISCO Packet Tracer
TASK 1
First open the CISCO Packet Tracer App from the desktop and then from the menu select
devices>generic devices select PC0 and PC1, now connect both PCs(Physical connection) with copper
cross wire by clicking fast Ethernet, a green dot will be shown which means that both the devices are
logically and physically connected. However in case of red dot, the PCs are not connected both
physically and logically. As shown below:

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Assignment of IP Addresses to PC0 and PC1
Now assign IPs to both the PCs. By double clicking on PC0 which we placed and go
to>desktop>Configure IP. Now assign IP in the IP Address bar, as shown below. The same method is for
PC1.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Accessing PC1 from PC0 by Ping Command
Now again close the IP Configuration tab. Then in the desktop>select>Command Prompt. Now ping the
PC1 from PC0 by using ping command and IP assigned to PC1. If PC1 replies it means that the connection
is properly established and data can be transferred or received. The same is the case for PC0 to be
pinged from PC1. As shown below:

Command: PC> ping 192.168.1.2

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Lab 3

Connecting Two LANs Using Switches

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Connecting Two Hosts through Switch and Sending Data
First connect the two PCs (PC0 & PC1) by Copper Straight Through wire along with the switch shown
below.

Note: But before connecting assign IPs to both the PCs.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
After the successful connection, on the right most corner there is a Message icon select it and then
target the Sending device with cursor and then the Destination PC. A Successful status will be obtained
when message is sent successfully from one PC to another.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Lab 4

Connecting Two LANs through Router

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Network Topology

Assigning IP Addresses to All the PCs


Assign IP Addresses to all the PCs according to the above network topology. The method of
assigning IP addresses is the same as explained in the previous Labs. As shown below

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Configuring Router
Now by clicking router and then go to CLI(Command Line Interface) and then press enter then
type no and write the following commands:

Enable

Configure terminal

Hostname ‘Your own choice’

Interface fastethernet 0/0

Ip address 192.168.10.1 255.255.255.0

No shut

And then configure the another node also whose IP is 192.168.20.6

Now Configuring Switches

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Go to CLI then type the following commands for Switch0

enable

configure terminal

hostname ‘your choice’

interface vlan1

ip address 192.168.10.2 255.255.255.0

no shut

exit

ip default-gateway 192.168.10.1

do write

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now close Switch0 and then configure the Switch1. But for switch1 the default gateway is
192.168.20.6

After all these activity check the network connection by selecting Message and send it from one
PC in either network to another PC in another Network.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Lab 5

Basic VLAN Configuration

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Objective:
Design a VLAN consisting of 3 switches and 6 PCs as shown below:

Topology

Now clear any existing configuration on the switches and initialize all ports in the shutdown
state by using following commands on all the 3 Switches in CLI.

Commands
Switch>en
Switch#config term
Switch(config)#interface range fa0/1-24
Switch(config-range)#shutdown
Switch(config-if-range)#interface range gi0/1-2
Now use these commands for the next 2 Switches (Switch1 & Switch2)

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
By doing this the Network will look like as shown below:

Now assign IP addresses to all the 6 PCs according table shown below:

Devices IP Addresses

PC0 192.168.2.1

PC1 192.168.2.2

PC2 192.168.2.3

PC3 192.168.2.4

PC4 192.168.2.5

PC5 192.168.2.6

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now configure VLAN on switches by using the below commands:
On Switch0 (hostname S1)
Swich> en
Switch# config t
Switch(config)# hostname S1
S1(config)#vlan 11
S1(config-vlan)#name Teachers
S1(config-vlan)#vlan 22
S1(config-vlan)#name Students
S1(config-vlan)#vlan 33
S1(config-vlan)#name Clerks
S1(config-vlan)#vlan 44
S1(config-vlan)#name Management
S1# ex
S1# ex
Now to show VLAN column entry brief, type

S1# sh vlan br

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Repeat the above commands for the other two switches (Switch1 and Switch2).

Assign Switch ports of VLANs on Switch1 & Switch2 (namely S2 and S3)

Go to CLI in Switch1 and type the following commands


S2>en
S2#config t
S2(config)#int range fa0/6-10
S2(config-if-range)#switchport access valn 33
S2(config-if-range)#int range fa0/11-17
S2(config-if-range)#switchport access vlan 11
S2(config-if-range)#int range fa0/18-24
S2(config-if-range)#switchport access vlan 22
S2(config-if-range)#end
S2#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]

For Switch2
S3>en
S3#config t
S3(config)#int range fa0/6-10
S3(config-if-range)#switchport access vlan 33
S3(config-if-range)#int range fa0/11-17
S3(config-if-range)#switchport access vlan 11
S3(config-if-range)#int range fa0/18-24
S3(config-if-range)#switchport access vlan 22
S3(config-if-range)#end
S3#copy running-config startup-config
Destination filename [startup-config]?
Building configuration...
[OK]
DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Assigning IP Address to Switches
Configuring the management IPs on all the 3 Switches
Commands on Switch0 (IP 192.168.4.1)
S1>en
S1#config t
S1(config)#int vlan 44
S1(config-if)#ip add 192.168.4.1 255.255.255.0
S1(config-if)#no shutdown
S1(config-if)#ex

Commands on Switch1 (IP 192.168.4.2)


S2>en
S2#config t
S2(config)#int vlan 44
S2(config-if)#ip add 192.168.4.2 255.255.255.0
S2(config-if)#no shutdown
S2(config-if)#ex

Commands on Switch2 (IP 192.168.4.3)


S3>en
S3#config t
S3(config)#int vlan 44
S3(config-if)#ip add 192.168.4.3 255.255.255.0
S3(config-if)#no shutdown
S3(config-if)#ex

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Configuring trunking and the native VLAN for the trunking ports on all Switches.

Switch0
S1(config)#interface range fa0/1-5
S1(config-if-range)#switchport mode trunk
S1(config-if-range)#switchport trunk native vlan 44
S1(config-if-range)#no shutdown
S1(config-if-range)#end

Switch1
S2(config)# interface range fa0/1-5
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#switchport trunk native vlan 44
S2(config-if-range)#no shutdown
S2(config-if-range)#end

Switch2
S3(config)# interface range fa0/1-5
S3(config-if-range)#switchport mode trunk
S3(config-if-range)#switchport trunk native vlan 44
S3(config-if-range)#no shutdown
S3(config-if-range)#end

After doing this the state of the desired ports will be changed to up.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
When PC6 pinged from PC1

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 6

DHCP Configuration

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Objective:
Configuring DHCP, such that all the PCs connected will get a Dynamic IP Address from the DHCP
pool.
Topology

In Router0 go to CLI and first assign IP Address to it.


Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#hostname R1
R1(config-if)#ip add 192.168.10.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#ex
Now configure the DHCP pool
R1(config)#ip dhcp pool IP10
R1(dhcp-config)#net 192.168.10.0 255.255.255.0
R1(dhcp-config)#default 192.168.10.1
R1(dhcp-config)#ex

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now exclude IP Addresses in range of 192.168.10.1 upto 192.168.10.10 by using the command
R1(config)#ip dhcp exclude 192.168.10.1 192.168.10.10
R1(config)#ex
So IPs in this range would not be assigned dynamically by the Router to all of the PC in this
Network.
Now type the following commands again
R1(config)#ip dhcp exclude 192.168.10.1 192.168.10.10
R1(config)#ex
Now select PC0 go to Desktop> IP Address and select DHCP, so the PC0 will get IP Address
dynamically from the DHCP pool. Do this for the remaining two PCs (PC1 & PC2).

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 7

DNS Configuration

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Introduction
Domain Name Servers (DNS) are the Internet's equivalent of a phone book. They maintain a
directory of domain names and translate them to Internet Protocol (IP) addresses.
This is necessary because, although domain names are easy for people to remember,
computers or machines, access websites based on IP addresses.

Objective: Create a DNS server and configure it.


Topology

Now first configure the Server (192.168.1.1) by assigning IP(192.168.1.1) to it.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now go to>services> DNS
In Name>type>www.ustb.com
In Address>type> 192.168.1.1 > now click > ADD

Now click on PC (192.168.1.5) and assign IP 192.168.1.5 to it. In its DNS section insert the IP
Address of the server known as 192.168.1.1 as shown below:

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now ping the server (192.168.1.1) from PC (192.168.1.5)

At last in PC>go to>browser>URL> type “www.ustb.com” or ‘192.168.1.1’ the following results


will be obtained.

LAB 8
DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
FTP Server Configuration

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Objective:
Create and configure FTP server and upload and download files from it.

Network topology:
First set the network according to the below figure:

Assign the desired IPs to all the devices according to the below table
Devices IP Address
PC0 171.16.0.1
PC1 171.16.0.3
PC2 192.168.10.3
Server-PT 192.168.10.1
Router0 fa0/0 171.16.0.2
Router0 fa1/0 192.168.10.2

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now go to Router> Config> FastEthernet0/0 > IP Address> type> 171.16.0.2

Repeat the same procedure for the FastEthernet1/0 with an IP 192.168.0.2


Now go to Router> Config> FastEthernet1/0 > IP Address> type> 192.168.0.2

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now configure FTP server
In config (Services) select FTP and create user id by using below commands:
Username: abc
Password: 123
Then click Add

You can use your choice Username and Password.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now create text file in either of the PC
By clicking either of the PC in the network, in desktop go to text editor to create the txt file and
save.

Now to check the saved txt file in command prompt type “dir” it will show the directory of that
PC.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Another access to FTP server whose IP is 192.168.10.1 by using the following commands
PC> ftp 192.168.10.1
And access with username: abc & password: 123

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now to check the directory of the server simply type “dir” it will look like as shown below:

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Uploading txt file to the Server
Use the below commands:
ftp> put text1.txt

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now to check the directry of server type “dir” so the text1.txt will be updated to it as shown
below:

Use the same commands for uploading files to server on other PCs in the Network.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now to download the file on either of the PC in the Network simply login to ftp server as
mentioned above and use the following commands and then in:
ftp> get text1.txt
As shown:

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 9

SMTP/Email Server Configuration

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Objective:
Create a network as shown below.

Now configure SMTP server


IP Address: 192.168.1.1

Subnet mask is generated according to the Class of IP used.

Default Gateway: Same as IP (192.168.1.1)

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
PC0 Configuration
IP : 192.168.1.2

Default Gateway: Same as of Server IP (192.168.1.1)

PC0 Configuration
IP : 192.168.1.3

Default Gateway: Same as of Server IP (192.168.1.1)

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Email/SMTP Configuration on SMTP Server
In SMTP Server go to Services and select EMAIL.

Now add Domain Name: iak.com

In User Setup
User: Daud

Password: 60

Add other users with their corresponding passwords. Like PC0 & PC1

Configuration of Mail on PC0


DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Configuration of Mail on PC1

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Composing Mail on PC0 and sending it to PC1

Then

Now to check the received Email go to PC1 > Mail Browser and click on the Receive button as
shown below:

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 10

Configuration of VOIP

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Topology
Draw the below topology in Packet Tracer with 2-Routers, 1-Switch and 3-IP Phones.

One Router is for DHCP and the other is for Communication Management Express (CME) which
is used for managing the phone calls.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now configure DHCP Server first
Name one of the router as the “dhcp” and then configure it by using the below commands.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
In the same way configure the CME router by using the following commands as shown in
below figure.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now Switch Configuration
Configure the switch by assigning switch port access to the user defined vlans.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now Power up the IP Phone by clicking it and go to “Config” menu.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Now check the DHCP router binding
Use the below command:

Router# sh ip dhcp binding

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Configuring CME for managing Phone Calls over VOIP Phones.
Note: Use the step wise procedure

Step 1

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Step 2

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Step 3

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Step 4

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 11

Configuration EIGRP Protocol

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Objectives
The objective of this lab is how to configure EIGRP Protocol on Cisco Router

Topology

Show IP EIGRP Neighbours

Result

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Ping PC1 from PC0

“Show IP eigrp traffic” Result

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Information about Routing Tables ( show IP route)

Topology Table (show IP eigrp topology all-links)

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
LAB 12

Network Simulation using Packet Tracer and router


GUI mode

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Device Interface IP Address Subnet Mask Def. Gateway
Se0/0/0 192.168.88.1 255.255.255.0 N/A
Router-0 Se0/0/1 192.168.77.1 255.255.255.0 N/A
Fa0/0 192.168.3.1 255.255.255.0 N/A
Se0/0/0 192.168.66.1 255.255.255.0 N/A
Router-1 Se0/0/1 192.168.77.2 255.255.255.0 N/A
Fa0/0 192.168.4.1 255.255.255.0 N/A
Se0/0/0 192.168.88.2 255.255.255.0 N/A
Router-2
Se0/0/1 192.168.66.2 255.255.255.0 N/A
PC0 Fa0/1 192.168.3.4 255.255.255.0 192.168.3.1
PC1 Fa0/2 192.168.3.3 255.255.255.0 192.168.3.1
PC2 Fa0/1 192.168.4.2 255.255.255.0 192.168.4.1
PC3 Fa0/2 192.168.4.3 255.255.255.0 192.168.4.1

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Task No.1: How to configure Routers

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Task No.2: How to configure Routing Protocols?

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Task No.3: How to configure PCs?

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS
Task No.4: How to check the connectivity (ping)?

1. Click this to select the simulation mode, where we shall simulate the network
and can see the packets visually.
2. Click on this message box to forward packets from source (3) to destination (4).
3. Click on the device from where you will forward packet to destination.
4. Click on the device which you want to select as a destination and want to
forward packets to.

5. Click on this to forward the packets automatically (works like a play button).
6. This will show the result of the simulation, the type of packets, source and
destination, the output weather it is successful or not or in progress.

DAUD WAZIR
COMPUTER COMMUNICATION NETWORKS

You might also like