0% found this document useful (0 votes)
4 views

CSCI333_Assignment_I

The assignment for CSCI 333 focuses on socket programming, requiring students to create a TCP server and client application using Python or C. It consists of two tasks: a basic TCP server/client implementation and a multi-client chat server with authentication, both emphasizing hands-on experience with real-time data exchange and structured communication protocols. Students must submit source code, screenshots, and a README file by the deadline of February 14, 2025.

Uploaded by

Yelnur
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

CSCI333_Assignment_I

The assignment for CSCI 333 focuses on socket programming, requiring students to create a TCP server and client application using Python or C. It consists of two tasks: a basic TCP server/client implementation and a multi-client chat server with authentication, both emphasizing hands-on experience with real-time data exchange and structured communication protocols. Students must submit source code, screenshots, and a README file by the deadline of February 14, 2025.

Uploaded by

Yelnur
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CSCI 333 – Computer Networks – Spring 2025

Prof. Zohaib Latif, Prof. Sain Saginbekov, Prof. Shinnazar Seytnazarov, Prof. Dimitrios Zorbas

Assignment I: Socket Programming Application


This assignment is worth 7% of the total grade

Submission Deadline: Friday 14/02/2025, 8pm


It is important to start working on the assignment as soon as possible!

Objective:
The goal of this assignment is to help you gain hands-on experience with socket programming
by creating a specific network application using Python or C. By completing this assignment,
you will:

- Understand the basics of TCP socket communication.


- Be able to develop a practical client-server application.
- Learn to handle multiple client connections and implement real-time data exchange.
- Learn how to implement structured communication protocols.

Task A: Basic TCP Server and Client (30%)


1. Implement a Python/C program for the TCP server.
The server should:
- Listen on a specific port.
- Accept a connection from a single client.
- Receive a message from the client and print it to the console.
- Send a response message back to the client (e.g., Hello user!)
2. Implement a Python/C program for the TCP client.
The client should:
- Connect to the server.
- Allow the user to input a message.
- Send the message to the server.
- Print the response received from the server.
3. Include comments in your code to explain key parts of the implementation.
4. Test the program on your local machine and provide screenshots showing
(mandatory even if you did not complete all tasks):
- The server starting and accepting a connection.
- The client sending and receiving messages.

Task B: Multi-Client Chat Server with Authentication (70 %)


1. Extend the server to support multiple clients simultaneously using threading.
Each client should:
- Connect to the server.
- Authenticate with a unique username and password (you may assume that the
username/password is already stored at the server).
- The server should:
- Validate client credentials before allowing access.
- Broadcast incoming messages from one client to all other connected clients in
CSCI 333 – Computer Networks – Spring 2025
Prof. Zohaib Latif, Prof. Sain Saginbekov, Prof. Shinnazar Seytnazarov, Prof. Dimitrios Zorbas

real time.
- Prepend usernames to messages before broadcasting (e.g., "[Alice]: Hello").

2. Implement a secure mechanism for storing and verifying user credentials on the
server.
- Store credentials in a file or use a simple database (e.g., SQLite).
- Ensure that passwords are hashed before storage.
3. Add functionality to handle the following:
- Graceful disconnection of clients (e.g., when a client closes the application with a
keyboard interrupt).
- Server-side logging of messages exchanged between clients, including
timestamps and usernames.
- Error handling for socket operations (e.g., connection errors, invalid input).
4. Test the program with at least three clients connected to the server. (mandatory
even if you did not complete all tasks)
Provide screenshots showing:
- Clients authenticating successfully.
- Multiple clients connecting to the server.
- Messages being exchanged and broadcasted.

Submission Guidelines:
1. Submit a single ZIP file containing:
a) Source code for both the client and server programs with filenames
firstname_lastname_task1_client.py and firstname_lastname_task1_server.py.
The same for task 2.
b) Screenshots of your program in action (firstname_lastname_task1_client.jpg
etc.)
c) A README file explaining how to run the programs and details of the features
implemented.
2. Ensure your code is well-structured and includes meaningful comments.

Notes:
- You are encouraged to discuss concepts with peers but must complete the implementation
individually.
- Plagiarism will result in a zero score for the assignment.
- You can use either Python or C. No other languages are acceptable.
- Write on Piazza if you face technical issues or need clarification.

You might also like