Git Product home page Git Product logo

simple-tcp-over-udp's People

Contributors

radonx avatar

Watchers

 avatar  avatar

simple-tcp-over-udp's Issues

TCP packet

  • seq & ack
  • TCP payload: deliver a single file

implement TCP header

  • building a header with char* in C

    using the pack() and unpack() function. They take a series of numbers and parameters specifying each number's type (int, short, long) and return the bit format of the bits.

    Here is an example command to 'pack' the header into it's bit format:

    bitHeader = pack( 'HHLLBBHHH', source, dest, seq, ack_seq, offset, unusedFlags, windowSize, check, urg_ptr )
    'HHLLBBHHH' is the format of the bits. H stands for short int (2 bytes), L stands for int (4 bytes) B is binary (1 byte)

    Now you can just append the packet payload to this bit header, send it through the link, get the packet on the other side and remove the first 32 characters from the packet (think header = packet[:32]) unpack them and now on the other side you have a tuple of all your packet header values!

test with newudpl

newudpl
[-i sorce_host[[:|/][port|*]]] [-o dest_host[[:|/]port]]
[-s link_speed] [-d delay] [-e Ethernet_speed] [-q queue_buf_size]
[-B bit_error_rate] [-L random_packet_loss_rate] [-O out_of_order_rate]


Commenting out line 161 in sysdep.h worked for me (I'm using Mac OS X, 10.11.3).

RTT

the RTT computation is only updated for original segments. You can also see the gory details in https://tools.ietf.org/html/rfc6298 (only sections 1 through 3 are likely relevant since we don't worry about timer granularity for this assignment).

TCP MUST use Karn's algorithm for taking RTT samples. That is, RTT samples MUST NOT be made using segments that were retransmitted (and thus for which it is ambiguous whether the reply was for the first instance of the packet or a later instance).

I found a suggestion to use an initial timeout length of 3s, and then commence using RTT and devRTT after two RTT measurements.

RFC 1323 [JBB92]
suggests that TCP connections utilizing large congestion windows
should take many RTT samples per window of data to avoid aliasing
effects in the estimated RTT.

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.