0% found this document useful (0 votes)
33 views2 pages

Ex. No. 4

The document outlines the installation process for Wireshark and tcpdump, along with steps to observe data transferred in client-server communication using TCP and UDP. It includes detailed instructions for downloading, installing Wireshark, setting up a client-server application, capturing packets, and applying filters for analysis. The result confirms successful installation and observation of TCP/UDP communication.

Uploaded by

cseaiml251258
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views2 pages

Ex. No. 4

The document outlines the installation process for Wireshark and tcpdump, along with steps to observe data transferred in client-server communication using TCP and UDP. It includes detailed instructions for downloading, installing Wireshark, setting up a client-server application, capturing packets, and applying filters for analysis. The result confirms successful installation and observation of TCP/UDP communication.

Uploaded by

cseaiml251258
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Ex. No.

4 Installation of Wire shark, tcpdump and Observation of data transferred

Date:

Aim:

To install Wire shark, tcpdump and to observe the data transferred in client-server communication
using TCP and UDP.

Procedure:

Step 1: Download Wireshark

1. Open the web browser and go to the official Wireshark website:


https://www.wireshark.org/download.html
2. Click on the appropriate download link based on the operating system:
o Windows (.exe)

Step 2: Install Wireshark on Windows

1. Run the downloaded .exe installer.


2. Click Next to proceed through the setup wizard.
3. Choose components to install (default selection is usually fine).
4. If prompted, install Npcap (this is required for packet capturing).
5. Continue with the installation and click Finish.
6. Restart your computer if needed.

Step 3: Set Up the Client-Server Communication

Before capturing packets, you need a client and a server application that communicate using UDP or TCP. If
you don’t have an existing application, you can use simple tools like:

 Netcat (nc) for basic TCP/UDP communication


 Python socket programming for creating a test client-server

Example using Python:

TCP Client-Server Code

Run this server script first:

import socket

server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)


server_socket.bind(("0.0.0.0", 12345)) # Listen on port 12345
server_socket.listen(1)

print("Server is listening...")
conn, addr = server_socket.accept()
print(f"Connection established with {addr}")

data = conn.recv(1024)
print(f"Received: {data.decode()}")
conn.send(b"Hello from server")

conn.close()
server_socket.close()

Then run this client script:


import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(("127.0.0.1", 12345)) # Connect to the server
client_socket.send(b"Hello from client")

response = client_socket.recv(1024)
print(f"Received from server: {response.decode()}")

client_socket.close()
For UDP, modify socket.SOCK_STREAM to socket.SOCK_DGRAM and use sendto()/recvfrom().

Step 4: Start Wireshark and Capture Packets


1. Open Wireshark.
2. Select the appropriate network interface (e.g., Wi-Fi, Ethernet, or Loopback if testing locally).
3. Click Start Capture (blue shark fin icon).

Step 5: Apply Filters for TCP/UDP Traffic


Once packets start flowing, filter the communication:
 TCP filter:
tcp.port == 12345

 UDP filter:
udp.port == 12345
This ensures that we only see relevant packets.

Step 6: Identify TCP/UDP Packets


Look for:
1. TCP Packets:
o SYN, SYN-ACK, ACK (3-way handshake)
o PSH, ACK (data transfer)
o FIN, ACK (connection termination)
2. UDP Packets:
o No handshake, just direct data transfer
Click on a packet and inspect the Packet Details Pane to see:
 Source & Destination IP/Port
 TCP flags (SYN, ACK, FIN, etc.)
 UDP payload

Step 6: Stop Capture and Analyze Data


 Click the Stop button (red square icon).
 Right-click on a packet → Follow TCP Stream (for TCP) or Follow UDP Stream (for UDP) to see full
data exchange.
 Save the capture (.pcap file) for later analysis.

Result:
Thus Wireshark was installed and TCP/UDP communication was captured and observed by applying filters.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy