Sorry if my issue is a bit hard to summarize in the title. That is the best I could come up with.
TL;DR Version: How do I debug when packets reach OS, but not the destination process?
Explanation: I have two processes, running on two devices, and communicating over TCP/IP. The first device is only connected to the second device, directly via an Ethernet cable. The second device is connected to the network. The two devices connect and start communicating with each other without any problem. I then try to physically disconnect the first device, and then reconnect the cable after a few moments. Using Wireshark I see that the device receives the packets. I see that packets have the right destination port number. I see that my process is listening on [0.0.0.0:port] with correct port number. But for some reason the process is not receiving the packets.
Here is the weird thing though. This only happens when the first device is directly connected to the second device. If I connect both devices to a switch and repeat this test, the packets reach the process after reconnecting the cable without an issue.
In both scenarios I am statically setting the IPs. And the process in question is using the ZMQ stack to receive packets. What confuses me most is why would my network topology affect the routing that is happening within the Linux operating system (if that is the case).
How do I debug this scenario? Where should I start looking? Is there a test I could run to narrow things down to where the issue is? Please let me know if you would want me to clarify anything further.
P.S. I have firewalls disabled on both systems.