Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Recommended VPN Tunnel client?
Date: Fri, 10 Feb 2012 20:13:43
Message-Id: CA+czFiBS7-F3jxwqhYBfYLgJhBJ6azrKe78RJ0mDb4v=EGR4cA@mail.gmail.com
In Reply to: Re: [gentoo-user] Re: Recommended VPN Tunnel client? by Todd Goodman
1 On Fri, Feb 10, 2012 at 2:21 PM, Todd Goodman <tsg@×××××××××.net> wrote:
2 > * Michael Mol <mikemol@×××××.com> [120210 13:36]:
3 >> On Fri, Feb 10, 2012 at 1:22 PM, Todd Goodman <tsg@×××××××××.net> wrote:
4 >> > * Michael Mol <mikemol@×××××.com> [120210 12:51]:
5 >> > [..]
6 >> >> That's what I was talking about. Where I work, we use OpenVPN,
7 >> >> operating in UDP mode. This is after several bad experiences using it
8 >> >> in TCP mode.
9 >> >>
10 >> >> By "UDP mode" and "TCP mode", I mean OpenVPN's connections to other
11 >> >> OpenVPN nodes were in UDP or TCP, respectively. When OpenVPN's
12 >> >> connections operate over TCP (and thus it gets guarantee'd delivery),
13 >> >> you can create a situation where a tunneled TCP connection attempts to
14 >> >> push data faster than your Internet connection can allow because it
15 >> >> never gets any congestion feedback; OpenVPN was accepting packets
16 >> >> faster than it could shove them through, and was buffering the rest.
17 >> >
18 >> > So obviously OpenVPN wasn't handling congestion appropriately and should
19 >> > have been using some queueing discipline to discard instead of letting
20 >> > transmit queues grow unbounded.
21 >>
22 >> Sure, that contributed to the problem, and may qualify as a bug. On
23 >> the flip side, by operating OpenVPN in TCP mode, you're saying you
24 >> want guaranteed delivery across the link.
25 >
26 > Yes, certainly.  And certainly TCP has far more resource requirements on the
27 > sending side.  However, it also has congestion avoidance built in to it,
28 > which UDP does not.
29
30 And that's perfectly fine, when you're going to be tunneling an entire
31 IP stack inside OpenVPN. If a tunneled application needs low latency,
32 low guarantee of delivery, it can use UDP. If a tunneled application
33 needs guarantee of delivery, it can use TCP. But if the OpenVPN tunnel
34 is itself using TCP, you lose low latency opportunities, and you deny
35 your tunneled applications' ability to respond to congestion.
36
37 >
38 >>
39 >> >
40 >> > But switching to UDP from TCP just pushes the problem off your OpenVPN
41 >> > gateway and onto the "outside" network.
42 >> >
43 >> > If you're really receiving more traffic than can be sent over the
44 >> > "outside" network, now you're relying on intermediate routers to "do the
45 >> > right thing" with your excess UDP traffic and most likely impacting TCP
46 >> > traffic through the same router.
47 >>
48 >> OpenVPN was running on the router on both ends. The sending side was
49 >> on the lean side of an ADSL modem, plugged directly into the same, so
50 >> the entire issue was handled locally.
51 >
52 > There was no infrastructure between the two routers?  They had a direct
53 > connection between them?  It would be slightly strange to go through the
54 > hassle of running OpenVPN in that case...
55
56 workstation - ovpn - ADSL 6Mbs/512Kbs - AT&T - ADSL(6Mbs/512Kbs) - ovpn - server
57
58 Both sides would be pushing up the weak end of ADSL, and both sides'
59 local routers would be discarding layer 3 packets that won't fit. AT&T
60 wouldn't even have seen the excess traffic.
61
62 >
63 >>
64 >> Even if OpenVPN wasn't running on the router itself, there'd wouldn't
65 >> *be* excess UDP traffic when running OpenVPN in UDP mode, as
66 >> congestion management would be behaving properly. so other traffic
67 >> would not be unduly impacted.
68 >
69 > Why do you think congestion management would be behaving properly?  What
70 > congestion management are you referring to for UDP traffic?
71
72 The fact that the tunneled TCP packets and fragments would be dropped,
73 causing the tunneled connections' relevant TCP stacks to scale back.
74
75 >
76 > The only thing intermediate routers can do in the case of congestion due
77 > to UDP traffic is to drop.  And depending on the queueing implementation
78 > they may end up dropping TCP traffic as well.
79
80 Which is *fine*, as long as the TCP packets are encapsulated inside
81 the tunnel, and the tunnel itself is UDP; the connection owners for
82 the encapsulated tunnels would scale back their throughput
83 automatically. If the TCP packet dropped is what's carrying the tunnel
84 itself, then one of the openvpn instances will resend, and the
85 encapsulated connection's packet will still ultimately reach its
86 destination.
87
88 >
89 > Almost certainly they'll signal congestion to TCP endpoints with traffic
90 > through them, hence impacting TCP traffic as well.
91
92 Not sure what you mean here.
93
94 Michael Orlitsky had a decent, relevant link:
95 http://sites.inka.de/sites/bigred/devel/tcp-tcp.html
96
97 Though instead of stacking TCP/IP/PPP on top of SSH/TCP/IP, I was
98 packing IMAP/TCP/IP on top of OpenVPN/TCP/IP.
99
100 --
101 :wq