Is there any possibility of tracing a packet through all networking layers inside the Linux kernel ? I'm aware of SystemTap, but I'm looking to see if there's another (more high level) solution.
The problem I'm facing is the following: I have a machine acting as a router, with multiple interfaces, a bridge, a firewall with multiple rules and some advanced routing using custom tables. Some incoming packet replies don't get delivered to a local process (even though I see them with tcpdump) and it's difficult to figure out if they are lost because of routing, firewall, or other cause.
So I'm looking for something to help with this, a tool which can "trace packets coming on interface X, from a.b.c.d" and will produce an output of how the packet traveled through the network layers and where it was dropped or delivered or left the system. Like a strace for packets.
Anything like this exists?
EDIT: added more details for clarity.