Implement a simple tcp client-server system

Assignment Help JAVA Programming
Reference no: EM132077411

Assessment

Task 1

You are to research five topics:

- The use of stacks in computer science; explain why stacks are important and how a stack can be implemented either in Java or Python.
- Explain two ways in which threads can be created in Java.
- The use of queues in computer science and how they might be implemented in Java or Python.
- Give details of two or more Input/Output devices and evaluate their usefulness, giving technical data of interest.
- What is meant by a recursive function definition? Give an example and explain how the definition works.

The result of each piece of research should be carefully written up, giving diagrams where appropriate and citing references used. You should aim at giving depth in answering these questions.

Task 2

You are to design and implement a simple TCP client-server system that makes use of a simple proxy server.

672_figure.jpg

Figure 1 the Architecture of the Proposed System

Overview

This assessed coursework assignment is designed to give you an opportunity of further developing and understanding software, how to configure a concurrent application using three separate pieces of software in order to allow Internet communications. It provides you with the opportunity of designing, implementing and understanding what in effect are a complete concurrent system serving one or more useful purposes.

Objectives

The main objective is to use your proxy within an operational system - executing all three programs (client, proxy and remote) server together - and testing the system's overall functionality. You will need to decide how best this is to be done, and draw appropriate conclusions.

Specific Requirements

Firstly, the proxy should accept a TCP connection request from a TCP client on Port 8080. It should open a TCP connection with your chosen TCP server and connect the client with the server, and the server to the client using streams provided by the sockets created. It is required that TCP communications from client to (remote) server are concurrent, with respect to TCP communications in the opposite direction. Minimally you should aim at constructing a system enabling an echo client to send messages via the proxy to an echo TCP server and correctly receive a copy of the message sent. The second capability of your proxy to be established is whether a client (such as the GenericClient.java found on Moodle) or an ordinary Web browser can connect via your proxy to a well-known Web server and successfully display the homepage in html format remembering that an HTTP client and Web server may should be capable of communicating with one another concurrently.

Secondly, you should investigate further how proxy servers might be used. These uses should be valuable to internet users. This investigation should be at least 1000 words long and written up formally, providing sources referred to, and using the Harvard referencing system.

Coursework - Project

Task 1

You are to provide an in-depth overview of Peer-to-Peer (P2P) computing by describing two or more well-known systems explaining what their role is and how they work at the level of network protocol used. In particular, you should explain how a client joins (and leaves) a P2P system, and in particular their advantages over normal client-server computing systems. You should address some of the professional, business and legal issues arising from the use of P2P networks by referring to the history of P2P networking and computer Systems and any relevant legislation. Finally, you should consider whether Skype is a P2P system, giving reasons for your answer.

Background Reading for Task 1
There is plenty of documentation and a range of short articles available on the Internet. However, a possible starting point might be the slides from Keith Ross and Dan Rubenstein "P2P Systems" (a copy is available on Moodle). These were written a while ago, but contain much essential background, and provide coverage of some of the main P2P systems in the past. Most of the material is quite straightforward, but some advanced material is covered. There is a bibliography at the end of the slides.

Task 2
You are to consider the problem of how a file can be distributed using UDP programming techniques. A file ("gutenberg.txt") is to be copied over the Internet from a host server to a client. This file is available on Moodle. The way in which the transfer takes places is by the server opening the file after it receives a request from the client. It then sends the file line-by-line.

You should initially set up the system (consisting of the server and client) using the two skeleton programs provided. Ultimately, data transmission should be designed to use a stop-and-wait protocol, i.e. on successful receipt of a line of text, the client will send an ACK, which implicitly is a request for the next line. You should attempt to add additional code to implement the simplest form of the protocol and to explain additions you would make to the code needed.

You may additionally wish to consider the case of the server not receiving an ACK back from the client after transmission of a line of code, and to suggest a reasonable action that should be taken by the sender. Why might and ACK not be received?

Instructions
Skeleton code for both client and server is provided as well as the file to be transferred. As the first step, you should provide a system that successfully transfers the file by executing the two programs in Eclipse, and give an explanation of the main features of the code. You should provide evidence of the file having been transferred.

You should then explain how the file would be transferred in principle by using the simplest version of stop-and-wait.

You should discuss the problem (or problems) that the stop-and-wait protocol are designed to solve, and outline one or more increasingly more elaborate steps to address corruption of data, or missing ACKs and data packets.

Finally, you should state what the protocol's main disadvantage is providing an explanation, and suggest how the protocol could make more efficient use of bandwidth by pipelining the protocol.

The client and server can both be executed using localhost ("127.0.0.1") and by using different UDP ports.

Reading for Task 2

The essential reading is contained in the tutorial material for UDP programming, and in particular the documentation on UDP Servers and clients. You may wish to consult the FileCopy Program the uses streams to read from and write to a file on a hard disk. You will need to remind yourself of socket creation in UDP, and how to use its relevant methods to read data from and write data to a communication partner.

Attachment:- Coursework.zip

Reference no: EM132077411

Questions Cloud

Interpersonal skills relate to managerial effectiveness : Discuss how technical, conceptual, and interpersonal skills relate to managerial effectiveness.
Compute the amount of the premium : Compute the amount of the premium that Newton Corporation should amortize on December 31, 2011, assuming the "effective-interest" method is used
Compute balance of investment in straw corporation account : Straw Corporation reported net income of $100,000, The balance of the Investment in the Straw Corporation account on the books of Evanston Corporation is
Contrast the role of management and management theory : Compare and contrast the role of management, as reflected by management theory,
Implement a simple tcp client-server system : IFG Computer Science - Foundation in Computer Science - Explain two ways in which threads can be created in Java - Give details of two or more Input
Why do people succumb to this irrational behavior : Is it rational for a person to not increase a savings rate over time that was initially set too low? Why do people succumb to this irrational behavior?
Prepare sesame entry to record depreciation expense : Sesame Company purchased a computer system (equipment) for $64,600 on January 1, 2013. Prepare Sesame's entry to record 2015 depreciation expense
What are some key indicators of a company : What are some key indicators of a company with a strong balance sheet?
Determine the amount of maintenance costs : If the maintenance costs are allocated to operating departments based on square footage, determine the amount of maintenance costs

Reviews

len2077411

8/6/2018 2:08:44 AM

Evidence that these tasks have been completed together with the required report must be formally submitted to IFG. Appropriate screen dumps showing the setup of each server and client together with a report containing an explanation of the essential code used to implement the proxy server will suffice. Note: Task 2 is worth 50% of available marks. Task 2 is broken up into two sub-tasks the first being the report and the research you have undertaken and the second your discussion of system’s operation and evidence of the system working. Both subtasks are worth 25%

len2077411

8/6/2018 2:08:30 AM

All marks for this coursework will be allocated to the successful setting up of system. Thought should go into making the system operational and for you to supply test data and devise a scheme for testing the system. The simple proxy server is to enable a client to send messages to, and receive replies from, an echo server. If a web server is used then sending a simple HTTP command should prompt an appropriate HTTP response (e.g. a web page).

len2077411

8/6/2018 2:08:11 AM

Credit will be given to careful and accurate research on the topics identified. Your understanding of network protocols should be apparent in discussing the operation of P2P systems. This piece of work provides you with an opportunity to show your understanding of data communications, relevant algorithms and data structures as appropriate.

len2077411

8/6/2018 2:08:00 AM

The following two tasks are to be completed: the first task is worth up to 60% of the overall mark, and the second is worth up to 40% of the overall mark for this assessment:Overall, you should state the intended correct operation of the client and server, and demonstrate this operation by a screen capture (such as Screenpresso, or any package suitable for your laptop). You should provide a commentary on this operation. If the system doesn’t perform as intended you should capture this behaviour and attempt to analyse this as carefully as possible, by referring to program code. Credit will be given for your ability (1) to explain the intended operation of both programs (this might include the use of two finite state machine diagrams); (2) to run both skeleton programs using Eclipse and (3) for formulating a simple test strategy for showing the file is transferred successfully or otherwise. (4) Credit will be given for your consideration the issues of stop-and-wait such as the additional program code needed and its advantage and its disadvantages compared to not any particular protocol at all.

Write a Review

JAVA Programming Questions & Answers

  Determine total annual compensation of a salesperson

Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors: A salesperson will earn a fixed salary of $45,000

  Develop the simplified p2p file sharing system

develop the simplified P2P file sharing system - A peer needs to ignore the requests from itself because by default IP multicast sends a message to every peer

  Develop java program using arrays

Critical part of any system. In this lesson, a Graphical User Interface (GUI) is created. The code generated will link the components to the action.

  Write a generic class called myfour

Write a generic class called "MyFour". It should use a type parameter of "T". It should have four fields, item1, item2, item3, item4, all of type T

  Implement a public class date that represents a date

The Date.java class. Implement a public class Date that represents a date composed of a month , day, and a year. Declare month, day, and year as integers.

  Design and write a base e and three derived classes

Design and write a base e and three derived classes that inherit from the base (similar to the shape class and the derived shape base asses).

  Identify the key properties of a web crawler

Identify the key properties of a web crawler. Describe in detail how each of these properties is implemented in your code.

  Write a recursive method that takes two non-negative integer

Write a recursive method that takes two non-negative integers m and n as parameters and returns the product.

  Leadership position in a hospital emergency room

Identify in a leadership position in a hospital emergency room. Evaluate how  organization handles patient and employee education, and whether that organization participates in any research (if so, find out what types and whether it is mostly qualita..

  Socket programming modify the translate program and

socket programming modify the translate program and dictionary program. modify the programs to handle multiple user

  Implement an inheritance hierarchy based on the following

Implement an inheritance hierarchy based on the following specifications for Account class, Checking Account class, and Savings Account class Methods: processDeposit ( ) - accepts a single double parameter containing the deposit amount. Updates the ..

  Make sure you are exception handling by verifying

Make sure you are exception handling by verifying that all of the customer-entered information is valid before the order is submitted to ensure order accuracy.

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