summaryrefslogtreecommitdiff
path: root/docs/Lossless_UDP.txt
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2013-06-27 20:59:16 -0400
committerirungentoo <irungentoo@gmail.com>2013-06-27 20:59:16 -0400
commit457feeed0b49a83b8244d0046e0daf3a632fc092 (patch)
tree691ded6a719cbb97ed3be797bd7b3b1a6e1cfd65 /docs/Lossless_UDP.txt
parent3986206de89f7094ba1300e72a7a46916bae7ff4 (diff)
Added current work on Lossless_UDP (Not done do not test it yet)
Lossless_UDP code is probably filled with problems right now. this is normal.
Diffstat (limited to 'docs/Lossless_UDP.txt')
-rw-r--r--docs/Lossless_UDP.txt10
1 files changed, 4 insertions, 6 deletions
diff --git a/docs/Lossless_UDP.txt b/docs/Lossless_UDP.txt
index 54eede16..09a2c133 100644
--- a/docs/Lossless_UDP.txt
+++ b/docs/Lossless_UDP.txt
@@ -17,7 +17,7 @@ Lossless UDP:
17 Bob receives the packet. 17 Bob receives the packet.
18 Bob copies the handshake packet he got from alice but caternates a random 4 byte number to it (handshake_id2) 18 Bob copies the handshake packet he got from alice but caternates a random 4 byte number to it (handshake_id2)
19 Alice receives the packet, checks if handshake_id1 matches the one she sent. 19 Alice receives the packet, checks if handshake_id1 matches the one she sent.
20 If it does she starts sending SYNC packets with sent_packetnum = handshake_id2 . 20 If it does she starts sending SYNC packets with sent_packetnum = handshake_id2 and recv_packetnum = handshake_id1.
21 Bob receives the packet, 21 Bob receives the packet,
22 if (handshake_id2) matches Bob adds Alice to his connections list and starts sending SYNC packets to alice. 22 if (handshake_id2) matches Bob adds Alice to his connections list and starts sending SYNC packets to alice.
23 Alice receives the SYNC packets and starts sending them too. 23 Alice receives the SYNC packets and starts sending them too.
@@ -64,9 +64,7 @@ Lossless UDP:
64 The client receives a Connection handshake packet(not initiating connection): 64 The client receives a Connection handshake packet(not initiating connection):
65 If handshake_id2 is zero: 65 If handshake_id2 is zero:
66 add our random handshake_id2 to it and send it back 66 add our random handshake_id2 to it and send it back
67 If handshake_id2 is non zero 67
68 check if it matches what we sent.
69 If it does add the client sending it to our connection list.
70 68
71 The client receives a Connection handshake packet(initiating connection): 69 The client receives a Connection handshake packet(initiating connection):
72 check if handshake_id1 matches what we sent. 70 check if handshake_id1 matches what we sent.
@@ -80,7 +78,7 @@ Lossless UDP:
80 78
81 Keep track of the percent of packets dropped, if it is too high, lower the send rate. If it is low, increase it. 79 Keep track of the percent of packets dropped, if it is too high, lower the send rate. If it is low, increase it.
82 80
83 81 Have a send packets buffer that we can write to and a recieved packets buffer that we can read from.
84 82
85 83
86 84
@@ -90,7 +88,7 @@ Lossless UDP:
90 [byte with value: 16 (10 in hex)][4 byte (handshake_id1)][4 bytes (handshake_id2)] 88 [byte with value: 16 (10 in hex)][4 byte (handshake_id1)][4 bytes (handshake_id2)]
91 89
92 SYNC packets: 90 SYNC packets:
93 [byte with value: 17 (11 in hex)][byte (00 for keep alive, 01 for request)][byte (counter)][4 byte (recv_packetnum)][4 byte (sent_packetnum)][sequence of requested packet ids[4 bytes each](not present in keep alive)] 91 [byte with value: 17 (11 in hex)][byte (type) (00 for keep alive, 01 for request)][byte (counter)][4 byte (recv_packetnum)][4 byte (sent_packetnum)][sequence of requested packet ids[4 bytes each](not present in keep alive)]
94 92
95 93
96 data packets: 94 data packets: