CS3357A Assignment #2: Building Two Chatroom Applications
Using TCP and UDP
1. Assignment Purpose:
The purpose of this assignment is to expand on your network/socket programming skills by
building a chatroom application that uses both TCP and UDP protocols. Additionally, you'll
analyze network traffic using Wireshark. No need to implement GUI,
2. Assignment Description:
You will develop two versions of the chatroom application: one using TCP and the other using
UDP. Each version should have the following features:
2.1.Common Features (Both TCP and UDP):
? Accept multiple client connections.
? Allow clients to send messages to the server.
? Broadcast messages from one client to all other connected clients.
? Handle client disconnections gracefully (without crashing the server).
2.2.TCP Version:
? Use TCP for communication between the server and clients.
? Implement the code in the provided template files: tcp_server.py for the server and
tcp_client.py for the client.
2.3.UDP Version:
? Utilize UDP for communication between the server and clients.
? Implement the code using the provided template files: udp_server.py for the server and
udp_client.py for the client.
? Ensure that the server can correctly identify the source client of each received message in
the UDP protocol.
In Wireshark software, capture network traffic while running TCP (running `tcp_server.py` &
`tcp_client.py`) and UDP (`udp_server.py` & `udp_client.py`) versions of your chatroom
application. You should capture packets sent and received during chatroom interactions. Then
analyze the captured packets using Wireshark to understand the differences between TCP and
UDP in terms of packet structure, parameters and other relevant network characteristics.
3. Resources Requirements:
? Install Python and the necessary Python package manager (e.g., Anaconda or pip).
? Install Wireshark software (https://www.wireshark.org/)
? Download the provided GitHub repository (www.github.com/eyadgad/CS3357_A2), which
contains template files for both the TCP and UDP versions of the chatroom application.
4. Rubric:
This assignment is out of 30 marks. Marks will be distributed over the required basic features for
both the server and the client.
? The server successfully accepts multiple client connections (TCP/UDP). 5 marks
? The server successfully identifies client’s username from each message (TCP/UDP). 5 marks
? The server broadcasts each received message to all other clients (TCP/UDP). 4 marks
? The client can connect to the server (TCP/UDP). 4 marks
? The client can send messages to the server (TCP/UDP). 4 marks
? The client receives messages from the server and display them (TCP/UDP). 4 marks
? Demonstrating the difference in Wireshark Analysis (TCP/UDP). 4 marks
5. Successfully Done Coding!! Let’s Test:
1. Open Wireshark and select the "loopback traffic capture" interface for packet capture.
2. Open multiple windows (e.g., 3) for executing the Python files.
3. Run tcp_server.py in one window and verify that the server is ready to accept
connections.
4. In the other windows, run tcp_client.py
版权所有:留学生编程辅导网 2021,All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。