Two test added: one for the normal slow start behavior in presence of a
normal socket (receive a packet, and ACKs the sequence number
according to the RFC) and the other with a malicious socket which sends
many small ACKs (on bad implementation this should artificially inflate
the window).
The class is responsible to take away the IP and TCP header from the packet,
and then to interrogate the pure virtual method ShouldDrop, dropping the packet
accordingly to the returned value. An implementation is a channel which
drops packet with specified flags.
The class provides a general infrastructure for a TCP-related test,
setting up the environment (two sockets connected through
SimpleNetDevice over SimpleChannel) and provides the basic management of
parameters (like segment size).
The receiver actively sends an update-window segment (a segment with ACK
flag set and the window field updated) when SetRcvBufSize is explicitly
called and the buffer size increases.
Moved the entering of persistent state in DoForwardUp(), right before
the processing of the packet (if the rWnd is 0, schedule a persist
timeout).
Right after the processing, check if rWnd is different from 0 but
the persistent event is still active: in this case (triggered when an
update window packet is received) exit from the zerowindow persist state
and try to send data.
Added TcpCongestionOps class, in where the congestion control is
managed. It is created/added to a socket through TcpL4Protocol.
TcpSocketBase and the congestion algorithm classes reworked to be
compatible with the new TcpCongestionOps class.
Since RFC 5681 defines Fast Recovery and Fast Retransmit, it has no sense to
replicate these algorithms over all TCP variants.
The only thing that a variant is allowed to do is using a different slow start
threshold: for example, TcpWestwood uses an estimate of the bandwidth to
calculate it.
So, its calculus has been delegated to a virtual function GetSsThresh which
replaces the old DupAck().
Fixed a bug in Tcp Tahoe implementation (slow start threshold
diminuished only from an RTO).
Fixed a bug on the inflation of the cWnd; it should be inflated of
m_dupAckCount segments (and not only 3, which is OK for the default
value of m_reTxThresh, but not for the others).
Using the TCP without congestion control is not recommented anymore by
IETF. This patch removes the class derived from RFC793. Its behavior
could be reintroduced later with using some conditional Attributes
inside TcpSocketBase.
TcpNewReno is introduced in RFC 2582. The most recent RFC on this is
the RFC 6582. Since its introduction, Tcp NewReno is the RECOMMENDED
algorithm by the Internet Engineering Task Force. The main difference
between Reno and New Reno is in the Fast retransmit algorithm, in order
to recover more quickly when multiple packet losses occur in a single
window. NewReno introduces the concept of Partial acknowledgments. Since
the intention is to merge fast retransmit and fast recovery into
TcpSocketBase, there isn't the possibility to maintain TcpReno as
separate class. However, its behavior could be introduced again with one
conditional attribute in TcpSocketBase itself.
The function ReceivedAck contained some if/else switches to manage ACK
which, by definition, should have been ignored, like old ACKs
(SEG.ACK < SND.UNA). The code still misses the management of the
mitigation of Blind Data Injection Attack.
This patch moves these switches inside ProcessEstablished, to simplify
the ReceivedAck function, which now manages only valid ACKS.
To complete the overview, one more condition has been added, which is
the case of an out-of-order ACK (SEG.ACK > SND.NXT).
This commits contains only the definition (in other words, the interface)
of the ACK state machine, where the design is taken from Linux v4.0.
The state machine allows to define congestion situations avoiding the
use of boolean state variables.