> > The first packet, "Acknowledge All", aims to reduce the overhead of
> > acknowledging packets. Currently, the "Acknowledge Reliable" packet
> > only operates on a single packet. Most UDP packets arrive in order so
> > reliable packets usually get acknowledged in-order. By using a single
> > "Acknowledge All" packet, all previous reliable packets implicitly get
> > acknowledged, reducing the connection overhead.
>
> The problem I can see here is that if you have 10 packets to
> acknowledge, but only received 9, you'll never get the missing packet.
> For some packets this wouldn't matter, but I can think of several
> cases where reliable packets are used strictly to ensure that they are
> processed in a set order. This has the potential to severely break
> that.
>
I'm not sure I follow the reasoning here. How do you have 10 packets
to acknowledge after receiving only 9 reliable packets? You would only
generate an ACK for a reliable once you've processed it (or buffered
it for deferred, in-order processing).
> What we could do as an alternative is have a list of packet ids,
> rather than just the single we're sending now. This way we can cut
> down on overhead and bandwidth a bit and still not improperly ack
> packets we haven't actually received.
> Technically, we could already do this with packet chunking... but that
> typically gets sent reliably itself, which requires another ack (which
> is kinda silly to be ack'ing the acks... ack, ack ack ack).
I would love to extend the 0x00 0x04 packet so that every 32-bit
integer after the packet identifier is a reliable ID that's being
acknowledged. It would be particularly useful when one reliable goes
missing in a series of reliables. In that case, the ACK-all wouldn't
work and the single-ACK would have a lot of overhead (as you
mentioned).
> > The second packet, "Set Window Size", can reduce the number of
> > reliable packets thrown away when received. Reliable packets beyond
> > the window of the SubSpace protocol stack are dropped as the receiver
> > might not have enough memory (or limits the amount of memory) for
> > reliable packets. The sender, if unaware of the receiver's window
> > size, would resend those dropped reliable packets and send more
> > reliable packets outside the window, leading to additional waste. This
> > packet allows both parties to specify their window size.
>
> Are you planning for embedded systems or something? Unless there are
> some severe packetloss issues involved, I don't think I've ever seen
> reliables get thrown out.
I certainly do want to see embedded devices running SubSpace-related
software. But there's more to it than just that.
Reliables *should* be discarded if they're outside a window or else
the reliable sender could mount a nasty memory attack. If your
protocol stack accepts all reliables and keeps them around until
they're ready to be processed, I could keep sending you reliables in
the 0x10000000-0xFFFFFFFF range and you'd keep allocating more and
more memory. Eventually, you'd run out of memory (assuming 32-bit
address space) and your application dies. Even if I don't manage to
take it down, you'll have enough memory pressure that your machine
will start swapping and will be running with degraded performance. You
could drop the connection entirely if the reliable happens to be too
far out but that would yield an intolerant system. I feel that the
control protocol should be resilient to failures and errors where
possible. Instead of dropping the connection, I think dropping the
packet would be a more appropriate action.
Given my argument for discarding reliables, I would say that knowing
the remote host's window size would help build a more efficient
connection.