tcp/ip stack in user space

tcp/ip stack in user space

Post by X.Xia » Thu, 18 Apr 2002 04:00:10



i want to move tcp/ip stack(including routing and
netfilter) to userspace, my goal is to trace all the
instructions involved in a firewall and router since i
don't know how to trace these instructions inside the
kernel. i want to get something like:

incoming ip packets(a file)-->fake ISR-->tcp/ip
stack-->outgoing ip packets( to /dev/null).

my question is: is it possible and relatively easy to
move tcp/ip stack to user space?

thanks for help.

X.Xiao

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

tcp/ip stack in user space

Post by Eric Weigl » Thu, 18 Apr 2002 05:10:08


Quote:> i want to move tcp/ip stack(including routing and
> netfilter) to userspace, my goal is to trace all the
> instructions involved in a firewall and router since i
> don't know how to trace these instructions inside the
> kernel. i want to get something like:

> incoming ip packets(a file)-->fake ISR-->tcp/ip
> stack-->outgoing ip packets( to /dev/null).

> my question is: is it possible and relatively easy to
> move tcp/ip stack to user space?

This comes up fairly frequently, it might be a good addition to the FAQ.
Here's my attempt at an answer culled from prior messages.

Several people have user-mode network stacks at various levels of
development, but it is *highly* unlikely for them ever to get into
the kernel proper (see the monolithic versus microkernel debate at
http://www.kernel.org/pub/linux/docs/lkml/#s15-4).

Here are some URLs to which you can refer for more information:
        http://www.cl.cam.ac.uk/Research/SRG/netos/arsenic/
        http://www.cs.nwu.edu/~pdinda/minet/minet.html
        http://www.joerch.org/tcpip/
        http://freshmeat.net/projects/libutcp/

However, for security purposes, you probably do not want a user-mode stack.
You want an extensible packet handling mechanism, and can be found with:
        iptables/ipchains -- the native Linux firewalling tools,
                http://netfilter.samba.org/
        tc -- the Traffic control program,
                http://www.sparre.dk/pub/linux/tc/
        libpcap -- packet capture library,
                http://www.tcpdump.org

Thanks,
-Eric

--
--------------------------------------------
 Eric H. Weigle   CCS-1, RADIANT team

 (505) 665-4937   http://home.lanl.gov/ehw/
--------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

tcp/ip stack in user space

Post by Frank Schaefe » Thu, 18 Apr 2002 17:00:12



> i want to move tcp/ip stack(including routing and
> netfilter) to userspace, my goal is to trace all the
> instructions involved in a firewall and router since i
> don't know how to trace these instructions inside the
> kernel. i want to get something like:

> incoming ip packets(a file)-->fake ISR-->tcp/ip
> stack-->outgoing ip packets( to /dev/null).

> my question is: is it possible and relatively easy to
> move tcp/ip stack to user space?

Hi,

Eric is right, I've started a syncookie fw using a daemon process for
now, because this is the first time I meet the kernel sources on a
larger project.

I do this using the REDIRECT ( ipchains ) / QUEUE ( ipfilter ) targets,
to get the packets to userspace. Once there, you can do what you want
using libpcap or syuscalls.

Regards and hope this helps
Frank

Quote:> Do You Yahoo!?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
 
 
 

1. Advice requested: Porting Linux TCP/IP stack to application space

Hello!  This is my first posting to this group.  If this is the wrong
place to post please let me know.

For ongoing product testing purposes, my company needs a TCP/IP stack
that supports pretty much the same RFCs as the Linux stack.
Converting lwIP was easy, of course, but that stack doesn't give us
what we need.  We mainly converted it to get ourselves started & prove
the test environment we're building will work.

Now, we're thinking we want to convert the Linux stack itself to work
in application space.  We have an API that abstracts OS specific
functions, such as threading, semaphores, etc.  The challenge is to
pull out the Linux TCP/IP stack code & get it to use our OS API.  If
successful, the "converted" stack would run in application space on
any platform (not just Linux).

Our current problem is we have nobody in-house who's familiar w/ Linux
at this level.  We're going to have to either hire someone or
outsource the work, but we need to get a general idea of how difficult
this would be or if it's even feasible.

Any thoughts/advice are greatly appreciated.  I can't contribute much
general stuff to the group in return since I personally have limited
Linux experience at this level, but in return I will share the success
of our port w/ the group.  :)

rt

PS:  We have someone working on an estimate for this project now, but
they also have no experience w/ Linux at this level.  The more we can
learn up front, the better!

2. Linux Questions with answers

3. Packets from bottom of TCP/IP stack direct to application bypassing stack

4. Passing a value in for()

5. tcp / ip stack and ip forwarding questions

6. Can you get RPM that runs under Slackware ????

7. Looking for TCP stack that runs in application space

8. chat script for Packard Bell internal modem

9. How to tell an application to use a custom tcp/ip stack instead of tcp/ip stack from linux?

10. linux tcp/ip stack as a module...insmod problems

11. Criticism of solaris2.x tcp/ip stack

12. TCP/IP stack for Wabi 2.2

13. TCP/IP - stacks?