LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Using nemesis-udp to simulate local host (https://www.linuxquestions.org/questions/linux-networking-3/using-nemesis-udp-to-simulate-local-host-758525/)

elstepherino 09-29-2009 03:49 PM

Using nemesis-udp to simulate local host
 
Looked around, couldn't find similar threads. If I missed anything, please forgive me.

Here is my setup.

1. I am using nemesis as a simulation tool for a distributed application.

2. For testing purposes, my distributed application basically listens to a UDP port (#50000) for incoming packets. When it receives the packets, it prints out the details to stdout. Packets can come from remote peers or from the localhost itself.

3. nemesis is used to simulate both the remote peers (10 of them) and the local host itself (which means the test host will receive a UDP packet on the network interface where the source and destination IP addresses are the same).


Here is my problem.

When both my test application and the nemesis program are run on the same platform (my Ubuntu laptop), everything works fine. All packets received are printed to stdout.

However, when the test application is run on a separate box (another Ubuntu platform), all except one packet are received by the test application.

I have verified the following:
- all packet contents are the same
- all destination IPs and ports are the same
- the receiving computer receives all packets, as per tcpdump
- the receiving application does not receive the UDP packet that pretends to be coming from the localhost itself.


Here is my question:
Why is the packet "pretending to be from the receiving host" not being handed over to the application?

Could it be that the network stack may be discarding packets that should have a source IP different than that of the local host itself?

Any help is appreciated.

everest40 09-30-2009 01:53 AM

Accepting packets that claim to be coming from the local host but actually come from another device on the network is a security vulnerability. It makes it possible for potential attackers (other people on the network) to send commands or information and have them appear to come from a trusted sender (localhost), so many devices, operating systems, or firewalls will just discard such packets. I don't know if Linux is one of those operating systems, but if you're running a firewall you might try turning the firewall off or setting it to allow this kind of thing.


All times are GMT -5. The time now is 12:14 AM.