Computer Network Lab Manual
Computer Network Lab Manual
BACHELOR OF TECHNOLOGY
COMPUTER
NETWORKS
(203105214)
4th SEMESTER
COMPUTER SCIENCE & ENGINEERING DEPARTMENT
Lab
Manual
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
CERTIFICATE
Head Of Department:...........................................
2
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
LIST OF PRACTICALS
Page No
Sr. Date of Date of Marks (out
No Experiment Title Start Completion Sign of 10)
To From
Experiments on Simulation Tools:
(CISCO PACKET TRACER):
To understand environment of
1 CISCO PACKET TRACER to
design simple network and perform
experiments.
3
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Implementation of
SUBNETTING: Design multiple
subnet with suitable number of
8 hosts. Make a plan to assign static
IP addressing across all subnet to
explain implementation of
SUBNETTING.
Routing at Network Layer:
Simulate Static and Dynamic
9 Routing.Protocol
Configuration using CISCO
Packet Tracer.
Experiment on Transport Layer:
Implement echo client server
10
using TCP/UDP sockets.
4
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRATICAL 1
The main purpose of Cisco Packet Tracer is to help students learn the principles of
networking with hands-on experience as well as develop Cisco technology specific skills. Since the protocols
are implemented in software only method, this tool cannot replace the hardware Routers or Switches.
Interestingly, this tool does not only include Cisco products
but also many more networking devices.
Workspace :
1. Logical –
Logical workspace shows the logical network topology of the network the user has
built. It represents the placing, connecting and clustering virtual network devices.
2. Physical –
Physical workspace shows the graphical physical dimension of the logical network. It depicts the scale
and placement in how network devices such as routers, switches and hosts would look in a real
environment. It also provides geographical representation of networks, including multiple buildings,
cities and wiring closets.
Key Features:
• Unlimited devices
• E-learning
• Customize single/multi user activities
• Interactive Environment
• Visualizing Networks
• Real-time mode and Simulation mode
• Self-paced
• Supports majority of networking protocols
• International language support
• Cross platform compatibility
5
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
The devices section of the CPT includes Networks devices, End devices, Components, Connections,
Miscellaneous and Multi-User Connections.
6
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Hub-PT is selected from network devices and placed on the logical Workspace. Three Computers from End-
devices, IP Addresses are allocated to all the three computers as shown in the figure. 10.0.0.1-10.0.0.3 from
class A IP Range is used.
To know whether the network is running send a Packet from one computer to another.
Packet is a small amount of data that is been sent over a network. In cisco packet tracer a packet is located
on the top ribbon bar.
Add simple PDU is the Packet Datagram Unit, select it and click on computer(PC0) that is sending and
another computer(PC2) which is receiving.
7
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
After sending the PDU from all the sources of computers they are able to communicate with each other.
All the Computers are interconnected in a network.
The status of the Packet Transmission can be viewed in the real-time(Shift+R) and also in Simulation
Mode(shift+S).
Here all the computers are communicating with each other.
8
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRACTICAL 2
Experiments of Packet capture tool:
AIM :To understand the features of wireshark as a packet capture tool and understand encapsulation
of information. Also study effect of few network commands
Purpose:
▪ Wireshark is an open-source packet analyser, which is used for education, analysis, software
development, communication protocol development and network troubleshooting.
▪ The main objective of proposed experiment is to give exposure of wire-shark tool to students so
they can learn to monitor transmission packets being send in Wi-Fi and LAN environments.
Setting Up Wireshark
Exercises
2.1 Monitor TCP packets in a LAN connection and record your observations
9
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
No TCP Packets are travelled as the device is not connected to a Local Area Network.
2.2 Monitor TCP packets in a Wi-Fi connection and record your observations
2.4 Monitor UDP packets in a Wi-Fi connection and record your observations
10
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRACTICAL 3
Design a simple network with multiple nodes and connect via generic devices available in library. Perform
simulation and trace communication behavior of specified network devices.
Packet datagrams can also be transferred successful from all the hosts to all the hosts.
11
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
• For this network, 2960-24TT, PT-Empty, 2950T-24 are Compatible with a larger number of
connections, whereas switches like switch-PT switch are not capable containing a large number of
hosts.
• All the packet datagrams are transferring successfully.
Now 3: Use both the device (HUB and SWITCH) for a network and find
out functioning difference between switch and hub.
➢ The packet which is transmitted from PC4 to PC5 using HUB is still
in progress.
➢ The packet which is transmitted from PC0 to PC2 using SWTICH
is successful
Therefore, the main difference between the HUB and SWITCH is the speed of transmission of data.
13
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRACTICAL 4
• Data Link Layer (Error Correction): Write a program to implement error detection
and correction using HAMMING code concept. Make a test rum to input data stream and verify
error correction feature.
Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can
occur when the data is moved or stored from the sender to the receiver. It is a technique developed by
R.W. Hamming for error correction.
Steps:
If the message contains m𝑚number of data bits, r𝑟number of redundant bits are added to it so that m𝑟 is
able to indicate at least (m + r+ 1) different states. Here, (m + r) indicates location of an error in
each of (𝑚 + 𝑟) bit positions and one additional state indicates no error. Since, r𝑟 bits can indicate 2r𝑟
states, 2r𝑟 must be at least equal to (m + r + 1). Thus the following equation should hold
2r ≥ m+r+1 Step 2 − Positioning the redundant bits.
The redundant bits are parity bits. A parity bit is an extra bit that makes the number of 1s either even or odd.
The two types of parity are −
Even Parity − Here the total number of bits in the message is made even.
Odd Parity − Here the total number of bits in the message is made odd.
Each redundant bit, ri, is calculated as the parity, generally even parity, based upon its bit position. It covers
all bit positions whose binary representation includes a 1 in the ith position except the position of ri
Once the receiver gets an incoming message, it performs recalculations to detect errors and correct them.
The steps for recalculation are −
14
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
The decimal equivalent of the parity bits binary values is calculated. If it is 0, there is no error. Otherwise,
the decimal value gives the bit position which has error. For example, if c1c2c3c4 = 1001, it implies that
the data bit at position 9, decimal equivalent of 1001, has error.
The bit is flipped to get the correct message.
for i in range(m):
if(2**i >= m + i + 1):
return i
15
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
def detectError(arr, nr):
n = len(arr)
res = 0
for i in range(nr):
val = 0
for j in range(1, n + 1):
if(j & (2**i) == (2**i)):
val = val ^ int(arr[-1 * j])
res = res + val*(10**i)
return int(str(res), 2)
data = '1011001'
m = len(data)
r = calcRedundantBits(m)
arr = posRedundantBits(data, r)
arr = calcParityBits(arr, r)
print("Data transferred is " + arr)
arr = '11101001110'
print("Error Data is " + arr)
correction = detectError(arr, r)
if(correction==0):
print("There is no error in the received message.")
else:
print("The position of error is ",len(arr)-correction+1,"from the left")
OUTPUT:
16
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRACTICAL 5
Procedure:
Step 1: Take 2 Switches and 6 PC
Step 2: Connect the pc’s to Switch and Switch to Router with copper straight-through wire.
Step 3: Assign ip’s to pc’s accordingly pc0(192.168.1.2), pc1(192.168.1.3) and pc2(192.168.1.4)
Step 4 : Assign ip’s in pc3(192.168.1.6), pc4(192.168.1.7) and pc5(192.168.1.8)
Now divide the network into two virtual Local Area Networks, VLAN1 & VLAN2
VLAN1 PCs: PC1,PC2,PC3
VLAN2 P S: PC0,PC4,PC5
1. We will set access ports that will access specific VLANs. We will do this with “switchport mode
access” command under these interfaces.
2. We will also set the VLAN, that this port will access.
3. After that, we will set the trunk port that will carry multiple VLANs with “switchport mode trunk”
command.
4. Then we will also set this port with “no negotiate” command to prevent negotiation about the port
role.
5. Lastly, we will set the allowed VLANs with “switchport trunk allowed vlan” command on this
trunk and save our configuration.
17
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
The excepted outcome should be like the below picture; the command is do show history after exiting from
config t and then config.
18
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
The excepted outcome should be like the below picture; the command is do show history after exiting from
config t and then config.
The expected outcome after sending packet datagram units, from PC1(vlan1) TO PC5(vlan2) and
19
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PC1 TO PC2 is successful.
20
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRACTICAL 6
Procedure:
Take a wireless router named WRT300N from /Network devices/Wireless devices.
Now, Connect the wireless router0 with End devices such as computers and laptops. Here Unlike every
Other Wired connection do not make wired connections. Instead follow the below steps,
Double-click on the router and go to the graphical user interface section. Where we can allocate Any
classes’/classless IP Addresses.
In GUI, in the wireless section we can configure the SSID, Network mode and Radio Band.
For implementing security on wireless network go to the config section in the router,
where we can implement
Many types of Password methodologies. WPA-PSK,WEP etc.
21
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Now that the router is configured we have to configure our end devices(computers and laptops)
Click on the PC and go to the physical section then turn off the power. Remove the PT-HOST Module
From the bottom and insert WMP300N module at the bottom of the CPU. As shown in the figure.
After this step the PC can be able to connect to wireless internet connections. For that go into desktop section
In the PC then select PC WIRELESS.
22
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Connect to the wireless network, enter the password. Now it is connected to the wireless network.
Proceed with the same step again with another Computer.
Remove the PT-HOST Module and insert WMP300N wireless module to support wireless connections.
Then, go to Desktop/PC-Wireless/ and connect with the same network.
Now that our computers are configured to connect the wireless network. Configure the laptop the same way.
First, turn off the power of laptop and then remove PT-LAPTOP module, drag it on the main menu of
modules, Select WPC300N insert it on to the laptop.
For connecting it to the network follow the same steps as a computer.
/desktop/PC-Wireless. Find the network names LIGHT then click connect, enter WEP Password. Now it’s
connected.
23
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Now all our End-devices are connected to the WRT300N wireless router. To verify the connection.
A PDU(Packet Datagram Unit) has been sent from,
Laptop0 – PC4
PC3 – Laptop0
PC4 – PC3
All the three packet transmissions are successful. We can say we correctly configured the WLAN network.
24
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
PRACTICAL 7
AIM :- Interworking with routers: Design a three or four simple networks (with 3 to 4
hosts) and connect via Router. Perform simulation and trace how routing is done in
packet transmission.
1. Experiment on same subset
2. Perform experiment across the subnet and observe functioning of Router via
selecting suitable pair of source and destination.
Step 1: Setup the router and hosts in CISCO Packet Tracer and assign the IP address to all the hosts
respectively.
● We will give IP address to the hosts and we will only change the subnet ID of all the IP address
because we want all the hosts to remain in the same network.
Subnet Mask of all the end devices are given as follow:
The IP Addresses and the Subnets for the computers are as follows,
25
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
26
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Perform simulation and trace how routing is done by sending a PDU(packet datagram Unit) from PC0-PC2,
PC1-PC0, PC2-PC0 vice-versa.
The transmission of all the Packets from all the sources are successfully transmitted to all the destinations.
27
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
Therefore,
There is no difference in the functioning of router between having same subnet and different subnet.
PRACTICAL 8
28
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
AIM :- Design multiple subnet with suitable number of hosts. Make a plan to
assign static IP addressing across all subnet to explain implementation of
subnetting.
THEORY:
🡺 Subnetting is the practice of dividing up a network into two or more networks. Common advantages
of subnetting include enhancing routing efficiency, network management control, and improving
network security. While these are just a few of the benefits that subnetting provides, they are
the most noticeable after immediately implementing a subnet system.
🡺 This results in the logical division of an IP address into two fields: the network number or routing
prefix and the rest field or host identifier. Addresses help to identify the pieces of hardware
connected to your network. To locate a particular device you would need to organize the IP
addresses in a logical way. This is where subnetting excels as a tool to help you maintain efficiency
across your network.
Configuring routers in two ways as shown above for the individual networks.
As we connected all the devices in the terminal now, Configure the router.
29
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
30
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
31
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
32
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
33
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
34
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
35
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
36
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
37
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
38
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
39
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
40
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
41
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
42
PARUL UNIVERSITY
FACULTY OF ENGINEERING & TECHNOLOGY
COMPUTER NETWORKS (203105255) (4th SEM)
43