Prepared By: Computer Network Lab Manual
Prepared By: Computer Network Lab Manual
PEO2: To adapt to evolving technologies and tools for serving the society.
Conduct of Experimental work: Thirty marks is distributed among all the experiments in the lab
courses
Internal Assessments:Two Internal Assessments tests are conducted each carrying five marks based
on the lab experiments within the lab
S.No Experiments
Module I
Course Outcomes
Demonstratetheuseofdifferentnetworkcablingcomponentsand devices
AnalysisperformanceofLANandwirelessLAN
Illustratebasicnetworksutilitiesanddemonstrateclientserver communication.
Demonstrateworkingofroutingalgorithms.
Performpacketcaptureanalysisthepacketcontents.
LAN ADAPTERS: - A LAN adapter is a device used to allow a compu ter to interface
with a network. Many computers may have some sort of LAN adapter already
installed, but others may require a special installation, which is accomplished by
adding a network interface card to the system or possibly connecting the adapter
to a USB port. Most networks that are used in an office or home environment are
known as local area
to it and then transmits the message only to the device for which the message
was meant. This makes the switch a more intelligent device than a hub (which
receives a message and then transmits it to all the other devices on its network).
The network switch plays an integral part in most modern Ethernet local area
networks (LANs).
HUB : - A special type of network device called the hub can be fo und in many
home and small business networks. Hub is a small rectangular box, often made of
plastic that receives its power from an ordinary wall outlet. A hub joins multiple
computers (or other network devices) together to form a single network segment.
Routers – A router is a device like a switch that routes data packets based on their
IP addresses. The router is mainly a Network Layer device. Routers normally
connect LANs and WANs and have a dynamically updating routing table based on
which they make decisions on routing the data packets. The router divides the
broadcast domains of hosts connected through it.
Computer Network Lab
1. Coaxial Cables
Coaxial cables contain a c entre conductor and a metal shield insulated by a plastic
layer placed in between. The metal shield in coaxial cables blocks any elements or
interferences from the outside.
In a coaxial cable, the outer layer, known as sheath, protects the cable from
physical damage. Meanwhile, the metal shield protects the cable from any
external interference, and the insulation between the metal shield and the
conductor protects the conductor – the core of the coaxial cable.
Coaxial cable conductors carry electromagnetic signals and can come either in
single - core or multi - core models. While a single - core coaxial cable has only one
central metal, multi - core cables have many metal wires.
STP cables consist of coloured wires twisted around one another, forming pairs.
Usually, shielded twisted pair cables are composed of four colourful pairs of wires
wrapped with metal sh ields and a singular plastic sheath.
Fibre optic cables can be single - mode fibre or multi - mode fibre. SMF cables
support longer distances, while MMF cables carry more data.
Computer Network Lab
Types of cabling
Standard Cabling:
1. 10BaseT and 100BaseT are most common mode of LAN. You can use UTP
category-5
cable for both modes.
2. A straight cable is used to connect a computer to a hub
Cross Cabling:
A cross cable is used to connect 2 computers directly (with ONLY the UTP cable).
It is also used
Computer Network Lab
4. Set the RJ45 connector (with the cable) on the pliers, and squeeze it tightly.
5. Make the other side of the cable (we call this side B -side) in the same way.
6. After you made it, you don't need to take care of the direction of the cable.
IO connector crimping: Run the full length of Ethernet cable in place,
from
endpoint to endpoint,
making sure to leave excess.
At one end, cut the wire to length leaving enough length to work, but not too
much
excess. Strip off about 2 inches of the Eth ernet cable sheath.
Align each of the colored wires according to the layout of the
jack. Use the punch down tool to insert each wire into the jack.
Repeat the above steps for the second RJ45jack.
Testing the crimped cable using a cable tester:
Step 1 : Skin off the cable jacket 3.0 cm long cable stripper up to cable11
Step 2: Untwist each pair and straighten each wire 190 0 1.5 cm long.
Step 3 : Cut all the wires
Step4:Insert the wires into the RJ45connector right white orange left brown the
pins facing up
Step 5 : Place the connector into a crimping tool, and squeeze hard so that the
handle reaches its
full swing.
Step6:Use a cable tester to test for proper continuity
Result:
Cable Crimping, Standard Cabling and Cross Cabling, IO connector crimping
and testing the
crimped cable using a cable tester are done successfully
Computer Network Lab
Procedure:
(a) Install the network card:
Disconnect all cables connected to the computer and open the case. Locate an
available PCI slot (white slots) and insert the network card and secure the card with
the screw that came with it. Once the adapter has been installed and secured close the
computer case, connect all the cables and turn it on.
After installing the adapter driver it should be working find, now let’s configure the
card for use on a network.
If necessary, click on the +sign next to Network Adapters to expand the list.
Ensure that there is no yellow exclamation mark (!) next to the Network Adapter.
This indicates a possible problem with the card or configuration.
Double click on your network driver (e.g. NE2000 Compatible).
If you do not see this message or if there is no Network Adapter displayed, then
your Ethernet card will probably need configuring.
Result:
Installation and configuration of Wired and Wireless (remotely) NIC and transfer
files between systems in LAN and Wireless LAN between two systems in a LAN
have been done successfully
Computer Network Lab
CONFIGURE STEPS:
1. Open the Control Panel from the Windows® icon in the lower left corner of
your monitor.
In the Control Panel window, make sure View by is set to Category.
2. Click Network and Internet.
Computer Network Lab
5. On the Networking tab, clear Clients for Microsoft Networks and File and
Printer Sharing for Microsoft Networks. These services can cause intermittent
connection problems with USRP™ radios. To configure the IP address, double-
click Internet Protocol Version 4 (TCP/IPv4).
6. On the General tab, the default setting is typically set to Obtain an IP address
automatically.
Computer Network Lab
7. NOW press Windows + R and PING the system and you can share the files also
MODULE : II
1. Implement sliding window protocol
To implement the sliding window protocol in a simulated network environment, we'll use
Cisco Packet Tracer to demonstrate the basic concepts. The sliding window protocol is a
technique used in computer networks for reliable and efficient data transmission between
sender and receiver.
int main()
{
intw,i,f,frames[50];
for(i=1;i<=f;i++)
{
if(i%w==0)
{
printf("%d\n",frames[i]);
printf("Acknowledgement of above frames sent is
received by sender\n\n");
}
else
printf("%d ",frames[i]);
}
if(f%w!=0)
printf("\nAcknowledgement of above frames sent is received
by sender\n");
return 0;
}
OUTPUT:
Enter window size: 2
Enter 5 frames: 1
2
3
4
5
With sliding window protocol the frames will be sent in the following manner (assuming
no corruption of frames)
After sending 2 frames at each stage sender waits for acknowledgement sent by the
receiver
12
Acknowledgement of above frames sent is received by sender
Computer Network Lab
34
Acknowledgement of above frames sent is received by sender
5
Acknowledgement of above frames sent is received by sender
--------------------------------
Process exited after 11.14 seconds with return value 0
Press any key to continue . . .
In this example, we'll simulate a simple network with two devices: a sender and a receiver. We'll
use the sliding window protocol to transmit data from the sender to the receiver.
2. go back N Protocol
#include<stdio.h>
int main()
{
intwindowsize,sent=0,ack,i;
printf("enter window size\n");
scanf("%d",&windowsize);
while(1)
{
for(i = 0; i<windowsize; i++)
{
printf("Frame %d has been transmitted.\n",sent);
sent++;
if(sent == windowsize)
break;
}
printf("\nPlease enter the last Acknowledgement
received.\n");
scanf("%d",&ack);
if(ack == windowsize)
break;
else
sent = ack;
}
return 0;
}
OUTPUT :
enter window size
7
Frame 0 has been transmitted.
Frame 1 has been transmitted.
Frame 2 has been transmitted.
Frame 3 has been transmitted.
Frame 4 has been transmitted.
Computer Network Lab
Frame 5 has been transmitted.
Frame 6 has been transmitted.
--------------------------------
Process exited after 10.15 seconds with return value 0
Press any key to continue . . .
CONFIGURE STEPS:
1.Open the Control Panel from the Windows® icon in the lower left corner of
your monitor.
In the Control Panel window, make sure View by is set to Category.
2.Click Network and Internet.
Computer Network Lab
5.On the Networking tab, clear Clients for Microsoft Networks and File
and Printer Sharing for Microsoft Networks. These services can cause
intermittentconnection problems with USRP™ radios. To configure the IP
address, double- click Internet Protocol Version 4 (TCP/IPv4).
6.On the General tab, the default setting is typically set to Obtain an IP
addressautomatically.
Computer Network Lab
7.NOW press Windows + R and PING the system and you can share the files also
Computer -2 AfterPing
Computer Network Lab
1. Open Cisco Packet Tracer: Launch Cisco Packet Tracer on your computer.
2. Add Devices: Drag and drop a switch from the device list onto the workspace. You can add
multiple switches if you want to create a larger network.
3. Connect Devices: Use the appropriate cables to connect the devices. You can connect PCs to
the switch using Ethernet cables. Drag cables from the available ports on the switch to the
Ethernet ports on the PCs.
4. Configure IP Addresses: Right-click on each PC and select 'Configure' to set their IP
addresses. Ensure that each PC has a unique IP address within the same subnet. For example,
you can use the subnet 192.168.1.0/24 and assign IP addresses like 192.168.1.1, 192.168.1.2,
etc., to each PC.
5. Test Connectivity: Once you've configured the IP addresses, you can test connectivity
between the PCs by using the 'Command Prompt' or 'Terminal' in the PCs to ping each other.
6. Optional: If you want to configure VLANs or any other advanced settings, you can do so by
accessing the switch's configuration interface. Right-click on the switch and select 'CLI' or
'Console' to access the command-line interface (CLI) of the switch.
7. Save Configuration: Once you're satisfied with your network setup, save your project in Cisco
Packet Tracer.
Computer Network Lab
2b. let's create a basic local area network (LAN) using both a hub and a
switch in Cisco Packet Tracer. We'll use four nodes (PCs) to keep it
simple. Here are the steps:
1. Open Cisco Packet Tracer: Launch Cisco Packet Tracer on your computer.
2. Add Devices: Drag and drop a switch and a hub from the device list onto the workspace. You
can find them under the "Connectivity" section.
3. Connect Devices to the Hub and Switch: Connect two PCs to the hub and the remaining two
PCs to the switch. To do this, select the appropriate cable type (Ethernet straight-through cable
for switch connections and Ethernet crossover cable for hub connections) and drag from the
available ports on the devices to the Ethernet ports on the PCs.
4. Configure IP Addresses (Optional): You can optionally configure IP addresses for the PCs to
enable communication between them. Right-click on each PC, select 'Configure,' and set their
IP addresses. Ensure that each PC has a unique IP address within the same subnet.
5. Study the Network: You can study the behavior of both the hub and the switch in this setup.
Hubs operate at the physical layer of the OSI model and forward data to all devices connected
to them, whereas switches operate at the data link layer and forward data only to the device it
Computer Network Lab
is intended for. You can observe the differences in traffic handling between the hub and the
switch by monitoring the traffic flow and collision rates.
6. Test Connectivity: If you've configured IP addresses, you can test connectivity between the
PCs by using the 'Command Prompt' or 'Terminal' in the PCs to ping each other.
7. Optional: You can also try adding more nodes or configuring VLANs to further study network
segmentation and traffic isolation.
8. Save Configuration: Once you're satisfied with your network setup, save your project in Cisco
Packet Tracer.
We'll create a network with a switch, a hub, and multiple PCs to demonstrate broadcast and
collision domains.
1. Open Cisco Packet Tracer: Launch Cisco Packet Tracer on your computer.
2. Add Devices: Drag and drop a switch, a hub, and several PCs onto the workspace.
3. Connect Devices: Connect the PCs to both the switch and the hub. PCs connected to the
switch should be connected using Ethernet straight-through cables, while PCs connected to the
hub should use Ethernet crossover cables.
4. Study Broadcast Domains:
The switch creates separate broadcast domains for each port. Since a switch forwards
traffic only to the port where the destination device is connected, broadcast packets
Computer Network Lab
sent from one PC are not forwarded to all other PCs connected to the switch. Each PC
connected to the switch is in its broadcast domain.
However, the hub forwards all incoming packets to all connected devices, so all PCs
connected to the hub are in the same broadcast domain.
5. Study Collision Domains:
In Ethernet networks, collision domains represent the set of devices whose frames could
collide with each other. Collisions occur on shared media segments, such as those
connected to hubs.
With a switch, each port is in its collision domain, meaning collisions are limited to the
devices connected to that port. Since a switch separates collision domains by default,
there are no collisions between devices connected to the switch.
However, all devices connected to the hub share the same collision domain. When
multiple devices transmit data simultaneously, collisions can occur, leading to
performance degradation.
6. Test Connectivity and Observations:
Configure IP addresses on the PCs and test connectivity between them.
Observe that broadcast traffic from a PC connected to the hub is received by all other
PCs connected to the hub, while broadcast traffic from a PC connected to the switch is
received only by the intended destination.
Monitor the network traffic using Packet Tracer's simulation mode to observe collisions
occurring on the hub-connected PCs.
7. Save Configuration: Once you're done studying the broadcast and collision domains, save
your project in Cisco Packet Tracer.
Wireshark to examine Ethernet packets and ARP (Address Resolution Protocol) packets. Here's
how you can do it:
1. Install Wireshark: If you haven't already, download and install Wireshark from the official
website: https://www.wireshark.org/.
2. Start Wireshark: Open Wireshark on your computer.
3. Select Network Interface: When you start Wireshark, it will ask you to select a network
interface to capture packets. Choose the appropriate interface for your network connection
and click on "Start" to begin capturing packets.
4. Capture Packets: Wireshark will start capturing packets on the selected interface. You'll see a
list of captured packets in the main window.
5. Filter for Ethernet Packets: To filter for Ethernet packets, type "eth" in the display filter box at
the top of the Wireshark window. This will filter the captured packets to only show Ethernet
frames.
6. Filter for ARP Packets: To filter for ARP packets, type "arp" in the display filter box. This will
filter the captured packets to only show ARP packets.
7. Analyze Packets: You can now examine the captured Ethernet and ARP packets in Wireshark.
Click on a packet in the list to view its details in the packet details pane below. You can analyze
various aspects of the packets, such as source and destination MAC addresses, source and
destination IP addresses, ARP request and reply messages, etc.
8. Stop Capturing: Once you're done examining packets, you can stop the packet capture by
clicking on the "Stop" button in Wireshark.
9. Save Capture: If you want to save the captured packets for further analysis or reference, you
can save the capture file by clicking on "File" > "Save As" and choosing a file format (e.g.,
pcap).
To study the performance of the CSMA/CD (Carrier Sense Multiple Access with Collision
Detection) protocol, we can simulate a network environment using tools like Cisco Packet
Tracer or Wireshark. Unfortunately, Packet Tracer does not provide direct support for
simulating CSMA/CD behavior explicitly. However, we can use Wireshark to analyze network
traffic and infer the behavior of CSMA/CD.
Computer Network Lab
Here's how you can study the performance of CSMA/CD using Wireshark:
1. Setup: Create a small network topology in Packet Tracer with multiple nodes (PCs or laptops)
connected via a hub or a shared medium like Ethernet. Ensure that the devices support
Ethernet connectivity.
2. Capture Packets: Open Wireshark on a computer connected to the network. Start capturing
packets on the network interface connected to the network.
3. Generate Traffic: Initiate data transfers between different nodes in the network. You can use
various methods to generate traffic, such as file transfers, pings, or continuous data streams.
4. Analyze Packets: Analyze the packet capture in Wireshark. Look for instances of collision
events. In a CSMA/CD environment, collisions occur when two or more devices attempt to
transmit data simultaneously, leading to data corruption. You can identify collision events by
observing packets with a high number of retransmissions, or packets with error flags indicating
collisions.
5. Study Performance Metrics: Measure the performance of the CSMA/CD protocol by
analyzing key metrics such as throughput, latency, and collision rates. Throughput refers to the
rate at which data is successfully transmitted across the network. Latency measures the time
taken for a packet to travel from the source to the destination. Collision rates indicate the
frequency of collisions occurring in the network.
6. Adjust Parameters: Experiment with different network parameters, such as the number of
nodes, data transmission rates, and network topology, to observe how they affect the
performance of CSMA/CD.
7. Draw Conclusions: Based on your observations, draw conclusions about the effectiveness of
the CSMA/CD protocol in managing network traffic and minimizing collisions. Consider factors
such as network load, congestion, and the number of active nodes in the network.
Computer Network Lab
MODULE : IV
1. Install & configure network devices routers
1. Choose a Router: Select a router suitable for your network requirements. Consider factors
such as the size of your network, desired features (e.g., wireless connectivity, VPN support), and
budget.
2. Physical Installation:
Unpack the router and its accessories.
Place the router in a central location for optimal coverage.
Connect the router to a power source using the provided power adapter.
Connect the router to your modem using an Ethernet cable if you're setting up an
internet connection.
3. Connect Devices:
Connect your devices (computers, printers, etc.) to the router using Ethernet cables or
via Wi-Fi if the router supports wireless connectivity.
4. Access Router Configuration:
Open a web browser on a connected device.
Enter the router's IP address in the browser's address bar. The default IP address is often
printed on a label on the router or provided in the router's manual. Common IP
addresses include 192.168.0.1 or 192.168.1.1.
Computer Network Lab
Log in to the router's administration interface using the default username and password.
This information is also provided in the router's manual.
5. Configure Network Settings:
Once logged in, you can configure various network settings such as:
WAN (Wide Area Network) settings for connecting to the internet.
LAN (Local Area Network) settings including IP address, subnet mask, and DHCP
(Dynamic Host Configuration Protocol) settings.
Wireless network settings (if applicable) including SSID (network name), security
mode, and password.
Port forwarding, firewall settings, and other advanced configurations as needed.
6. Save Configuration:
After making changes, be sure to save the configuration settings. This is usually done by
selecting a "Save" or "Apply" button within the router's configuration interface.
7. Test Connectivity:
Once configuration is complete, test connectivity by accessing the internet from
connected devices and verifying that they can communicate with each other on the local
network.
8. Update Firmware:
Check for firmware updates for your router and install them if available. Firmware
updates often include bug fixes, security patches, and performance improvements.
9. Secure Your Router:
Change the default login credentials to something more secure.
Enable WPA2 or WPA3 encryption for Wi-Fi networks.
Disable remote administration if not needed.
Consider enabling additional security features such as MAC address filtering or guest
networks.
g. Configure RIP/OSPF
2B. Connect two or three LAN’s via a router. Trace how routing happens via Simulation,
and study the working of router:
2D. Demonstrate static routing and dynamic routing for given topology:
Configure static routes on routers to manually specify the next-hop IP address for remote
networks.
Alternatively, configure dynamic routing protocols such as RIP or OSPF to allow routers to
dynamically learn and share routing information.
Verify routing functionality by sending packets between devices on different networks and
observing how they are routed.
2F. Create subnets, Configure Host IP, Subnet Mask, and Default Gateway in a LAN:
Define the subnetting scheme and assign IP addresses to devices within each subnet.
Computer Network Lab
Configure the subnet mask and default gateway on each device according to the subnet they
belong to.
Verify connectivity between devices within the same subnet.
By following these steps, you can effectively design, configure, and test various network
scenarios in Cisco Packet Tracer, gaining practical experience with IP addressing, routing,
subnetting, DHCP, and routing protocols.
3. Use Wireshark to
3A. analyze IP Datagram and IP fragmentation received during the execution of
trace route command.
3A. Analyze IP Datagram and IP Fragmentation Received During the Execution of Trace
Route Command:
1. Start Wireshark on your computer and select the network interface connected to the network
where you want to capture traffic.
2. Open the command prompt or terminal on your computer and execute the trace route
command to a destination IP address. For example:
Computer Network Lab
3. Wireshark will start capturing packets on the selected network interface. Filter the captured
packets to display only IP traffic by typing "ip" in the filter box.
4. Analyze the captured packets to observe the IP datagrams exchanged during the trace route
command execution. You'll see ICMP Time Exceeded messages generated by routers along the
path, indicating the route taken by packets to reach the destination.
5. Look for IP fragmentation by examining packets with the "Fragmentation" flag set. IP
fragmentation occurs when packets exceed the Maximum Transmission Unit (MTU) of a
network segment and need to be fragmented into smaller packets for transmission.
3B. Run Ping Command and Examine ICMP Packets Using Wireshark:
1. Start Wireshark on your computer and select the network interface connected to the network
where you want to capture traffic.
2. Open the command prompt or terminal on your computer and execute the ping command to
a destination IP address. For example:
3. Wireshark will start capturing packets on the selected network interface. Filter the captured
packets to display only ICMP traffic by typing "icmp" in the filter box.
4. Analyze the captured packets to observe ICMP Echo Request and Echo Reply messages
exchanged during the ping command execution. The Echo Request messages are sent by your
computer, and the Echo Reply messages are generated by the destination host.
5. Examine the timestamps and sequence numbers of ICMP packets to calculate round-trip times
(RTT) between your computer and the destination host.
Computer Network Lab
MODULE : V
1. Use wireshark to
a. Examine UDP and TCP ports and handshake segments
b. Use packet tracer to configure DHCP server, DNS server, SMTP server
1A. Examine UDP and TCP Ports and Handshake Segments using Wireshark:
1. Start Wireshark on your computer and select the network interface connected to the network
where you want to capture traffic.
2. Apply filters to display only UDP or TCP traffic. Type "udp" or "tcp" in the filter box and press
Enter. This will filter the captured packets to display only UDP or TCP packets.
3. Analyze the captured packets to observe UDP and TCP port numbers in the packet details
pane. Look for source and destination port numbers to identify the communication endpoints.
4. To examine TCP handshake segments, focus on TCP connections. Look for packets with the
SYN (synchronize), SYN-ACK (synchronize-acknowledgment), and ACK (acknowledge) flags set.
This sequence represents the TCP three-way handshake used to establish connections.
5. Pay attention to the sequence and acknowledgment numbers exchanged during the
handshake to understand the flow of data between the client and server.
1B. Use Packet Tracer to Configure DHCP Server, DNS Server, SMTP Server:
Computer Network Lab
Below are examples of simple client-server programs implemented in both C and Java.C
Client-Server Program: