联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-23:00
  • 微信:codehelp

您当前位置:首页 >> OS程序OS程序

日期:2023-10-17 07:28

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

and confirm successful connections.
5. Check that the server received their usernames and printed them upon connection.
6. Send messages from any client window and verify if they are received by the server and
other clients.
7. In Wireshark, select the message packet from the traffic, check the data or parameters
from the lower-left window, and save the analysis as a backup file. Quit packet capturing.
8. Repeat the above steps, but this time with the UDP chatroom application.
9. After testing UDP, collect the data from the traffic, compare it with the TCP packet
analysis and describe what you understood from the comparison.
10. Prepare all required deliverables and proceed with the submission of your assignment.
See a demo video of my testing in UDP version.
6. Deliverables:
For this assignment submission, prepare a compressed directory named "lastname_studentID"
containing the following five files:
1. lastname_studentID.pdf: This PDF file should include the followings:
a. Student name, ID, and email address.
b. Chatroom section: record one quick video (screen share) to test the chatroom
application for TCP and UDP (must show the server and two or more clients
windows, and simple conversation in the chatroom).
c. Wireshark section: include the following components:
? Analysis description: two or more sentences concluding the analysis or describing
the comparison between TCP and UDP. (e.g., what are the different or similar
parameters in both versions)
? Images: Integrate two screenshots (one for TCP and one for UDP) from
Wireshark to support your analysis description.
2. tcp_server.py: This Python file should contain the code for the TCP server.
3. tcp_client.py: This Python file should contain the code for the TCP client.
4. udp_server.py: This Python file should contain the code for the UDP server.
5. udp_client.py: This Python file should contain the code for the UDP client.
Ensure that these files are organized within the "lastname_studentID" directory and then
compress the entire directory into a single compressed file (e.g., a ZIP or TAR file) for
submission.
7. Late Submission:
? Late assignments will be accepted for up to two days after the due date, with weekends counting
as a single day; the late penalty is 20% of the available marks per day. Lateness is based on the
time the assignment is submitted.
? Extensions will be granted only by your course instructor. If you have serious medical or
compassionate grounds for an extension, you must take supporting documentation to the
Academic Counselling unit of your faculty, who will contact the instructor.
8. Struggling!! Let’s Meet:
Feel free to seek assistance during any consultancy hours. However, for implementation issues, I
recommend the following hours:
o Gad Gad, Mon 12:00 - 02:00, https://westernuniversity.zoom.us/j/94758934201 Pass:347367
o Eyad Gad, Fri 11:00 - 01:00, https://westernuniversity.zoom.us/j/92072575085 Pass: 3357
Not available during these hours or need immediate help? reach out to me

版权所有:留学生编程辅导网 2021,All Rights Reserved 联系方式:QQ:99515681 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。