Re: [Idr] BGP Flowspec rules precedence order (RFC 5575)

PVLR Pavana Murthy <pvlrpm@gmail.com> Thu, 15 February 2018 04:08 UTC

Return-Path: <pvlrpm@gmail.com>
X-Original-To: idr@ietfa.amsl.com
Delivered-To: idr@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2A22A1270AE for <idr@ietfa.amsl.com>; Wed, 14 Feb 2018 20:08:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.696
X-Spam-Level:
X-Spam-Status: No, score=-2.696 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HK_RANDOM_ENVFROM=0.001, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EhnL0s3nuQZm for <idr@ietfa.amsl.com>; Wed, 14 Feb 2018 20:08:16 -0800 (PST)
Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1D3641270A3 for <idr@ietf.org>; Wed, 14 Feb 2018 20:08:16 -0800 (PST)
Received: by mail-wm0-x232.google.com with SMTP id t74so26448489wme.3 for <idr@ietf.org>; Wed, 14 Feb 2018 20:08:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pa82j1Fmby7aReaSdIDc5gnozW/bTOC0BwF7eCGUJuE=; b=gZkpFec6VDK0kkTJgCu8Dp47vUlQn22jFMymXSuWNa2HgDXkNVgWi+9r8mYCZtoZX+ 6cKxQ/QgUt00fiHMA5ucoF7uyGdPwSBA6Op6E0IzQEEmsY6xtXHJ9XnvmtFrCmN06HXc 9dmGUdUCyJVx0FbsFZO83WHvULFrkPY6urGWFesW7FZCbQVzV0MxjcCKgBDlfu7Mp+kb QqXVXX1ChJmu8DjfI6QrnJOocJVcw8ykh794rzxzBOJqeaUBRwX3BWc3PsYSg9znP/FW G7QXhU2l+qDGLdRr6UE4rZYHMd9yIur0hkEDnWFkr5hREwfNrD6c540xv+FYttNbImfb E1lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pa82j1Fmby7aReaSdIDc5gnozW/bTOC0BwF7eCGUJuE=; b=a0L6RehCg8mDrKXVAQe4aYku3rfLXSXDUcvhB7mD16cItF1fzLYzAZKrGIrFEgwOKm DquwizY9van74tnQrVgQpk4be01OEaq7loR2/4UU/h5MYmaoaQoc2KIg6pibUqMVzydF ewbyQTXRlBq2tGdwSjIeinK7ecebI94M/ZA2F4iiCzsm/pHncPrInjGicvEBhwElnCWt JXiMC0J00vHassCcIZMG09uxGrT9mUyudZJTPP4J+QbCqk1995lzyXA8s8wPYBEwsrWW jwoBBdktUIz/MYIrG/gkOkCofDrCs7fihYvkAfHXlvLD0DZJnyUKNL1okxz91YzDhgJx fgow==
X-Gm-Message-State: APf1xPAX6lyRf9/JMLzIXDdp/xFBPjL88w81G0Grbcd9ieJjGOgm07Ov a2KXQC3wXYCpH8afH2/LbkPWLbU/xmPaTvyJaIZLyw==
X-Google-Smtp-Source: AH8x227FBksxm9rvQ4G9P7tVmR9iSlRgsrHZ2iclXLsU6ZE5GXzVANqOXyQr0zZOGUinlueX4gXW7p9KUN7CMtgFeMM=
X-Received: by 10.28.181.72 with SMTP id e69mr794734wmf.7.1518667694485; Wed, 14 Feb 2018 20:08:14 -0800 (PST)
MIME-Version: 1.0
Received: by 10.223.195.200 with HTTP; Wed, 14 Feb 2018 20:08:14 -0800 (PST)
In-Reply-To: <372B554B-47F1-49AC-8D66-37A7ED69E57F@tix.at>
References: <CAN-MQG6xnsP28Xn3d7-PECkJrDSk-+QuKZawmAgJs6c-j536=w@mail.gmail.com> <372B554B-47F1-49AC-8D66-37A7ED69E57F@tix.at>
From: PVLR Pavana Murthy <pvlrpm@gmail.com>
Date: Thu, 15 Feb 2018 09:38:14 +0530
Message-ID: <CAN-MQG59aTOKYVULVscfK_Mx3L8xcaXhny=1q4E5yi2+7rc2kQ@mail.gmail.com>
To: Christoph Loibl <c@tix.at>
Cc: idr wg <idr@ietf.org>
Content-Type: multipart/alternative; boundary="001a1148dec07636190565386032"
Archived-At: <https://mailarchive.ietf.org/arch/msg/idr/u3YFGacZjDigBE0Q23sp9tkx9Hk>
Subject: Re: [Idr] BGP Flowspec rules precedence order (RFC 5575)
X-BeenThere: idr@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Inter-Domain Routing <idr.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/idr>, <mailto:idr-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/idr/>
List-Post: <mailto:idr@ietf.org>
List-Help: <mailto:idr-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/idr>, <mailto:idr-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 15 Feb 2018 04:08:19 -0000

Hi Christoph,
  Even in the  RFC5575bis,  the following is given  for comparing
non-prefix type components.

 else:
               # assuming comp_a.value, comp_b.value of type bytearray
               if len(comp_a.value) == len(comp_b.value):
                   if comp_a.value > comp_b.value:
                       return B_HAS_PRECEDENCE
                   if comp_a.value < comp_b.value:
                       return A_HAS_PRECEDENCE
                   # components equal -> continue with next component
               else:
                   common = min(len(comp_a.value), len(comp_b.value))
                   if comp_a.value[:common] > comp_b.value[:common]:
                       return B_HAS_PRECEDENCE
                   elif comp_a.value[:common] < comp_b.value[:common]:
                       return A_HAS_PRECEDENCE
                   # the first common bytes match
                   elif len(comp_a.value) > len(comp_b.value):
                       return A_HAS_PRECEDENCE
                   else:
                       return B_HAS_PRECEDENCE


*What is  comp_a.value here ? Is it the binary sting of [op,
value]/[op,bitmask] or only value/bitmask ?*


Thanks,

Pavana.


On Thu, Feb 15, 2018 at 3:11 AM, Christoph Loibl <c@tix.at> wrote:

> Hi Pavana,
>
> Did you have a look into the actual code (thanks to Job’s comment) that is
> contained in the RFC5575bis draft which should be identical from the
> behaviour:
>
> https://tools.ietf.org/html/draft-ietf-idr-rfc5575bis-06
>
> Christoph
>
> --
> Christoph Loibl
> c@tix.at | CL8-RIPE | PGP-Key-ID: 0x4B2C0055 | http://www.nextlayer.at
>
>
>
> On 12.02.2018, at 12:03, PVLR Pavana Murthy <pvlrpm@gmail.com> wrote:
>
> Hello,
>   In the RFC 5575, the following is given for the comparing the Flowspec
> components of types other then prefix.
>
> } else {
> common =
> MIN(component_length(comp1), component_length(comp2));
> cmp = memcmp(data(comp1), data(comp2), common);
> // not equal, lowest value has precedence
> // equal, longest string has precedence
> }
>
>
> Here, what does *data* refrer to  ?
>
> Is it the binary form of 1) [op, value]> / [op, bitmask]  or 2) Just
> [value] / [bitmask]
>
> eg:
>
>
> 1)  01 *18 58 58 58* 04 *01 46 81 50  ----> Dst.Prefix: 88.88.88.0/24
> <http://88.88.88.0/24>  Port: 70 | 80*
>
> 2)  01* 18 58 58 58 *04* 03 5a c5 6e    ---->   Dst.Prefix: 88.88.88.0/24
> <http://88.88.88.0/24>  Port: >=90 & <= 110*
>
> *In the above FS rules,  Dst. Prefix is same in both, so we need to
> compare the data of next type 4 (Port). *
> *So do we need to do memcmp of  (01 46 81 50) and  (03 5a c5 6e) ?*
>
> Thanks,
> Pavana*.*
>
>
>
> _______________________________________________
> Idr mailing list
> Idr@ietf.org
> https://www.ietf.org/mailman/listinfo/idr
>
>
>