Skip to contentSkip to conversation

Multi-channel VPN

Openvpn-devel James Yonan 4 participants 12 messages Apr 17, 2003 – Apr 24, 2003

lore
Share & tools
lore
#0 lore raw

I'm forwarding this discussion of an interesting feature request. Namely, could (and should) OpenVPN have a channel bonding capability, where more than one UDP connection over different paths is used to connect two peers, and OpenVPN does channel bonding, load balancing, and failover among the connections? Or does this function not belong in OpenVPN since it is functionally distinct from the role of network security and tunneling and could be implemented as a module or driver apart from OpenVPN?

James

Forwarded From: "R. Latimer" <[email protected]...>

Quoted 104 lines

Hi,

Certainly, I don't mind if you wish to post to the list.

My reason for suggesting this be done in OpenVPN is primarily due to the ability to support multiple platforms (my e-mail should say platform-independant, not hardware-independant) without relying on additional software being installed at both ends, or OS-specific solutions.

Thanks,

- R. Latimer

-----Original Message-----
From: James Yonan [mailto:[email protected]...]
Sent: Thursday, 17 April 2003 22:40
To: R. Latimer
Subject: Re: Multi-channel VPN

Mr. Latimer,

It's an interesting idea, though I'm not sure that OpenVPN is the right place
to put the channel bonding code.

Since OpenVPN leaves all routing control to the OS, it would seem to make more
sense to implement the channel bonding at the router level, since channel bonding is functionally distinct from the role of a VPN.

Having said that, it would certainly be possible to implement this in OpenVPN
though it would add the complexity of load balancing, failover, to OpenVPN. It would also introduce issues of flow control on the UDP channel(s) that OpenVPN hasn't had to deal with before.

If you don't mind, I would like to post this thread to the list so that others
can comment.

James

Quoted 4 lines · R. Latimer

Hi James,

Sorry to e-mail you directly rather than using the mailing list. I'm not presently subscribed to the development list, but have a feature

suggestion

Quoted 1 line

you may wish to give some consideration (Post-1.4, perhaps much further

down

Quoted 6 lines

the development path).

I was wondering if it would be possible to allow OpenVPN to use multiple paths to connect two networks? E.g. use two Internet connections here to connect to a single remote VPN. I see no reason both ends couldn't use multiple paths, but a simple one to many relationship alone would be

handy.

Quoted 4 lines

The reason for this is, Internet access in NZ is very expensive. I have a 128k connection, and am looking at getting 128k a wireless connection as well for use with a laptop. The VPN terminates in the US, where bandwidth

is

Quoted 12 lines

plentiful, and supplying the VPN with 256k wouldn't be a problem.

I would like to be able to join the two channels when the laptop is connected to the LAN, and when unavailable, have all traffic automatically sent through a single interface.

Each interface would be with a different ISP, so traditional routing protocols to one IP address wouldn't work in this case. In fact, the local telephone company specifically disallows static IPs on the 128k connections - they are only permitted on the expensive (pay per MB) high-speed ADSL connections.

Quoted 3 lines

I believe this would be possible using two instances of OpenVPN, and NetGraph on FreeBSD, but unfortunately the remote end uses Linux. If possible to do this in OpenVPN, it would provide a hardware-independant

way

Quoted 5 lines

to link multiple channels. Currently NetGraph contains no code for intelligently determining the path, it simply alternates between ports. It would be great if OpenVPN could additionally favour one link over another based on actual performance.

Quoted 9 lines

I've been using OpenVPN since the FreeBSD port became available, and it works very well. Thanks for such a great tool, and I hope you'll give my suggestion some thought.

Thanks,

- R. Latimer

--

#1 lore raw
Quoted 7 lines · James Yonan

I'm forwarding this discussion of an interesting feature request. Namely, could (and should) OpenVPN have a channel bonding capability, where more than one UDP connection over different paths is used to connect two peers, and OpenVPN does channel bonding, load balancing, and failover among the connections? Or does this function not belong in OpenVPN since it is functionally distinct from the role of network security and tunneling and could be implemented as a module or driver apart from OpenVPN?

I wouldn't add multilink capabilities into OpenVPN itself unless it will see a major improvement in security compared to bonding several OpenVPN connections, and I'd rather see it separately. I could imagine OpenVPN using a virtual device that has this multilink capability with failure resilience, or I could imagine such multilink software operating several OpenVPN tunnels. Either would likely be adequate. It gets simple if this (de)multiplexer looked like a regular network interface to other applications.

#2 lore raw
In reply to James Yonan
Quoted 7 lines · James Yonan

I'm forwarding this discussion of an interesting feature request. Namely, could (and should) OpenVPN have a channel bonding capability, where more than one UDP connection over different paths is used to connect two peers, and OpenVPN does channel bonding, load balancing, and failover among the connections? Or does this function not belong in OpenVPN since it is functionally distinct from the role of network security and tunneling and could be implemented as a module or driver apart from OpenVPN?

I'm not necessarly sure it belongs in OpenVPN, but then again, I can see the advantages to automatically failover to other links. Perhaps abstracting things out in the code a bit that it would be possible to have multiple methods of sending data out to the world, perhaps even non-ip methods. Or even implementing something as tunnelling over TCP(I do know the reasons why you don't want to do this, but in some cases you don't have a choice, and are willing to eat the performance loss).

Regards,

Aaron

#11 lore raw
In reply to James Yonan
Quoted 8 lines · James Yonan

I'm forwarding this discussion of an interesting feature request. Namely, could (and should) OpenVPN have a channel bonding capability, where more than one UDP connection over different paths is used to connect two peers, and OpenVPN does channel bonding, load balancing, and failover among the connections? Or does this function not belong in OpenVPN since it is functionally distinct from the role of network security and tunneling and could be implemented as a module or driver apart from OpenVPN?

Hi all,

IMHO this feature would be out of OpenVPN's scope, just as QoS or firewalling are. It'd add (talking from my ignorant-and-no-developer point of view) lots of complexity, and we know complexity and bugs travel in the same ship :)
This can be achieved in both Linux and FreeBSD, it's not easy but it's possible.
Let each tool do its job, and only that.

Signature · 5 lines
Alberto Gonzalez Iniesta       | They that give up essential liberty
agi@(agi.as|debian.org)        | to obtain a little temporary safety
Encrypted mail preferred       | deserve neither liberty nor safety.

Key fingerprint = 9782 04E7 2B75 405C F5E9  0C81 C514 AF8E 4BA4 01C3
#3 lore raw

[Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

In reply to Aaron Sethman
Quoted 7 lines · Aaron Sethman

I'm not necessarly sure it belongs in OpenVPN, but then again, I can see the advantages to automatically failover to other links. Perhaps abstracting things out in the code a bit that it would be possible to have multiple methods of sending data out to the world, perhaps even non-ip methods. Or even implementing something as tunnelling over TCP(I do know the reasons why you don't want to do this, but in some cases you don't have a choice, and are willing to eat the performance loss).

TCP-over-TCP tunnelling isn't necessarily a performance loss, but it also exhibits excessive retransmit behaviour -- which isn't too bad if you have congested links and need to take a bigger share than the others ;-) I've always found vpnd (tcp-over-tcp) to be more stable than vtund (over udp in my configurations) across congested links, but I haven't compared vpnd to openvpn. (And I've found vtund to be fragile, a single ping -f into a tunnel usually let the tunnel collapse on Linux. OpenVPN is solid in these circumstances.)

Signature · 1 line
Matthias Andree
#4 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

Quoted 10 lines · Matthias Andree
Quoted 7 lines · Aaron Sethman

I'm not necessarly sure it belongs in OpenVPN, but then again, I can see the advantages to automatically failover to other links. Perhaps abstracting things out in the code a bit that it would be possible to have multiple methods of sending data out to the world, perhaps even non-ip methods. Or even implementing something as tunnelling over TCP(I do know the reasons why you don't want to do this, but in some cases you don't have a choice, and are willing to eat the performance loss).

Quoted 8 lines

TCP-over-TCP tunnelling isn't necessarily a performance loss, but it also exhibits excessive retransmit behaviour -- which isn't too bad if you have congested links and need to take a bigger share than the others ;-) I've always found vpnd (tcp-over-tcp) to be more stable than vtund (over udp in my configurations) across congested links, but I haven't compared vpnd to openvpn. (And I've found vtund to be fragile, a single ping -f into a tunnel usually let the tunnel collapse on Linux. OpenVPN is solid in these circumstances.)

I wonder if one could build a better tcp-over-tcp by doing some intelligent packet filtering on the higher level tcp connection, such as filtering out retransmits and fudging return ACKs -- essentially removing those elements of the TCP protocol which are designed to make TCP work over an unreliable link.

James

#5 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

Quoted 4 lines · James Yonan

I wonder if one could build a better tcp-over-tcp by doing some intelligent packet filtering on the higher level tcp connection, such as filtering out retransmits and fudging return ACKs -- essentially removing those elements of the TCP protocol which are designed to make TCP work over an unreliable link.

I wonder if that's necessary. Tunnelling through TCP is inherently reliable no matter what you send, so TCP-nested-in-TCP is just overkill. Cheating the OS doesn't help. Maybe some LD_PRELOAD library that turns stream sockets into dgram sockets for connections that use the tunnel is sufficient. However, this doesn't actually apply to openvpn because openvpn does TCP-over-UDP.

Signature · 1 line
Matthias Andree
#6 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

Quoted 7 lines · Matthias Andree
Quoted 4 lines · James Yonan

I wonder if one could build a better tcp-over-tcp by doing some intelligent packet filtering on the higher level tcp connection, such as filtering out retransmits and fudging return ACKs -- essentially removing those elements of the TCP protocol which are designed to make TCP work over an unreliable link.

Quoted 6 lines

I wonder if that's necessary. Tunnelling through TCP is inherently reliable no matter what you send, so TCP-nested-in-TCP is just overkill. Cheating the OS doesn't help. Maybe some LD_PRELOAD library that turns stream sockets into dgram sockets for connections that use the tunnel is sufficient. However, this doesn't actually apply to openvpn because openvpn does TCP-over-UDP.

I think you've got it backwards. I think James is talking about the layer that openvpn is tunnelling over. Basically fiddling with it to keep that layer from doing a lot of the reliabilitiy stuff. To be honest I'm not sure its possible without using raw sockets and constructing your own TCP packets. Even then though, I don't think that would work for some people's needs like being able to shove it through an SSL proxy or something like that.

Aaron

#7 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

Quoted 9 lines · Aaron Sethman
Quoted 5 lines · Matthias Andree
Quoted 3 lines · James Yonan

I wonder if one could build a better tcp-over-tcp by doing some intelligent packet filtering on the higher level tcp connection, such as filtering out retransmits and fudging return ACKs -- essentially removing those

elements of

Quoted 1 line
Quoted 1 line
Quoted 1 line

the TCP protocol which are designed to make TCP work over an unreliable

link.

Quoted 8 lines
Quoted 7 lines

I wonder if that's necessary. Tunnelling through TCP is inherently reliable no matter what you send, so TCP-nested-in-TCP is just overkill. Cheating the OS doesn't help. Maybe some LD_PRELOAD library that turns stream sockets into dgram sockets for connections that use the tunnel is sufficient. However, this doesn't actually apply to openvpn because openvpn does TCP-over-UDP.

Quoted 7 lines

I think you've got it backwards. I think James is talking about the layer that openvpn is tunnelling over. Basically fiddling with it to keep that layer from doing a lot of the reliabilitiy stuff. To be honest I'm not sure its possible without using raw sockets and constructing your own TCP packets. Even then though, I don't think that would work for some people's needs like being able to shove it through an SSL proxy or something like that.

Actually, I was thinking more about the situation where people are forced to tunnel IP over TCP, for whatever reason, when UDP is not an option. Since IP is designed to transit over an unreliable physical layer, when you tunnel it over TCP (a la vpnd or IP over ssh) you end up with this problem:

http://sites.inka.de/sites/bigred/devel/tcp-tcp.html (see Stacking TCPs)

The key issue here is that when you tunnel IP over TCP, that will usually mean TCP over TCP. And this tends to break TCP's retransmission algorithm. As the article above states: "The upper layer will queue up more retransmissions faster than the lower layer can process them".

So my idea is why not filter out the upper layer TCP retransmissions, and synthesize the return ACKs so that the upper TCP layer doesn't begin the exponential backing off of the retransmit timer that eventually will stall the connection? This process would essentially strip the upper layer TCP of its reliability function, since now the lower TCP layer will provide that function. This is not difficult to implement, since to OpenVPN, the upper layer protocols are all simply byte streams flowing over the TUN pipe. They can be filtered without resorting to raw sockets or any other such potentially unportable constructs.

Using raw sockets would be another potential method -- instead of removing the reliability function from the upper layer TCP layer, remove it from the lower layer. This would require a sort of fake-TCP implementation in user-space with the reliability function stripped out. On first glance, this seems to be a more complicated approach because you would need to implement a lot of the TCP protocol in user space, and you would need to depend on the OS supporting raw sockets. The approach outlined in the previous paragraph doesn't need raw sockets, and it doesn't need to reimplement TCP. It only needs to examine the byte stream of IP packets flowing over the TUN device, filter out TCP retransmits, and synthesize return TCP ACKs.

Each method tries to stabilize TCP-over-TCP by eliminating a redundant reliability layer. Both of these methods, while somewhat ugly, would eliminate a big part of the robustness issue of IP over TCP, for those who lack IP over UDP as an option.

James

#8 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

Quoted 6 lines · James Yonan

Actually, I was thinking more about the situation where people are forced to tunnel IP over TCP, for whatever reason, when UDP is not an option. Since IP is designed to transit over an unreliable physical layer, when you tunnel it over TCP (a la vpnd or IP over ssh) you end up with this problem:

http://sites.inka.de/sites/bigred/devel/tcp-tcp.html (see Stacking TCPs)

I've read the paper many times, heh ;)

Quoted 6 lines

The key issue here is that when you tunnel IP over TCP, that will usually mean TCP over TCP. And this tends to break TCP's retransmission algorithm. As the article above states: "The upper layer will queue up more retransmissions faster than the lower layer can process them".

Quoted 9 lines

So my idea is why not filter out the upper layer TCP retransmissions, and synthesize the return ACKs so that the upper TCP layer doesn't begin the exponential backing off of the retransmit timer that eventually will stall the connection? This process would essentially strip the upper layer TCP of its reliability function, since now the lower TCP layer will provide that function. This is not difficult to implement, since to OpenVPN, the upper layer protocols are all simply byte streams flowing over the TUN pipe. They can be filtered without resorting to raw sockets or any other such potentially unportable constructs.

What if you end up filtering out necessary retransmissions that occur elsewhere on the path. Consider the situation of one end being a router and passing packets out to the rest of the world, and openvpn is being used to brige an insecure link like say an 802.11b network. Personally I think mucking with this could be dangerous.

Quoted 10 lines

Using raw sockets would be another potential method -- instead of removing the reliability function from the upper layer TCP layer, remove it from the lower layer. This would require a sort of fake-TCP implementation in user-space with the reliability function stripped out. On first glance, this seems to be a more complicated approach because you would need to implement a lot of the TCP protocol in user space, and you would need to depend on the OS supporting raw sockets. The approach outlined in the previous paragraph doesn't need raw sockets, and it doesn't need to reimplement TCP. It only needs to examine the byte stream of IP packets flowing over the TUN device, filter out TCP retransmits, and synthesize return TCP ACKs.

This is what I was thinking, however this is a really big pain in the rear too.

Quoted 4 lines

Each method tries to stabilize TCP-over-TCP by eliminating a redundant reliability layer. Both of these methods, while somewhat ugly, would eliminate a big part of the robustness issue of IP over TCP, for those who lack IP over UDP as an option.

Or you could just tell users that you are to expect degraded performance in this case and use UDP if possible. But *if* you are stuck, and have no other options, this will work, but it'll suck too.

I'm wondering if there are some socket options one could set to twiddle the TCP stack into playing slightly nicer. I doubt it, because you've still got the issue of other systems not playing nice with it.

-Aaron

#10 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

In reply to James Yonan
Quoted 12 lines · James Yonan

Actually, I was thinking more about the situation where people are forced to tunnel IP over TCP, for whatever reason, when UDP is not an option. Since IP is designed to transit over an unreliable physical layer, when you tunnel it over TCP (a la vpnd or IP over ssh) you end up with this problem:

http://sites.inka.de/sites/bigred/devel/tcp-tcp.html (see Stacking TCPs)

The key issue here is that when you tunnel IP over TCP, that will usually mean TCP over TCP. And this tends to break TCP's retransmission algorithm. As the article above states: "The upper layer will queue up more retransmissions faster than the lower layer can process them".

Quoted 4 lines

So my idea is why not filter out the upper layer TCP retransmissions, and synthesize the return ACKs so that the upper TCP layer doesn't begin the exponential backing off of the retransmit timer that eventually will stall the connection? This process would essentially strip the upper layer TCP of its

I think data volume (in flight or lost) is the issue, not stalls. Once an ACK of the outer layer is returned, the inner layer will implicitly also see an ACK (payload) which will then kick the data flow alive again.

Quoted 5 lines

reliability function, since now the lower TCP layer will provide that function. This is not difficult to implement, since to OpenVPN, the upper layer protocols are all simply byte streams flowing over the TUN pipe. They can be filtered without resorting to raw sockets or any other such potentially unportable constructs.

Only that OpenVPN would have to parse the TCP protocol for IPv4 and IPv6.

Signature · 1 line
Matthias Andree
#9 lore raw

Re: [Openvpn-devel] TCP-over-TCP (was: Multi-channel VPN)

In reply to Aaron Sethman
Quoted 25 lines · Aaron Sethman
Quoted 6 lines · James Yonan

Actually, I was thinking more about the situation where people are forced to tunnel IP over TCP, for whatever reason, when UDP is not an option. Since IP is designed to transit over an unreliable physical layer, when you tunnel it over TCP (a la vpnd or IP over ssh) you end up with this problem:

http://sites.inka.de/sites/bigred/devel/tcp-tcp.html (see Stacking TCPs)

I've read the paper many times, heh ;)

Quoted 6 lines

The key issue here is that when you tunnel IP over TCP, that will usually mean TCP over TCP. And this tends to break TCP's retransmission algorithm. As the article above states: "The upper layer will queue up more retransmissions faster than the lower layer can process them".

Quoted 9 lines

So my idea is why not filter out the upper layer TCP retransmissions, and synthesize the return ACKs so that the upper TCP layer doesn't begin the exponential backing off of the retransmit timer that eventually will stall the connection? This process would essentially strip the upper layer TCP of its reliability function, since now the lower TCP layer will provide that function. This is not difficult to implement, since to OpenVPN, the upper layer protocols are all simply byte streams flowing over the TUN pipe. They can be filtered without resorting to raw sockets or any other such potentially unportable constructs.

Quoted 5 lines

What if you end up filtering out necessary retransmissions that occur elsewhere on the path. Consider the situation of one end being a router and passing packets out to the rest of the world, and openvpn is being used to brige an insecure link like say an 802.11b network. Personally I think mucking with this could be dangerous.

That's a good point. Once you synthesize an ACK to avoid retransmission over the TCP-tunnel segment of the path, you are guaranteeing to the sender that the packet has been received at the destination. This means you would need to do some accounting of TCP sequence numbers at both ends of the tunnel, so that you could differentiate retransmits caused by local congestion on the TCP-tunnel from retransmits occurring due to lossage elsewhere on the path. The more you look at it, the uglier it gets.

What you need is a kind of TCP mode that strips out the reliability function.
Of course we have it, it's called UDP ;)

James