Added test to Packets and more
This commit is contained in:
13
protocol.md
13
protocol.md
@@ -2,7 +2,7 @@
|
||||
|
||||
// Handshake or encryption setup here
|
||||
1. Client sends request for file
|
||||
2. Server answers with error or FileSize (possibly also Packetsize)
|
||||
2. Server answers with error or FileSize
|
||||
3. Client ack
|
||||
4. Server sends File Packets with Sync to keep track
|
||||
5. Server sends Sync End Packet
|
||||
@@ -13,8 +13,15 @@
|
||||
8. If Client has all packets, or retries has exceeded limit. Client sends Ack Packet for last Sync
|
||||
9. Client and Server "close" / forget the connection
|
||||
|
||||
## Header
|
||||
4 Byte Header Length | 4 Byte Request Flag (Request, Pte, Ack, File, End, Resend) | 4 Byte Sync | 4 Byte Data Length | x Byte Data
|
||||
### Secure Header | Unencrypted
|
||||
1 Byte RSA Flag | 24 Byte Nonce | 8 Byte Session ID | 4 Byte Encrypted Data Length
|
||||
|
||||
### Packet Header | Encrypted
|
||||
1 Byte Header Type Flag | 4 Byte Sync
|
||||
|
||||
### Packet Structure
|
||||
37 Byte Secure Header | 5 Byte Packet Header | <= 446 Byte Data | 16 Byte chacha20poly1305 overhead
|
||||
|
||||
|
||||
### Data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user