Programming Assignment 3

Size: px
Start display at page:

Download "Programming Assignment 3"

Transcription

1 UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 3550 Section 002 Communication Networks Spring 2018 Programming Assignment 3 Introduction Having created a TCP client in programming assignment 2, it s only natural to create a server in programming assignment 3. And that s what we ll do! The goal of the server is to provide a simple chat facility. Although it will only support a simple chat client, you should be able to see how it could be expanded to provide expanded functionality. The server you will create will handle chats among a somewhat arbitrary number of clients. We ll assume at most 5 clients can be used, but that s just an arbitrary number. It should be easy to redefine the maximum number of clients. There will be a unique TCP port number specified for the server (on the command line); the host IP address of the server will naturally be the local IP address associated with the system on which it is running. You will be provided with a complete client chat program that can use the server you create. As a result, you should be able to develop and test your server on any system to which you have access, including (for example) a laptop assuming it has the appropriate software to develop applications in the language you choose. Once the chat server is running, it will continually loop, waiting for one of three events to occur: a connection request from a client, a termination indication from a client, or the arrival of data from a client. Let s consider what s done for each of those events. A connection request will be accepted and recorded if the maximum number of active clients hasn t yet been reached. Since we re allowing 5 clients at the same time, the data structures you use can easily be statically allocated for that many clients. Several obvious data items that will be needed for each client will be the client status (connected or not connected), the socket used to communicate with the client (if the client is connected), an any partial part of a line that might have been received so far. When a complete line has been received from the client (that is, we read an end of line character from the socket), we will send that line to each of the other currently-connected clients. A disconnection request is accepted and processed as you might expect: the server closes the socket used for its connection with the client, and all record of the client is cleared. That is, the data structures used for the terminating client are made available for another client. The only other event the server deals with are the arrival of data from a client. When one or more bytes of data arrive, they are copied to a per-client buffer (as mentioned above). Eventually we expect a client will have sent a complete input line (which we ll assume is at most 100 characters long, including the end of line character). When that happens, that line of input will be sent to each of the other currently-connected client programs. If a client disconnects before sending a complete line, any partial input line that is in the buffer will be discarded.

2 The Sample Server (Instructor s Solution) The instructor s executable solution for the assignment is provided for your use in the class directory on loki. It will accept the s and v options. The s option will cause input lines to be sent to all the other connected clients and the client that sent the input line. The v option is used to display verbose output. These options need not be implemented in your server. Additional details on how to start and stop the server are described later in the assignment. Server Actions The server will perform the following steps in the order specified: 1. [GET PORT NUMBER] Get a port number between 1024 and (inclusive). This is the port number to which clients will direct their connection requests. We ll call it the SERVER PORT, and the associated socket will be called the SERVER SOCKET. If the selected port number you choose is already being used, you ll get an error when you attempt to bind it to a socket; in that case, just run the server again with a different port number. 2. [CREATE THE SERVER SOCKET] Create a socket for use with TCP and associate it with the port number obtained in step 1. (This is where an error will occur if the port is already in use.) You can see how to do this in C by looking at the server code on page 505 of the text or the passivesock function in the library provided in the class directory on loki. 3. [INITIALIZE STATE] Initialize the state of all possible clients (you should allow at least 5). Initially, no clients will be active (that is, connected to the server). 4. [WAIT FOR AN EVENT] Wait for a new connection request from a client, a connection termination, or for some data to become available to read on one of the active connections. Depending on which event was detected, go to step 5, step 6, or step 7. The details of identifying an event will be discussed in more detail below. 5. [HANDLE A NEW CONNECTION REQUEST] If a new connection is being requested, accept the connection, record the identifity of the connected socket on which data will be read or written (returned by the accept system call in UNIX/Linux) in the appropriate data structure associated with the client, clear the buffer to be used for incoming lines of text from the connection (set its length to zero), and return to step 4. (If the maximum number of active connections permitted by the server has already been reached, then just accept the connection, immediately close it, and return to step 4.) 6. [HANDLE A CONNECTION TERMINATION] When a previously-active connection is terminated (because the client closed its socket), close the corresponding connected socket, then mark that connection as inactive and return to step [HANDLE ANY INPUT DATA] Otherwise (that is, if it s not a new or terminated connection event), read a byte of data from the appropriate socket (which is associated with the connection that has data ready to be read) and add it to the end of the appropriate buffer (associated with the connection). If the byte just added contained an end of line character, then send the line to each of the other active connections and clear the line (that is, set its length back to zero). Optionally you could send the line back to the client that produced it; that s what the -s option requests in the instructor s solution. Return to step 4. Note that there is no event associated with server termination. Indeed, there is no specification of how the server should be terminated. Ideally there should be some means for terminating the server other

3 than pressing control-c in the terminal window associated with the server process. However that isn t required, and no specific mechanism is specified in this assignment statement for that task. Details There are a few additional points that you ll need to consider in your implementation. The most complicated point to deal with is determining what event caused the wait in step 4 to terminate. As noted there, there are three possible events that must be handled by the server: (a) a new connection is being requested, (b) an existing connection is terminated (because the client closed its socket), and (c) incoming data is available to be read from the socket. How do you know which of these three will occur next? If you assume a connection request will arrive and do an accept on the server socket, then you won t be able to process any incoming data (from an already-connected client) until a connection request does arrive. Similarly, if you assume data will arrive next and do a read on a connected socket, you won t be able to process any new connection requests until some data arrives. It almost appears that you have to be clairvoyant to write the appropriate code to handle these cases. But the situation isn t quite that grim. There are several ways we can proceed. MULTIPLE THREADS One way to handle this problem is to create a separate thread for each connected client (at the time it connects). The main thread, after performing appropriate initialization tasks, continually waits on connection requests. Each time one arrives, it is accepted and a new thread to handle communication with the client is created. This is very similar to what happens in a web server, except that the threads are usually created in advance of their use, and are just waiting to be assigned some work. The thread for a connected client can safely block when it tries to read data from the connected socket, since even if that thread blocks, the other threads in the program will be able to continue execution. DETECTING CLOSED CONNECTIONS As with the second assignment, it may be most appropriate to read data from the connected socket one byte at a time (although this isn t required), and note the number of bytes actually read. Any attempt to read data that indicates 0 bytes were read is an indication that the connection has been closed (in C and C++ code using the read or recv system calls); in Java, the read method applied to a socket returns 1 if the socket was closed by the client. In this case, the server s end of the connection should also be closed, and the state of the corresponding connection should be updated. If a separate thread is used to handle each connected client, the thread should terminate after the corresponding connection has been closed. SINGLE THREAD WITH SELECT Another approach to dealing with the multiple cases is to use the select system call (if you re using C or C++), or perhaps using a Selector object in Java. Since the UNIX select system call is more frequently used, we ll consider it here. Simply stated, the select system call causes the executing thread to wait until an event of interest occurs on one of the file descriptors specified in a set. Since sockets are also effectively file descriptors, we can use the select system call to wait until one of the events in which we re interested has occurred. Here s some simple pseudocode to illustrate the approach. 1. Create a set containing the server socket s file descriptor and the file descriptor associated with each active connection. 2. Use the select system call to wait for an event of interest on any of the file descriptors in the set. When the select call returns, we know that at least one file descriptor is ready for processing (or an error occurred, which we ll ignore in this pseudocode), and the set (created in step 1) has been modified to contain just those file descriptors of interest.

4 3. If the server socket s file descriptor is in the set that was produced by step 2, we know a new connection request has been made. That new request is handled (as specified above in Server Actions, step 5), then we continue at step If we reach this point, we know that at least one of the sockets connected to a client has data to be read. It can be read here and added to a buffer for the connection. If the incoming character was an end of line, then we can also write that line to each of the other active connections. In any case, we continue with step 1. Another issue that may arise if you write your own client is similar to that just discussed for the server: when do you read the keyboard and when do you read the socket? These can be handled in the same way in a client (using threads to separate the work, or using the select system call to identify the next event). But in the client we want to avoid writing an incoming line (from the server) to the terminal until there is no partial user input line in progress. For example, suppose you want to send a line containing Hello, world to the other clients. But after you type the comma, a complete input line arrives from the socket. The client should avoid writing that line in the middle of the echo of the keyboard input. This isn t a server issue, however. Finally, the thread-based solutions will in a robust solution require some method for synchronizing access (from the threads) to the shared data structures. It is unlikely that you ll run into difficulty in testing if you don t provide the synchronization. And since things like semaphores and mutexes and other synchronization facilities are more properly the domain of an operating system class, we ll ignore them here. Notes and Restrictions Your solution may be written in the C, C++, Java, or Python3 programming language. It must accept a single command line argument indicating the port number to be associated with the server socket. One of the instructor s executable solutions has been provided on loki.ist.unomaha.edu in the directory /home/stanw/csci3550/prog3. A C-based client is provided in source code for your use, but it works with servers written in any of the allowable languages. It is called client3 and expects two command-line arguments: the hostname (in symbolic or dotted numeric form) on which the server is running, and the port number associated with the server socket. The file /home/stanw/csci3550/serv3temp.java contains a simple template for a thread-based solution to the problem. Show below is the output (on loki) when the C server and two clients were executed. Note that the C server has been designed to terminate gracefully when it receives a SIGHUP signal (which is signal 1). The Java server must be interrupted with a SIGINT signal (which is what happens when you press control-c in the window where the server is running). Note that three separate terminal windows were used; the content of each window is bracketed by horizontal lines. stanw@loki:~/csci3550/prog3$./serv Server for assignment 3, CSCI 3550, Spring 2018 Accepting at most 5 connections on port Server process ID is stanw@loki:~/csci3550/prog3$ stanw@loki:~/csci3550/prog3$./client3 localhost Hello over there! I am a client for programming assignment 3. Well so am I! Will you get my message?

5 I did! I did! It appears everything is working fine. I concur. But this is boring, and I'm going to quit soon. Okay. So long. I'm going to press control-d now. And so will I. Of course, since the only other client has terminated, no one will see this input. stanw@loki:~/csci3550/prog3$ # We'll kill the server now stanw@loki:~/csci3550/prog3$ kill stanw@loki:~/csci3550/prog3$ stanw@loki:~/csci3550/prog3$./client3 localhost Hello over there! I am a client for programming assignment 3. Well so am I! Will you get my message? I did! I did! It appears everything is working fine. I concur. But this is boring, and I'm going to quit soon. Okay. So long. I'm going to press control-d now. stanw@loki:~/csci3550/prog3$ Evaluation Submissions will be evaluated as follows. 1. Extraneous files in the submission directory will be deleted. For each one deleted, the overall score for the assignment will be reduced by one. A group effort with multiple submission directories will lose 10 points for the duplication. 2. The program will be compiled and linked as necessary. If this fails, and it looks like there is some reasonable effort to produce a solution, a grade of 50 percent will be recorded. 3. The server program will be started. If that fails, a grade of 60 percent will be recorded. 4. In a second terminal window, a client will be started and several lines of arbitrary text will be entered. Failure here will result in a grade of 65 percent. 5. In a third terminal window, another client will be started. As before, several lines of arbitrary text will be entered. These should appear in the second terminal window (that is, sent to the first client). Failure here will result in a grade of 75 percent. 6. Input text for the various clients will be entered and the behavior of the server will be assessed. Thins like limits on the number of clients (5) and the input line lengths will be examined. Depending on the results, a grade between 80 and 100 percent will be reported. Requirements You must write and test a program that functions as a server for up to five chat clients at a time. Your solution may be written in C, C++, Java or Python3. You may use the library of functions provided on loki in your solution. The solution must be submitted by Tuesday, May 1, You may work in groups of two on this assignment if you wish. If you do, it is absolutely essential that you (a) make certain both of your names appear in all of the source code files you submit (likely as comments), and (b) you only create one submission directory into which you put your joing submission. The same evaluation will be given to each member of a group effort. The source code file (or files) for your solution should be placed in a directory named csci prog3 immediately below your home directory. For example, if your username was brenfro,

6 your home directory would probably be /home/brenfro and your solution s source code would be placed in the directory /home/brenfro/csci prog3. There should be nothing but source code files (and perhaps a Makefile and/or a readme file, as needed) in your submission directory. DO NOT CREATE THE SUBMISSION DIRECTORY UNTIL YOU ARE READY TO SUBMIT YOUR WORK. GROUP EFFORTS SHOULD HAVE ONLY A SINGLE SUBMISSION DIRECTORY FOR BOTH MEMBERS. As always, please contact the instructor if you have questions, and periodically check the class web site for any additions or corrections to this assignment.

Programming Assignment 3

Programming Assignment 3 UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2017 Programming Assignment 3 Introduction For this programming assignment you are to write a C, C++, Java, or Python

More information

Programming Assignment 3

Programming Assignment 3 UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Spring 2016 Programming Assignment 3 Introduction For this programming assignment you are to write a C, C++, Java, or Python

More information

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

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall Programming Assignment 1 (updated 9/16/2017) UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Fall 2017 Programming Assignment 1 (updated 9/16/2017) Introduction The purpose of this programming assignment is to give you

More information

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

UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2016 Programming Assignment 1 Introduction The purpose of this UNIVERSITY OF NEBRASKA AT OMAHA Computer Science 4500/8506 Operating Systems Summer 2016 Programming Assignment 1 Introduction The purpose of this programming assignment is to give you some experience

More information

Computer Networks CS3516 B Term, 2013

Computer Networks CS3516 B Term, 2013 Computer Networks CS3516 B Term, 2013 Project 1 Project Assigned: October 31 Checkpoint: November 07 12:01 AM Due: November 14 12:01 AM Networks - Project 1 1 What You Will Do In This Project. The purpose

More information

Figure 1: Graphical representation of a client-server application

Figure 1: Graphical representation of a client-server application CS/EE 145a : Networking Lab #1 http://www.its.caltech.edu/ eecs145/ Due: October 24, 2007 1 Introduction The development of network-based software has been around for many years. Since its conception,

More information

P2P Programming Assignment

P2P Programming Assignment P2P Programming Assignment Overview This project is to implement a Peer-to-Peer (P2P) networking project similar to a simplified Napster. You will provide a centralized server to handle cataloging the

More information

CS354/CS350 Operating Systems Winter 2004

CS354/CS350 Operating Systems Winter 2004 CS354/CS350 Operating Systems Winter 2004 Assignment Three (March 14 VERSION) Design and Preliminary Testing Document Due: Tuesday March 23, 11:59 am Full Assignment Due: Tuesday March 30, 11:59 am 1 Nachos

More information

CIS 505: Software Systems

CIS 505: Software Systems CIS 505: Software Systems Spring 2018 Assignment 2: Email servers MS1 due February 16, 2018, at 10:00pm EST MS2+3 due March 1, 2018, at 10:00pm EST 1 Overview For this assignment, you will build two simple

More information

ENGR 3950U / CSCI 3020U (Operating Systems) Simulated UNIX File System Project Instructor: Dr. Kamran Sartipi

ENGR 3950U / CSCI 3020U (Operating Systems) Simulated UNIX File System Project Instructor: Dr. Kamran Sartipi ENGR 3950U / CSCI 3020U (Operating Systems) Simulated UNIX File System Project Instructor: Dr. Kamran Sartipi Your project is to implement a simple file system using C language. The final version of your

More information

Project 1: Remote Method Invocation CSE 291 Spring 2016

Project 1: Remote Method Invocation CSE 291 Spring 2016 Project 1: Remote Method Invocation CSE 291 Spring 2016 Assigned: Tuesday, 5 April Due: Thursday, 28 April Overview In this project, you will implement a remote method invocation (RMI) library. RMI forwards

More information

CS 450 Introduction to Networking Spring 2014 Homework Assignment 1 File Transfer and Data Bandwidth Analysis Tool

CS 450 Introduction to Networking Spring 2014 Homework Assignment 1 File Transfer and Data Bandwidth Analysis Tool CS 450 Introduction to Networking Spring 2014 Homework Assignment 1 File Transfer and Data Bandwidth Analysis Tool Due: Monday 17 February. Electronic copy due at 10:30 A.M., Optional paper copy may be

More information

Programming Standards: You must conform to good programming/documentation standards. Some specifics:

Programming Standards: You must conform to good programming/documentation standards. Some specifics: CS3114 (Spring 2011) PROGRAMMING ASSIGNMENT #3 Due Thursday, April 7 @ 11:00 PM for 100 points Early bonus date: Wednesday, April 6 @ 11:00 PM for a 10 point bonus Initial Schedule due Thursday, March

More information

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

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.0) Network Programming using C CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.0) Network Programming using C Overview This homework is due by 11:59:59 PM on Thursday, April 26, 2018.

More information

CS 167 Final Exam Solutions

CS 167 Final Exam Solutions CS 167 Final Exam Solutions Spring 2018 Do all questions. 1. [20%] This question concerns a system employing a single (single-core) processor running a Unix-like operating system, in which interrupts are

More information

CS 118 Project Phase 2 P2P Networking

CS 118 Project Phase 2 P2P Networking CS 118 Project Phase 2 P2P Networking Due Monday, March 15 th at 11:59pm Boelter Hall 4428, Box D3/C4 and via Electronic Submission Overview In this phase you will extend your work from Phase 1 to create

More information

Creating a Shell or Command Interperter Program CSCI411 Lab

Creating a Shell or Command Interperter Program CSCI411 Lab Creating a Shell or Command Interperter Program CSCI411 Lab Adapted from Linux Kernel Projects by Gary Nutt and Operating Systems by Tannenbaum Exercise Goal: You will learn how to write a LINUX shell

More information

CS Operating Systems

CS Operating Systems CS 4500 - Operating Systems Module 7: Deadlocks Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 4, 2017 In This Module... Deadlock: Definition

More information

CS Operating Systems

CS Operating Systems CS 4500 - Operating Systems Module 7: Deadlocks Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 4, 2017 In This Module... Deadlock: Definition

More information

BITS-Pilani Hyderabad Campus

BITS-Pilani Hyderabad Campus BITS-Pilani Hyderabad Campus CS C461/IS C461/CS F303/ IS F303 (Computer Networks) Laboratory 4 Aim: To give an introduction to Socket Programming in TCP and UDP. TCP Socket Programming: A socket is the

More information

The Norwegian text is authoritative, this translation is provided for your convenience.

The Norwegian text is authoritative, this translation is provided for your convenience. Contents 1 INF3190 Home exam 2 in English 1 1.1 Formalities............................ 1 1.2 Exercise.............................. 1 1.2.1 Details........................... 2 1.2.2 You shall deliver

More information

Interprocess Communication Mechanisms

Interprocess Communication Mechanisms Interprocess Communication 1 Interprocess Communication Mechanisms shared storage These mechanisms have already been covered. examples: shared virtual memory shared files processes must agree on a name

More information

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals

shared storage These mechanisms have already been covered. examples: shared virtual memory message based signals Interprocess Communication 1 Interprocess Communication Mechanisms shared storage These mechanisms have already been covered. examples: shared virtual memory shared files processes must agree on a name

More information

Lab 2: Threads and Processes

Lab 2: Threads and Processes CS333: Operating Systems Lab Lab 2: Threads and Processes Goal The goal of this lab is to get you comfortable with writing basic multi-process / multi-threaded applications, and understanding their performance.

More information

CIS 505: Software Systems

CIS 505: Software Systems CIS 505: Software Systems Fall 2017 Assignment 3: Chat server Due on November 3rd, 2017, at 10:00pm EDT 1 Overview For this assignment, you will implement a simple replicated chat server that uses multicast

More information

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Midterm Exam October 23, 2012, Duration: 80 Minutes (10 pages, 12 questions, 100 Marks) Instructor: Dr. Kamran Sartipi Question 1 (Computer Systgem)

More information

Interprocess Communication Mechanisms

Interprocess Communication Mechanisms Interprocess Communication 1 Interprocess Communication Mechanisms shared storage shared virtual memory shared files message-based sockets pipes signals Interprocess Communication 2 Message Passing Indirect

More information

Interprocess Communication Mechanisms

Interprocess Communication Mechanisms Interprocess Communication 1 Interprocess Communication Mechanisms shared storage shared virtual memory shared files message-based sockets pipes signals... Interprocess Communication 2 Message Passing

More information

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

CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.1) Sockets and Server Programming using C CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.1) Sockets and Server Programming using C Overview This homework is due by 11:59:59 PM on Monday, December

More information

Task 2: TCP Communication

Task 2: TCP Communication UNIVERSITY OF TARTU, INSTITUTE OF COMPUTER SCIENCE Task 2: TCP Communication Hadachi&Lind October 12, 2017 Must Read: The task 2 should be done individually! You can submit your solution for task using

More information

CS 125 Web Proxy Geoff s Modified CS 105 Lab

CS 125 Web Proxy Geoff s Modified CS 105 Lab CS 125 Web Proxy Geoff s Modified CS 105 Lab January 31, 2014 Introduction A Web proxy is a program that acts as a middleman between a Web browser and an end server. Instead of contacting the end server

More information

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length)

Memory-Mapped Files. generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length) File Systems 38 Memory-Mapped Files generic interface: vaddr mmap(file descriptor,fileoffset,length) munmap(vaddr,length) mmap call returns the virtual address to which the file is mapped munmap call unmaps

More information

HOT-Compilation: Garbage Collection

HOT-Compilation: Garbage Collection HOT-Compilation: Garbage Collection TA: Akiva Leffert aleffert@andrew.cmu.edu Out: Saturday, December 9th In: Tuesday, December 9th (Before midnight) Introduction It s time to take a step back and congratulate

More information

Australian Informatics Olympiad Thursday 23 August, Information Booklet

Australian Informatics Olympiad Thursday 23 August, Information Booklet Australian Informatics Olympiad Thursday 23 August, 2018 Information Booklet Information for Teachers and Students Contest Rules Why Did I Score Zero? Please read this booklet before the day of the contest

More information

COMP/ELEC 429/556 Project 2: Reliable File Transfer Protocol

COMP/ELEC 429/556 Project 2: Reliable File Transfer Protocol COMP/ELEC 429/556 Project 2: Reliable File Transfer Protocol Assigned: Thu, 28 September Due: 11:55pm, Tue, 24 October 1 Description The objective of this project is to give you hands-on experience with

More information

6.824 Distributed System Engineering: Spring Quiz I Solutions

6.824 Distributed System Engineering: Spring Quiz I Solutions Department of Electrical Engineering and Computer Science MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.824 Distributed System Engineering: Spring 2009 Quiz I Solutions All problems are open-ended questions.

More information

Fall CSEE W4119 Computer Networks Programming Assignment 1 - Simple Chat Application

Fall CSEE W4119 Computer Networks Programming Assignment 1 - Simple Chat Application Fall 2011 - CSEE W4119 Computer Networks Programming Assignment 1 - Simple Chat Application Prof. Gil Zussman due: 10/26/2011, 11 AM, EST 1 Introduction This programming assignment is to implement a simple

More information

Qualifying exam: operating systems, 1/6/2014

Qualifying exam: operating systems, 1/6/2014 Qualifying exam: operating systems, 1/6/2014 Your name please: Part 1. Fun with forks (a) What is the output generated by this program? In fact the output is not uniquely defined, i.e., it is not always

More information

Module 15 Communication at Data Link and Transport Layer

Module 15 Communication at Data Link and Transport Layer Computer Networks and ITCP/IP Protocols 1 Module 15 Communication at Data Link and Transport Layer Introduction Communication at data link layer is very important as it is between two adjacent machines

More information

Project 2: Part 1: RPC and Locks

Project 2: Part 1: RPC and Locks Project 2: Part 1: RPC and Locks Due: 11:59PM Thursday, October 14, 2010 1 Introduction In this series of labs, you will implement a fully functional distributed file server with the Frangipani architecture

More information

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1

ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1 ACORN.COM CS 1110 SPRING 2012: ASSIGNMENT A1 Due to CMS by Tuesday, February 14. Social networking has caused a return of the dot-com madness. You want in on the easy money, so you have decided to make

More information

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 CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs

More information

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

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs. CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs

More information

Student Name: University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science

Student Name: University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science CS 162 Spring 2011 I. Stoica FIRST MIDTERM EXAMINATION Wednesday, March 9, 2011 INSTRUCTIONS

More information

CSC209 Review. Yeah! We made it!

CSC209 Review. Yeah! We made it! CSC209 Review Yeah! We made it! 1 CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files 2 ... and C programming... C basic syntax functions

More information

Program 1: Generating Summation Puzzles

Program 1: Generating Summation Puzzles Program 1: Generating Summation Puzzles Owen Kaser October 3, 2015 Due: 15 October 2015, end of class. 1 Introduction Textbook section 5.3.3 gives pseudocode to solve a given summation puzzle. We want

More information

The Specification of Project-1

The Specification of Project-1 The Specification of Project-1 EE122 Introduction to Communication Networks, Fall 2002 Weidong Cui, Karthik Lakshminarayanan, Khian Hao Lim Revision : 1.23 1 Overview In this project, you will build a

More information

ENCE 3241 Data Lab. 60 points Due February 19, 2010, by 11:59 PM

ENCE 3241 Data Lab. 60 points Due February 19, 2010, by 11:59 PM 0 Introduction ENCE 3241 Data Lab 60 points Due February 19, 2010, by 11:59 PM The purpose of this assignment is for you to become more familiar with bit-level representations and manipulations. You ll

More information

TCP and Concurrency. The third assignment at DA

TCP and Concurrency. The third assignment at DA TCP and Concurrency The third assignment at DA2402 2009-03-05 Jonas Lundberg/Ola Flygt adapted to Java by Marcus Edvinsson maintained by Marcus Edvinsson Matematiska och systemtekniska institutionen, MSI

More information

USA North 811. Positive Response System Requirements

USA North 811. Positive Response System Requirements USA North 811 Positive Response System Requirements Automated Response via TCP Connection Connect to posres.usanorth811.org (IP address 4.7.9.14) via TCP/7377 In the dialog below the (le arrow) means it

More information

CPS 110 Final Exam. Spring 2011

CPS 110 Final Exam. Spring 2011 CPS 110 Final Exam Spring 2011 Please answer all questions for a total of 300 points. Keep it clear and concise: answers are graded on content, not style. I expect that you can answer each question within

More information

CS : Programming for Non-Majors, Fall 2018 Programming Project #5: Big Statistics Due by 10:20am Wednesday November

CS : Programming for Non-Majors, Fall 2018 Programming Project #5: Big Statistics Due by 10:20am Wednesday November CS 1313 010: Programming for Non-Majors, Fall 2018 Programming Project #5: Big Statistics Due by 10:20am Wednesday November 7 2018 This fifth programming project will give you experience writing programs

More information

Lecture 1. Course Mechanics. Administrative Items. Grading. Programming Assignments. Homework Assignments

Lecture 1. Course Mechanics. Administrative Items. Grading. Programming Assignments. Homework Assignments Course Mechanics Lecture 1 Introduction, Course Overview January 12, 2005 Administrative Items Grading Course Organization Homeworks Programming Assignments Exams Administrative Items Course Time: MWF

More information

Homework # 7 Distributed Computing due Saturday, December 13th, 2:00 PM

Homework # 7 Distributed Computing due Saturday, December 13th, 2:00 PM Homework # 7 Distributed Computing due Saturday, December 13th, 2:00 PM In this homework you will add code to permit a calendar to be served to clients, and to open a calendar on a remote server. You will

More information

Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded

Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded Deviations are things that modify a thread s normal flow of control. Unix has long had signals, and these must be dealt with in multithreaded improvements to Unix. There are actually two fairly different

More information

Computer Science 385 Design and Analysis of Algorithms Siena College Spring Lab 8: Search Trees Due: Start of your next lab session

Computer Science 385 Design and Analysis of Algorithms Siena College Spring Lab 8: Search Trees Due: Start of your next lab session Computer Science 385 Design and Analysis of Algorithms Siena College Spring 2018 Lab 8: Search Trees Due: Start of your next lab session You will be assigned a partner to work with on this lab. Only one

More information

Job Reference Guide. SLAMD Distributed Load Generation Engine. Version 1.8.1

Job Reference Guide. SLAMD Distributed Load Generation Engine. Version 1.8.1 Job Reference Guide SLAMD Distributed Load Generation Engine Version 1.8.1 December 2004 Contents 1. Introduction...3 2. The Utility Jobs...4 3. The LDAP Search Jobs...11 4. The LDAP Authentication Jobs...22

More information

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018

Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Lab 1: Silver Dollar Game 1 CSCI 2101B Fall 2018 Due: Tuesday, September 18, 11:59 pm Collaboration Policy: Level 1 (review full policy for details) Group Policy: Individual This lab will give you experience

More information

Laboratory Exercise #0

Laboratory Exercise #0 Laboratory Exercise #0 This assignment focuses on the mechanics of installing and using Python. The deadline for Mimir submission is 11:59 PM on Monday, January 8. 1. Complete the steps given below to

More information

COMPUTER SCIENCE 4500 OPERATING SYSTEMS

COMPUTER SCIENCE 4500 OPERATING SYSTEMS Last update: 2/23/2017 COMPUTER SCIENCE 4500 OPERATING SYSTEMS 2017 Stanley Wileman Module 7: Deadlocks In This Module 2! Deadlock: Definition and Examples! Deadlock: Models! Deadlock: Prevention Algorithms

More information

Project 2: Shell with History1

Project 2: Shell with History1 Project 2: Shell with History1 See course webpage for due date. Submit deliverables to CourSys: https://courses.cs.sfu.ca/ Late penalty is 10% per calendar day (each 0 to 24 hour period past due). Maximum

More information

Computer Science 4500 Operating Systems. In This Module. Deadlock Definition. Module 7 Deadlocks

Computer Science 4500 Operating Systems. In This Module. Deadlock Definition. Module 7 Deadlocks Computer Science 4500 Operating Systems Module 7 Deadlocks 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 In This Module Deadlock: Definition and Examples Deadlock: Models Deadlock: Prevention

More information

Computer Science 4500 Operating Systems

Computer Science 4500 Operating Systems Computer Science 4500 Operating Systems Module 7 Deadlocks 2008 Stanley A. Wileman, Jr. Operating Systems Slide 1 1 In This Module Deadlock: Definition and Examples Deadlock: Models Deadlock: Prevention

More information

Assignment 1: Plz Tell Me My Password

Assignment 1: Plz Tell Me My Password Assignment 1: Plz Tell Me My Password Part I Due: 11:59 pm, September 23, 2013 Part II Due : 11:59 pm, September 27, 2013 1 Introduction The objective of this assignment is to gain experience in: socket

More information

CS Operating Systems

CS Operating Systems CS 4500 - Operating Systems Module 4: The Producer-Consumer Problem and Solution Methods Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 3,

More information

CS Operating Systems

CS Operating Systems CS 4500 - Operating Systems Module 4: The Producer-Consumer Problem and Solution Methods Stanley Wileman Department of Computer Science University of Nebraska at Omaha Omaha, NE 68182-0500, USA June 3,

More information

Good Luck! Marking Guide. APRIL 2014 Final Exam CSC 209H5S

Good Luck! Marking Guide. APRIL 2014 Final Exam CSC 209H5S APRIL 2014 Final Exam CSC 209H5S Last Name: Student #: First Name: Signature: UNIVERSITY OF TORONTO MISSISSAUGA APRIL 2014 FINAL EXAMINATION CSC209H5S System Programming Daniel Zingaro Duration - 3 hours

More information

Midterm Exam CPS 210: Operating Systems Spring 2013

Midterm Exam CPS 210: Operating Systems Spring 2013 Your name: Sign for your honor: Midterm Exam CPS 210: Operating Systems Spring 2013 The last page of this exam is a list of terms used in this class, and whose meanings you should know. You may detach

More information

COS 126 Midterm 2 Programming Exam Fall 2012

COS 126 Midterm 2 Programming Exam Fall 2012 NAME:!! login id:!!! Precept: COS 126 Midterm 2 Programming Exam Fall 2012 is part of your exam is like a mini-programming assignment. You will create two programs, compile them, and run them on your laptop,

More information

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209

CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209 CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System

More information

Rubrics. Creating a Rubric

Rubrics. Creating a Rubric Rubrics A rubric is a set of specific evaluation criteria used to assess an assignment. Instructors use rubrics to carefully outline their assignment requirements and expectations for students. Students

More information

Dr. Mohammad Nassiri

Dr. Mohammad Nassiri Bu-Ali Sina University Faculty of Engineering Computer Department Title: Internet Engineering Course Socket Programming Project Instructor: Dr. Mohammad Nassiri Adapted from: Mr. Raja Venkatraman P R s

More information

Programming Assignment 3 Due Monday, March 24 (Note the change in the due date)

Programming Assignment 3 Due Monday, March 24 (Note the change in the due date) Department of Computer Science Parallel and Distributed Computing Programming Assignment 3 Due Monday, March 24 (Note the change in the due date) For programming assignment 3 you should write a C program

More information

Computer Science 330 Operating Systems Siena College Spring Lab 5: Unix Systems Programming Due: 4:00 PM, Wednesday, February 29, 2012

Computer Science 330 Operating Systems Siena College Spring Lab 5: Unix Systems Programming Due: 4:00 PM, Wednesday, February 29, 2012 Computer Science 330 Operating Systems Siena College Spring 2012 Lab 5: Unix Systems Programming Due: 4:00 PM, Wednesday, February 29, 2012 Quote: UNIX system calls, reading about those can be about as

More information

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager

COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager COMP 3500 Introduction to Operating Systems Project 5 Virtual Memory Manager Points Possible: 100 Submission via Canvas No collaboration among groups. Students in one group should NOT share any project

More information

Project 2 Reliable Transport

Project 2 Reliable Transport Project 2 Reliable Transport UC Berkeley CS 168, Fall 2014 Version 1.0 Due: 11:59am (noon), November 2nd, 2014 In this project, you will build a simple reliable transport protocol, BEARS TP (BTP). Your

More information

CS 447 : Networks and Data Communications Programming Assignment #02 Total Points: 150

CS 447 : Networks and Data Communications Programming Assignment #02 Total Points: 150 CS 447 : Networks and Data Communications Programming Assignment #02 Total Points: 150 Assigned Date : Tuesday, October 23, 2018 Due Date : Tuesday, November 06, 2018 @ 12:29:59 p.m. Overview Your second

More information

PROCESS CONCEPTS. Process Concept Relationship to a Program What is a Process? Process Lifecycle Process Management Inter-Process Communication 2.

PROCESS CONCEPTS. Process Concept Relationship to a Program What is a Process? Process Lifecycle Process Management Inter-Process Communication 2. [03] PROCESSES 1. 1 OUTLINE Process Concept Relationship to a Program What is a Process? Process Lifecycle Creation Termination Blocking Process Management Process Control Blocks Context Switching Threads

More information

Project 2: CPU Scheduling Simulator

Project 2: CPU Scheduling Simulator Project 2: CPU Scheduling Simulator CSCI 442, Spring 2017 Assigned Date: March 2, 2017 Intermediate Deliverable 1 Due: March 10, 2017 @ 11:59pm Intermediate Deliverable 2 Due: March 24, 2017 @ 11:59pm

More information

Assignment 2, due September 17

Assignment 2, due September 17 Assignment 2, due September 17 The objectives of this assignment are to introduce you to some simple UNIX commands, to give you practice working with directories and the le hierarchy, and to give you practice

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Final Programming Project

Final Programming Project Due Thursday, Dec. 7, at 5:00 pm Logistics This assignment should be completed in groups of 3. This is not optional -- you are not allowed to complete it on your own, or in groups of any other size. I

More information

COSC 2P91. Bringing it all together... Week 4b. Brock University. Brock University (Week 4b) Bringing it all together... 1 / 22

COSC 2P91. Bringing it all together... Week 4b. Brock University. Brock University (Week 4b) Bringing it all together... 1 / 22 COSC 2P91 Bringing it all together... Week 4b Brock University Brock University (Week 4b) Bringing it all together... 1 / 22 A note on practicality and program design... Writing a single, monolithic source

More information

CSC 101 Spring 2010 Lab #8 Report Gradesheet

CSC 101 Spring 2010 Lab #8 Report Gradesheet CSC 101 Spring 2010 Lab #8 Report Gradesheet Name WFU Username Lab Section: A B C D Partner s Name (if you had one): Topic Points Notes Pre-lab questions 20 total - 5 at 4 points each Lab report questions

More information

Concurrent & Distributed Systems Supervision Exercises

Concurrent & Distributed Systems Supervision Exercises Concurrent & Distributed Systems Supervision Exercises Stephen Kell Stephen.Kell@cl.cam.ac.uk November 9, 2009 These exercises are intended to cover all the main points of understanding in the lecture

More information

Homework 3 CSC , Spring, 2016

Homework 3 CSC , Spring, 2016 Homework 3 CSC453-001, Spring, 2016 Instructions in previous homeworks also apply to this one. For a coding question that requires coding your BBBK, you also need to be able to demonstrate, upon demand,

More information

Fall CSEE W4119 Computer Networks Programming Assignment 1 - Simple Online Bidding System

Fall CSEE W4119 Computer Networks Programming Assignment 1 - Simple Online Bidding System Fall 2012 - CSEE W4119 Computer Networks Programming Assignment 1 - Simple Online Bidding System Prof. Gil Zussman due: Wed. 10/24/2012, 23:55 EST 1 Introduction In this programming assignment, you are

More information

(MCQZ-CS604 Operating Systems)

(MCQZ-CS604 Operating Systems) command to resume the execution of a suspended job in the foreground fg (Page 68) bg jobs kill commands in Linux is used to copy file is cp (Page 30) mv mkdir The process id returned to the child process

More information

3. When you process a largest recent earthquake query, you should print out:

3. When you process a largest recent earthquake query, you should print out: CS3114 (Fall 2013) PROGRAMMING ASSIGNMENT #1 Due Wednesday, September 18 @ 11:00 PM for 100 points Due Tuesday, September 17 @ 11:00 PM for 10 point bonus Updated: 9/11/2013 Assignment: This is the first

More information

Project #1: Tracing, System Calls, and Processes

Project #1: Tracing, System Calls, and Processes Project #1: Tracing, System Calls, and Processes Objectives In this project, you will learn about system calls, process control and several different techniques for tracing and instrumenting process behaviors.

More information

Project #2: FishNet Distance Vector Routing

Project #2: FishNet Distance Vector Routing Project #2: FishNet Distance Vector Routing Assignment documentation version: 1.0 Due Nov 18 th, 2009 This informational handout covers introductory material describing the Fishnet software that you use,

More information

COMP 321: Introduction to Computer Systems

COMP 321: Introduction to Computer Systems Assigned: 3/29/18, Due: 4/19/18 Important: This project may be done individually or in pairs. Be sure to carefully read the course policies for assignments (including the honor code policy) on the assignments

More information

CMPSCI 187 / Spring 2015 Implementing Sets Using Linked Lists

CMPSCI 187 / Spring 2015 Implementing Sets Using Linked Lists CMPSCI 187 / Spring 2015 Implementing Sets Using Linked Lists Due on Tuesday February 24, 2015, 8:30 a.m. Marc Liberatore and John Ridgway Morrill I N375 Section 01 @ 10:00 Section 02 @ 08:30 1 CMPSCI

More information

Kea Messages Manual. Kea Messages Manual

Kea Messages Manual. Kea Messages Manual Kea Messages Manual i Kea Messages Manual Kea Messages Manual ii Copyright 2011-2015 Internet Systems Consortium, Inc. Kea Messages Manual iii Contents 1 Introduction 1 2 Kea Log Messages 2 2.1 ALLOC Module....................................................

More information

QUEST Procedure Reference

QUEST Procedure Reference 111 CHAPTER 9 QUEST Procedure Reference Introduction 111 QUEST Procedure Syntax 111 Description 112 PROC QUEST Statement Options 112 Procedure Statements 112 SYSTEM 2000 Statement 114 ECHO ON and ECHO

More information

ENGR 3950U / CSCI 3020U UOIT, Fall 2012 Quiz on Process Synchronization SOLUTIONS

ENGR 3950U / CSCI 3020U UOIT, Fall 2012 Quiz on Process Synchronization SOLUTIONS Name: Student Number: SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Quiz on Process Synchronization November 13, 2012, Duration: 40 Minutes (10 questions and 8 pages, 45 Marks) Instructor: Dr.

More information

52 Remote Target. Simulation. Chapter

52 Remote Target. Simulation. Chapter Chapter 52 Remote Target Simulation This chapter describes how to run a simulator on a target and connect it to the SDL simulator interface (SimUI) on the host via TCP/IP communication. July 2003 Telelogic

More information

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I

BASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment

More information

Fishnet Assignment 1: Distance Vector Routing Due: May 13, 2002.

Fishnet Assignment 1: Distance Vector Routing Due: May 13, 2002. Fishnet Assignment 1: Distance Vector Routing Due: May 13, 2002. In this assignment, you will work in teams of one to four (try to form you own group; if you can t find one, you can either work alone,

More information

Peer to Peer Instant Messaging

Peer to Peer Instant Messaging Peer to Peer Instant Messaging Assignment in Computer Networks I, Department of Information Technology, Uppsala University. Overview In this assignment you will implement an instant messaging system that

More information