I found I cannot understand my test. Setup two Linux PC, say moon and sun. The moon has two network interface, eth0=192.168.0.20, eth1=192.168.1.20. The sun has single network interface, eth0=192.168.0.10. Setup a route in sun allowing it can reach to 192.168.1.20 in moon. Ping test passed.
Now run 'nc -l -p 1234 -u' on moon, and then in sun, run 'nc 192.168.1.20 1234 -u'. It is always that the first message sent from sun can appear in moon. But the next message sent from sun in the same nc session will failed. The tcpdump show that the second message arrived moon, but the moon generated an 'ICMP unreachable' error back to sun which cause sun closed the socket. In same test with socat, I found the same result.
This is quite strange to me. I checked from tcpdump that the two messages sent from sun has the same source/dest ip and source/dst port numbers. Why the second message from sun cannot be recognized by moon's nc or socat?
Can someone give me any hint? thanks.