Develop a reliable transfer protocol over udp

Assignment Help JAVA Programming
Reference no: EM13537

Project: Socket Programming - UDP

Objectives:

- Learn socket programming in Java: UDP

-  Cement your understanding of reliable transfer protocols

Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.

Overview

This framework provides:

-  a template for the reliable transfer protocol implementation.

-  a testing framework, with a graphical user interface.

How to use the testing framework later in the project description.

The main goal of this project is to implement a Stop-and-wait reliable transfer protocol based on the provided template.

-  MyDataPacket,
-  MyAckPacket,
-  MyServerSocket and  
-  MySocket

The former two classes are used to handle data and ack packets, respectively. They are fully implemented. Implement the latter two classes, i.e., MyServerSocket and MySocket. These classes have the following interface:

class MySocket
{
    public MySocket(InetAddress IPAddress, int portNumber)
 
    public OutputStream getOutputStream()
}
 
class MyServerSocket
{
    public MyServerSocket(int port)
 
    public InputStream getInputStream()
}

These classes are quite similar to the TCP sockets available in Java: Socket and ServerSocket. Therefore, we make a few simplifications:

-  No connection-level multiplexing. We assume that only one client at a time connects to a MyServerSocket open at a given port. Therefore, MyServerSocket has no accept method.

Furthermore, we are not going to implement any mechanisms for opening or closing of connections.

-  Unidirectional transfer. Our sockets implement transfer of data in one direction only. To send data, MySocket must be used. To receive data, MyServerSocket is used.

Consequently, there is no getInputStream in MySocket and no getOutputSteam in MyServerSocket

A benefit of the above interface is that we can use it with all the familiar stream classes available in Java, such as DataOutputStream or BufferedReader. An example program that would use our sockets can look as follows:

// Sender (Client)
    ...
    MySocket socket = new

MySocket(InetAddress.getHostByName("somhostname.edu"), 12345);

    DataOutputStream out = new DataOutputStream(socket.getOutputStream());

    out.writeBytes("Hello world!");
    ... 

// Receiver (Server)
    ...

    MyServerSocket serverSocket = new MyServerSocket(12345);

    BufferedReader in = new BufferedReader(new

InputStreamReader(serverSocket.getInputStream()));

    String sentence = in.readLine();

    System.out.println("Received: " + sentence);
    ...

Reference no: EM13537

Questions Cloud

Create a shopping cart in asp : The users will use a browser to access the on-line store. The web server software for the production web server is Windows 2003 Server /IIS6.
Create a structural model : Structural modeling is a different view of the same system that you analyzed from a functional perspective. This model shows how data is organized within the system.
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.
Recursive tree algorithms : Write a recursive function to determine if a binary tree is a binary search tree.
Develop a reliable transfer protocol over udp : Develop a reliable transfer protocol over UDP. Focus on a Stop- and-Wait protocol.
Create a web site for an apple farm : Create a web site for an apple farm. Create an HTML5 form allowing visitors to create an account with the site. Account details are to be stored in your MySQL database. Information should be stored in a secure way.
Stock market project : Select five companies for the purpose of tracking the stock market, preparing research on the companies, and preparing company reports.
Shopping cart program for web applications class : Shopping Cart program for web applications class. Allows user to browse while keeping track of the items in which they will purchase at the end on the order page link and this will give a final price for all items.
Estimate the residual value and perform firm valuation : Estimate the Residual Value and perform the corresponding firm valuation.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Java program to create a tree

Java program to create a tree, generate class - BottomUpTwoThreeFourTree, BottomUpTwoThreeFourTree,

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Determine if strings are equal

Complete the recursive method match in the code below which will determine whether or not two strings match.

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