TCP connections recycle used port numbers

Discussion to talk about software related topics only.
Post Reply
stephan
Posts: 10
Joined: Fri Feb 26, 2010 1:58 am
Location: Germany

TCP connections recycle used port numbers

Post 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
User avatar
pbreed
Posts: 1091
Joined: Thu Apr 24, 2008 3:58 pm

Re: TCP connections recycle used port numbers

Post 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
stephan
Posts: 10
Joined: Fri Feb 26, 2010 1:58 am
Location: Germany

Re: TCP connections recycle used port numbers

Post 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
Post Reply