Page 1 of 1

TCP connections recycle used port numbers

Posted: Thu Mar 04, 2010 4:32 am
by stephan
Hello,

my netburner app only uses 3 different local ports for outgoing TCP connections: 32809, 32810, and 32811. Even though I have passed 0 to randomly use an unsed port number. According to the connect() function documentation for the local port: If zero (0) a randomly selected port > 0x8000 will be used.

The network sniffer wireshark reports errors like
  • "TCP Port numbers reused",
  • "TCP Retransmission", and
  • "TCP Dup ACK 26147#5".
Does anyone have an idea how to avoid that?
Could it be a result of static IP address configuration?

Stephan

Re: TCP connections recycle used port numbers

Posted: Thu Mar 04, 2010 2:34 pm
by pbreed
Retranmission and Dup Ack are a normal part of the way TCP operates.
I'd be interestied in TCP ports reused, that is different.

One way you can see this is if you initiate connections from the netburner on power up,
the ports get reused between resets of the board as the system uses the timer to generate randomness and the
without any outside time variation (such as getting a DHCP address) it tends to land on the same number.
If your getting port reuse without reseting the netburner I'd like to see the wireshark file.

Paul

Re: TCP connections recycle used port numbers

Posted: Fri Mar 05, 2010 5:48 am
by stephan
Probably the reused port number just happens when the netburner board automatically resets itself.

I had problems running gSOAP on the SB70LC. gSOAP allocates by default 8192 bytes on the stack when entering the http_parse function to parse headers. I need a long time to fix that out, because the board had a very non-deterministic behavior. Sometime it just resets, prints only a half trap info and so on.

However, after reducing the amount of allocated byte in that function, I am able to run a gSOAP hello world web service client on the NetBurner SB70LC.

Stephan