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

  Protecting and securing any kind of network

Protecting and securing any kind of network is our responsibility as a network engineer. No matter what kind of situation we get into weather good or bad we have to stick to our ethics and knowledge to provide the best service and support to our c..

  How a company-wide policy program could help the situation

Explain why you think the use of these guidelines and procedures is not sufficient and may not solve the problem. Consider how a company-wide policy program could help the situation.

  Open this using a brute-force attack

What is the worst case number of combinations he must now test to try open this using a brute-force attack?

  Illustrate possible placement of servers including access

Illustrate the possible placement of servers including access paths to the Internet and firewalls. Note: Facility limitations, workstations, printers, routers, switches, bridges and access points should be considered in the illustration.

  Technical versus soft skills

Suppose that there is some consensus with basic premise that most skills can be learnt, which would you expect to be the more productive task,

  Write a ten page report for the cio of kudler fine foods

Write an 8-to 10-page report for the CIO of Kudler Fine Foods. The report should have clear recommendations to ensure that the final frequent shopper program system is properly secured against likely threats.

  Define information security governance and management tasks

Develop a checklist of items that needs to be addressed by senior management. Define the information security governance and management tasks that senior management needs to address.

  Can this many users be supported under circuit-switching

A circuit-switching scenario in which Ncs users, each requiring a bandwidth of 20 Mbps, must share a link of capacity 100 Mbps.

  Explain the necessary components within a security policy

Using or textbooks, internet and other resources, identify the necessary components / sections within a security policy and then craft the actual policy for XYZ Healthcare and address the risks within policy that are prevalent with Remote Access.

  Coaxial cable as a transmission medium

The earliest LANs used coaxial cable as a transmission medium. Over time, unshielded twisted pair wiring emerged as a better and faster medium.

  Write a paper about malware that could cripple organization

Write a paper about malware that could cripple your organization. You have been tasked to describe the ways in which different malware function. You also must provide at least one example.

  Discuss how this and other information security

write a 1400- to 2100-word paper that describes the security authentication process.discuss how this and other

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