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

  An overview of wireless lan security - term paper

Computer Science or Information Technology deals with Wireless LAN Security. Wireless LAN Security is gaining importance in the recent times. This report talks about how vulnerable are wireless LAN networks without any security measures and also talk..

  Computer networks and security against hackers

This case study about a company named Magna International, a Canada based global supplier of automotive components, modules and systems. Along with the company analysis have been made in this assignment.

  New attack models

The Internet evolution is and is very fast and the Internet exposes the connected computers to attacks and the subsequent losses are in rise.

  Islamic Calligraphy

Islamic calligraphy or Arabic calligraphy is a primary form of art for Islamic visual expression and creativity.

  A comprehensive study about web-based email implementation

Conduct a comprehensive study about web-based email implementation in gmail. Optionally, you may use sniffer like wireshark or your choice to analyze the communication traffic.

  Retention policy and litigation hold notices

The purpose of this project is to provide you with an opportunity to create a document retention policy. You will also learn how to serve a litigation hold notice for an educational institute.

  Tools to enhance password protection

A report on Tools to enhance Password Protection.

  Analyse security procedures

Analyse security procedures

  Write a report on denial of service

Write a report on DENIAL OF SERVICE (DoS).

  Phising email

Phising email It is multipart, what are the two parts? The HTML part, is it inviting the recepient to click somewhere? What is the email proporting to do when the link is clicked?

  Express the shannon-hartley capacity theorem

Express the Shannon-Hartley capacity theorem in terms of where is the Energy/bit and is the psd of white noise.

  Modern symmetric encryption schemes

Pseudo-random generators, pseudo-random functions and pseudo-random permutations

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