[ntp:questions] Better QoS support

Philip Prindeville philipp_subx at redfish-solutions.com
Tue Dec 26 07:14:52 UTC 2006


Hi.

I added better support for setting IPTOS_PREC_* in ntpd/ntp_io.c
and ntpd/ntp_config.c.

Why?

Just specifying LOWDELAY with the old TOS bits isn't sufficient.

The new QoS models using Precedence and Diffserv allow for
greater granularity.  Plus certain router implementations (like
the Cisco c837 and c877) can't rewrite ToS bits as part of the
CEF switching path (they end up having to process switch the
packets instead, alas).

I've added precedence and TOS support (though why anyone
would want to set high-throughput, min-cost, or reliability, I
don't know...  but it seemed the Right Thing To Do to add
full TOS support anyway).

I currently have my c877 configured as:

class-map match-any call-setup
 match ip dscp af31
 match ip dscp af32
 match ip dscp cs3
 match ip precedence 3
class-map match-any internetwork-control
 match ip dscp cs6
class-map match-any voice
 match ip dscp ef
 match ip dscp cs5
 match ip precedence 5
!
!
policy-map voip_dsl
 description Note LLQ for ATM/DSL G.729=64K, G.711=128K
 class voice
  priority 144
 class call-setup
  bandwidth percent 2
 class internetwork-control
  bandwidth percent 5
 class class-default
  fair-queue
  random-detect
policy-map shaper
 class class-default
  service-policy voip_dsl



However, with "qos internetcontrol" (or equally "qos cs6")
at the end of my /etc/ntp.conf file, I see:


Dec 25 23:37:14 settop ntpd[17473]: ntpd 4.2.2p3 at 1.1577-o Tue Dec 26 06:33:52 UTC 2006 (1)
Dec 25 23:37:14 settop ntpd[17474]: precision = 1.000 usec
Dec 25 23:37:14 settop ntpd[17474]: setsockopt IP_TOS 16
Dec 25 23:37:14 settop ntpd[17474]: Listening on interface wildcard, 0.0.0.0#123 Disabled
Dec 25 23:37:14 settop ntpd[17474]: setsockopt IP_TOS 16
Dec 25 23:37:14 settop ntpd[17474]: Listening on interface lo, 127.0.0.1#123 Enabled
Dec 25 23:37:14 settop ntpd[17474]: setsockopt IP_TOS 16
Dec 25 23:37:14 settop ntpd[17474]: Listening on interface eth0, 192.168.1.7#123 Enabled
Dec 25 23:37:14 settop ntpd[17474]: kernel time sync status 0040
Dec 25 23:37:14 settop ntpd[17474]: getaddrinfo: "::1" invalid host address, ignored
Dec 25 23:37:14 settop ntpd[17474]: ntokens 2
Dec 25 23:37:14 settop ntpd[17474]: flag 11
Dec 25 23:37:14 settop ntpd[17474]: tos c0
Dec 25 23:37:14 settop ntpd[17474]: setsockopt IP_TOS c0
Dec 25 23:37:14 settop ntpd[17474]: Added Multicast Listener 224.0.1.1 on interface 3
Dec 25 23:37:14 settop ntpd[17474]: frequency initialized -90.855 PPM from /var/lib/ntp/drift
Dec 25 23:38:29 settop ntpd[17474]: synchronized to 192.168.1.1, stratum 2
Dec 25 23:38:29 settop ntpd[17474]: kernel time sync enabled 0001


so the code seems to be mostly working...  except that "qos"
seems to be called (and processed, as seen from the debug lines
ntokens/flag/tos) after the sockets have been created.  Not sure
why.  Does the "qos" need to appear earlier in the config file?

I'll dig through the code some more and see the order of
processing...

I've attached the patches for the FC5 .spec file, the
SOURCES/ntp.conf file, and of course the changes to the BUILD/
tree itself.

-Philip




More information about the questions mailing list