[sip-overload] draft-ietf-soc-overload-control-07 section 6.3 algorithm

Eric McMurry <emcmurry@estacado.net> Wed, 07 March 2012 19:10 UTC

Return-Path: <emcmurry@estacado.net>
X-Original-To: sip-overload@ietfa.amsl.com
Delivered-To: sip-overload@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4207311E8072 for <sip-overload@ietfa.amsl.com>; Wed, 7 Mar 2012 11:10:57 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.157
X-Spam-Level:
X-Spam-Status: No, score=-2.157 tagged_above=-999 required=5 tests=[AWL=-0.443, BAYES_00=-2.599, HTML_FONT_FACE_BAD=0.884, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X3czgyu3hadu for <sip-overload@ietfa.amsl.com>; Wed, 7 Mar 2012 11:10:56 -0800 (PST)
Received: from estacado.net (estacado-pt.tunnel.tserv2.fmt.ipv6.he.net [IPv6:2001:470:1f03:266::2]) by ietfa.amsl.com (Postfix) with ESMTP id 626BF21F85AA for <sip-overload@ietf.org>; Wed, 7 Mar 2012 11:10:56 -0800 (PST)
Received: from dn3-227.estacado.net (dn3-227.estacado.net [172.16.3.227]) (authenticated bits=0) by estacado.net (8.14.3/8.14.3) with ESMTP id q27JAr1p096554 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for <sip-overload@ietf.org>; Wed, 7 Mar 2012 13:10:55 -0600 (CST) (envelope-from emcmurry@estacado.net)
From: Eric McMurry <emcmurry@estacado.net>
Content-Type: multipart/alternative; boundary="Apple-Mail=_654FFEAB-C44A-4038-9F20-48DB3D4E4864"
Date: Wed, 07 Mar 2012 13:10:53 -0600
Message-Id: <D05CF57C-B7B8-4187-BF55-70426DB3762D@estacado.net>
To: sip-overload@ietf.org
Mime-Version: 1.0 (Apple Message framework v1257)
X-Mailer: Apple Mail (2.1257)
Subject: [sip-overload] draft-ietf-soc-overload-control-07 section 6.3 algorithm
X-BeenThere: sip-overload@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIP Overload <sip-overload.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sip-overload>, <mailto:sip-overload-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sip-overload>
List-Post: <mailto:sip-overload@ietf.org>
List-Help: <mailto:sip-overload-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sip-overload>, <mailto:sip-overload-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 07 Mar 2012 19:10:57 -0000

I'm a bit confused on the default loss-based algorithm in section 6.3 of draft-ietf-soc-overload-control-07.  Based on the text, I believe that this algorithm is intended to apply to outbound messages from a client and to use previously stored information about the overload condition of the downstream server the message is targeted to.

When I read through the algorithm part though, I'm not sure of the intent.  I've made some changes in the algorithm to try to communicate what I think it was saying.  Does this match the intent?

    cat1 := 40.0          // Category 1 --- subject to reduction
   cat2 := 100.0 - cat1  // Category 2 --- Not subject to
                         // reduction.  40/60 mix.
   in_oc := false        // Not operating under overload

   while (true)  {
     sip_msg := get_outgoing_sip_msg()
     if (is_response(sip_msg))  {
         process_msg(sip_msg)
     }
     else if (is_request(sip_msg))  {

       // Determine if target server wants to enter overload or is
       // in overload
       target_server := extract_target(sip_msg)
       in_oc := lookup_in_oc(target_server)

       // Get validity value
       oc_validity := lookup_oc_validity(target_server)

       // Get oc parameter value
       oc_value := lookup_oc_value(target_server)

       pct_to_reduce := oc_value / cat1 * 100
       // Example: if oc=10,
       // server uses 10 / 40 * 100 = 25 or 25% of messages in
       // Category 1 can be reduced.

       if (in_oc == false)  {
         process_msg(sip_msg)
       }
       else  {

         // Either Category 1 or Category 2
         assign_msg_to_category(sip_msg)

         if (oc_validity is in effect)  {
           process_msg(get_msg_from_cat2())
           sip_msg := get_msg_from_cat1()

           // Draw a random number between 1 and 100
           r := random()

           if (r <= pct_to_reduce)  {
               // Do not send to server, handle locally by
               // generating a final response
           }
           else  {
             process_msg(sip_msg)
           }
         }
       }
     }
   }