The presence of TCP options will only increase
the header length to muliples of 4. The added
padding consists of zeros.
This also fixes an emit panic when the Window
Scale and MSS options result in a length of 27
which then gets floored to 24 when applied to
the header.
Closes: #251
Approved by: whitequark
The size of the contiguous window should be prioritized over the size of
the contiguous window if padding were added.
For example, given the following packet buffer:
1 2 3
|---|----|------|
If 2 is used and 1 and 3 are empty, enqueing a buffer of size 4 should
be placed in contiguous window 3 and the size of 1 should not cause
any issues in enqueue.
Closes: #247
Approved by: whitequark
Using Routes<'static> used to make these functions impossible because it created a reference that needed to be valid for the static lifetime
Closes: #243
Approved by: dlrobertson
Improve detection of duplicate ACKs by checking that the segment does
not contain data.
Move implementation from the 'reject unacceptable acknowledgements'
to later in the process function, because a duplicate ACK is not an
'unacceptable' acknowledgement but rather a condition to update state.
Implement more tests to verify the operation of the fast retransmit
implementation.
Related issue: #224Closes: #225
Approved by: whitequark
- Add a helper function for returning an error in the implementation of
next
- Add an assert in Ipv6OptionsIterator::new that ensures that an
iterator is not created with a length field larger than that of the
data buffer we're iterating over.
Closes: #230
Approved by: dlrobertson
The IPv6 Option representation layer structure includes the type value
as the raw u8. This should be stored as the Type enum.
Closes: #229
Approved by: whitequark
- Do not require the packet structure of the header have the same
lifetime as the underlying bytes or the parsed representation.
- Add the bytes of the contained options to the parsed representation
structure.
- Add the IPv6OptionsIterator structure to make iterating over the
contained options easier.
Closes: #212
Approved by: whitequark
This optimization makes sure that enqueueing to an empty ring buffer
would never wrap around, in turn ensuring that enqueueing to an empty
packet buffer would never use more than one metadata entry.
Right now, pushing buffer-sized packets into a packet buffer requires
at least two metadata entries, which is surprising and wasteful.
Implement a simple way to discover and respond to three duplicate ACKs
from the reciver of the data. This leads to a fast retransmit of the
last unacknowledged seqment. This is feature is described in [RFC 5681].
Closes: #104Closes: #214
Approved by: whitequark
Add the FailureType enumeration that can be acquired from a IPv6
extension header option which determines the required action if the
extension header option type is not known or is not supported.
Closes: #204
Approved by: whitequark
Ensure that cargo does not attempt to autodiscover examples. This causes
problems with utils.rs and ensures that an example section exists in the
Cargo.toml.
Only ACKs generated by `dispatch` were updating
`remote_last_win` but not the ACKs generated by
`process`, failing to keep track of the last
announced receive window. This left
`window_to_update` to return false in `dispatch`
after the RX buffer was emptied, thus not announcing
that the receive window is not zero anymore.
The change updates `remote_last_win` for immediate
ACKs generated by `process`.
Closes: #200
Approved by: whitequark