Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 May 2003 12:13:36 +0900 (JST)
From:      Kenjiro Cho <kjc@csl.sony.co.jp>
To:        ashish@symonds.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: changing the ToS in IP Header
Message-ID:  <20030527.121336.41645344.kjc@csl.sony.co.jp>
In-Reply-To: <1116.203.192.199.30.1053958864.squirrel@secure.symonds.net>
References:  <1116.203.192.199.30.1053958864.squirrel@secure.symonds.net>

next in thread | previous in thread | raw e-mail | index | archive | help

Ashish Kulkarni wrote:
> Is there any way in which I can manipulate the Type of Service (TOS) byte
> in the IPv4 header? I need to set the TOS bits on all outgoing packets from
> my box to the ISP to a particular pattern (0x02), as otherwise the ISP does
> not forward packets.

Tell your ISP not to use 0x02; it violates the standard.
You may modify the upper 6 bits for an arbitrary value, though.
The lower 2 bits of the (now deprecated) TOS field are officially
assigned to ECN (RFC3168).  0x02, ECT(0), is used to indicate that the
sender is ECN-capable.

> I have been able to do this in Linux using the
> iptables mangle table:
> 
> http://www.tldp.org/LDP/nag2/x-087-2-firewall.tos.manipulation.html
> 
> but am unable to find a similiar packet-mangling feature in the firewalls
> running on FreeBSD...there are rules for matching on TOS pattern, but not
> on TOS manipulation. Does anyone know of any tool which can do this?

ALTQ supports diffserv and is capable of rewriting the upper 6 bits of
the TOS field.
http://www.csl.sony.co.jp/~kjc/software.html

-Kenjiro



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030527.121336.41645344.kjc>