BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
setting DiffServ in network packets under Linux???
- Subject: setting DiffServ in network packets under Linux???
- From: bogstad-e+AXbWqSrlAAvxtiuMwx3w at public.gmane.org (Bill Bogstad)
- Date: Mon, 15 Mar 2010 20:29:25 -0400
- In-reply-to: <um6377duaf.fsf-JIwW9X8F/fmcvWdFBKKxig@public.gmane.org>
- References: <2d6a9f6f1001061336s30ce8223wcda7fa83e1ba1831@mail.gmail.com> <2d6a9f6f1001062343h6b2361a3p22a9dddf0aa8d3d1@mail.gmail.com> <um6377duaf.fsf@nifty.dyndns.org>
On Tue, Jan 12, 2010 at 2:58 PM, Kevin D. Clark <kevin_d_clark-Wuw85uim5zDR7s880joybQ at public.gmane.org> wrote: > > Bill Bogstad writes: > >> On Wed, Jan 6, 2010 at 4:36 PM, Bill Bogstad ?wrote: >> > Does anybody have any idea if there is a programmatic way to set the >> > DiffServ (Differentiated Services Code Point (DSCP)) field on IP >> > packets generated by programs running under Linux? >> >> Never mind. ? It appears that you can use setsockopt() with IPPROTO_IP >> and IP_TOS options to do this. >> At least that's what the documentation seems to say. > > At a previous company, I experimented around with doing this via > setsockopt(...IP_TOS...) and via iptables. ?Either way works. > > Eventually, I determined (for myself) that doing this via iptables was > better (for my situation) because setsockopt(...IP_TOS...) requires > root privileges, and I wanted to minimize the number of places in > which my server had to run as root. > > (in fact, soon after the time that I added this iptables stuff to our > product I also I added code to my server that disallowed it from > being run as root, unless the > "--i-want-to-run-this-server-incorrectly-as-root" flag was set...I > recommend this pattern...) I just wanted to let everyone know that things have changed as far as IP_TOS and Linux are concerned. As of Feb. 2008, root is no longer required. David Miller decided that other Unix systems don't have any privilege check so he removed it for Linux as well. The commit message is here: http://kerneltrap.org/mailarchive/git-commits-head/2008/2/15/870764 It was backported to the 2.6.24.4 stable release as well: See http://lwn.net/Articles/274741/ Just some additional info, in case someone runs across this thread while trying to understand IP_TOS and DiffServ with Linux. Bill Bogstad
- Prev by Date: Waiting for Verizon..
- Next by Date: FCC on broadband
- Previous by thread: office multi-function printer recommendations
- Next by thread: FCC on broadband
- Index(es):