Programming Assignment 0

Similar documents
Programming Assignment 1

Programming Assignment 1

Programming Assignment 2

Program Assignment 2

3 Threadsafe Bounded List Wrapper Library Monitor

Project Introduction

Shell Project Part 1 (140 points)

COMP 321: Introduction to Computer Systems

Homework 2: Programming Component SCALABLE SERVER DESIGN: USING THREAD POOLS TO MANAGE AND LOAD BALANCE ACTIVE NETWORK

Systems Programming/ C and UNIX

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.0) Network Programming using C

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall Programming Assignment 1 (updated 9/16/2017)

Assignment 1: Plz Tell Me My Password

Project #1: Tracing, System Calls, and Processes

MP 1: HTTP Client + Server Due: Friday, Feb 9th, 11:59pm

Lab 03 - x86-64: atoi

Final Programming Project

Introduction to Supercomputing

Shell Project, part 3 (with Buddy System Memory Manager) ( points)

CSE Fall Project 1: Password Management

Task 2: TCP Communication

OPERATING SYSTEMS ASSIGNMENT 2 SIGNALS, USER LEVEL THREADS AND SYNCHRONIZATION

CS 455 / Computer Networks Fall Using an Echo Application to Measure TCP Performance Due: THURSDAY, October 2, 2014 (1pm)

Assumptions. GIT Commands. OS Commands

CSSE 460 Computer Networks Group Projects: Implement a Simple HTTP Web Proxy

CS4516 Advanced Computer Networks. Program 1 {February 4, 2013} 70 points

CS168 Programming Assignment 2: IP over UDP

Your submitted proj3.c must compile and run on linprog as in the following example:

Homework 2: Translating between the ER and relational models Due at 5pm on Wednesday, April 25

ECE 2400 Computer Systems Programming, Fall 2018 PA2: List and Vector Data Structures

Homework 1: Programming Component Routing Packets Within a Structured Peer-to-Peer (P2P) Network Overlay VERSION 1.1

Lab Assignment 3 for ECE374

COMP90015: Distributed Systems Assignment 1 Multi-threaded Dictionary Server (15 marks)

CNT5505 Programming Assignment No. 4: Internet Packet Analyzer (This is an individual assignment. It must be implemented in C++ or C)

CS 344/444 Spring 2008 Project 2 A simple P2P file sharing system April 3, 2008 V0.2

CpSc 1011 Lab 5 Conditional Statements, Loops, ASCII code, and Redirecting Input Characters and Hurricanes

CS 390 Software Engineering Lecture 5 More Git

2 Initialize a git repository on your machine, add a README file, commit and push

CNIT 127: Exploit Development. Ch 3: Shellcode. Updated

ICSI 516 Fall 2018 Project 1 Due October 26th at 11:59PM via Blackboard

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

P2: Collaborations. CSE 335, Spring 2009

Section 1: Tools. Kaifei Chen, Luca Zuccarini. January 23, Make Motivation How... 2

Lab 2: Threads and Processes

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

Operating Systems, Assignment 2 Threads and Synchronization

Introduction to computer networking

HY-457 Assignment 2. Objectives:

CS 3214 Final Exam. To be considerate to your fellow students, if you leave early, do so with the least amount of noise.

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

CS 118 Project Phase 2 P2P Networking

HW 1: Shell. Contents CS 162. Due: September 18, Getting started 2. 2 Add support for cd and pwd 2. 3 Program execution 2. 4 Path resolution 3

CSC209 Review. Yeah! We made it!

COE 518 Operating Systems. Lab 10

Cosc 242 Assignment. Due: 4pm Friday September 15 th 2017

Version Control Systems

KMIP 64-bit Binary Alignment Proposal

ERRS: Homework 4 Scalability

Tizen/Artik IoT Practice Part 4 Open Source Development

Assignment pts

CS155: Computer Security Spring Project #1

CS344/444 Spring 2007 Project 1 Instant Messaging Client and Server

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.1) Sockets and Server Programming using C

New York University Computer Science Department Courant Institute of Mathematical Sciences

CIS 505: Software Systems

P2P Programming Assignment

Project #1 Exceptions and Simple System Calls

Project phase 1 Scanner front-end assigned Tuesday 2 September, due Tuesday 16 September

: Distributed Systems Principles and Paradigms Assignment 1 Multithreaded Dictionary Server

CS 4410, Fall 2017 Project 1: My First Shell Assigned: August 27, 2017 Due: Monday, September 11:59PM

Tools for software development:

git Version: 2.0b Merge combines trees, and checks out the result Pull does a fetch, then a merge If you only can remember one command:

CDA3101 Project 1: MIPS Assembler Due 2/5. I. Purpose

162 HW2. David Culler, Arka Bhattacharya, William Liu. September 2014

CS3516 Computer Networks. Program 3 {October 27, 2014} 55 points

Tutorial 2 GitHub Tutorial

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2016 Programming Assignment 1 Introduction The purpose of this

Computer Systems A Programmer s Perspective 1 (Beta Draft)

Revision control. INF5750/ Lecture 2 (Part I)

CS 3214, Fall 2015 Malloc Lab: Writing a Dynamic Storage Allocator Due date: November 16, 2014, 11:59pm

Git and GitHub. Dan Wysocki. February 12, Dan Wysocki Git and GitHub February 12, / 48

Module 3: Hashing Lecture 9: Static and Dynamic Hashing. The Lecture Contains: Static hashing. Hashing. Dynamic hashing. Extendible hashing.

Git for Newbies. ComMouse Dongyue Studio

HW2d Project Addenda

Version Control with Git

Figure 1: Graphical representation of a client-server application

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

FPLLL. Contributing. Martin R. Albrecht 2017/07/06

TCSS 422: OPERATING SYSTEMS

Version control system (VCS)

Out: April 19, 2017 Due: April 26, 2017 (Wednesday, Reading/Study Day, no late work accepted after Friday)

COSC6340: Database Systems Mini-DBMS Project evaluating SQL queries

Package PKI. September 16, 2017

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

CS Homework 8. Deadline. Purpose. Problem 1. Problem 2. CS Homework 8 p. 1

- b: size of block in bytes. - s: number of sets in the cache (or total number of sets between split caches). - n: associativity of cache.

Version Control Systems

CS 426 Fall Machine Problem 1. Machine Problem 1. CS 426 Compiler Construction Fall Semester 2017

Transcription:

CMSC 17 Computer Networks Fall 017 Programming Assignment 0 Assigned: August 9 Due: September 7, 11:59:59 PM. 1 Description In this assignment, you will write both a TCP client and server. The client has a file and wants to obtain the hashes for various segments of the data inside the file. The client will send a message to the server for each segment, and the server will respond with the hash of the segment. The client converts each hash into a hexadecimal string representation, and prints it to the console. The server must be able to handle more than one client concurrently. Protocol Client Server Initialization HashRequest 1 Acknowledgement HashRequest HashResponse 1 HashRequest N HashResponse N Figure 1: Example message sequence diagram for the assignment protocol. An overview of the protocol is shown in Figure 1. The protocol between the client and server will use four types of messages: Initialization, Acknowledgement, HashRequest, and HashResponse. The client starts by sending an Initialization message to the server, which informs the server of the number of hashing requests that the client will make (denoted by the variable N). Afterwards, the client sends N HashRequest messages to the server, where each HashRequest contains the data segment to be hashed. The server responds to the Initialization message with an Acknowledgement, which informs the client of the total length of the response. The server responds to each HashRequest with a HashResponse that contains the hash of the corresponding data. The formats for four types of messages are shown in Figure. Additional details for each type of message are listed below. 1

Client Server Initialization N = 1 N = Number of Hash Requests Server Client Acknowledgement Length = Client Server HashRequest Length Data (Length) = 3 Server Client HashResponse i Hash i 3 = Figure : Format for messages used in the assignment protocol. Initialization (Client Server) 1. : A -byte integer value in network byte order that is set to the value 1.. N: A -byte integer value in network byte order that corresponds to the number of HashRequests that the client will send to the server. Acknowledgement (Server Client) 1. : A -byte integer value in network byte order that is set to the value.. Length: A -byte integer value in network byte order that denotes the total length of all HashResponses. This should be equal to 38*N. HashRequest (Client Server) 1. : A -byte integer value in network byte order that is set to the value 3.. Length: A -byte integer value in network byte order that denotes the length of the Data payload in number of bytes. 3. Data: A payload that holds the data segment to be hashed. HashResponse (Server Client) 1. : A -byte integer value in network byte order that is set to the value.. i: A -byte integer value in network byte order that denotes the zero-based index of the response. That is, the first HashResponse should have this set to 0, while the last HashResponse should have this set to N - 1. 3. Hash i: A 3-byte (56-bit) value that corresponds to the hash of the data contained in the i th HashRequest sent by the client.

3 Server Implementation The server will be a command line utility, which takes the following arguments: 1. -p <Number> = Port that the server will bind to and listen on. Represented as a base-10 integer. Must be specified, with a value > 10.. -s <String> = Salt that the server will use in computing the hash. Represented as an ASCII string. This is an optional argument. An example usage is as follows: server -p 171 -s newsalt The server listens for incoming connections on a TCP socket bound to the port specified in the command line arguments. The server should be capable of handling multiple concurrent client connections. Three ways of supporting concurrent connections are fork(), threading, or select()/poll() (see their manpages for more information). For each HashRequest that the server receives from the client, the server must compute the hash of the data using the SHA56 cryptographic message digest function. We provide code that wraps OpenSSL functionality in a Git repository that you can clone as follows: git clone fall17git@poole.cs.umd.edu:materials The files are located in the hash directory, and the header file contains information on the API. If the salt is specified, the server will pass the salt to the wrapper functions as the binary representation of the ASCII string, not including the NULL byte at the end of the string. Otherwise, if the salt is not specified, the server passes a NULL pointer (and 0 length) to the wrapper functions. The server is restricted to using at most 1 megabyte of memory for each client. Clients may request a hash for a source file that exceeds those bounds. Thus, hashes must be calculated without retaining the full message in memory. Additionally, the client may issue a large number of small hashing requests. Therefore, the server should start sending HashResponses without waiting until the N th HashRequest has been received. Client Implementation The client will be a command line utility, which takes the following arguments: 1. -a <String> = The IP address of the machine that the server is running on. Represented as a ASCII string (e.g., 18.8.16.63). Must be specified.. -p <Number> = The port that the server is bound listening on. Represented as a base-10 integer. Must be specified. 3. -n <Number> = The number of HashRequests (N) that the client will send to the server. Represented as a base-10 integer. Must be specified, and have a value 0.. smin <Number> = The minimum size for the data payload in each HashRequest. Represented as a base-10 integer. Must be specified, and have a value 1. 3

5. smax <Number> = The maximum size for the data payload in each HashRequest. Represented as a base-10 integer. Must be specified, and have a value. 6. -f <File> = The file that the client reads data from for all HashRequests. Must be specified, and have enough data to support N requests at the maximum length (specified by -n and -smax respectively). An example usage is as follows: client -a 18.8.16.63 -p 171 -n 100 smin=18 smax=51 -f /dev/zero We provide code parses the options for you, located in a Git repository that you can clone as follows: git clone fall17git@poole.cs.umd.edu:materials The files are located in the assignment0 directory. After reading in and parsing the command line arguments, the client will connect to the server and start the protocol by sending the server an Initialization message. For each one of the N HashRequests, the client must do the following: 1. Sample a random number L uniformly at random from the range [SMin,SMax].. Read in the next L bytes from the source file. 3. Construct and send the HashRequest message using the L bytes read as the data payload. As the client receives each HashResponse, it must print out the index and thirty-two byte hash contained therein. The index must be in decimal format, while the hash must be in lowercase hexadecimal form. They should be separated by a colon and space ( : ) and the hash must be preceded by 0x. Each HashResponse should be on a new line. Here is an example of a correct line of output, corresponding to the 7th HashResponse received: 5 Grading 7: 0x1793be17d3bf0e8ebba571e3fcfb1b638b5c59eeaa0fd7c0978509 Your project grade will depend on the parts of the project that you implement. Assuming each part has a good implementation, the grades are as follows: Grade A B C Parts Completed Client and Server (Handles 1+ Clients) Client and Server (Handles 1 Client) Client Only

6 Additional Requirements 1. Your code must be submitted as a series of commits that are pushed to the origin/master branch of your Git repository. We consider your latest commit prior to the due date/time to represent your submission.. The directory for your project must be called assignment0 and be located at the root of your Git repository. 3. You must provide a Makefile that is included along with the code that you commit. We will run make inside the assignment0 directory, which must produce two binaries server and client also located in the assignment0 directory.. You must submit code that compiles in the provided VM, otherwise your assignment will not be graded. 5. Your code must be -Wall clean on gcc/g++ in the provided VM, otherwise your assignment will not be graded. Do not ask the TA for help on (or post to the forum) code that is not -Wall clean, unless getting rid of the warning is the actual problem. 6. You are not allowed to work in teams or to copy code from any source. 5