we are writing socket application to send UDP packets out from eth1
and loop it back to
the same interface using loopback stub to verify the hardware without
devices/ports. The sending and receiving port are the same.
our target machine has eth0 configured as 15.6.xx.xx and eth1
configured as 18.104.22.168.
the listening socket is listing on all ip.
When we looked at the packet in the tx code of the driver, we have
observed that the packet passed down from the ip stack has the same
MAC address for both source and destination. Also when packet is
returning, its ip source and destination are the same as the
transmitting packet, which is to be expected.
The outgoing packet on eth1 has ip address of 22.214.171.124.
1. Is this type of loopback possible under linux?
2 Is it better to send raw packet, or should UDP work as well?
3. is there a similar code that we can leverage?
4. the returning (incoming) packet is lost after the driver passes it
to the ip stack. The receving socket is not able to retrieve packets
the driver receives.
What could be some of the issues?
Thank you in advance.