MantisBT - Zandronum
View Issue Details
0002288Zandronum[All Projects] Suggestionpublic2015-06-07 21:342016-04-10 19:18
Watermelon 
 
highfeaturealways
confirmedopen 
 
 
0002288: Packet header
To use LZ4 we'll need a packet header.

Depending on how well this goes, maybe it can even be used for clients? I don't know if we would want to bother having reliable transmission for client pukes (or if we care).
No tags attached.
Issue History
2015-06-07 21:34WatermelonNew Issue
2015-06-07 21:34WatermelonStatusnew => needs review
2015-06-07 21:34WatermelonNote Added: 0012589
2015-06-07 21:52Edward-sanStatusneeds review => confirmed
2015-06-08 05:57DuskNote Added: 0012590
2015-06-08 14:45WatermelonNote Added: 0012593
2015-06-08 14:48WatermelonNote Edited: 0012593bug_revision_view_page.php?bugnote_id=12593#r7312
2015-06-08 14:49WatermelonNote Edited: 0012593bug_revision_view_page.php?bugnote_id=12593#r7313
2015-06-08 14:50WatermelonNote Edited: 0012593bug_revision_view_page.php?bugnote_id=12593#r7314
2015-06-08 17:52Torr SamahoNote Added: 0012600
2015-06-08 18:18WatermelonNote Added: 0012601
2015-06-08 18:53WatermelonNote Edited: 0012601bug_revision_view_page.php?bugnote_id=12601#r7320
2016-04-10 19:18Torr SamahoProduct Version3.0 =>
2016-04-10 19:18Torr SamahoTarget Version3.0 =>

Notes
(0012589)
Watermelon   
2015-06-07 21:34   
From previous meetings, was there any discussion on the general protocol/idea behind how this would be done?
(0012590)
Dusk   
2015-06-08 05:57   
The point of the packet header was so that it would be protocol-agnostic. Every packet Zandronum would ever use would contain this header, which would detail which protocol it is for and how it is compressed.
(0012593)
Watermelon   
2015-06-08 14:45   
(edited on: 2015-06-08 14:50)
Throwing out some stuff:

Header:

[0x01] Type:
    - (0) Reliable
    - (1) Unreliable

[0x02] Compression:
    - (0) LZ4
    - (1) Huffman
    * May not actually be needed right now

[remaining 6 bits unused (for now)]


I figure we need Huffman coding since the unreliable stream would mess up LZ4, therefore meaning all unreliable code from server <-> client needs it.

* The reason I said this may not be needed now is that if LZ4 works, then the reliable channel should always be LZ4, and the unreliable channel will always have to be Huffman.




Body:

Reliable:
    - Sequence number
    - Payload of headers + data

Unreliable:
    - Payload of headers + data


(0012600)
Torr Samaho   
2015-06-08 17:52   
Here is what I said earlier regarding the header in 0001268:0012193, i.e.
Quote from Torr Samaho

Mandatory contents of the header are the compression type and the packet number (to keep track of lost packets). How exactly they are encoded and if additional things are needed is up for discussion.
(0012601)
Watermelon   
2015-06-08 18:18   
(edited on: 2015-06-08 18:53)
I'm assuming then this is only for the reliable stream, and the unreliable stream will be handled as it currently is?

If that's the case, the first 2-3 bits of the first byte could be different kind of compression (in case we find any new ones in the future, but I'm guessing we won't keep finding new ones every year), then the sequence number comes after that.

I currently can't think of anything else that would be needed in the header.


I figure if we ever decide in the future for something we need to add, the residual bits in the first byte can be used at a later date. Therefore if nothing is to be added, the unused bits should be set to 0 always for now.