simple-tcp-over-udp's People
simple-tcp-over-udp's Issues
calculate checksum
UDP server/client
TCP packet
- seq & ack
- TCP payload: deliver a single file
ipv6
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!
timer
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).
log file
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.
TCP state machine
- timeout
FIN
Window with acked states
design window
- divide and deliver a single file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.