All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cameron Kerr <cameron.kerr@paradise.net.nz>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Problem with Howto
Date: Tue, 15 Apr 2003 20:52:39 +0000	[thread overview]
Message-ID: <marc-lartc-105044002621277@msgid-missing> (raw)
In-Reply-To: <marc-lartc-105043113410762@msgid-missing>

On Tue, Apr 15, 2003 at 12:55:52PM -0500, Dr Aldo Medina wrote:

> In the LART Howto, section 9.6.1 it says: "...we want to assign all
> traffic from and to port 22 to the highest priority band...",

Please excuse my newbie-ness in this matter, but in the case of SSH,
would it not be much better to say "...we want to assign all traffic
from port 22 with TOS of Minimal Delay to the highest priority band..."?

This is because of applications such as scp, which also use port 22, and
is bulk data. I know at least OpenSSH sets TOS appropriately (Only
turned on for interactive stuff, not for scp).

If anyone is interested, I wrote a wrapper script for tcpdump to show
what's happening wrt TOS. I call it tosaudit. To use it, just do (as
root)

tosaudit dst port 22

====================================
#!/bin/sh
#
# Audit the use of TOS based on a pcap filter provided by the user.
# 
# Cameron Kerr
# 13 Apr 2003

umask 077

report=/tmp/tosaudit$$
count\x1000

echo "#Capture file is $report"
echo "#Capturing $count packets..."

tcpdump -c $count -w $report $*

echo "#Processing..."
tcpdump -r $report -v | \
	sed -e '/\[tos 0x..\]/s/.*\[tos \(0x..\)\].*/\1/' \
		-e 't' -e 's/.*/0x00/' | \
	uniq -c | \
	awk '
	BEGIN {
		sum00 = 0
		sum10 = 0
		sum20 = 0
		sum40 = 0
		sum80 = 0
		suminv = 0
	}

	$2 = "0x00" { sum00 += $1; next }
	$2 = "0x10" { sum10 += $1; next }
	$2 = "0x20" { sum20 += $1; next }
	$2 = "0x40" { sum40 += $1; next }
	$2 = "0x80" { sum80 += $1; next }

	{ suminv += $1 }
	
	END {
		printf( "No TOS                 0x00 = %d\n", sum00 )
		printf( "Minimum Delay          0x10 = %d\n", sum10 )
		printf( "Maximise Throughput    0x20 = %d\n", sum20 )
		printf( "Maximise Reliability   0x40 = %d\n", sum40 )
		printf( "Mimimise Monetary Cost 0x80 = %d\n", sum80 )
		printf( "Others (Non-Standard)  0x?? = %d\n", suminv )
	}'

echo "#Actual TOS values found..."
tcpdump -r $report -v | \
	sed -e 's/.*\[tos \(0x..\)\].*/\1/' -e t -e 's/.*/0x00/' | \
	sort | uniq -c
====================================

By the way, is it still wrong to have multiple TOS bits set?

I'll be putting this script on my website in due course, when its a bit
more polished. (Option for reading from capture file, instead of from
network.)

-- 
Cameron Kerr
Email:   cameron.kerr@paradise.net.nz
Website: http://nzgeeks.org/cameron/

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

      parent reply	other threads:[~2003-04-15 20:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-15 17:55 [LARTC] Problem with Howto Dr Aldo Medina
2003-04-15 19:44 ` Stef Coene
2003-04-15 20:52 ` Cameron Kerr [this message]

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-105044002621277@msgid-missing \
    --to=cameron.kerr@paradise.net.nz \
    --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.