322 CN practical
322 CN practical
1|Page
COMPUTER SCIENCE AND ENGINEERING
The objective of this CN Practical Book is to provide a comprehensive source for all the
experiments included in the CN laboratory course. It explains all the aspects related to every
experiment such as: basic underlying concept and how to analyze a problem. It also gives
sufficient information on how to interpret and discuss the obtained results.
We acknowledge the authors and publishers of all the books which we have consulted while
developing this Practical book. Hopefully this CN Practical Book will serve the purpose for
which it has been developed.
2|Page
COMPUTER SCIENCE AND ENGINEERING
CERTIFICATE
Mr./Ms......................................................................................................................................
2024-2025.
Head Of Department:...........................................
3|Page
COMPUTER SCIENCE AND ENGINEERING
4|Page
COMPUTER SCIENCE AND ENGINEERING
7. Internetworking with
routers: Design a three or
four simple networks (with 3
to 4 hosts) and connect via
Router. Perform simulation
and trace how routingis done
in packet transmission.
1: Experiment on same
subnet 2: Perform Experiment
across the subnet and
observe functioning ofRouter
via
selecting suitable pair of Source and
destination.
8. Implementation of
SUBNETTING: Design
multiple subnet with suitable
number of
hosts. Make a plan to assign
staticIP addressing across all
subnet to explain
implementation of
SUBNETTING.
9. Routing at Network Layer:
Simulate Static and Dynamic
Routing Protocol Configuration using
CISCO Packet Tracer.
10. Experiment on Transport
Layer:Implement echo client
server using TCP/UDP sockets
5|Page
COMPUTER SCIENCE AND ENGINEERING
EXPERIMENT NO: 1
AIM: Experiments on Simulation Tools: (CISCO PACKET TRACER): To understand
environment of CISCO PACKET TRACER to design simple network and perform
experiments.
1.1 Purpose:
The main objective of the proposed experiment is to give exposure of numerous simulation
devices to students such that student can actually design various network topologies in real-
6|Page
COMPUTER SCIENCE AND ENGINEERING
7|Page
COMPUTER SCIENCE AND ENGINEERING
EXPERIMENT NO: 2
Aim : To understand the features of wireshark as a packet capture tool and
understand encapsulation of information. Also study effect of few network
commands
Theory :
Wireshark is a network packet analyzer. A network packet analyzer presents captured packet
data in as much detail as possible. You could think of a network packet analyzer as a
measuring device for examining what’s happening inside a network cable, just like an
electrician uses a voltmeter for examining what’s happening inside an electric cable (but at a
higher level, of course).
In the past, such tools were either very expensive, proprietary, or both. However, with the
advent of Wireshark, that has changed. Wireshark is available for free, is open source, and is
one of the best packet analyzers available today.
Advantages of Wireshark:
1. Comprehensive Protocol Support: Wireshark supports hundreds of protocols, making it
useful for a wide variety of network troubleshooting tasks. It can analyze and capture both
wired and wireless network traffic, providing in-depth insights.
2. Detailed Packet Inspection: It allows users to examine packets in great detail, including
headers and payloads, helping to identify and troubleshoot network issues at a granular level.
3. Free and Open Source: Wireshark is free to use, and its open-source nature means that it is
continuously updated by the community, with many plugins and add-ons available.
Disadvantages of Wireshark:
1. Complexity for Beginners: While powerful, Wireshark can be overwhelming for beginners,
as interpreting network traffic and applying proper filters requires a deep understanding of
networking protocols.
2. Performance Issues with Large Traffic Volumes: When capturing large amounts of network
traffic, Wireshark can consume significant system resources, leading to performance issues
on machines with limited processing power.
3. Security Risks: Wireshark captures network traffic, which can include sensitive
information. If not used securely, it could expose passwords or other confidential data.
8|Page
COMPUTER SCIENCE AND ENGINEERING
9|Page
COMPUTER SCIENCE AND ENGINEERING
10 | P a g e
COMPUTER SCIENCE AND ENGINEERING
11 | P a g e
COMPUTER SCIENCE AND ENGINEERING
Conclusion: Wireshark is a powerful tool for capturing and analyzing network packets,
helping to understand data encapsulation across various protocol layers. Using network
commands alongside Wireshark provides insights into how different commands impact
network traffic and packet flow.
12 | P a g e
COMPUTER SCIENCE AND ENGINEERING
EXPERIMENT NO: 3
Introduction:
This practical explores the behavior and configuration of generic networking
devices like routers and switches using CISCO Packet Tracer, a versatile
network simulation tool. It provides hands-on experience in designing, testing, and
troubleshooting networks, laying a strong foundation in networking concepts and
protocols.
A simple network with multiple nodes and connect via generic devices available in
library.
In computer networks, many different network devices are used. These devices used
in computer networks has different characteristics. Each of them provides a specific
role.
Basically, these network equipment’s are:
• Hubs
• Bridges
• Layer Two Switches
• Multilayer Switches
• Routers
• Modems
• Repeater
• Firewall
Hub :is a very simple network device that is used in LANs. It is basically a multiport
repeater. Hubs do not decide anything and forwards any traffic to all of the ports. So, they are
not smart devices. They have multiple ports that connects different network equipment’s in
the same network.
Bridge - A bridge is a network device that connects two or more LANs (local area
networks) to form a larger LAN. Network bridging refers to the process of
aggregating networks.
13 | P a g e
COMPUTER SCIENCE AND ENGINEERING
14 | P a g e
COMPUTER SCIENCE AND ENGINEERING
Modems - The name modem means modulator demodulator. A modem connects our
computer to a standard phone line or to our cable, which allows us to send data or
receive data.
Program datagrams can also be transferred successful from all the hosts to all the hosts.
15 | P a g e
COMPUTER SCIENCE AND ENGINEERING
CONCLUSION: Here we have studied the, behavior of generic devices used for
networking of CISCO PACKET TRACER done successfully.
16 | P a g e
COMPUTER SCIENCE AND ENGINEERING
EXPERIMENT NO: 4
AIM: 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.
Introduction:
The Hamming Code method is a network technique designed by R.W. Hamming, for
damage and error detection during data transmission between multiple network
channels. The Hamming Code method is one of the most effective ways to detect single-
data bit errors in the original data at the receiver end.
Theory:
All bit positions that are power of 2 are marked as Parity bits (1,2,4,8,16…..)
Remaining bits are for data
7 Bits
D7 D6 D5 P4 D3 P2 P1
Rules:- The value of parity bit is determined by the sequence of bits that is alternatively
checks and skips.
1101
Sende Receive
r r
D7 D6 D5 P4 D3 P2 P1
For P1:- Check 1 bit, skip 1 bit, check 1 bit, skip 1 bit (1,3,5,7)
For P2:- Check 2 bits, skip 2 bits, check 2 bits, skip 2 bits (2,3,6,7)
For P4:- Check 4 bits, skip 4 bits, check 4 bits, skip 4 bits (4,5,6,7)
17 | P a g e
COMPUTER SCIENCE AND ENGINEERING
P1 D3 D5 D7 P2 D3 D6 D7 P4 D5 D6 D7
P1 1 0 1 P2 1 1 1 P4 0 1 1
P1=0(Even Parity) P2=1(Odd Parity) P4=0(Even Parity)
• Detecting Error
Consider Hamming
Code D7 D6 D5 P4
D3 P2 P1
At receiving end bits are (1,3,5,7) , (2,3,6,7) and (4,5,6,7) are checked for
every parity. if P1 = 0, P2 = 0, P4 = 0 then No Error
If any one parity bit is 1 then there is an error.
•Correcting Error
An error is located by forming a 3 bit no. out of 3 parity checks
•A 7bit Hamming Code is received as 1011011. Assume even parity and state whether the
received code is correct or wrong. If wrong locate the bit in error.
D7 D6 D5 P4 D3 P2 P1
1)Detecting Errors:-
Step 1:- Analyzing Parity bits
P1-> 1,3,5,7
Odd Parity So error exists We put P1 = 1
18 | P a g e
COMPUTER SCIENCE AND ENGINEERING
Program :
19 | P a g e
COMPUTER SCIENCE AND ENGINEERING
OUTPUT :
Conclusion: Here we have studied that, program to correct or detect error using hamming
code done successfully.
20 | P a g e
COMPUTER SCIENCE AND ENGINEERING
EXPERIMENT NO: 5
AIM : Virtual LAN: Simulate Virtual LAN configuration using CISCO
Packet Tracer Simulation.
Introduction:
VLAN - A virtual local area network (VLAN) is a virtualized connection that connects
multiple devices and network nodes from different LANs into one logical network.
A virtual LAN (VLAN) is a logical overlay network that groups together a subset of
devices that share a physical LAN, isolating the traffic for each group. A LAN is a group
of computers or other devices in the same place -- e.g., the same building or campus -- that
share the same physical network.
Switch#config terminal
Switch(Config)#Vlan 10
Switch(Config—Vlan)#name HR
Switch(Config—Vlan)#Vlan 20
Switch(Config—Vlan)#name IT
Switch(Config—Vlan)#int fa0/1
Switch(Config—Vlan)#switchport
mode access Switch(Config—
Vlan)#switchport access vlan 10
Switch(Config—Vlan)#int fa0/2
Switch(Config—Vlan)#switchport
mode access Switch(Config—
Vlan)#switchport access vlan 10
Switch(Config—Vlan)#int fa0/3
Switch(Config—Vlan)#switchport
mode access Switch(Config—
Vlan)#switchport access vlan 20
Switch(Config—Vlan)#int fa0/4
Switch(Config—Vlan)#switchport
mode access Switch(Config—
Vlan)#switchport access vlan 20
Switch(Config—Vlan)#int fa0/5
Switch(Config—Vlan)#switchport
mode trunk Router Configuration”
Continue with the configuration
dialog: Yes Router>en
Router>Conf t
Enter the configuration commands end with CNTL/Z
Router(Config)# int fa0/0
Router(Config-if)#no
shutdown Some
Router(Config-if)# int
fa0/0.10
Router(Config-subif)#
encapsulation dot1q 10
Router(Config-subif)# ip add 192.168.1.1 255.255.255.0
Router(Config-subif)# int fa0/0.20
Router(Config-subif)# encapsulation
dot1q 20int
CONCLUSION: Here we have studied the, Simulation of the Virtual LAN configuration
using
22 | P a g e
COMPUTER SCIENCE AND ENGINEERING
EXPERIMENT NO: 6
Introduction:
In this practical, we will configure a Wireless Local Area Network (WLAN) using CISCO
Packet Tracer. WLANs enable devices to connect and communicate wirelessly via radio
transmissions, providing flexibility and mobility within the network.
ADVANTAGES –
• Mobility: WLAN allows users to move around a specific area while staying
connected to the internet.
• Flexibility: WLANs allow nodes to communicate within radio coverage without
restrictions.
• Cost: WLANs are generally less expensive to install and maintain than wired LANs.
• Ease of use: WLANs are easy to use and require little new information to learn.
• Robustness: WLANs can handle disasters better than wired networks, which
often break down.
DISADVANTAGES –
• Interference: Wireless networks are vulnerable to interference from external
factors like dust storms, fog, radiation, and radio signals.
• Security: WLANs are less secure than wired networks.
• Bandwidth: WLANs have lower bandwidth than wired networks due to radio
transmission limitations.
• Speed: WLANs are slower than wired networks due to lower bandwidth and
higher error rates.
• Reliability: Wireless connections can be less reliable than wired connections
due to signal degradation from distance, interference, and obstacles
23 | P a g e
COMPUTER SCIENCE AND ENGINEERING
A) Static
B) Dynamic
24 | P a g e
COMPUTER SCIENCE AND ENGINEERING
PRACTICAL- 7
Serial Transmission:
In Serial Transmission, data-bit flows from one computer to another computer in
bi-direction. In this transmission, one bit flows at one clock pulse. In Serial
Transmission, 8 bits are transferred at a time having a start and stop bit.
Serial Transmission
Parallel Transmission:
In Parallel Transmission, many bits are flow together simultaneously from one
computer to another computer. Parallel Transmission is faster than serial transmission
to transmit the bits. Parallel transmission is used for short distance.
Parallel Transmission
25 | P a g e
COMPUTER SCIENCE AND ENGINEERING
7.1:
7.2:
26 | P a g e
COMPUTER SCIENCE AND ENGINEERING
PRACTICAL- 8
Introduction To Subnetting:
When a bigger network is divided into smaller networks, to maintain security, then that is
known as Subnetting. So, maintenance is easier for smaller networks. For example, if we
consider a class A address, the possible number of hosts is 224 for each network, it is
obvious that it is difficult to maintain such a huge number of hosts, but it would be quite
easier to maintain if we divide the network into small parts.
Uses of Subnetting:
The network can be divided into two parts: To divide a network into two parts, you need to
choose one bit for each Subnet from the host ID part.
27 | P a g e
COMPUTER SCIENCE AND ENGINEERING
• For Subnet-2: The first bit chosen from the host id part is one and the range
will be from (193.1.2.100000000 till you get all 1’s in the host ID part
i.e,193.1.2.11111111).
Introduction to Subnetting:
Subnetting is a combination of two words i.e. Sub and Netting. Here Sub word means
Substitute and netting word means Network. The Substitute Network created for a function to
happen is known as Subnetting.
29 | P a g e
COMPUTER SCIENCE AND ENGINEERING
purposes.
EXAMPLE:
Conclusion: Here we studied to Design multiple subnets with suitable number of hosts
successfully.
30 | P a g e
COMPUTER SCIENCE AND ENGINEERING
PRACTICAL- 9
Routing is the process of selecting and defining paths for IP-packet traffic within or between
networks as well as the process of managing network traffic overall..
Routing is a concept of layer 3 (network layer). Routing is the process of discovering the best
path for one network to another. The best path is selected based on metric and administrative
distance.
Layer 3
According to the OSI layer concept, routing, or best path selection, takes place on Layer
3 and is based on the logical address.
Static routing uses preconfigured routes to send traffic to its destination, while dynamic
routing uses algorithms to determine the best path.
31 | P a g e
COMPUTER SCIENCE AND ENGINEERING
Routing can be classified into three categories: Static Routing. Default Routing. Dynamic
Routing.
In packet-switching networks, such as the Internet, routing selects the paths for Internet
Protocol (IP) packets to travel from their origin to their destination. These Internet routing
decisions are made by specialized pieces of network hardware called routers.
Uses of Routers
32 | P a g e
COMPUTER SCIENCE AND ENGINEERING
Types of Routers
The following are different types of routers that are used by individuals as well as
enterprises:
1. Edge router
• Also known as a gateway router, it is a specialised router that acts as an intermediary
between different networks. It resides at the edge of a network.
• Edge ensures connectivity of its network with wide area network (WAN), internet or
external networks.
• For connectivity with remote networks, Edge uses the network protocol .
• Edge routers have ethernet ports as inputs to connect with the internet and have
multiple outputs for connecting additional routers.
2. Wireless router
It is a device that acts as a router as well as a wireless access point.
Such routers provide access to private computer networks or the internet.
Based on the model, it can function in either a wired local area network, wireless-only LAN
or a mix of the wired and wireless network.
These routers have one or two USB ports that can be connected to a device and used as a
shared resource on the network.
3. Virtual router
It is a software-based framework with the same function as physical routers.
These routers run on commodity servers and are packaged either alone or with other network
functions.
However, they increase the reliability of a network through virtual redundancy protocol.
4. Distribution router
It is a router in the local area network of a single organization.
Also known as an interior router, it receives data from Edge router via a wired connection
and it sends this to the end user.
This is usually done through Wi-Fi.
33 | P a g e
COMPUTER SCIENCE AND ENGINEERING
CONCLUSION:
Here we have done to simulate Static and Dynamic Routing Protocol Configuration using
CISCO Packet Tracer successfully.
34 | P a g e
COMPUTER SCIENCE AND ENGINEERING
PRACTICAL- 10
Transport Layer
o The transport layer is a 4th layer from the top.
o The main role of the transport layer is to provide the communication services directly
to the application processes running on different hosts.
o The transport layer provides a logical communication between application processes
running on different hosts. application processes use the logical communication
provided by the transport layer to send the messages to each other.
o The transport layer protocols are implemented in the end systems but not in the
network routers.
o A computer network provides more than one protocol to the network applications. For
example, TCP and UDP are two transport layer protocols that provide a different set
of services to the network layer.
What is E-mail?
35 | P a g e
COMPUTER SCIENCE AND ENGINEERING
E-mail is defined as the transmission of messages on the Internet. It is one of the most
commonly used features over communications networks that may contain text, files, images,
or other attachments. Generally, it is information that is stored on a computer sent through a
network to a specified individual or group of individuals.
FTP
o FTP stands for File transfer protocol.
o FTP is a standard internet protocol provided by TCP/IP used for transmitting the files
from one host to another.
o It is mainly used for transferring the web page files from their creator to the computer
that acts as a server for other computers on the internet.
DNS
An application layer protocol defines how the application processes running on different
systems, pass the messages to each other.
HTTPS
HTTPS is an abbreviation of Hypertext Transfer Protocol Secure. It is a secure extension
or version of HTTP. This protocol is mainly used for providing security to the data sent
between a website and the web browser. It is widely used on the internet and used for secure
communications. This protocol uses the 443 port number for communicating the data.
36 | P a g e
COMPUTER SCIENCE AND ENGINEERING
37 | P a g e
COMPUTER SCIENCE AND ENGINEERING
Conclusion: Here we have done Routing using Transport Layer with Application Layer.
38 | P a g e