Re: packet created by local raw socket

From: Rob Landley (landley@trommello.org)
Date: Sun Feb 03 2002 - 19:51:20 EST


On Sunday 03 February 2002 07:24 pm, Xinwen - Fu wrote:
> Rob,
> Thanks for your reply! It's very good!
>
>
> In fact my problem is simpler to you( the
> last email is not clear):
>
> Now I create a raw socket(SOCK_RAW) on a local machine, construct
> a ICMP packet and send it out. So what queues will this packet go through?

Locally generated packets seem to go through the tests in the output table
first, then on to postrouting. I didn't think the type of the locally
generated packet mattered. (I know UDP, TCP, or ICMP don't...)

> I tested it and it seems that this packet first goes to OUTPUT
> queue. is that right?

Sounds about right.

> If so, then ip stack's interface to RAW socket
> should be below the function of appending IP header to a transport layer
> datagram but above the routing decision function and also above the
> OUTPUT queue, am I right?

If you asked for a raw socket, the system won't append an IP header to it for
you. You asked it not to.

It has to come before the routing decision. Otherwise how does it know where
to send it? (You might have more than one network interface in the machine.
Two ethernet cards, or ethernet and ppp...)

> Thanks!
>
> Fu

Have you tried the "logging" target? It's loads of fun for this sort of
thing...

Rob
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Feb 07 2002 - 21:00:30 EST