Commit 2150ca12 authored by Olivier Crête's avatar Olivier Crête

pseudotcp: Implement NewReno timestamp heuristic

This allows the sender to enter fast retransmit after a timeout because
it can now detect that three duplicate acks are caused by a packet loss.

As specific in RFC 6582 section 4.2.
parent 3774f539
......@@ -534,6 +534,7 @@ struct _PseudoTcpSocketPrivate {
guint32 recover;
gboolean fast_recovery;
guint32 t_ack; /* time a delayed ack was scheduled; 0 if no acks scheduled */
guint32 last_acked_ts;
gboolean use_nagling;
guint32 ack_delay;
......@@ -1100,6 +1101,7 @@ pseudo_tcp_socket_init (PseudoTcpSocket *obj)
priv->dup_acks = 0;
priv->recover = 0;
priv->last_acked_ts = 0;
priv->ts_recent = priv->ts_lastack = 0;
......@@ -2590,6 +2592,8 @@ process(PseudoTcpSocket *self, Segment *seg)
DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "Invalid RTT: %ld", rtt);
goto done;
}
priv->last_acked_ts = seg->tsecr;
}
priv->snd_wnd = seg->wnd << priv->swnd_scale;
......@@ -2680,7 +2684,8 @@ process(PseudoTcpSocket *self, Segment *seg)
int transmit_status;
if (LARGER_OR_EQUAL (priv->snd_una, priv->recover)) { /* NewReno */
if (LARGER_OR_EQUAL (priv->snd_una, priv->recover) ||
seg->tsecr == priv->last_acked_ts) { /* NewReno */
/* Invoke fast retransmit RFC3782 section 3 step 1A*/
DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "enter recovery");
DEBUG (PSEUDO_TCP_DEBUG_NORMAL, "recovery retransmit");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment