Commit ce7c9a95 authored by Jonathon Duerig's avatar Jonathon Duerig

Various bug fixes. Especially with the system for determining whether a...

Various bug fixes. Especially with the system for determining whether a connection is sending as fast as it can. Now it correctly determines when it is in slow start, and when the receivers buffer is empty so that these do not cause erroneously small bandwidth/max_delay figures.
parent d00f448e
......@@ -471,7 +471,10 @@ u_int16_t handle_IP(u_char *args, const struct pcap_pkthdr* pkthdr, const u_char
perror("getsockopt() TCP_INFO");
clean_exit(1);
}
if (info.tcpi_snd_cwnd < info.tcpi_snd_ssthresh
if ((info.tcpi_snd_cwnd < info.tcpi_snd_ssthresh
|| ((unsigned int)(tp->window)
<< info.tcpi_rcv_wscale)
<= (info.tcpi_unacked * 1448))
&& bandwidth_method == BANDWIDTH_BUFFER)
{
// We are in slow start. This means that even if the
......@@ -481,6 +484,10 @@ u_int16_t handle_IP(u_char *args, const struct pcap_pkthdr* pkthdr, const u_char
last_through[path_id] = INT_MAX;
logWrite(DELAY_DETAIL, NULL, "Buffer Clear");
}
logWrite(DELAY_DETAIL, NULL, "receive_window: %u, unacked: %u",
(unsigned int)(tp->window)
<< info.tcpi_rcv_wscale,
info.tcpi_unacked * 1448);
}
msecs = floor((pkthdr->ts.tv_usec-sniff_rcvdb[path_id].records[record_id].captime.tv_usec)/1000.0+0.5);
......
......@@ -863,7 +863,7 @@ int send_max_delay_to_monitor(int monitor, int index)
}
}
last_max_delay[index] = delay;
max_delay[index] = 0;
// max_delay[index] = 0;
return result;
}
......@@ -908,7 +908,7 @@ int send_delay_to_monitor(int monitor, int index)
last_delays[index] = delay;
delays[index] = 0;
delay_count[index] = 0;
base_rtt[index] = LONG_MAX;
// base_rtt[index] = LONG_MAX;
}
return result;
......
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