All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Riechmann <riechmann@fgan.de>
To: netfilter@lists.netfilter.org
Subject: Re: Need some clarification or help
Date: Wed, 21 Apr 2004 13:45:43 +0200	[thread overview]
Message-ID: <20040421114543.GB892@rie.rie.priv> (raw)
In-Reply-To: <200404202207.04668.Antony@Soft-Solutions.co.uk>

On 2004-04-20 22:07:04 +0100, Antony Stone wrote:

> On Tuesday 20 April 2004 9:51 pm, Christian Riechmann wrote:
> 
> > I know that UDP and TCP protocols are completely different, especially
> > the 3-way handshake. But all its steps are TCP packets. Therefore my idea
> > is to encapsulate on each side each TCP packet into a UDP packet, send
> > this one to the other side, decapsulate the original TCP paket from the UDP
> > packet and inject the TCP packet to the kernel.
> 
> Okay - that sounds to me like a UDP tunnel through which you are sending TCP 
> packets - I agree.

Exact.

> 
> > This way the total TCP dialog shall be exchanged as payload of separate UDP
> > packets. UDP is necessary, because only UDP can use broadcast addresses.
> > (I use this type of address to emulate LAN-broadcast within a mobile
> > adhoc network. Therefore I doubt that vtun would help me.)
> 
> I don't quite understand how this would work.   You say you want to use UDP 
> broadcasts - which suggests to me one sender and many receivers.   TCP cannot 
> work with that, because each receiver is going to want to send 
> acknowledgement packets back to the sender, which will get confused about who 
> is it communicating with.

UDP Broadcast is used to forward packets within the ad hoc network. The
forwarding nodes know whether the received packet has to be forwarded.
Only that node which is the intended receiver of the encapsulated TCP
packet will inject the payload (IP/TCP-packet) to the kernel.
So we have the one-to-one relation. (UDP-Broadcasting is used to a certain
extent as a layer 2 transmission.)
> 
> TCP is basically a one-to-one protocol, and even if you try putting the 
> packets inside UDP packets which can be broadcast to multiple receivers, TCP 
> is still going to want to communicate between one machine at each end.
> 
> Ultimately you have to regard the UDP tunnel as just another route to 
> somewhere, and TCP will use all routes in the same way - to find one machine 
> at the other end.

I think this will not be a problem, because the tunnel is build between
both TCP speaking hosts.

As mentioned earlier, this method works very well if UDP and ICMP packets are
encapsulated. Only a IP/TCP packet (captured and encapsulated at the TCP
sending host and captured, decapsulated and injected at the intended TCPr
receiving host) will not be delivered to the TCP application, although a
tcpdump running on the receiver displays the injected IP/TCP packet,
but with some additional bytes at the end. In other words tcpdump
seems to display an IP/TCP packet, which according to the length field
of IP shall have only 64 bytes but really consists of 80 bytes (numbers
are only examples).

My assumption is, that some surplus bytes beyond the end, lead to the
problem (maybe a checksum error because of those bytes not belonging to
the TCP packet.) I do not see why during injection the surplus bytes
have not been deleted, although the verdict call is parameterized with
the new length.

Regards
Christian

-- 
Christian Riechmann    E-Mail: riechmann@fgan.de
c/o FGAN/FKIE          Tel: (+49) 228/9435 345,378
Neuenahrer Strasse 20  Fax: (+49) 228/9435 685
D-53343 Wachtberg, Germany


  reply	other threads:[~2004-04-21 11:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20 18:22 Need some clarification or help Christian Riechmann
2004-04-20 18:47 ` Antony Stone
2004-04-20 20:51   ` Christian Riechmann
2004-04-20 21:07     ` Antony Stone
2004-04-21 11:45       ` Christian Riechmann [this message]
2004-04-20 21:32     ` Jee J.Z.
2004-04-21 11:14       ` Christian Riechmann
2004-04-21 15:41         ` Jee J.Z.
2004-04-21 19:51           ` Christian Riechmann
2004-04-21 22:17             ` Jee J.Z.
2004-04-22 20:41               ` root
2004-04-22 21:34                 ` Jee J.Z.
2004-04-23 10:17                   ` Christian Riechmann
2004-04-22  0:38 ` Henrik Nordstrom
2004-04-22  0:38   ` Henrik Nordstrom
2004-04-22 21:32   ` Christian Riechmann
2004-04-23  7:02     ` Henrik Nordstrom
2004-04-23 10:22       ` Christian Riechmann

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=20040421114543.GB892@rie.rie.priv \
    --to=riechmann@fgan.de \
    --cc=netfilter@lists.netfilter.org \
    /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.