Monday Dec 16, 2013

DSCP QoS tagging of DNS traffic in Solaris

A huge telco customer recently shared their desire to support DSCP marking of their core network infrastructure, specifically they asked if there's a way to do this in Solaris? Sure there is! Since DSCP marking is enforced by the router,  they wanted to know how to make their Solaris 10 systems conform to this. (Why Solaris 10 and not Solaris 11? Because their current roll-out reflects systems deployed before Solaris 11 came out) - AND they wanted to do this by the end of the year.  Given the opportunity and the fast-approaching deadline, I looked into this further by jointly teaming up with Krishna Yenduri of our Solaris network developer team, a team that focuses on network protocols and related cloud/virtualization technologies. Wanted to share what needs to be configured - and how easy it actually is.

So the customer inputs were:

  • Application: ISC BIND 
  • Requirement: Every DNS packet has to be tagged with value of 32, every DNS query needs to be tagged. 
  • Platform: x86 systems, Sun x4270 M2 servers running Solaris 10 

DSCP marking is supported in Solaris's implementation of support of IPQoS.  It is one of the most used features of IPQoS -- we have a number of scenarios of uses of Sun Ray servers where this has been deployed.   The way to configure IPQoS in Solaris 10 is thru the ipqosconf(1M)  interface.  Solaris 10 comes with a couple of sample config files located in /etc/inet/ipqosconf*, which show how to use the DSCP marking rules.  

If the need is to limit the marking to just the outgoing DNS queries, use the 'dport' parameter (that indicates the destination port), and set it to 53, as shown in the complete example that follows. Alternatively, if the need is to limit the marking to the outgoing DNS response, use the 'sport' parameter in the filter definition.

Contents of /etc/inet/ipqosinit.conf


fmt_version 1.0

# Mark the DSCP with code point AF32, 011100 = 28
action {
       module dscpmk
       name markAF32

       params {
               global_stats true
               next_action continue
               dscp_map {
                       0-63:28
               }
               dscp_detailed_stats false
       }
}

action {
       module ipgpc
       name ipgpc.classify

       params {
               global_stats true
       }

       class {
               name myclass
               next_action markAF32
               enable_stats true
       }

       class {
               name default
               next_action continue
               enable_stats false
       }

       filter {
               name myfilter
               class myclass
               # DNS response
               sport 53
               direction { LOCAL_OUT }
       }
}

The file gets saved as:   /etc/inet/ipqosinit.conf

Then the following operation instantiates the contents of the config file: 

# /usr/sbin/ipqosconf -s -a /etc/inet/ipqosinit.conf

and there is NO need to reboot.

How would you verify this?

If you're looking at the IPv4 network traffic, you would use:

#snoop -V -d <ipif-name> dst 53

This would show the IP header with the TOS value of '0x70', since the TOS value of 0x70 is the DSCP value of decimal 28).

Here's an example: 

host1 -> dns-server.yourcompany.com IP  D=XXX.XX.XXX.XX S=YY.YYY.YY.YYY LEN=74, ID=19461, TOS=0x70, TTL=255

Kindly note that 'TOS' is the same as the DSCP field - it happens to be an older RFC format and snoop(1M) does not know how to interpret it as DSCP, however ethereal/wireshark/tshark can perform such an interpretation properly (in case you'd be looking to verify the DSCP field value).

If you're handling IPv6 network traffic, beware that DSCP appears as a different field name: 'Traffic class' and if you're using wireshark, you should expect to see something like this:

Internet Protocol Version 6, Src: fe80::21b:21ff:fe88:fcd4 (fe80::21b:21ff:fe88:fcd4), Dst: fe80::21b:21ff:fe87:8d78 (fe80::21b:21ff:fe87:8d78)
    0110 .... = Version: 6
        [0110 .... = This field makes the filter "ip.version == 6" possible: 6]
    .... 0111 0000 .... .... .... .... .... = Traffic class: 0x00000070
        .... 0111 00.. .... .... .... .... .... = Differentiated Services Field: Assured Forwarding 32 (0x0000001c)
        .... .... ..0. .... .... .... .... .... = ECN-Capable Transport (ECT): Not set
        .... .... ...0 .... .... .... .... .... = ECN-CE: Not set
    .... .... .... 0000 0000 0000 0000 0000 = Flowlabel: 0x00000000
    Payload length: 33
    Next header: TCP (6)
    Hop limit: 60
    Source: fe80::21b:21ff:fe88:fcd4 (fe80::21b:21ff:fe88:fcd4)
    [Source SA MAC: IntelCor_88:fc:d4 (00:1b:21:88:fc:d4)]
    Destination: fe80::21b:21ff:fe87:8d78 (fe80::21b:21ff:fe87:8d78)
    [Destination SA MAC: IntelCor_87:8d:78 (00:1b:21:87:8d:78)]


For more information, please consult the System Administration Guide for IP Services - for Solaris 10 that book is located here: http://docs.oracle.com/cd/E19253-01/816-4554/ipqostm-1/index.html

For more general Oracle Solaris 11 How-To examples and content, please check this site out:

http://www.oracle.com/technetwork/server-storage/solaris11/documentation/how-to-517481.html

About

Isaac Rozenfeld is a Product Manager for Oracle Solaris; current responsibilities include the portfolio of networking and installation technologies in Solaris, with a focus on easing the overall application deployment experience


You can follow Isaac on Twitter @izfromsun

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News
Blogroll
Tech Reference

No bookmarks in folder