CSCE 5580 assignment #1

1 CSCE 5580 assignment #1 Messaging server, 270 points Self signup group are created in canvas Due: Sunday, September 25th, 2022, 11:59 pm Project Goal The aim of this project is to implement a simulator of a messaging server using TCP/IP sockets. You will instantiate node objects (clients) that will connect to a server object via the local host TCP/IP interface, which will then allow inter-node communication. All data communication must go through the server. Project Description Overview You are to create a program that will spawn multiple node objects and threads, as well as a server object and worker threads. The server will use a listening socket to allow nodes to connect to it, and spawn worker threads as needed to allow inter-node communication. The nodes will open a file, and send data to other nodes via the server. The nodes will save all data that was sent to them in the form of output files. Main Class Your main class should instantiate a single server, and a number of nodes between 2 and 255, which it should get from the command line arguments. It should also wait until all nodes are done sending data, before shutting down all the individual nodes, followed by the server, and exiting cleanly. Server Class The server is a single class, which will be instantiated once. It should open a port to allow any number of nodes to connect to it. It can spawn as many threads as needed to perform its function. It should have a global frame buffer (queue), which it can use to store packets to forward them out as they are received. Your server must be able to handle multiple nodes sending data to it at the same time! The server should also have a table; in which it will keep track of which ports have which clients are connected to them. Node Class (Clients) The nodes should connect to the server upon start-up while being recorded in the server table along with its (possibly) temporary TCP port assignment. It is important to note that the communication with the server might not be through the same TCP port that it initially connected to. The nodes are to be numbered, and you should design your code so that we can instantiate between 2 and 255 nodes easily. Every node should open and read an input file (that node generate itself), which contains data that it should send across the network to other nodes (See Files section below). Every node should also create an output file that contains all the data that was sent to it by the other nodes. The nodes should send data to the other nodes via the server. Files Nodes should generate a file that will be named node1.txt, node2.txt, node3.txt, etc. data in nodesi.txt is a random string to send out to other nodes. The following is an example input file for node 1: 2: ABCDEFG 3: 1234567 5: This data will be sent to node 5. In this example, node 1 will send `ABCDEFG` to node 2. You may assume that no node will want to send data to itself. 2 The nodes are also responsible for creating a file, named node#output.txt, which will contain all the data that was sent to it, and who sent that data. Using the previous example file, Node 2 will create `node2output.txt` which will have the line `1: ABCDEFG`. Frame Format You will have to design your own encapsulating frame for this project; it is not sufficient to just send the data across the network and rely on the port number to determine who it was from. The following is a suggested frame format for this project: [SRC][DST][SIZE/ACK] [data] SRC: Source of the frame, 1 byte, 1-255 DEST: Destination of the frame, 1 byte, 1-255 SIZE/ACK: In a data frame, this field has the size of the data in bytes, from 1-255. When the size is 0, the data field is omitted, and this is treated as an ACK. data: The actual Data (1-255 bytes) You may modify the frame format as you see necessary, possibly additional fields), however, the preceding three fields are the bare minimum. There are two options to generate your output data (string, binary format). Project Requirements 1. Language – You are required to implement the project in one of the following programming languages: Java, Python, or C++. IAs will help you with these languages. 2. Environment – Your program must compile and run on the UNT machines. All projects will be graded on the UNT machines. If your project does not compile or run on this system, then your grade will suffer. 3. Build Automation – You are required to employ some sort of build automation for this project. Acceptable formats are GNU make for C++, or Apache Ant for Java. Look into your IDE, there’s a good chance that it will create makefiles or build.xml files for you! 4. Documentation – You need to create a README file that includes the following: • Names of all group members. • How to compile and run your program. • The names of all files in the project and a brief description of their purpose. • Provide a checklist that includes which features are implemented, and which features are missing. The minimum required checklist for this project is below. • A list of all known bugs. Documenting bugs will reduce the corresponding point deduction. 5. Code Style – Source code should be well-organized, follow accepted conventions for that language, and be well-documented with meaningful comments and variable names. Assumptions The following is a list of assumptions you are allowed to make in regards to your program: 1. You are not going to have more than 255 nodes connected at any given time. 2. A single frame of data will not contain more than 255 bytes. 3. No node will attempt to send data to itself. You are not required to provide a GUI of any kind. Output to the console is both acceptable and encouraged. Feature Checklist 3 Include a specification of the frame format in your README. This should include the order of the fields, the byte sizes and acceptable ranges for the fields, and a short description of the function of the field. Include the following checklist in your README. Each item should be marked as complete, missing, or partial. In the case of a partial status, make sure to add a description as to what works and what does not. The following is an example; it is expected that you will change the “Status/Description” column to indicate progress in your project. Feature Status/Description Project Compiles and Builds without warnings or errors Complete The server class Complete The server has a frame buffer and reads/writes appropriately Complete The server allows multiple connections Complete The server learns destinations and doesn’t forward packets to any port except the one required The server acts like a hub Node class Partially Complete – see below Nodes instantiate, and open connection to the server Complete Nodes open their input files and send data to the server Complete Nodes open their output files and save data that they received Partial – They also save flooded frames 4 Extra Credit There is an opportunity to implement extra features in the code in order to get a higher grade. The following is a list of features that can be implemented, as well as their point values if they work properly. NOTE: You cannot receive any extra credit if the above basic requirements are not met! This means that you can’t implement all of the switch extra credit, and have non-working nodes! Description Point Value Backbone Switching: Instantiate two switches, connect them to each other, and have the nodes connect to one or the other. Allow data to be sent between switches. 30 Frame Priority: Add a “high priority” flag to the frame format, and make the switch send that frame first, regardless of its position in the frame buffer. 10 You are allowed to make differing instances of the project to showcase all of these features (e.g. you don’t need one set of code that handles all of these features). If you think of more features, you can receive more extra credit for them, but the ideas have to be submitted for approval, in writing, to the class TA before any extra credit will be given. Note: You will have to demonstrate your implementations to the TAs to receive credit for them! Project Submission Place all of your source code, your build files (makefile or build.xml), and your README, into a directory named “___CSE5580_Project1” and tarball the directory. The tar archive should also be named using the same convention: “___CSE5580_Project1.tar.gz”. Zip files are also acceptable. Submit your archive file to Canvas before the deadline. Please see the class syllabus regarding late assignment policy. Academic Honesty ALL WORK MUST BE YOUR OWN! YOU MUST CITE ANY CONTRIBUTIONS THAT YOU RECEIVE FROM CLASSMATES OR ANY OTHER EXTERNAL SOURCES. This doesn’t include contributions from your group members. All rules in the UNT Academic Honesty Policy strictly apply. 5 Grading The project will be graded according to the following rubric: TOTAL POINTS 270 General Project 50 Build System (Makefile) 10 Clean Exit 5 Frame Format Design 30 Proper naming of directory and tarball 5 Server 70 Accept multiple connections 25 Global Frame Buffer 10 Address Table (clients and their port number) 25 Initial Packet Flood 10 Node 30 Proper instantiation of nodes 5 Generate input file 10 Write output file 10 Only accept frames destined for it 5 Documentation 70 Frame Format Specification 20 Compilation Instructions 10 Useful Comments and Self-documenting variable names 20 Feature Checklist 20 Presentation- video 50 6 Contact Information If you have questions, please send a message through Canvas to the class IA. If this fails for some reason, please send via email or stop by TA during office hours. Sai Akhil Kandukuri, Tuesday 2:00 pm, 5:00 pm, Friday 8:00, 10:00 am, Email: Sai Meghana Gushidi: MW 2:00 to 5:00 pm, Email: Recommended References Sockets: Java All About Sockets: C# Sockets: C++ Practical C++ Sockets: Sockets Tutorial: Multi-process and Multi-Threaded Programming: Java JavaDoc – Thread: Java Threads Tutorial: a-threads-tutorial C++ Introduction to C/Unix Multiprocess Programming: Threads in C++:

Leave a Comment

Your email address will not be published. Required fields are marked *

+1 587-331-9072
We will write your work from scratch and ensure that it is plagiarism FREE, you just submit the completed work.