From: Harald Welte <laforge@netfilter.org>
To: yangrunhua <yangrunhua@njupt.edu.cn>
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: How to take over TCP connection from userspace process?
Date: Thu, 23 Oct 2003 10:53:48 +0200 [thread overview]
Message-ID: <20031023085347.GD1418@sunbeam.de.gnumonks.org> (raw)
In-Reply-To: <006f01c3984e$e045fce0$d32f110a@yrhd>
[-- Attachment #1: Type: text/plain, Size: 2264 bytes --]
On Wed, Oct 22, 2003 at 11:44:56AM +0800, yangrunhua wrote:
> What I need is: after I authenticated TCP connection A(host A
> connected to me) and TCP connection B(host B connected to me), then
> let what host A send (through TCP connection A)directly forward to
> host B(through TCP connection B) in the kernel ,meanwhile, what host B
> send directly forward to host A in the kernel.
> That's much like MSN Messenger Server's relaying webcam video stream
> between two peers after authenticated them. I want to do this relay in
> kernel space and auth in the userspace. It's much like NGN
> softswitch's theory: control and auth separate from transfer.
>
> That's much useful functionality. Can netfilter/iptables help this?
> done this by writing a new target or something?
no, it doesn't help. What you are trying is intermixing of
packet-oriented paradigm with connection/stream oriented paradigm.
netfilter/iptables deals with individual packets. So if you do NAT or
something, every packet that we receive is transmited as another
packet.
If you accept a socket from userspace, than there's no more packets. At
socket level you have a bidirectional stream of bytes. So in order to
send the same data oever another socket, you need to re-packetize that
stream. In the end, you will have different packets with different
flags, sequencenumber, and eventually size (depending on mtu), window
scaling, options, ...
so _either_ you authenticate based on layer2 - layer4 addresses, and you
deal with packets, _or_ you authenticate somehow witin the TCP stream,
but than you don't have packets of a single connection, but rather two
seperate connections with each a stream of bytes in each direction.
This is not a limitation by netfitler/iptables. It's about the
fundamentals of networking protocol layers.
> Thanks,
> Runhua Yang
--
- Harald Welte <laforge@netfilter.org> http://www.netfilter.org/
============================================================================
"Fragmentation is like classful addressing -- an interesting early
architectural error that shows how much experimentation was going
on while IP was being designed." -- Paul Vixie
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2003-10-23 8:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-21 7:33 How to take over TCP connection from userspace process? yangrunhua
2003-10-21 13:47 ` Harald Welte
[not found] ` <20031021145537.GA25030@superhijitus.linux.org.ar>
2003-10-21 17:31 ` Harald Welte
2003-10-22 3:44 ` yangrunhua
2003-10-23 8:53 ` Harald Welte [this message]
2003-10-22 3:50 ` yangrunhua
2003-10-22 4:15 ` Jeremy Kerr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031023085347.GD1418@sunbeam.de.gnumonks.org \
--to=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
--cc=yangrunhua@njupt.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.