This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

gratuitous arp broadcast

0

Hi, I am connecting my STM32f4 board ( server) with my client computer via a switch using TCP protocol. Everything works fine but then If I unplug the power supply of STM board for >7 sec then plug back, the TCP connection breaks and cannot restore. IF I unplug the power supply of STM board for <3 sec and plug back, the TCP connection can restore like normal. I then use Wireshark on the computer to trace the network traffic and see that for the second case (unplug<3sec), when I plug back, the STM board sends out a gratuitous arp which somehow makes the whole system restore.

plug <3s

In the first case, when I plug back, the STM boards does not send any gratuitous arp package and then cannot connect.

plug >7s

Could any one help to solve this problem? THanks.

This question is marked "community wiki".

asked 04 Mar '15, 00:25

tako's gravatar image

tako
1112
accept rate: 0%

edited 04 Mar '15, 00:26


One Answer:

1

This ARP is only part of the deal, and is only a consequence of the TCP layer trying to get packets out.

The platform knows that it's lost the physical layer and hence cannot be sure it's connected to the same subnet as before when it got it's IP address. So it broadcasts an ARP. If after a while nothing comes back, it can safely assume there's no IP address collision on this subnet and carry on using its assigned IP.

Then it cleanly (somewhat, a reset is not clean, but common practice) terminates the TCP connection and let the client setup a new one.

In the second case the TCP layer just gave up, it could not get packets out. So when physical layer is restored, there's nothing to send, hence no need for an ARP broadcast. It also seems as if the ICMP broke, because there's no ICMP echo reply, nor port unreachable for the TCP port (if it is indeed shutdown).

answered 04 Mar '15, 05:24

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

Hi, Thank you for your nice explaination. I can now quite understand what is happening. As you said, the main difference between the two is that one tries to get packets out and another just gives up ( maybe after long-time trying).That may explain the difference between 7s off and 3s off. However, If flatform is poweroff, how could it is possible that the TCP layer tries to get the packets out? I think if the platform is powered off, the TCP layer also should stop working and both should behave the same when I plug back the power? And the problem does not happen when I unplug/plug in the Ethernet cable or if I connect the STM board directly to the client computer.

(04 Mar '15, 18:36) tako