41
RaptorNL / Re: Questions about the RUDP headers
« on: November 02, 2006, 07:06:32 pm »
First off, I'd like to note that I moved the Enhanced UDP information off of the Features page into its own page.
I can agree with leaving the header length, now that I've read more of the spec. I just wanted to make sure it got discussed so we're sure what we're doing.QuoteDo we really need header length?
If we look further down the spec, we can see that every segment except EAK has a fixed length in bytes (which is the unit of the value in header length). About half of the segments (ACK, RST, NUL) have header lengths of 6. SYN has the longest length at 28, and TCS has 12. Only EAK has a variable-length header, since the header contains the list of segments received out of sequence. "Its minimum value is seven and its maximum value depends on the maximum receive queue length." Thus, we need the header length to know how long the segment header is.
I suppose we can make an argument that if we know the type of segment (based on the flags at the start) that we know the size of the segment, meaning that the size is not needed. However, I'd still think the size would be necessary for determining whether additional data was included in the segment (which is expressly forbidden for certain segment types - SYN, RST, NUL - meaning that an error would be thrown), and for determining whether the whole packet made it (especially important for EAK, since we can't know the full header length).
Quote
It is worth noting that the spec refers to the data as "segments," not "packets." I think this is due to RUDP being implemented on top of the UDP protocol - the whole thing, UDP header + RUDP header + data (if any) is the whole packet. However, to UDP's standpoint, the RUDP header is simply regular data in binary form, to be interpreted in any way so chosen by the recipient. Thus, I think the spec is thinking of the RUDP headers as simply "segments" in the packet as a whole. Just an observation I thought I'd share.Ok, we can change our terminology to match, if we want to. The reason I'm using the term "packet" stems more from my experience with RakNet.
Quote
The reason I asked that is because I want to add two flag types to the original spec: one for reliable/unreliable and one for ordered/unordered.QuoteDo we need all those flag bits?
As described above, the flag bits are necessary to know what kind of packet we're dealing with, so I'll take this question as "Do we have to send all of the types of packets described in the spec?" Initially, I'd say yes - they're in the spec, so we should probably use them. The only one we may not end up using is the NUL packet, which is basically the equivalent of a "ping," which the Gamdev.net forum post says can easily be accomplished (in games) by just watching the traffic going back and forth. However, I would still rather include it for completeness's sake, rather than leaving it out to save a bit and a minor bit of logic to handle it.
Quote
Where does channel number fit in here?I modified the page to include that today.
Quote
These headers are both for sending ordered data packets? Is that why we have the 7th bit 0 for reliable and 1 for unreliable (which I would reverse, personally)?Yes. I have actually changed the meaning of that bit in the latest version on there, using the ACK bit instead for reliable/unreliable (since ACK is only used when you're doing reliable packet transmission) and used that bit instead to signify ordered/unordered receipt.