Code Monkey home page Code Monkey logo

shitty-tcp's People

Contributors

eliasjorgensen avatar itualol avatar vilfredsikker avatar

Watchers

 avatar

shitty-tcp's Issues

3. Write programs to reliably communicate over UDP.

Using only DatagramSocket, write programs A,B which together reliably transmits a string of length less than 255 characters. Program A accepts at startup a destination ip and port and a string, then transmits the string, somehow ensures that the string correctly arrived, says so and terminates. Program B repeatedly receives such strings and prints them.
Your transmission mechanism must guarantee that for each invocation of Program A with string S, Program B prints S exactly once.

  • Optional: Design the server, so that it can handle multiple concurrent clients.

  • Submit two java source files ReliableUDPClient.java and ReliableUDPServer.java

2. Write programs to estimate UDP datagram loss.

The program Your programs must accept as input

  • (a) datagram size
  • (b) number of datagrams to send
  • (c) interval between transmissions.

The program must output

  • (a) absolute number and percentage of lost datagrams and
  • (b) absolute number and percentage of duplicated datagrams.
  • (c) absolute number of reordered packets

It is acceptable if your estimate cannot distinguish between losing a single request, losing a single response, or losing both a request and a response.

Use your loss estimator to demonstrate:

  • Datagram loss on a local connection on a single machine (i.e., no physical net).

  • Datagram loss on Wifi.

  • Datagram loss on ethernet.

  • Datagram loss on the Internet (i.e., transmitting across multiple physical nets).

  • Indicate for each of these four cases the parameters (a-c above) you used to elicit the loss and the observed lossage (i-ii above).

  • Explain where and why you expect the loss to be happening.

  • Submit a single java source Estimator.java and a .txt file briefly summarising your findings.

1. Write a drop-in replacement for DatagramSocket

Write a drop-in replacement for DatagramSocket which randomly either discards, duplicates, reorders or simply sends datagrams. Inherit from DatagramSocket.

When sending the datagrams "Hello" and "Goodbye" the following datagrams could be send.

  • Discard: "Goodbye"

  • Duplicate: "Hello", "Hello", "Goodbye"

  • Reorder: "Goodbye", "Hello"

  • Send: "Hello", "Goodbye"

  • Test your implementation with a (modified) UDP-client.

(Hint, useful Java libraries: java.util.Random, java.net.DatagramSocket)

  • Submit your solution as a single Java-file QuestionableDatagramSocket.java.

1a. Implement an RFC862 server

Implement an RFC862 server adhering to the RFC 862 specification. Use port 7007 instead of 7. You need only implement the UDP part ("UDP Based ...โ€).

  • Submit your solution as a single Java-file RFC862.java.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.