Git Product home page Git Product logo

sliding's Introduction

sliding

Protocol-agnostic, efficient sliding transmission window implementation

Usage

SlidingWindow(protocol, size, max_retrans, timeout).run(packets)
  • protocol - An object capable of sending packets and receiving responses.
  • size - The window size.
  • max_retrans - Max retrans attempts for each packet before failing the operation.
  • timeout - How long to wait for a confirmation for a packet since its transmission.
  • packets - A source of iterable data describing each packet, that protocol is capable of sending

Theoretical Background

Many protocols dealing with transferring large amount of data, needs to do this in a reliable manner.

Depending on the medium the data has to travel in, this might not be a trivial task. data might get lost along the way, or get corrupted due to noise or other physical factors.

Sending the entire data in a single transmission is not very practical because if something goes wrong - you have to resend to whole thing again.

Thus, the data is usually split between multiple "packets", which can be verified, and retransmitted if needed.

To verify a packet, the receiver needs to confirm its reception. This confirmation, is itself bound to the same conditions of the original packet, and might also get lost / corrupted. The sender need to deal with these situation by issuing a re-transmission, and the receiver should expect duplicate packets arriving.

The performance issue

Waiting for confirmation on each packet before sending the next one, will result in a bad throughput. This is because the medium will not be utilized while waiting for the confirmation to arrive.

Ideally we would prefer that the sender will send the entire data (split to individual packets) to the receiver, and then wait for confirmation / rejection on individual packets. Practically it is not always possible due to memory limitations on both sides, and in order to avoid network congestion.

Sliding Window

For these reasons, protocols usually limits the number of packets allowed to be transmitted in burst, before pausing for confirmation. A batch of packets that are waiting confirmation is called a Transmission Window

There is no need to wait for confirmation on the entire window. As confirmations starts to arrive, more packets are can be sent, thus shifting the window forward, or Sliding it.

Terminology

  • Request - a packet sent to a receiver, that requires confirmation by the receiver
  • Retransmission Timeout - The amount of time from the transmission of a packet, in which a confirmation is expected. If no confirmation received, the packet is considered lost, and should be retransmitted.
  • Window Size - The maximal amount of unconfirmed packets that are allowed to sent at any given moment.

sliding's People

Contributors

avrahamshukron avatar talshorer avatar

Stargazers

 avatar

Watchers

 avatar James Cloos 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.