Bug report (long) - OpenVPN dropping small frames
I'm looking for a solution to a problem with small amounts of packet loss thru Openvpn tunnel, and I think the root cause may be some sort of subtle bug in Openvpn. It appears to be dropping small packets - such as those that result from fragmenting larger frames for crypto/encapsulation - as well as the small frames used by ppp/pppoe for link control. We aren't dealing with actual packet loss of the crypted udp packets carrying the tunneld data, nor are we dealing with firewalls or other common openvpn faq items. Please forgive my verbosity, here's what I have so far:
I do bridging thru openvpn/tap device, and I'm basiclly passing a *lot* of different pppoe sessions thru it. I initially became aware of the problem back in Feburary and it was due to a very simple observation - that there appeared to be an occasional network disruption which would cause just one (and random) pppoe client to think the server had went away, but then immediately when the client tried to re-establish pppoe, the server would 'be there' again and ppp would sucessfully renegotiate a new session and everything would be fine.
The PPP protocol can use (and all of my clients do), a sub protocol called 'lcp-echo', which is basiclly a protocol layer ping check between the client and server to verify connectivity. In my configuration, this check happens once every 10 seconds and if there are 5 failures in a row, the client will decide that the server is dead, send a 'padt' protocol frame with a message embedded in it to the other side and will recycle itself and begin a new session negotiation process.
I experience issues where random clients will, for no network reason I am aware of, renegotiate their sessions. And I have spent much time
investigating the circumstances surrounding these. The key bit of
information I see is recorded either on the pppoe client or the pppoe
server, where either of them will claim 'no response to 5 echo requests', which implies that the network path between them has been unavailable for at least 50 seconds continously (or enough packet loss to make it the same difference).
I have focused on this symptom - of there being enough (apparent) packet
loss enough to cause client disconnection - and what I found was that this is NOT happening, and that at no time did the disconnecting client actually suffer a real loss of connectivity. I have been able to ping sample clients over the routed portion of the network (my clients have pppoe thru the vpn, and a statically routed IP address as well) during these times and have observed NO PACKET LOSS, and yet the client in question clearly states this (no echo replies) as the reason for dropping and renogiating the session.
This has been maddening to say the least. Because if I can ping the client, and it's taking exactly the same path thru the network that the encapsulated pppoe frames do, and the pings all work and at the same time the pppoe client thinks it's partner is gone, then logically there's got to be another explanation.
I have recently been able to observe this situation first hand with tcpdump running at the OpenVPN server and client sides. I saw frames go into the tunnel that _did not_ make it out the other side. Worse yet, it appeared that the frames not making it out (the encapsulated pppoe frames) were all destined for one mac address in particular. Like, for whatever reason, OpenVPN appeared to not be able to decapsulate any frames destined for one particular mac address for some period of time.
Suspeciously, I also have been observing an excessive number of ICMP "Frag reassembly time exceeded" messages coming from this openvpn client directed at the server. Putting 2 and 2 together, these excess icmp messages appear to be being generated because the client is not receiving all fragments. And I think it's the encrypted payload that's not being received properly.
I have a good test case right now. If I ping with 1393 bytes or more of
data, it doesn't work reliably. Whereas if I ping with 1392 bytes, it does work reliably and without loss. Here is an example:
[[email protected]... ~]# ping -s1393 172.16.18.18
PING 172.16.18.18 (172.16.18.18) 1393(1421) bytes of data. 1401 bytes from 172.16.18.18: icmp_seq=6 ttl=62 time=42.7 ms 1401 bytes from 172.16.18.18: icmp_seq=7 ttl=62 time=6.89 ms 1401 bytes from 172.16.18.18: icmp_seq=69 ttl=62 time=7.61 ms 1401 bytes from 172.16.18.18: icmp_seq=130 ttl=62 time=8.66 ms 1401 bytes from 172.16.18.18: icmp_seq=131 ttl=62 time=8.19 ms ^C
--- 172.16.18.18 ping statistics ---
137 packets transmitted, 5 received, 96% packet loss, time 136261ms rtt min/avg/max/mdev = 6.893/14.813/42.703/13.957 ms, pipe 2
Now the 'good' size:
[[email protected]... ~]# ping -s1392 -c 100 172.16.18.18 PING 172.16.18.18 (172.16.18.18) 1392(1420) bytes of data. 1400 bytes from 172.16.18.18: icmp_seq=0 ttl=62 time=10.2 ms 1400 bytes from 172.16.18.18: icmp_seq=1 ttl=62 time=9.89 ms 1400 bytes from 172.16.18.18: icmp_seq=2 ttl=62 time=9.96 ms .
.
.
^C
--- 172.16.18.18 ping statistics ---
86 packets transmitted, 86 received, 0% packet loss, time 85247ms rtt min/avg/max/mdev = 8.169/16.197/138.610/21.278 ms, pipe 2
So what does it mean that a 1 byte larger packet size is just
unreliable, as opposed to just not working at all?!?
I'm not really sure where to go next with this other than to report
these damm strange observations and hope someone can suggest some next steps to try in resolving the basic packet loss problem. Please bear in mind that I have to be careful with the testing I do because I am running this in production and can't afford to take it completely down for long periods of time. I do have a backup system which has everything the production system does - except no clients - which I can test against, but I haven't yet been able to reproduce the problem on it yet (and I fear it is because of traffic loading).
Mike
Quoted 7 lines · Mike Ireton
I have recently been able to observe this situation first hand with tcpdump running at the OpenVPN server and client sides. I saw frames go into the tunnel that
_didnot_make it out the other side. Worse yet, it appeared that the frames not making it out (the encapsulated pppoe frames) were all destined for one mac address in particular. Like, for whatever reason, OpenVPN appeared to not be able to decapsulate any frames destined for one particular mac address for some period of time.
I need a more granular snapshot of what's happening here.
To properly test for packet lossage on an OpenVPN session between machines A and B, you would need 4 simultaneous tcpdump sessions:
(1) Machine A -- tcpdump on tap interface
(2) Machine A -- tcpdump on TCP/UDP 1194 (internet gateway interface)
(3) Machine B -- tcpdump on TCP/UDP 1194 (internet gateway interface)
(4) Machine B -- tcpdump on tap interface
When you do your 1393 byte ping from A to B, the packet is going to travel 1 -> 2 -> 3 -> 4 -> ICMP echo reply on B -> 4 -> 3 -> 2 -> 1.
I need to know exactly where the packet is being dropped in this chain.
If the packet disappears between 1 and 2 or between 3 and 4 then either OpenVPN or a firewall/packet-filter operating on the tap interface is dropping it.
If the packet disappears between 2 and 3, it's a network connectivity issue, or a firewall/router/NAT issue on OpenVPN's communication port (usually 1194).
BTW, I tried a 1393 byte ping through an OpenVPN tap tunnel with default settings and it worked fine.
If you think that 1393 is an important number with respect to reproducing the problem, try to isolate and differentiate the cases where 1393 byte pings fail and where they succeed.
James
Quoted 5 lines · James Yonan
When you do your 1393 byte ping from A to B, the packet is going to travel 1 -> 2 -> 3 -> 4 -> ICMP echo reply on B -> 4 -> 3 -> 2 -> 1.
I need to know exactly where the packet is being dropped in this chain.
The problem with this test is that there are many hundreds of OpenVPN packets per second flying between machine a and machine b - coupla megabits per second in fact. There is no way to capture just the crypted udp packets carrying the tunneled data involved in the test seperate from normal data traffic.
Quoted 6 lines
If the packet disappears between 1 and 2 or between 3 and 4 then either OpenVPN or a firewall/packet-filter operating on the tap interface is dropping it.
If the packet disappears between 2 and 3, it's a network connectivity issue, or a firewall/router/NAT issue on OpenVPN's communication port (usually 1194).
The evidence is that the link 2 -- 3 is good. These are passing a _lot_ of traffic, both openvpn tunneled pppoe and regularly routed subnets and I have excellent low latency no packet loss connectivity to hosts reached over this link. My test case with the 1393 byte packets not working 'well' is actually directly connected to the same switch that 'Machine B' connects to.
Quoted 9 lines
BTW, I tried a 1393 byte ping through an OpenVPN tap tunnel with default settings and it worked fine.
If you think that 1393 is an important number with respect to reproducing the problem, try to isolate and differentiate the cases where 1393 byte pings fail and where they succeed.
James
I do think 1393 is an important number, at least on this newtwork, and
I think it's the point at which the resulting crypted frames exceed the link mtu (1500) and generate fragments.
I should have stated that my test case actually has two ip addresses.
One IP is routed only thru the openvpn tunnel, and the other is a normal statically assigned routed public ip address. Both IP's are on the same interface, and this interface is connected to a switch that also interconnects the OpenVPN client and the router that serves this subnet.
The 1393 byte pings to the OpenVPN address (and larger), are the ones
that do not work reliably. I can see up to %95 loss with pinging that address, while at the exact same time I can see %0 loss pinging the other (routed) address, which travels over the same exact path. When running tcpdump, if the ping is currently working for the openvpn tunneled address, I will see the icmp messages as I should. When the pings aren't working, I don't see anything. But this doesn't tell me if they're being dropped on the Openvpn client or server. However, running this ping to the statically routed address does continue to work thruout, so I think I can rule out a transport problem between the client and server.
For what it's worth, at the time when the pings to the tunneled address
are not working, this is when I see a high instance of icmp errors from the client directed at the server:
x.x.x.x ICMP ip reassembly time exceeded, length 556
For the others who suggested reducing mss values and such - I'm already
doing it. In fact I have mss clamped down to 1312 right now for testing. But, mss clamping doesn't have anything to do with the loss of the lcp-echo frames I was complaining about.
Mike-
Quoted 6 lines · Mike Ireton
Quoted 4 lines · James Yonan
When you do your 1393 byte ping from A to B, the packet is going to travel 1 -> 2 -> 3 -> 4 -> ICMP echo reply on B -> 4 -> 3 -> 2 -> 1.
Quoted 8 lines
Quoted 1 line
I need to know exactly where the packet is being dropped in this chain.
The problem with this test is that there are many hundreds of OpenVPN packets per second flying between machine a and machine b - coupla megabits per second in fact. There is no way to capture just the crypted udp packets carrying the tunneled data involved in the test seperate from normal data traffic.
Actually it is quite trivial using tcpdump/windump, ethereal. snoop, sniffer, etc.
If you traffic volume is too high then I'd say you may want to check the performance of the equipment for bottlenecks.
Quoted 54 lines
Quoted 8 lines
If the packet disappears between 1 and 2 or between 3 and 4 then either OpenVPN or a firewall/packet-filter operating on the tap interface is dropping it.
If the packet disappears between 2 and 3, it's a network connectivity issue, or a firewall/router/NAT issue on OpenVPN's communication port (usually 1194).
The evidence is that the link 2 -- 3 is good. These are passing a _lot_ of traffic, both openvpn tunneled pppoe and regularly routed subnets and I have excellent low latency no packet loss connectivity to hosts reached over this link. My test case with the 1393 byte packets not working 'well' is actually directly connected to the same switch that 'Machine B' connects to.
Quoted 9 lines
BTW, I tried a 1393 byte ping through an OpenVPN tap tunnel with default settings and it worked fine.
If you think that 1393 is an important number with respect to reproducing the problem, try to isolate and differentiate the cases where 1393 byte pings fail and where they succeed.
James
I do think 1393 is an important number, at least on this newtwork, and
I think it's the point at which the resulting crypted frames exceed the link mtu (1500) and generate fragments.I should have stated that my test case actually has two ip addresses.
One IP is routed only thru the openvpn tunnel, and the other is a normal statically assigned routed public ip address. Both IP's are on the same interface, and this interface is connected to a switch that also interconnects the OpenVPN client and the router that serves this subnet.The 1393 byte pings to the OpenVPN address (and larger), are the ones
that do not work reliably. I can see up to %95 loss with pinging that address, while at the exact same time I can see %0 loss pinging the other (routed) address, which travels over the same exact path. When running tcpdump, if the ping is currently working for the openvpn tunneled address, I will see the icmp messages as I should. When the pings aren't working, I don't see anything. But this doesn't tell me if they're being dropped on the Openvpn client or server. However, running this ping to the statically routed address does continue to work thruout, so I think I can rule out a transport problem between the client and server.For what it's worth, at the time when the pings to the tunneled address
are not working, this is when I see a high instance of icmp errors from the client directed at the server:
Quoted 8 lines
x.x.x.x ICMP ip reassembly time exceeded, length 556
For the others who suggested reducing mss values and such - I'm already
doing it. In fact I have mss clamped down to 1312 right now for testing. But, mss clamping doesn't have anything to do with the loss of the lcp-echo frames I was complaining about.
You _have_ to do a packet capture to determine where the packets are getting lost.
While I'm not a developer I have quite a bit of experience with networking and VPNs (OPenVPN and others) and your issues look like a bottleneck or packet size issue to me, and others.
If I may be so bold. James has requested that packet caputres be performed to confirm where the loss is and IMHO this is what you need to do to prove your point.
--
Leonard Isham, CISSP
Ostendo non ostento.
Quoted 9 lines · Leonard Isham
Quoted 7 lines
The problem with this test is that there are many hundreds of OpenVPN packets per second flying between machine a and machine b - coupla megabits per second in fact. There is no way to capture just the crypted udp packets carrying the tunneled data involved in the test seperate from normal data traffic.
Quoted 6 lines
Actually it is quite trivial using tcpdump/windump, ethereal. snoop, sniffer, etc.
If you traffic volume is too high then I'd say you may want to check the performance of the equipment for bottlenecks.
Leonard, I think you missed the point. There is no way to capture just the tunneled data involved in the test case because one encrypted udp frame will look the same as any other encrypted udp frame. That's the whole point of the vpn in the first place! Compounding the problem of the cryptography - which makes the use of packet capture tools useless for examining problems _inside_ the tunnel - is the fact that with it actively being used, there's no way to peform any kind of realistic traffic analysis either. How do you propose to trivialy seperate out the 1 or 2 encrypted udp packets per scond which are the ones are carrying the ping packets for the test case, from the other hundreds of encrypted udp packets per second which are carrying pppoe session data for other applications and users??
You can't.
Quoted 4 lines
You _have_ to do a packet capture to determine where the packets are getting lost.
My point is that according to the packet captures that can be done, it appears they're getting dropped in secret, in a way that I currently don't have any way to examine or test for without divine intervention. Once the packets hit openvpn (by way of being forwarded into the tap device), I have no way of examining the data until it comes out the other side. The OpenVPN client could be dropping the frames due to a number of reasons such as failed hmac authenticiaton, failed decryption, failed some other sanity check. Or, the server could be creating invalid frames which pass all the checks, but is not what was actually passed to it in the first place. Or, the kernel in the OpenVPN client machine could be running low on some resource which is contributing to the problem.
By the way, here's the packet fragment statistics for various machines along the path:
OpenVPN server: (talking to 8 clients):
InDiscards:97972
ReasmTimeout: 1206 ReasmReqds:329076 ReasmOKs:163935 ReasmFails:1206 FragsOKs:0 FragFails:1 FragCreates:1500526
OpenVPN client:
InDiscards:0
ReasmTimeout: 133045 ReasmReqds:640581 ReasmOKs:253756 ReasmFails:133045 FragsOK s:0 FragFails:0 FragCreates:29208
Router A between Server to Client:
InDiscards:0
ReasmTimeout: 0 ReasmReqds:0 ReasmOKs:0 ReasmFails:0 FragsOKs:0 FragFails:0 FragCreates:0
Router B between Client to Server:
InDiscards:0
ReasmTimeout: 0 ReasmReqds:96 ReasmOKs:48 ReasmFails:0 FragsOKs:0 FragFails:0 FragCreates:0
According to the ip stack of all machines involved, the only fragmentation activity is happening inside the client and server.
Mike
Quoted 30 lines · Mike Ireton
Quoted 9 lines · Leonard Isham
Quoted 7 lines
The problem with this test is that there are many hundreds of OpenVPN packets per second flying between machine a and machine b - coupla megabits per second in fact. There is no way to capture just the crypted udp packets carrying the tunneled data involved in the test seperate from normal data traffic.
Quoted 6 lines
Actually it is quite trivial using tcpdump/windump, ethereal. snoop, sniffer, etc.
If you traffic volume is too high then I'd say you may want to check the performance of the equipment for bottlenecks.
Leonard, I think you missed the point. There is no way to capture just the tunneled data involved in the test case because one encrypted udp frame will look the same as any other encrypted udp frame. That's the whole point of the vpn in the first place! Compounding the problem of the cryptography - which makes the use of packet capture tools useless for examining problems _inside_ the tunnel - is the fact that with it actively being used, there's no way to peform any kind of realistic traffic analysis either. How do you propose to trivialy seperate out the 1 or 2 encrypted udp packets per scond which are the ones are carrying the ping packets for the test case, from the other hundreds of encrypted udp packets per second which are carrying pppoe session data for other applications and users??
Quoted 1 line
You can't.
Frames have time/date stamps on them when they are captured into a binary file. Each VPN tunnel is between two (2) unique IP addresses.
Check the TAP (unencrypted) traffic from both sides looking for packet loss. TCP traffic works best with this.
Check the UDP packets on both sides and look for anomolies between the capture. This is non-trivial as you will have to manually find the matching first UPD packet in both directions. Ngrep may help here. Look for out of order packets and lost packets.
Merge the encrypted and unencrypted traffic for each side. Look for missing unencrypted packets and then compare encrypted packets that follow and look for a correlation of one or more missing or out of order encrypted packets. Also non-trivial.
Again I am not a developer...
You are reporting a bug that. apparently, no one else has found. Your bug report is based on what I would call circumstantial evidence at this time. If there is a better way to prove the bug not based on circumstantial evidence I'm sure the, IMHO, extremely talented developers, which includes James, would be able to develop a fix for it.
Quoted 35 lines
Quoted 4 lines
You _have_ to do a packet capture to determine where the packets are getting lost.
My point is that according to the packet captures that can be done, it appears they're getting dropped in secret, in a way that I currently don't have any way to examine or test for without divine intervention. Once the packets hit openvpn (by way of being forwarded into the tap device), I have no way of examining the data until it comes out the other side. The OpenVPN client could be dropping the frames due to a number of reasons such as failed hmac authenticiaton, failed decryption, failed some other sanity check. Or, the server could be creating invalid frames which pass all the checks, but is not what was actually passed to it in the first place. Or, the kernel in the OpenVPN client machine could be running low on some resource which is contributing to the problem.
By the way, here's the packet fragment statistics for various machines along the path:
OpenVPN server: (talking to 8 clients):
InDiscards:97972
ReasmTimeout: 1206 ReasmReqds:329076 ReasmOKs:163935 ReasmFails:1206 FragsOKs:0 FragFails:1 FragCreates:1500526OpenVPN client:
InDiscards:0
ReasmTimeout: 133045 ReasmReqds:640581 ReasmOKs:253756 ReasmFails:133045 FragsOK s:0 FragFails:0 FragCreates:29208Router A between Server to Client:
InDiscards:0
ReasmTimeout: 0 ReasmReqds:0 ReasmOKs:0 ReasmFails:0 FragsOKs:0 FragFails:0 FragCreates:0
Quoted 8 lines
Router B between Client to Server:
InDiscards:0
ReasmTimeout: 0 ReasmReqds:96 ReasmOKs:48 ReasmFails:0 FragsOKs:0 FragFails:0 FragCreates:0According to the ip stack of all machines involved, the only fragmentation activity is happening inside the client and server.
--
Leonard Isham, CISSP
Ostendo non ostento.
Quoted 6 lines · Leonard Isham
Merge the encrypted and unencrypted traffic for each side. Look for
missing unencrypted packets and then compare encrypted packets that follow and look for a correlation of one or more missing or out of order encrypted packets. Also non-trivial.
I think you don't understand what encryption is or does.
1) Yes, packets can be captured entering the server from outside.
2) Yes, packets can be captured being forwarded into the tap device on
server.
3) NO, packets being forwarded out in crypted udp form CAN NOT BE
CORRELATED to any particular input to the tap device. So there's no way to know if any particular input frame, is actually making it out as a crypted udp packet, nor can we see the results of any fragmentation decisions or anything else OpenVPN decides to do with the data. If the link was completely quiet except for test data, then we could surmise that all packets leaving in crypted form are the packets for the test case (This is called traffic analysis in crypto circles), but since the link is in moderate use, there's no way to do this. So, at the present time, we CAN'T know or independently verify that it's doing anything at all with the frames in questio nor what exactly is happening to them (by looking at the crypted udp output). And if you claim to be able to do this, then congratulations! you have set us up the bomb, you've broken openvpn and the entire ssl security model, and all our base are now belong to you!
4) YES, crypted udp packets can be captured on the input ethernet
entering the client. They cannot be further examined to determine any correlation to inputs at the server. And we know that we have 0 packet loss end to end between client and server.
5) NO, packets being decrypted CAN NOT BE examined independently of
OpenVPN, nor can we trace the write path of the packets, nor can we examine any packets that the kernel itself decides to hold on to for fragmentation purposes. We can only see the packets once they are decrypted and presented to the network layer were pcap can get to them.
We've proven that the server to client link is good by passing
non-tunneled data (my pings to static public ips) while at the same time passing pings to tunneled ips which fail. We can look at steps 1, 2, and 4 and all we learn is that some particular tunneld data is not making it thru. But steps 3 and 5 can't be examined with packet captures, and it is at exactly these two points that silent packet corruption or dropping can take place, and with validity, and we won't know about it or any of the possible causes of it.
Quoted 2 lines
Again I am not a developer...
You keep saying that.
If anyone has any other ideas, I'm all ears. Espically if anyone knows
how I might tune in to the linux kernel and get copies of any packets it decides to drop because it can't find the rest of its fragments. Doesn't icmp return a copy when it says reassembly failed? Maybe I could look at these - they should be in decrypted form. Hmmm...
Mike Ireton
Quoted 11 lines · Mike Ireton
Quoted 6 lines · Leonard Isham
Merge the encrypted and unencrypted traffic for each side. Look for
missing unencrypted packets and then compare encrypted packets that follow and look for a correlation of one or more missing or out of order encrypted packets. Also non-trivial.I think you don't understand what encryption is or does.
Nasty comments are starting.
I'm not going to bother reading further.
If I offended anyone I apologise. I am stopping any further comments, by me, on this thread.
--
Leonard Isham, CISSP
Ostendo non ostento.
Quoted 2 lines · Mike Ireton
For the others who suggested reducing mss values and such - I'm
already doing it. In fact I have mss clamped down to 1312 right now for testing. But, mss clamping doesn't have anything to do with the loss of the lcp-echo frames I was complaining about.
I don't know if you have got any comments off-list, but I only said that --mssfix can usually help with MTU / packet fragmentation programs, but *won't* help you with this as it's not TCP based. My suggestion were therefor to try using --fragment which will cause OpenVPN to do internal fragmentation on ALL packets to avoid real IP fragmentation.
Janne also suggested that you could play with the MTU settings. I don't think you will get away with only changing the MTU when you're doing bridging though as you would then have to change the MTU on ALL hosts connected to both sides of the bridge as it's the transmitting hosts MTU that decides what frame size to use, not the recieving end (the openvpn machine).
I understand it's hard to play with these options in a production environment so if possible, I'd recommend setting up two new machines that takes the same network path to connect and continue the troubleshoting on these. As you can easily reproduce the problem with your ping, it shouldn't be to hard to "move" the problem into new machines. If you don't manage to "move" the problem to the new machines, well then you know where to continue looking for the problem.
If you have a spare NIC in each gateway you could setup a second instance of OpenVPN between your current machines, and just create a second bridge.
Cheers / Mathias
Quoted 11 lines
Quoted 5 lines
For the others who suggested reducing mss values and such - I'm
already doing it. In fact I have mss clamped down to 1312 right now for testing. But, mss clamping doesn't have anything to do with the loss of the lcp-echo frames I was complaining about.Janne also suggested that you could play with the MTU settings. I don't think you will get away with only changing the MTU when you're doing bridging though as you would then have to change the MTU on ALL hosts connected to both sides of the bridge as it's the transmitting hosts MTU that decides what frame size to use, not the recieving end (the openvpn machine).
According to this wepbage: http://www.netheaven.com/pmtu.html
you can use:
echo 1 >/proc/sys/net/ipv4/ip_no_pmtu_disc
to make linux hosts stop doing the DF-trick. Might be helpful if that seems to be the case for you.
--
Some mornings, it's just not worth gnawing through the straps...
Quoted 4 lines · Mike Ireton
Suspeciously, I also have been observing an excessive number of ICMP "Frag reassembly time exceeded" messages coming from this openvpn client directed at the server. Putting 2 and 2 together, these excess icmp messages appear to be being generated because the client is not receiving all fragments. And I think it's the encrypted payload that's not being received properly.
I have a good test case right now. If I ping with 1393 bytes or more of
data, it doesn't work reliably. Whereas if I ping with 1392 bytes, it does work reliably and without loss. Here is an example:
At first glance that seems like a classic MTU/packet fragmentation issue.
I've seen many odd problems due to packet fragmentation. Packet fragementation should in teory work just as reliable as with no fragmentation, just a little performance lose, but in reality there are many problems associated with this. For example I've seen routers routing frags perfect for a couple of seconds and then all of suddence only forward the first frag of each packet. Very hard to debug as all packets not large enough to be fragmented, like smaller pings still pass perfectly.
So, the bottom line is to always try avoiding packet fragmentation, or if you have the time, get to the bottom with why frags are not getting though properly.
--mssfix helps keeping frags away for tcp sessions, but that won't help you with pppoe or pings. First use tcpdump to watch the network for the openvpn traffic and see if you have any frags occationally while sending large pings.
Then try using the --fragment option with a rather low value which will cause OpenVPN todo internal fragrentation to avoid IP fragmentation and see if the frags goes away, and hopefully the problem as well!
If that solves your problem, it would still be nice to understand if the cause were due to a broken router, or if there really is a bug somewhere...
Cheers - Mathias
A message that is not in the archive (sent off-list or not yet received): [email protected]...
Sent only to Mathias first time. Oops.
---------- Forwarded message ----------
From: Janne Johansson <[email protected]...>
Date: 2005-okt-20 12:42
Subject: Re: [Openvpn-devel] Bug report (long) - OpenVPN dropping small frames
To: Mathias Sundman <[email protected]...>
2005/10/20, Mathias Sundman <[email protected]...>:
Quoted 4 lines · Mike Ireton
Quoted 3 lines
Suspeciously, I also have been observing an excessive number of ICMP "Frag reassembly time exceeded" messages coming from this openvpn client
--8<--
Quoted 3 lines
Quoted 3 lines
I have a good test case right now. If I ping with 1393 bytes or more of data, it doesn't work reliably. Whereas if I ping with 1392 bytes, it does work reliably and without loss. Here is an example:
--8<--
Quoted 3 lines
If that solves your problem, it would still be nice to understand if the cause were due to a broken router, or if there really is a bug somewhere...
Actually, this is exactly what I saw in the early days of openvpn, when putting the traffic through an openbsd-PF gateway while using linux clients in one or both ends
of openvpn. Since Linux hosts sends fragments with the "dont-fragment" bit set*, (supposedly to investigate MTU) the firewall will detect a fragmented packet that
has requested not to be fragmented (DF) and drops it. In my case, the openbsd gw was under my control, so I could figure out that it was the "scrub" option in PF
that followed this kind of rule, and remove it at first. Later I decided that this would
only work until someone was behind another PF-scrubbing host and instead lowered the MTU of the openvpn traffic instead (or the tun-device, cant remember what options
I used then), and always got the large packets through.
Give it a try to lower the MTU and see if it helps.
*) As a sidenote, I think PF does the right thing, regardless of how useful PMTU seems
to be, a packet that requests not to be fragmented and indeed arrives as a fragment
should be removed by my firewall, since one of its purposes is to make sure weird
stuff dont get into my network.
--
Some mornings, it's just not worth gnawing through the straps...
--
Some mornings, it's just not worth gnawing through the straps...
Quoted 2 lines · Mathias Sundman
Then try using the --fragment option with a rather low value which will cause OpenVPN todo internal fragrentation to avoid IP fragmentation and see if the frags goes away, and hopefully the problem as well!
A problem with this - which I am open to doing if it does solve the
problem - is that I have a number of clients and this option apparently isn't a negotiated option, so if I enable it on the server, I have to enable it on all clients and restart all of them, which would be hugely disruptive and not an option at this point in time.
Thanks for the suggestion.