COMS3200-无代写
时间:2024-05-17
The University of Queensland
School of Electrical Engineering and Computer Science (EECS)
Semester One, 2024
COMS3200
Computer Networks I Assignment 2
Due: 3:00 pm 24th May 2024
Marks: 100
Weight: 25% of your final grade.
Version: 1.2
*Updates are marked as red
COMS3200 Assignment 2 2024
100 total marks, 25% overall course mark
Due: 15:00 24 May 2024
1. Preface
1.1. Notes
• This document is subject to change for the purpose of clarification. Changes made since the
original release will be highlighted in red.
• Please post any questions on the course Ed stem page.
• It is strongly recommended that all programming tasks are done in Python 3.9
1.2. Revision History
• Version 1.1: remove readme files, clarification on invalid commands.
2. Part A: Wireshark Questions (20 marks total)
This part is worth 20% of the assignment. This part covers Wireshark questions related to the Network
and Link Layer Protocols. Submit your answers to the quiz for Assignment 2 under the Assessment on
the Blackboard. You need to show your workings for all the questions in a report (e.g., the place where
you find the related information for a question). Marks may be withheld if the report with explanation
is not provided. There is no time limit to submit these answers and multiple resubmissions are
permitted. Note that only the last submitted attempt will be marked.
3. Part B: Programming (80 marks total)
This assignment involves building a multi-threaded chat system in Python3 using sockets and other
libraries (e.g., threading libraries). The problem is divided into two scenarios as follows:
1. Scenario 1: A server with one channel and multiple users.
2. Scenario 2: A server with multiple channels and multiple users.
Scenario 2 is an extension of scenario 1, hence, we will be repurposing some of the functions developed
for scenario 1 in the scenario 2. Along with some common requirements, each scenario will have some
scenario specific requirements. We will be using the same server and client python file for both the
scenarios. However, the config files will be different.
The recommended version is Python 3.9. We will provide you with code templates on the course
blackboard, and you are not allowed to use any other third-party library which is not included in the
code templates. Fulfill the requirements from the descriptions in function documentations.
3.1. Multi-thread chat Scenario 1: One channel, multiple users (40
marks).
You must implement a server program that can support concurrent communication between multiple
clients within a single channel. The specifics of channel such as channel name, channel capacity, and
channel port will be specified in an external config file.
Once in a channel, a client can send messages to other clients in the channel. A client will be identified
by his/her unique username. Your client and server programs must rely on socket and multithreading
libraries in Python. You may use any transport layer protocol, but it is highly recommended you use
TCP.
3.1.1. Functional Requirements
The server must be able to run by the following command:
where is the configuration file name (e.g., config1.txt) for the scenario 1.
The server configuration file must follow the following format: channel < channel_name > < channel_port>
Where is the name of the channel, is the port that the channel should
use, and is the maximum number of users who can be active at once within the
channel, respectively; for example, channel uqcyber 44444 5.
The client must be able to run by the below command:
where is the port of the channel and is the name which should be used to identify
the client in the channel (Note: should be unique in the channel). It’s not very common in
the real world for the clients to know the channel’s port. For simplicity, we assume that the client knows
the channel’s port.
The below requirements must be met:
• The channel must operate on a socket (it should not use ephemeral port).
• Channel names cannot contain a number or any special characters.
• Each channel’s capacity must be at most five.
If the configuration file is missing, invalid or not specified, then the server process should exit
immediately with status code 1 (Note: specifying the channel capacity more than five also renders the
config file invalid). Similarly, if the client cannot connect to the server due to malformed arguments or
an invalid port number, then the client process should also exit immediately with status code 1 (This
includes non-unique usernames).
Once the server is running, it will accept incoming client connections. If there’s space in the channel
(the number of clients is less than the channel capacity), the client gets accepted in the channel and
below message is displayed to the stdout of every client in the channel:
And the below is displayed to the server’s stdout:
Where

essay、essay代写