Build a pair of multi-threaded servers

Assignment Help Computer Network Security
Reference no: EM131211843

Program One - Multithreaded Joke Server and Client

Overview:

In this assignment you will build a pair of multi-threaded servers that accept input from multiple clients, and return appropriate output. In addition to the basic client-server model, you will also implement a secondary administration channel to your servers, and manually maintain the state of all conversations within your distributed application.

Each aspect of the specifications requires you to solve a particular client-server problem while maintaining a conversation within a stateless protocol. The assignment is designed to give you general-purpose exposure to writing code for a client-server environment, and working with threads, neither of which is trivial.

Your finished server is just for fun, but with minor changes it can serve as the basis for a real, viable, client-server application handling thousands of client conversations simultaneously.

Note that we will not make these servers thread-safe which is beyond the scope of this assignment.

InetServer:

Install Java 1.8 if you need to. We will be running your programs under Java 1.8.

You will need several command windows (shells), each running a separate process to run your client/server programs. Command windows are available under Windows by using [Start | run | cmd]. Use [Start] within the original command shell to start other windows. Under Unix (and Apple OSX which runs on top of Unix) use command shells [Terminal Windows] of your choosing.

Refer to the InetServer PDF document, and the lecture, for large hints on how to get this program working. The expectation is that you will TYPE IN THE CODE YOURSELF, and GET IT RUNNING. In my experience, the 30-40 minutes to type in the programs yourself, fix the bugs you have introduced, and figure out how they run, will be paid back many times over.

Remove ALL of my comments from InetServer.java and InetClient.java. Add extensive comments of your own demonstrating that you know how the server works. This is a required part of this pedagogical assignment, demonstrating that you understand the code.

Some sample Java Inet .class files and source code are available to help you get started. (These work fine under Java 1.8). Run the client/server program as follows: Download ALL the .class files into a directory. Issue [> Java InetServer] in one of the windows, and [> Java InetClient] in a separate window for each client that you will be running simultaneously.

Running the InetServer: In one command window issue: [> java InetServer]. In another command window issue: [> java InetClient] Then follow the prompts on the client to look up the IP addresses of domain-named computers. Optionally, you can run the program on two different machines, exactly the same way, but by starting the client with the name or IP address of the server machine as the first argument to the InetClient program.

You may have to speak to your firewall about allowing the client/server TCP/IP connections, depending on how it is configured.

Note: The application code in the server-looking up the IP addresses corresponding to domain names-is not particularly interesting to us and was just some fun network code using existing libraries. The client and server portion of the assignment is what we care about. The assignment would be almost as interesting if we simply sent two numbers from the client to the server and had the server add them together.

Submission files for Inet:
InetServer.java
InetClient.java.

Zip these two java source files together and submit to the InetServer D2L link.

Concatenate your two Inet files together and submit your InetAll file to the InetTII link as .docx, .html, or .txt. NO ZIP FILES HERE.

Run the plagiarism checker against your InetTII link by clicking on the D2L number representing the number of InetTII submissions you have made, and following the links. In this case only, your code will likely appears as being flagged for plagiarism (because all of the code is the same as other submissions), but none of your comments should be flagged for plagiarism.

Execution:

Run your sever with multiple clients active at the same time. Interleave requests from different clients. Capture eight output responses from one client in joke mode, and eight in proverb mode, showing that the jokes and proverbs are returned randomly, but not repeated until all four in each set have been sent back. Annotate this in your output log.

Repeat the process, but this time use your adminstration client to interleave Joke Mode and Proverb Mode, showing that state is correctly maintained across changes between modes.

Put the output from your running sessions in a text log file and ANNOTATE the output-highlighting the randomness of the jokes, the interleaving of modes, etc. Do NOT change any of the output data, but you can add some white space to make it easier to read if you like.

Format the presentation and submission of your work exactly as specified.

Attachment:- java.rar

Reference no: EM131211843

Questions Cloud

Kingsland residents from investments : The gross domestic product (GDP) in a Fultonland in 2012 is $8 billion. The income received in 2012 by Fultonland  residents from investment in Kingsland is $1 billion. The income received in 2012 by Kingsland residents from investments in Fultonland..
Write the article critique assignment : Write the Article critique assignment: - The Topic is:" Student Led Conferences Article Critique" - Review the given paper and improve it and provide tips to improve it.
Actual country data : The life expectancy index for Haiti is:( Show steps please for each question) (See Table 1) The standard of living index for Haiti is:
New machine is no more powerful than the moore machine : Suppose that an FSM is allowed to make state -transitions, that is, state transitions on the empty string. Show that the new machine model is no more powerful than the Moore machine model.
Build a pair of multi-threaded servers : In this assignment you will build a pair of multi-threaded servers that accept input from multiple clients, and return appropriate output - implement a secondary administration channel to your servers, and manually maintain the state of all convers..
Accounting database was destroyed : Part of your? company’s accounting database was destroyed when Godzilla attacked the city. Through careful recreation of? data, you have been able to determine that during the previous? period, 20,000 units of product were produced. The actual price ..
Short-term versus long-term liabilities : Short-term versus Long-term Liabilities. In the shaded cells below, indicate whether the following liabilites should be classified as short-term or long-term.
Find a simple nondeterministic finite-state machine : Convert the nondeterministic finite state machine of part (a) to a deterministic finite-state machine by the method of Section 4.2.
Desire of being a dominant player in the global market : Many firms are relying on cloud computing, also known as “the cloud,” to perform key business functions. By moving transactional processing to the cloud, firms are exposing themselves to additional attacks as well as to tighter scrutiny from regulato..

Reviews

len1211843

9/19/2016 3:16:08 AM

Make your client and server somewhat fault-tolerant by writing the state to disk after each request at both the client side and the server side, so that if either crashes, on restart they read the state back in from disk before resuming operation. You will need to identify your user to the JokeClient in this case, and the user will need to have a unique user name, or be verified by a unique ID (email address?) Hard: Modify your client and server so that they use a secure channel for JokeClientAdmin via SSL. Hard: See the associated extra credit project for creating an asynchronous JokeServer Client, possibly that also connects to multiple JokeServers.

len1211843

9/19/2016 3:15:56 AM

It is not required that your admin client have the capability to shut down your server, but it would be nice. Send the token "shutdown" from your JokeClientAdmin to shut down your server. There is a catch, however. Your request will be processed by an AdminWorker thread. By the time you get to your worker, your JokeServer main listening thread will be blocked waiting, and your JokeAdminServer main listening thread will also be blocked waiting. Neither will automatically wake up so that they can be shut down. Even if you change the loop control variable for each loop to false, these servers will not notice it until you wake them up with a request. To see a way of gracefully shutting down your admin server loop within the worker dialog and "reaching back" to kill off the parent that called the admin worker thread see the "HostServer" assignment. Now, how can you kill off the main Joke listening thread?

len1211843

9/19/2016 3:15:49 AM

These modifications are not required, but if you complete them, let me know about it, and post your interesting work on the forums! Be SYRE to print a comment about the extra features to the console screens at startup time, and give clear prompting. Your JokeServer and clients MUST still run in the default way. Pass an additional argument to your programs to turn on the extra features.

Write a Review

Computer Network Security Questions & Answers

  Compare the different threats and vulnerabilities

Compare Different Threats and Vulnerabilities. Collaborative discussion, submit, individually, the different kinds of data breaches, the threats and vulnerabilities that lead to the breaches, and the severity of each.

  Address the possible security requirements

Prepare a 3- to 5-page paper describing the considerations necessary to address the possible security requirements and the possible risks associated with the Benefits Elections Systems being requested by the Service Request, SR-HT-001 for Huffman ..

  What firewall type or methodology or system would you

what firewall typemethodology or system would you recommend for a small 10-user it shop running windows systems

  Calculate the positions in an array

How do you calculate the positions in an array of the left and right child of a node in a tree represented as an array?

  Determine the impact of five potential logical threats

Identify at least five (5) potential physical threats that require attention. Determine the impact of at least five (5) potential logical threats that require attention.

  Define the terms class, object and message

Define the terms class, object and message. How does the concept of message passing help to encapsulate the implementation of an object, including its data?

  Describe the concept and function of electronic money

Identify potential solutions for these issues and evaluate their ability to protect both payers and receivers. You must remember this homework has to be plagiarism free thanks

  Questions on cyber security

Question 1: Submit a list of five cybersecurity breach case studies. Question 2: For each breach, write a brief statement covering the following points: a\ When did the incident take place (dates)? b\ What went wrong? c\ What was the outcome?

  Describes the ideal information system security plan

Write a 1,750- to 2,450-word paper that describes the ideal information system security plan for your selected organization. Provide a clear description of the organization that includes the following: Business purpose and Primary functions

  Value of the challenge text sent by the ap

What is the value of the challenge text sent by the AP and what is the value of the IVcaptured by the attacker - what is the value of the response to the challenge?

  Research the elements of a multilayered security plan

You need to research the elements of a multilayered security plan and to create a detailed outline. Your outline should indicate one or more general security solutions for each of the seven domains of a typical IT infrastructure

  Computer systems architecture

From a Windows comand line prompt execute a DIR command. Note and record how much space remains on your disk drive. Open NOTEPAD and create a new file that contains only a period and a carriage return. Save the file as "sample.txt". Use a DIR samp..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd