Skip to contentSkip to conversation

Prioritize TCP ACKs

Openvpn-devel Nielsen 3 participants 3 messages Nov 24, 2005 – Nov 29, 2005

lore
Share & tools
lore

Nielsen

author
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here's a hack of a patch which puts nice TOS bits on TCP ACK packets. This allows you to use pf or another firewall to prioritize the resulting openvpn traffic in the way you normally do over asynchronous connections.

Certaintly no need to put this in openvpn. Just figured someone else out there might have run into the same problems.

Cheers,
Nate Nielsen
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDhqUue/sRCNknZa8RAoDpAKCI/Fk1EdV49UGY2act8kLnWb0zpACgoLYG drRf/4s1cX8QrlxcYyfqv+k=
=5Xea
-----END PGP SIGNATURE-----

socket.h renamed from openvpn-2.0.orig/socket.h +8 -0
diff -rU3 ../openvpn-2.0.orig/socket.h ./socket.h
@@ -737,6 +737,14 @@
       struct openvpn_iphdr *iph = (struct openvpn_iphdr *) BPTR (ipbuf);
       ls->ptos = iph->tos;
       ls->ptos_defined = true;
+
+      if (iph->protocol == OPENVPN_IPPROTO_TCP)
+        {
+          struct openvpn_tcphdr *tcp = (struct openvpn_tcphdr *) (BPTR(ipbuf) + OPENVPN_IPH_GET_LEN (iph->version_len));
+	  if ((tcp->flags & (OPENVPN_TCPH_SYN_MASK | OPENVPN_TCPH_ACK_MASK)) == OPENVPN_TCPH_ACK_MASK && 
+	      iph->tot_len <= 80)
+		ls->ptos |= 0x10;
+	}
     }
 }
 
#1 lore raw
Quoted 4 lines

Here's a hack of a patch which puts nice TOS bits on TCP ACK packets. This allows you to use pf or another firewall to prioritize the resulting openvpn traffic in the way you normally do over asynchronous connections.

I think you have to make those TOS values configurable because their meaning is no longer standardized (or, more precisely, there are several standards to choose from).

#2 lore raw
Quoted 8 lines · Florian Weimer
Quoted 4 lines

Here's a hack of a patch which puts nice TOS bits on TCP ACK packets. This allows you to use pf or another firewall to prioritize the resulting openvpn traffic in the way you normally do over asynchronous connections.

I think you have to make those TOS values configurable because their meaning is no longer standardized (or, more precisely, there are several standards to choose from).

It's a patch :) Completely customizeable. I doubt this code would (or should) be included in openvpn as is.

Cheers,
Nate