exp_4_ccn
exp_4_ccn
–4
EXPERIMENT TITLE: Study of TCP and UDP using Wireshark
BRIEF THEORY:
27
TCP Packet Structure:-
28
STEPS FOR THE TCP PROTOCOL
1. Given that Wireshark is running, upload a text file on the given website to catch packets.
2. Search TCP on Wireshark, followed by IP address of sender (your PC) and receiver (server).
You should see the following results.
29
3. Analyze SYN-ACK message.
30
Fig 4: Details of FIN-ACK message
TCP Connection Termination Process
TCP uses a four-step termination process:
i. Client sends FIN:
• Flags: FIN=1, ACK=0
• The client signals that it has finished sending data.
ii. Server responds with FIN-ACK:
• Flags: FIN=1, ACK=1
• The server acknowledges the client's FIN and also indicates that it will close the
connection soon.
iii. Client sends ACK:
• Flags: ACK=1
• The client acknowledges the server's FIN.
iv. Connection closes:
• The connection is terminated, but the system may wait for a timeout period
(TIME_WAIT state) to ensure all packets have been received.
31
6. Analyzing throughput.
2. Find the IP address using the UDP protocol and find the message in the datagram.
32
• ytes): Identifies the sender's port.
• Destination Port (2 bytes): Identifies the recipient's port.
• Length (2 bytes): Specifies the total size of the UDP packet (header + data).
• Checksum (2 bytes): Used for error detection (optional in IPv4, mandatory in IPv6).
ii. Data (Variable Size)
• Contains the actual payload sent over the network.
• Size depends on the UDP length field and the MTU (Maximum Transmission Unit).
DISCUSSION:
• TCP establishes a reliable connection through a three-way handshake and terminates using
the FIN-ACK process.
• It ensures sequential and error-free data transmission by utilizing acknowledgments and
sequence numbers.
• UDP, being connectionless, is significantly faster but does not guarantee packet delivery or
order.
• TCP is ideal for applications requiring reliability (e.g., web browsing, emails), whereas UDP
is preferred for low-latency applications such as streaming and gaming.
• Wireshark analysis demonstrated TCP’s structured control mechanisms through various
flags, while UDP’s minimalistic approach enables rapid data transmission.
CONCLUSION:
This experiment provides insight into the core differences between TCP and UDP by examining
real-time network traffic. TCP is chosen for applications requiring reliability, whereas UDP is
favoured for high-speed, low-latency communication.
33