[Mono-list] TCP errors with HttpWebRequest

eydelber z hellosticky at gmail.com
Wed Oct 22 13:41:47 EDT 2008


Hi, I'm wondering if this could be related to mono or not: I have a
Mono command line program (Mono 2.0) running the following code:

                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Timeout = 30000;
                string data;

                using (WebResponse resp = request.GetResponse())
                {
                    using (Stream stream = resp.GetResponseStream())
                    {
                        using (StreamReader sr = new StreamReader(stream))
                        {
                            data = sr.ReadToEnd().Trim();
                        }
                    }
                }

Sporadically, I am getting the following weirdness in a TCPDUMP:

NOTICE: The HTTP GET request actually receives a 200 OK response, but
that apparently is not enough for the Mono client to finish its stream
and return, and then there are all kinds of retransmits and other
things.

This happens only sporadically.

12	2008-10-22 12:18:49.237572	10.20.30.180	10.20.30.178	TCP	54591 >
http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=208836954 TSER=0 WS=7
15	2008-10-22 12:18:49.237766	10.20.30.178	10.20.30.180	TCP	http >
54591 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460 WS=0 TSV=0
TSER=0
16	2008-10-22 12:18:49.237783	10.20.30.180	10.20.30.178	TCP	54591 >
http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=208836955 TSER=0
17	2008-10-22 12:18:49.245585	10.20.30.180	10.20.30.178	HTTP	GET /execute.aspx
18	2008-10-22 12:18:49.356969	10.20.30.178	10.20.30.180	HTTP/XML	HTTP/1.1
200 OK
19	2008-10-22 12:18:49.446099	10.20.30.180	10.20.30.178	HTTP	[TCP
Retransmission] GET /execute.aspx
20	2008-10-22 12:18:49.446182	10.20.30.178	10.20.30.180	TCP	[TCP Dup
ACK 18#1] http > 54591 [ACK] Seq=267 Ack=203 Win=65333 Len=0
TSV=5492664 TSER=208836962
21	2008-10-22 12:18:49.848097	10.20.30.180	10.20.30.178	HTTP	[TCP
Retransmission] GET /execute.aspx
22	2008-10-22 12:18:49.848190	10.20.30.178	10.20.30.180	TCP	[TCP Dup
ACK 18#2] http > 54591 [ACK] Seq=267 Ack=203 Win=65333 Len=0
TSV=5492669 TSER=208836962
27	2008-10-22 12:18:52.293569	10.20.30.178	10.20.30.180	HTTP/XML	[TCP
Retransmission] HTTP/1.1 200 OK
34	2008-10-22 12:19:07.340362	10.20.30.178	10.20.30.180	TCP	http >
54591 [RST, ACK] Seq=267 Ack=203 Win=0 Len=0
37	2008-10-22 12:19:14.772185	10.20.30.180	10.20.30.178	HTTP	[TCP
Window Full] [TCP Retransmission] GET /execute.aspx
38	2008-10-22 12:19:14.772281	10.20.30.178	10.20.30.180	TCP	http >
54591 [RST] Seq=1 Win=0 Len=0
41	2008-10-22 12:19:19.235335	10.20.30.180	10.20.30.178	TCP	54591 >
http [FIN, ACK] Seq=203 Ack=1 Win=5888 Len=0 TSV=208866952 TSER=0
42	2008-10-22 12:19:19.235430	10.20.30.178	10.20.30.180	TCP	http >
54591 [RST] Seq=1 Win=0 Len=0

Here is a good case:

5	2008-10-22 12:55:12.039774	10.20.30.180	10.20.30.178	TCP	35019 >
http [SYN] Seq=0 Win=5840 Len=0 MSS=1460 TSV=211019727 TSER=0 WS=7
6	2008-10-22 12:55:12.039848	10.20.30.178	10.20.30.180	TCP	http >
35019 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460 WS=0 TSV=0
TSER=0
7	2008-10-22 12:55:12.039866	10.20.30.180	10.20.30.178	TCP	35019 >
http [ACK] Seq=1 Ack=1 Win=5888 Len=0 TSV=211019728 TSER=0
8	2008-10-22 12:55:12.047698	10.20.30.180	10.20.30.178	HTTP	GET /execute.aspx
9	2008-10-22 12:55:12.157555	10.20.30.178	10.20.30.180	HTTP/XML	HTTP/1.1 200 OK
10	2008-10-22 12:55:12.157572	10.20.30.180	10.20.30.178	TCP	35019 >
http [ACK] Seq=197 Ack=267 Win=6912 Len=0 TSV=211019846 TSER=5514492
11	2008-10-22 12:55:12.270820	10.20.30.180	10.20.30.178	TCP	35019 >
http [FIN, ACK] Seq=197 Ack=267 Win=6912 Len=0 TSV=211019959
TSER=5514492
12	2008-10-22 12:55:12.270910	10.20.30.178	10.20.30.180	TCP	http >
35019 [ACK] Seq=267 Ack=198 Win=65339 Len=0 TSV=5514493 TSER=211019959
13	2008-10-22 12:55:12.270926	10.20.30.178	10.20.30.180	TCP	http >
35019 [FIN, ACK] Seq=267 Ack=198 Win=65339 Len=0 TSV=5514493
TSER=211019959
14	2008-10-22 12:55:12.270937	10.20.30.180	10.20.30.178	TCP	35019 >
http [ACK] Seq=198 Ack=268 Win=6912 Len=0 TSV=211019959 TSER=5514493


Could this possibly be a Mono bug or is this an infrastructure problem
with my NIC or switch?

Thanks!


More information about the Mono-list mailing list