CN Lab Manual
CN Lab Manual
[DATE]
[COMPANY NAME]
[Company address]
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
Cisco Packet Tracer is a powerful network simulation tool developed by Cisco Systems. It allows users
to create, configure, and troubleshoot complex network topologies in a virtual environment. It is widely
used for educational purposes, especially for students preparing for Cisco certifications like CCNA.
Packet Tracer provides an interactive platform where users can simulate real-world networking
scenarios, understand how different network devices interact, and gain hands-on experience without the
need for physical hardware.
2. Install on Windows:
o Locate the downloaded .exe file and double-click to launch the installer.
o Follow the on-screen prompts, accepting the license agreement and selecting the installation
directory.
o Choose whether to install for "All Users" or "Just for Me" depending on your needs.
o After the installation is complete, click "Finish" to exit the installer.
3. First-Time Setup:
• Upon the first launch, you may be prompted to log in with your Cisco NetAcad credentials.
• After logging in, you'll have full access to the software and can start building network topologies.
WEEK 1
1. Study of different types of network cables, and connectors using a crimping tool (CO1)
Network Cables:
1. Coaxial Cable:
o Description: A single copper conductor at the center, surrounded by a plastic layer,
braided metal shield, and an outer plastic covering.
o Use: Commonly used for cable television and early Ethernet networks.
o Connectors: BNC (Bayonet Neill-Concelman), F-Type.
2. Twisted Pair Cable:
o Description: Consists of pairs of wires twisted together to reduce electromagnetic
interference (EMI).
o Types:
▪ Unshielded Twisted Pair (UTP): Most common in modern networking (e.g.,
Cat5e, Cat6).
▪ Shielded Twisted Pair (STP): Includes a shield to protect from EMI.
o Use: Commonly used in Ethernet networks.
o Connectors: RJ45 (for Ethernet), RJ11 (for telephone).
3. Fiber Optic Cable:
o Description: Uses light to transmit data, providing high-speed transmission over long
distances.
o Types:
▪ Single-mode fiber (SMF): For long-distance communication.
▪ Multi-mode fiber (MMF): For shorter distances.
o Connectors: SC (Subscriber Connector), LC (Lucent Connector), ST (Straight Tip).
Connectors:
1. RJ45:
o Description: An 8-pin connector used primarily for Ethernet networking.
o Use: Terminates twisted-pair Ethernet cables (Cat5e, Cat6).
2. RJ11:
o Description: A 4-pin connector used for telephone lines.
o Use: Connects telephones and modems to the phone network.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
3. BNC:
o Description: A connector used with coaxial cables.
o Use: Often found in older networks, radio, and television.
Crimping Tool:
• Purpose: A crimping tool is used to attach connectors (e.g., RJ45) to the end of network cables.
• Parts:
o Crimping Die: The part that presses the pins into the cable.
o Wire Cutter: For cutting the cable to the desired length.
o Wire Stripper: For removing the insulation from the wires.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
2. Implement the cross-wired cable and straight-through cable using the crimping tool (CO1)
1. Straight-Through Cable:
• Use: Connects different types of devices, such as a computer to a switch or router.
• Wiring Standards: T568A or T568B on both ends.
Steps:
1. Prepare the Cable:
o Cut the cable to the desired length.
o Strip about 1 inch of the outer jacket from both ends of the cable.
2. Arrange the Wires:
o Untwist the pairs and arrange them according to the T568A or T568B standard.
3. Insert Wires into the RJ45 Connector:
o Insert the arranged wires into the RJ45 connector, ensuring each wire is in the
correct slot.
o The flat side of the connector should face upwards.
4. Crimp the Connector:
o Place the RJ45 connector into the crimping tool.
o Squeeze the crimping tool firmly to press the connector pins into the wires.
5. Test the Cable:
o Use a cable tester to ensure all connections are correct and functioning.
2. Cross-Wired Cable:
• Use: Connects similar devices, such as a computer to another computer or a switch to another
switch.
• Wiring Standards: T568A on one end and T568B on the other.
Steps:
1. Prepare the Cable:
o Cut the cable to the desired length.
o Strip about 1 inch of the outer jacket from both ends of the cable.
2. Arrange the Wires:
o On one end, arrange the wires according to the T568A standard.
o On the other end, arrange the wires according to the T568B standard.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 2
Software Required:
• A computer with Windows OS
• Command Prompt
Theory:
Networking commands are essential tools for managing and troubleshooting network connectivity and
performance. These commands help in gathering information about network configurations, testing
network paths, and analyzing network traffic.
Procedure:
1. ipconfig Command
Description: The ‘ipconfig’ command displays the IP address, subnet mask, and default
gateway for all adapters.
Syntax: ipconfig
Example Usage:
• Open the Command Prompt.
• Type ipconfig and press Enter.
• Observe the network configuration details like IP address and default gateway.
2. ipconfig/all Command
Description: The ipconfig/all command provides a detailed view of the IP configuration,
including the MAC address, DNS servers, and DHCP information.
Syntax: ipconfig/all
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
Example Usage:
• In the Command Prompt, type ipconfig /all and press Enter.
• Review detailed information about each network adapter.
Output: Provides detailed IP configuration for all network adapters. (Write your output here)
3. nslookup Command
Description: The nslookup command queries the DNS to obtain the domain name or IP address
mapping.
Syntax: nslookup [hostname]
Example Usage:
• In the Command Prompt, type nslookup [Link] and press Enter.
• Observe the IP address corresponding to the domain name.
Output: Displays the IP address associated with the specified domain name. (Write your output
here)
4. ping Command
Description: The ping command tests the reachability of a host on an IP network and measures
the round-trip time for messages sent from the originating host.
Syntax: ping [hostname or IP address]
Example Usage:
• In the Command Prompt, type ping [Link] and press Enter.
• Observe the reply from the host, including the time taken and packet loss.
Output: Shows whether the target is reachable and provides response times. (Write your output
here)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
5. tracert Command
Description: The tracert command traces the path packets take to reach a network host, showing
each hop along the way.
Syntax: tracert [hostname or IP address]
Example Usage:
• In the Command Prompt, type tracert [Link] and press Enter.
• View the list of routers the packets pass through to reach the destination.
Output: Lists all intermediary routers between the source and destination. (Write your output
here)
6. resmon Command
Description: The resmon command opens the Resource Monitor tool, which displays detailed
information about resource usage, including network activity.
Syntax: resmon
Example Usage:
• In the Command Prompt, type resmon and press Enter.
• In the Resource Monitor window, navigate to the Network tab to view current activity.
Output: Opens the Resource Monitor to monitor network usage in real-time.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 3
4. Hands-on Practice with the Packet Tracer tool with a sample Peer to Peer network connection
(CO1)
Objective:
To establish a peer-to-peer network using Cisco Packet Tracer and verify communication between two
PCs connected directly via a crossover cable.
Software Required:
• Cisco Packet Tracer software
• A computer with Cisco Packet Tracer installed
Theory:
Peer-to-peer (P2P) networking involves direct communication between two or more devices, without
the need for a central server. In this experiment, two PCs will be directly connected using a crossover
cable, allowing them to communicate and share resources.
Procedure:
Step 1: Launch Cisco Packet Tracer
Open the Cisco Packet Tracer application on your computer.
Step 2: Add Network Devices
Add PCs:
• In the bottom left-hand corner of the Packet Tracer interface, click on the “End Devices”
icon.
• Drag and drop two PCs (PC0 and PC1) onto the workspace.
Step 3: Connect the PCs with a Crossover Cable
1. Select a Crossover Cable:
• Click on the “Connections” icon (shaped like a lightning bolt).
• Choose the “Copper Cross-over” cable (represented by a red line).
2. Connect the PCs:
• Click on PC0, select FastEthernet0 port.
• Then click on PC1, and select the FastEthernet0 port to connect them using the crossover
cable.
Step 4: Configure IP Addresses
1. Configure PC0:
• Double-click on PC0 to open its configuration window.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
Result:
The peer-to-peer network was successfully set up using Cisco Packet Tracer. Both PCs were able to
communicate with each other directly through a crossover cable.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 4
5. Hands-on Practise with Packet Tracer tool with a sample static routing (CO1)
Objective:
To configure static routing in a network using Cisco Packet Tracer, enabling routers to communicate
with each other and route traffic between different network segments.
Software Required:
• Cisco Packet Tracer software
• A computer with Cisco Packet Tracer installed
Theory:
Static routing is a process where the network administrator manually adds routes in the routing table.
Unlike dynamic routing, static routing does not require routing protocols and is more secure and less
resource-intensive, but it requires manual configuration and management.
Procedure:
1. Configure IP Addresses on PCs
• PC0:
o Click on PC0.
o Go to the Desktop tab, select IP Configuration.
o Set the IP address to [Link].
o Set the subnet mask to [Link].
o Set the default gateway to [Link].
• PC1:
o Click on PC1.
o Go to the Desktop tab, select IP Configuration.
o Set the IP address to [Link].
o Set the subnet mask to [Link].
o Set the default gateway to [Link].
2. Assign IP Addresses to Router Interfaces
• Router0:
o Click on Router0.
o Go to the Config tab.
o Click on the interface FastEthernet0/0 (connected to PC0).
o Assign IP address [Link] with subnet mask [Link] and turn the interface ON.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
Observation:
• Record the successful communication between the two PCs using static routes configured on the
routers. (Write if ping is successful or not and whether the connection is established or not)
• Note the Type of connection used between Routers and Devices (Serial connection, Fast ethernet
connection, and why crossover cable used between two different devices).
Result:
The static routing was successfully configured, allowing both PCs on different networks to communicate
with each other through the routers.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 5
5. Create three LAN topologies: bus, star, and ring. Assign appropriate IP addresses to devices and
demonstrate basic connectivity.
Instructions:
1. Use Packet Tracer to build bus, star, and ring topologies.
2. Configure IP addresses on devices accordingly.
3. Verify basic connectivity within each topology.
4. Provide a short description of each topology and discuss its pros and cons. (CO1)
Objective:
Design and implement three different LAN topologies (Bus, Star, and Ring) using Cisco Packet Tracer,
assign appropriate IP addresses to devices, and verify basic connectivity within each topology.
Software Required:
• Cisco Packet Tracer software
• A computer with Cisco Packet Tracer installed
Theory:
LAN topologies define the physical and logical layout of a network. Common topologies include Bus,
Star, and Ring, each with distinct characteristics in terms of performance, scalability, and fault tolerance.
1. Bus Topology:
• Description: In a bus topology, all devices are connected to a single central cable (the bus). Data sent
by any device is broadcast to all devices on the network, but only the intended recipient accepts the
data.
Procedure: Build the Bus Topology
1. Set up the Devices:
o Open Packet Tracer and add four PCs (PC0, PC1, PC2, PC3).
o Connect all PCs using a single Coaxial Bus cable.
2. Assign IP Addresses:
o Configure IP addresses for each PC:
▪ PC0: [Link]
▪ PC1: [Link]
▪ PC2: [Link]
▪ PC3: [Link]
o Subnet Mask for all PCs: [Link]
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
3. Verify Connectivity:
o Ping from PC0 to PC1, PC2, and PC3 to check network connectivity.
o Record the results. (Write if ping is successful or not and whether the connection is
established or not)
2. Star Topology:
• Description: In a star topology, all devices are connected to a central hub or switch. The hub/switch
acts as a repeater for data, improving performance.
Procedure: Build the Star Topology
1. Set up the Devices:
o Add a switch/hub and connect four PCs (PC0, PC1, PC2, PC3) to the switch using Copper
Straight-through cables.
2. Assign IP Addresses:
o Configure IP addresses for each PC:
▪ PC0: [Link]
▪ PC1: [Link]
▪ PC2: [Link]
▪ PC3: [Link]
o Subnet Mask for all PCs: [Link]
3. Verify Connectivity:
o Ping from PC0 to PC1, PC2, and PC3 to check network connectivity.
o Record the results. (Write if ping is successful or not and whether the connection is
established or not)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
3. Ring Topology:
• Description: In a ring topology, each device is connected to exactly two other devices, forming a
circular pathway for signals. Data travels in one direction around the ring.
Procedure: Build the Ring Topology
1. Set up the Devices:
o Add four switches and connect four PCs (PC0, PC1, PC2, PC3) and circularly connect them
using Copper Cross-over cables and Copper Straight – through cables between PC and
switch.
2. Assign IP Addresses:
o Configure IP addresses for each PC:
▪ PC0: [Link]
▪ PC1: [Link]
▪ PC2: [Link]
▪ PC3: [Link]
o Subnet Mask for all PCs: [Link]
3. Verify Connectivity:
o Ping from PC0 to PC1, PC2, and PC3 to check network connectivity.
o Record the results. (Write if ping is successful or not and whether the connection is
established or not)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
Observation:
• Record the successful pings in each topology, demonstrating that devices can communicate with
each other. (Write ping statistics of each topology here)
• Note any connectivity issues and how they were resolved. (Write about what problem occurs in ring
topology)
Result:
All three topologies (Bus, Star, and Ring) were successfully implemented using Cisco Packet Tracer.
Basic connectivity was verified by successfully pinging between the devices in each topology.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 6
6. Design and implement a CRC algorithm in C language. Conduct laboratory experiments to test
the CRC implementation with various data strings and polynomials, recording and analyzing the
calculated CRC remainders for each scenario. (CO2)
Objective:
To design and implement a CRC algorithm in the C programming language. The experiment will test
the algorithm with various data strings and polynomial values, recording and analyzing the calculated
CRC remainders.
Introduction:
Cyclic Redundancy Check (CRC) is a widely used error-detecting code that can detect accidental
changes to raw data. It involves treating the data as a polynomial and performing division by a generator
polynomial. This record details the implementation process and the results of testing various scenarios.
Resource Required:
• C compiler (e.g., GCC, Dev C++)
• Text editor/IDE (e.g., Code::Blocks, Visual Studio Code)
• Sample data strings and polynomial values
Methodology:
1. CRC Algorithm Design:
o Implement the CRC algorithm in C by defining functions for:
▪ Generating the CRC polynomial.
▪ Performing binary division to calculate the CRC remainder.
▪ Appending the CRC remainder to the original data.
2. Code Implementation:
#include <stdio.h>
#include <string.h>
void xorOperation(char *dividend, const char *divisor) {
for (int i = 0; i < 4; i++) { // XOR the first 4 bits
dividend[i] = dividend[i] == divisor[i] ? '0' : '1';
}
}
void crcCalculation(char *data) {
char poly[] = "1001"; // Polynomial x^3 + 1 in binary
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
int main() {
char data[20];
return 0;
}
3. Testing Scenarios:
• Prepare different data strings and polynomials to test the algorithm.
• Example data strings: "1101011011", "1011001", "011111", etc.
• Example polynomials: "10011", "1101", "1011", etc.
4. Execution:
• Compile and run the C program for each data string and polynomial.
• Record the CRC remainder obtained from each execution.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
Results:
• Create a table to record the data strings, polynomials, and calculated CRC remainders:
Data String Polynomial CRC Remainder
1101011011 10011 1010
1011001 1101 011
011111 1011 101
(Give your data strings, polynomials, and CRC remainders in the table. Do not copy the same)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 7
8. Create a network topology with three routers (Router A, Router B, and Router C) and connect
each to its respective department subnet. Implement a distance vector routing protocol such as RIP
on all routers to ensure connectivity between the Sales, Marketing, and HR departments.
Instructions:
1. Assign IP addresses to each router interface and department subnet.
2. Configure RIP on all routers to advertise connected networks.
3. Verify routing table entries on each router to ensure interdepartmental communication.
4. Document the configuration steps and provide evidence of successful communication between
departments. (CO3)
Objective:
To configure and implement dynamic routing using RIP in Cisco Packet Tracer, enabling automatic
route sharing between routers for seamless inter-network communication.
Introduction:
RIP (Routing Information Protocol) is a dynamic routing protocol that automatically updates routing
tables between routers in a network.
Resources Required:
• Cisco Packet Tracer software
• Three routers (e.g., Router-PT in Packet Tracer)
• Three PCs (PC-PT in Packet Tracer)
• Ethernet cables for LAN connections (Copper Straight-Through)
• Serial cables for router-to-router connections (Serial DCE)
Methodology:
• Router1:
o Go to Router1, and configure interfaces FastEthernet0/0 and Serial0/0/0 (connected to
Router0) with appropriate IP addresses (e.g., [Link] for LAN, [Link] for Serial).
o Configure Serial0/0/1 (connected to Router2) with another IP (e.g., [Link]).
• Router2:
▪ On Router2, assign IPs to FastEthernet0/0 (e.g., [Link]), and Serial0/0/0 (e.g.,
[Link] connected to Router1).
Displays the RIP routes with an R next to them, indicating that these are routes learned via RIP.
Observation:
1. After configuring RIP on each router, the routing tables automatically update to include networks
connected to neighboring routers.
2. Successful pings between PCs on different networks verify that RIP is correctly propagating
routes across routers. (Write ping statistics of any one connection)
3. RIP dynamically adjusts routes, showing route entries marked with "R" in the routing table,
confirming successful communication across the network without manual static routes. (Write
the routes updated in CLI mode)
Result:
Dynamic routing using RIP was successfully configured, allowing automatic route sharing and enabling
seamless inter-network communication between devices across different networks.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 8
9. Design a network topology representing a university campus with multiple buildings and
routers connecting them. Implement a link-state routing protocol such as OSPF on all routers to
facilitate communication between different buildings.
Instructions:
1. Design the network topology with routers representing each building and appropriate
subnetting for each building.
2. Configure OSPF on all routers to advertise their connected networks and form adjacencies.
3. Verify OSPF neighbor relationships and routing table entries on each router to ensure proper
communication between buildings.
4. Document the OSPF configuration steps and provide evidence of successful routing between
different buildings. (CO3)
Objective:
To configure the OSPF routing protocol in a university campus network to ensure seamless
communication between buildings.
Resources Required:
• Cisco Packet Tracer software
• Routers to represent each building (e.g., Router-PT)
• PCs for testing connectivity
• Switches (if required for LAN connections within buildings)
• Ethernet and Serial cables for connections
Procedure:
1. Design the Topology:
Arrange routers and assign each building a separate subnet:
2. Configure IP Addresses:
o Assign IP addresses to each router’s interface based on the chosen subnet scheme.
o Ensure each PC in the network has an IP address within the assigned subnet.
• Router 1 Configuration:
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 9
10. Design a network topology with a router, a switch, and at least three PCs connected to the switch.
Configure the router to act as a DHCP server and assign IP addresses dynamically to the PCs. Ensure
that the PCs can obtain IP addresses from the DHCP server successfully.
Instructions:
1. Set up the network topology with appropriate connections between the router, switch, and PCs.
2. Configure the router to act as a DHCP server, defining the IP address range, subnet mask, default
gateway, and DNS server (if applicable).
3. Configure the PCs to obtain IP addresses automatically via DHCP.
4. Verify that each PC has been assigned an IP address from the DHCP server and can communicate
with other devices on the network.
5. Document the DHCP configuration steps and provide evidence of successful IP address assignments
to the PCs. (CO3)
Objective
To set up a network topology with a router, switch, and three PCs where the router acts as a DHCP
server to dynamically assign IP addresses to the PCs.
Resources Required
• Cisco Packet Tracer software
• 1 Router
• 1 Switch
• 3 PCs
• Ethernet cables for connections
Procedure
1. Network Topology Setup:
o Connect Router0 to Switch0 using an Ethernet cable.
o Connect PC0, PC1, and PC2 to Switch0 using Ethernet cables.
2. Configuring the Router as a DHCP Server:
o On Router0, go to the Config tab.
o Select FastEthernet0/0 (or the interface connected to the switch), set the IP address to
[Link] and Subnet Mask to [Link], and enable the interface.
o Go to DHCP settings on Router0 and create a DHCP pool with the following settings:
▪ Network Address: [Link]
▪ Subnet Mask: [Link]
▪ Default Gateway: [Link]
▪ DNS Server: Set as required (optional)
CLI commands for configuring the router as a DHCP server:
1. Enter Global Configuration Mode:
enable
configure terminal
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
4. Exclude the Router's IP from the DHCP Pool (so it doesn’t assign [Link] to another
device)
Explanation of Commands:
• ip dhcp pool LAN: Creates a DHCP pool named "LAN" for assigning IP addresses.
• network [Link] [Link]: Defines the network and subnet mask for the DHCP pool.
• default-router [Link]: Sets the default gateway for DHCP clients (router’s IP).
• dns-server [Link] [Link]: Sets the DNS servers (optional).
This configuration enables the router to act as a DHCP server for the connected PCs.
Wireshark is a popular, open-source network protocol analyzer that enables users to capture and analyze
network traffic in real time. It's widely used by network administrators, security analysts, and IT
professionals for troubleshooting, monitoring network performance, and identifying security issues.
Purpose of Wireshark
• Network Troubleshooting: Helps identify network issues, such as packet loss, latency, and network
congestion.
• Security Analysis: Detects potential security threats by analyzing suspicious network traffic.
• Protocol Development: Useful for developers creating or testing network protocols.
• Educational Tool: Allows students and professionals to learn about network protocols and
communication.
o Note: You may see an option to install USBPcap if you need to capture USB traffic. This is
usually optional.
6. Choose Installation Location:
o Choose the destination folder or leave it at the default location.
7. Start Installation:
o Click “Install” to begin installing Wireshark and Npcap.
o Wait for the installation to complete.
8. Launch Wireshark:
o Once installation is complete, you can choose to launch Wireshark immediately.
o Click “Finish” to complete the installation process.
Running Wireshark
• Start Wireshark: Open Wireshark from the Start menu or desktop shortcut.
• Select Network Interface: Choose the network interface to capture packets (e.g., Wi-Fi, Ethernet).
• Capture and Analyze: Click on "Start Capturing" to begin and view captured packets in real-time.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
WEEK 10
11. Capture network traffic using Wireshark and analyze the performance of TCP and UDP in terms
of reliability, packet overhead, and throughput.
Instructions:
1. Simulate various network conditions (e.g., low bandwidth, high latency, and packet loss) using the
simulation tool.
2. Capture network traffic using Wireshark during data transmission.
3. Analyze the captured packets to evaluate the performance of TCP and UDP under different
network conditions.
4. Prepare a report summarizing your findings, including comparisons of reliability, packet
overhead, and throughput between TCP and UDP in each network condition.
5. Provide insights into the advantages and disadvantages of TCP and UDP based on your
observations. (CO4)
Objective
To capture and analyze the performance of TCP and UDP protocols in terms of reliability, packet
overhead, and throughput under real network conditions.
Resources Required
• Wireshark (Network Protocol Analyzer)
• TCP and UDP Applications for generating network traffic (e.g., web browsers for HTTP traffic,
iperf for specific TCP/UDP tests)
• A Computer or Virtual Machine running Wireshark
Theory
TCP (Transmission Control Protocol) is a connection-oriented protocol that ensures reliable data
transmission through acknowledgments and retransmissions. UDP (User Datagram Protocol) is
connectionless and faster, but it does not guarantee delivery. Analyzing these protocols under real-world
conditions helps identify their strengths and weaknesses.
Procedure
1. Set Up the Environment:
o Ensure you have Wireshark installed on your computer.
o Choose applications that utilize TCP and UDP. For instance:
▪ TCP: Web browsers, file transfer applications.
▪ UDP: Streaming applications, online games, or use iperf to generate UDP traffic.
2. Start Wireshark:
o Open Wireshark and select the network interface to capture traffic (e.g., Ethernet, Wi-Fi).
o Click on the "Start Capturing Packets" button.
3. Capture Traffic:
o Run the applications that generate TCP and UDP traffic. For example, open a web page (for
TCP) or stream a video (for UDP).
o Allow some time for traffic to be generated while Wireshark captures the packets.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)
4. Stop Capture:
o Once sufficient data has been captured, stop the packet capture in Wireshark.
5. Apply Filters:
o Use display filters in Wireshark to focus on TCP and UDP traffic:
▪ For TCP: tcp
▪ For UDP: udp
o This helps in analyzing only the relevant packets.
6. Analyze Captured Data:
o TCP Analysis:
▪ Examine TCP packets for key details:
▪ Sequence and acknowledgment numbers
▪ Retransmissions (look for duplicate ACKs)
▪ TCP window size
▪ Packet overhead (header size)
o UDP Analysis:
▪ Observe UDP packets for:
▪ Packet loss (missing packets)
▪ Packet overhead (header size)
o Throughput Measurement:
▪ Measure the amount of data successfully delivered over time for both TCP and UDP:
▪ Use the "Statistics" menu in Wireshark to generate graphs and charts.
▪ Consider using "I/O Graphs" for visual throughput comparisons.
7. Document Findings:
o Record your observations on:
▪ Reliability: Note how TCP handles lost packets versus UDP.
▪ Packet Overhead: Compare the header sizes of both protocols.
▪ Throughput: Summarize the measured throughput for both protocols.
Conclusion
• TCP: More reliable and suitable for applications where accurate data delivery is essential.
• UDP: Better suited for real-time applications where speed is critical and some data loss is acceptable.
ANITS | COMPUTER NETWORKS LAB | CSE (AI &ML, DS)