All of lore.kernel.org
 help / color / mirror / Atom feed
From: "sufcrusher" <sufcrusher@zonnet.nl>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Low latency on large uploads - almost done but not quite.
Date: Tue, 17 Jun 2003 18:16:13 +0000	[thread overview]
Message-ID: <marc-lartc-105587387105306@msgid-missing> (raw)
In-Reply-To: <marc-lartc-105560610320685@msgid-missing>

Playing CounterStrike myself regurlarly and being on a LAN with a few
professional P2Pers, I had the same problem and also experienced the
non-stable pings. At first I started experimenting with the rates and
ceilings, but in practice that didn't help much.

(one of) the reasons for the unstable ping is that a packet of ~ 1500 bytes
on a 128kbit connection (like yours and mine) takes roughly a 10th of a
second to send (100ms). So at the moment a large packet is being sent and a
quake packet is next in the queue, it still has to wait 100ms (worst case).
This latency of course adds to the normal latency you already have to the
quake server.

What does seem to help a little is lowering the maximum packet size (MTU) in
your routing table:

#!/bin/sh
oldroute=`ip route | grep default | cut -d' ' -f-5`
ip route change $oldroute mtu 500

The cut takes care of removing the 'mtu xxx' from a line like this (type "ip
route": to see it)
default via a.b.c.d dev eth0  mtu 900

It only takes the first 5 words. I presume that number of words can be
different in other situations, so you might have to adapt for that. (or use
something other than 'cut' to do it properly).

Note that the MTU only effects the outgoing packetsize, so downloads are not
affected at all. Uploads do get a little less efficient (the packetheaders
consist of a larger portion of the traffic) but in practise this is still
acceptable. Game packets are pretty small anyway, so won't be affected at
all.

I'm assuming the burst and quantum settings can be optimized for smaller
packet sizes to take full advantage of this. But to be honest I haven't
really done that yet.

I use a cable connection which has a more than 10 times faster download than
upload, so for me shaping the download isn't very effective. If you want to
limit the maximum packetsize for incoming packets as well (at least for TCP)
you can simply do this:

iptables -I PREROUTING -t mangle -i eth0 -j TCPMSS --set-mss 1000 -p
TCP --tcp-flags SYN,RST SYN
iptables -I INPUT                 -t mangle -i eth0 -j TCPMSS --set-mss
1000 -p TCP --tcp-flags SYN,RST SYN

For 1000 bytes packets. You can also use --clamp-mss-to-mtu option, which
probably makes sense. Note that the MSS thing only works for new
connections.

Note: After you change the MSS value, existing connections will still use
the old size. MTU changes have effect immediately.

Also make sure you patched the kernel to use the high resolution timer (info
at www.docum.org somewhere). That helped a lot in my case (you can put the
ceilingrates closer to the actual 128kbit and therefore reduce latency as
well). I'm not sure it's still necessary on 2.4.20 and/or 2.4.21.

Jannes Faber

----- Original Message -----
From: "Thilo Schulz" <arny@ats.s.bawue.de>
To: <lartc@mailman.ds9a.nl>
Sent: Saturday, June 14, 2003 5:54 PM
Subject: [LARTC] Low latency on large uploads - almost done but not quite.


Does anyone of you have an idea how I can minimize this effect, and let
pings
be stable at 60 ms? stable 80ms delay are okay for me too, no question.
If I let the worst-priority bulkdownload class ceil up only to 10kbyte/s I
have the same effect, only when the max ceil class is put down under 6 i do
not have this changing ping effect.


_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

  parent reply	other threads:[~2003-06-17 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-14 15:54 [LARTC] Low latency on large uploads - almost done but not quite Thilo Schulz
2003-06-15  9:09 ` Stef Coene
2003-06-15 11:44 ` Thilo Schulz
2003-06-15 12:00 ` Stef Coene
2003-06-16  7:54 ` [LARTC] Low latency on large uploads - almost done but not Corey Rogers
2003-06-17 18:16 ` sufcrusher [this message]
2003-06-18 12:32 ` [LARTC] Low latency on large uploads - almost done but not quite Thilo Schulz
2003-06-18 19:10 ` sufcrusher

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=marc-lartc-105587387105306@msgid-missing \
    --to=sufcrusher@zonnet.nl \
    --cc=lartc@vger.kernel.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.