Code Monkey home page Code Monkey logo

cn-assignment-6's Introduction

CN-Assignment-6

Implement an application level RDT protocol.

Your program will have a client and a server part, both using UDP sockets and then additional RDT layer on top of it. The server is basically going to do an addition of specified numbers. This is how the communication will take place:

Client: 3 
Server: 3 + ACK 
Client: 4 5 9 + ACK 
Server: 18  + ACK

The first message from client is the number of numbers(3 here), the server echoes the same back in second message; then client sends the numbers (3 RANDOM nos: 4 5 9 in this case), and server sends their sum back. The client verifies that the sum is correct by locally computing it and verifying it. Since both client and server are going to run on 127.0.0.1, there is no chance of packets getting dropped; hence we will 'simulate' the packets getting dropped.

Packets dropped simulation: The program will have a function called udtsend() which will accept a packet and send it with a probability as command line argument. Not sending the packet will be equivalent to the packet getting dropped.

Both the programs will use a timer to detect a packet drop (actually packet that was never sent by other side) and then resend packets.

You need to take care of the following: duplicate packets, duplicate ACKS, sequence numbers. Design the application header properly.Each message from the client and server should carry an identifier also (same identifier for the 4 messages), to distinguish between different connections.

Your code should clearly modularise the functions

udtsend()
rdtsend()
udtrecv()
rdtrecv()

Every packet drop, timeout and retransmit should be printed one each side.

Filenames: client.py server.py library.by (the library.py can include the common code used by client and server both)

For example: The programs will run like this:

$ python3 ./client.py 0.4

Dropped Packet 2, ID: 123123

Retransmitted Packet 2, ID: 123123

$ python3 ./server.py 0.75

Timeout: Packet 2: ID 123123

Where the second argument is the probability of dropping packets.

cn-assignment-6's People

Contributors

codeplusmath avatar

Stargazers

 avatar

Watchers

 avatar

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.