Giter VIP home page Giter VIP logo

muhammedkhamis / rdtoverudp Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 3.0 12.23 MB

We aimed to implement our own socket layer and reliable transport layer. So we implemented a reliable transfer service on the top of UDP/IP protocol. In other words, you need to implement a service that guarantees the arrival of datagrams in the correct order on top of the UDP/IP protocol, along with congestion control.

License: MIT License

CMake 4.54% C++ 94.87% C 0.59%
udp rdt selective-repeat go-back-n gbn stop-and-wait congestion-control

rdtoverudp's Introduction

RdtOverUDP

Introduction

In this assignment, we aimed to implement our own socket layer and reliable transport layer. So we implemented a reliable transfer service on the top of UDP/IP protocol. In other words, you need to implement a service that guarantees the arrival of datagrams in the correct order on top of the UDP/IP protocol, along with congestion control.

Reliability layer

Specifications

Suppose you’ve a file and you want to send this file from one side to the other(server to client), you will need to split the file into chunks of data of fixed length and add the data of one chunk to a UDP datagram packet in the data field of the packet.

Reliable data transfer (RDT) methods

We have implemented 3 different methods, and will explain them below

Stop-and-wait

The server sends a single datagram, and blocks until an acknowledgment from the client is received (or until a timeout expires).

Selective-repeat

At any given time, the server is allowed to have up to N datagrams that have not yet been acknowledged by the client. The server has to be able to buffer up to N datagrams, since it should be able to retransmit them until they get acknowledged by the client. Moreover, the server has to associate a timer with each datagram transmitted, so that it can retransmit a datagram if it is not acknowledged in time.

Go-Back-End (GBN)

The server sends up to N datagrams that have not yet acknowledged by the client. the server also has to be able to buffer up to N datagrams, since it should be able to retransmit them until they get acknowledged by the client. The server should accept cumulative acknowledgment, which mean that the client would send acknowledgment with last expected acknowledgment number, so if the expected packet lost, and the client received other packets, then the client would send acknowledgment for the last correctly received packet, from that the server knows that packet loss happened, and starts sending that packet again.

Packet Specifications

There is 2 types of packets sent through the network. Data packets, and acknowledgment packets. Both packets have the same header, but the data packet got extra field for the data we want to transfer.

Congestion Control

Introduction

congestion is informally: "too many sources sending too much data too fast for network to handle", there are two main indicators for congestion: lost packets (buffer overflow at routers) long delays (queuing in router buffers). No handling network congestion may lead to unneeded retransmissions(link carries multiple copies of a packet, since when packet dropped, any upstream transmission capacity used for that packet was wasted)!

Additive increase Multiplicative decrease

the sender increases transmission rate (window size), probing for usable bandwidth, until loss occurs. So we implemented dynamic window, that its size increased by 2 in case of receiving correct acknowledgment, decreasing the window size to 1 in case of time-out of the packet, and decreasing it to its half size in case of 3-duplicate acknowledgments.

Packet Loss Simulation

  • Since we don’t have machines with OS that we can modify, our implementation will run in a simulated environment, this means that we will simulate the packet loss with packet loss probability (PLP) since packet loss is infrequent in a local-host or LAN environment.

  • We used seed to generate random indices of the lost packets, to simulate the loss.

  • We start the timer of the packet will be sent, then determine if it would be sent or not, if it will not be sent the timer of this packet will raise time-out to simulate time-out, then we will really send this packet again.

Checksum Error Detection.

We provided error detection using checksum to detect transmission errors. We choose to make the checksum of 16 bits as in Internet checksum to make undetected errors very rare, but we can not guarantee completely error-free delivery because of the checksum limitations.

Made with love ❤️

rdtoverudp's People

Contributors

abdelrhman-yasser avatar muhammedkhamis avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

rdtoverudp's Issues

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.