Raw sockets

Michael A. Ziober mziober at solferino.ics.uci.edu
Fri Feb 22 11:25:56 AEST 1991


Hi,

I am in a project class and our group is stumped, confused,
frustrated, and otherwise at our wit's end.  Let me tell you why:

Our project was to attach an experimental network interface to an
Omron box running 4.3BSD Unix.  We were informed of a
pseudo-network-interface module which is affectionately termed
"rawpacket".  You may have heard of it.  Or not.  The point is that we
really don't know what the hell we are doing when it comes to grafting
code onto a kernel.  We can't even get config to do what it is we
think it should be doing.  But that's not why I'm writing now.

We are ready to consider alternative approaches to accomplish the same
task.  All that we really need is the following:

1. A way to get IP packets that can not be routed out a network
   interface so that we can manually place them on the experimental
   network.

2. A way to inject packets that we receive from the experimental
   network into IP as if they had just been received from a normal
   kernel-level network interface.

Is this too much to ask from a raw socket?  I sincerely hope not.
Let's say we open a raw socket in the INET domain, with protocol 0
(zero).  So what?

1. What access does this give us to IP as outlined above?

2. Do recvfrom()'s pick up unroutable IP packets?  Do sendto()'s place
   packets into IP routing layer?

3. Do we get a subset of these capabilities?

4. Is there any way to use raw sockets to accomplish this at all?

"The Design and Implementation of 4.3BSD Unix" is really too vague
regarding the specifics/semantics of raw sockets.  Are there any other
references that have particularly good explanations of the
uses/limitations/quirks of raw sockets?

Finally, if you don't know what I'm talking about, but know someone
who would, could you please forward this?  Please?

Thank you for your time,
Michael Ziober



More information about the Comp.unix.internals mailing list