Re: [Dots] Data Channel ACL fragments

"Jon Shallow" <supjps-ietf@jpshallow.com> Fri, 13 April 2018 12:29 UTC

Return-Path: <supjps-ietf@jpshallow.com>
X-Original-To: dots@ietfa.amsl.com
Delivered-To: dots@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1ABE6127078 for <dots@ietfa.amsl.com>; Fri, 13 Apr 2018 05:29:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 DScd53oVHMj1 for <dots@ietfa.amsl.com>; Fri, 13 Apr 2018 05:29:34 -0700 (PDT)
Received: from mail.jpshallow.com (mail.jpshallow.com [217.40.240.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 07E8112420B for <dots@ietf.org>; Fri, 13 Apr 2018 05:29:34 -0700 (PDT)
Received: from [127.0.0.1] (helo=N01332) by mail.jpshallow.com with esmtp (Exim 4.90_1) (envelope-from <jon.shallow@jpshallow.com>) id 1f6xpc-0006w0-8V; Fri, 13 Apr 2018 13:29:32 +0100
From: Jon Shallow <supjps-ietf@jpshallow.com>
To: "'Konda, Tirumaleswar Reddy'" <TirumaleswarReddy_Konda@mcafee.com>, mohamed.boucadair@orange.com, dots@ietf.org
References: <016401d3cc1c$03321200$09963600$@jpshallow.com> <787AE7BB302AE849A7480A190F8B93302DEF7F97@OPEXCLILMA3.corporate.adroot.infra.ftgroup> <01a701d3cc29$ba915b10$2fb41130$@jpshallow.com> <BN6PR16MB14257B016ED90BC00A9BA3E5EABB0@BN6PR16MB1425.namprd16.prod.outlook.com> <007501d3ccc2$b49f0b00$1ddd2100$@jpshallow.com> <BN6PR16MB1425B5115EC9C603E5E7945AEAB90@BN6PR16MB1425.namprd16.prod.outlook.com> <021301d3cfe7$77e5cbe0$67b163a0$@jpshallow.com> <BN6PR16MB142560DE045B75F16CB4E981EABF0@BN6PR16MB1425.namprd16.prod.outlook.com> <02b001d3d048$a2c68be0$e853a3a0$@jpshallow.com> <BN6PR16MB1425D028388461917E44A9F4EABE0@BN6PR16MB1425.namprd16.prod.outlook.com> <000001d3d0ab$547dec40$fd79c4c0$@jpshallow.com> <DM5PR16MB14363A5B24501ED8ABFB0903EABE0@DM5PR16MB1436.namprd16.prod.outlook.com> <007701d3d0bb$2404c330$6c0e4990$@jpshallow.com> <DM5PR16MB143609A08263017E97C71A17EABE0@DM5PR16MB1436.namprd16.prod.outlook.com> <00a801d3d0c8$67315800$35940800$@jpshallow.com> <BN6PR16MB142519B30BC7F44E332B 7077EAB30@BN6P R16MB1425.namprd16.prod.outlook.com> <00e901d3d30f$687eb1a0$397c14e0$@jpshallow.com> <BN6PR16MB1425DFC5475D456042FD6F11EAB30@BN6PR16MB1425.namprd16.prod.outlook.com>
In-Reply-To: <BN6PR16MB1425DFC5475D456042FD6F11EAB30@BN6PR16MB1425.namprd16.prod.outlook.com>
Date: Fri, 13 Apr 2018 13:29:33 +0100
Message-ID: <013201d3d323$141409d0$3c3c1d70$@jpshallow.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0133_01D3D32B.75DEDA70"
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQEYhrWXRSNBek+fWBybzdJS41Z0KAI4GsKdAX18SvQDE9KikwNzyn9FAeCfBHcAmG/gMgGrGCDSAZ2/A+cCF5qWXQGy5AXbAg+JyVkByAAwbQHvg6xBAdFnBMIC/mI4iQC6rlcwA1dFhlmkYaSr0A==
Content-Language: en-gb
Archived-At: <https://mailarchive.ietf.org/arch/msg/dots/9STcvSDB6dXb2IGJeEUNCtnCfFw>
Subject: Re: [Dots] Data Channel ACL fragments
X-BeenThere: dots@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "List for discussion of DDoS Open Threat Signaling \(DOTS\) technology and directions." <dots.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dots>, <mailto:dots-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dots/>
List-Post: <mailto:dots@ietf.org>
List-Help: <mailto:dots-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dots>, <mailto:dots-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Apr 2018 12:29:37 -0000

Hi Tiru,

 

Thanks.

 

I think that we do need an example in the draft of how to do this though..

 

IPv6 will not be using flags, but looking instead for the next header of
protocol 44.

 

Regards

 

Jon

 

From: Dots [mailto:ietf-supjps-dots-bounces@ietf.org] On Behalf Of Konda,
Tirumaleswar Reddy
Sent: 13 April 2018 13:25
To: Jon Shallow; mohamed.boucadair@orange.com; dots@ietf.org
Subject: Re: [Dots] Data Channel ACL fragments

 

[Jon6] - Yes - I stand corrected, your ordering is correct.  A2 no longer
needs destination-port.

 

Yup. The summary of our discussion is to use the flags defined in
netmod-acl-model to drop fragments (both initial and non-initial), and
v4-fragments and v6-fragments and the associated text added to drop
non-initial fragments discussed in Section 4.1 will be removed from the
draft.

 

Cheers

-Tiru

 

From: Jon Shallow [mailto:supjps-ietf@jpshallow.com] 
Sent: Friday, April 13, 2018 3:39 PM
To: Konda, Tirumaleswar Reddy <TirumaleswarReddy_Konda@McAfee.com>;
mohamed.boucadair@orange.com; dots@ietf.org
Subject: RE: [Dots] Data Channel ACL fragments

 

Hi Tiru,

 

See inline [Jon6]

 

Regards

 

Jon

 

From: Dots [mailto: dots-bounces@ietf.org] On Behalf Of Konda, Tirumaleswar
Reddy
Sent: 13 April 2018 10:03
To: Jon Shallow; mohamed.boucadair@orange.com; dots@ietf.org
Subject: Re: [Dots] Data Channel ACL fragments

 

Hi Jon,

 

Please see inline [TR4]

 

 

From: Konda, Tirumaleswar Reddy [mailto: TirumaleswarReddy_Konda@mcafee.com]

Sent: 10 April 2018 07:10
To: Jon Shallow; mohamed.boucadair@orange.com; dots@ietf.org
Subject: RE: [Dots] Data Channel ACL fragments

 

[Jon2] The "flags->fragment" definition is ambiguous for an ACE (but valid
as to whether to allow a packet to get fragmented or not - is that really a
ACE?) which I would like to use.  

 

[TR] I don't get it. What purpose does it serve to create a ACE rule using
"fragment" bit ?

[Jon3] Agreed - This definition has not been thought through for an ACE.  I
think they have just emulated the DF bit in RFC791 as this general flags
definition is the same as for the flags in RFC791.

 

[TR2] You may want to inform the authors of netmod-acl draft, surprisingly
BGP flowspec also uses "fragment" bit.

[Jon4] On my ToDo list for a clean solution.  But we do now have a solution
- see below.

 

 

"Flags->more" definition covers all fragments but the last fragment.
"Offset" is unfortunately not a range, but otherwise would get used for the
final fragment.

~jon2

 

[TR] It looks like two ACE entries are required to drop all the fragments
("flags->more" set to 1 in the first ACE and "flags->more" set to 0 in the
second ACE). How to use the "Offset"  field for the final fragment ?

 

[Jon3] I read "flags-more" to refer to the IP_MF in the IP header (RFC791 MF
or more-fragments flag).  This is set for all fragments apart from the final
(as in last part of packet, not the order in which they are sent -
fortunately that early decision to send them in the wrong order was phased
out, but still there in some legacy systems!)

 

[TR2] Yes, why can't "flags->more" be set to 0 as one ACE entry to drop the
final fragment along with "flags->more" set to 1 to drop the first fragment
as another ACE entry so as to drop all fragments to the target ?

[Jon4] If "flags->more" is configured and it is configured with a value of
0, this will match not only the final fragment, but also a non-fragmented
packet.  If "flags->more" is not configured, then this will match a
non-fragmented packet only.

 

[TR3] net-mod-acl says "Setting the value to 0 indicates this is the last
fragment, and setting the value to 1 indicates more fragments are coming.".
I think it means, if "flags->more" is set to zero and offset is not zero
then it indicates this is the last fragments; the flags can be used in
isolation without comparing if offset value is zero or non-zero. We should
check with netmod-acl authors for confirmation. 

 

[Jon5].  The netmod-acl text for flags and offset is effectively a word for
word copy out of RFC791 3.1 Internet Header Format.  So I think it is meant
to be interpreted as being an exact match for the same - including the
offset specific value.

 

  Flags:  3 bits

 

    Various Control Flags.

 

      Bit 0: reserved, must be zero

      Bit 1: (DF) 0 = May Fragment,  1 = Don't Fragment.

      Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.

 

          0   1   2

        +---+---+---+

        |   | D | M |

        | 0 | F | F |

        +---+---+---+

 

  Fragment Offset:  13 bits

 

    This field indicates where in the datagram this fragment belongs.

 

    The fragment offset is measured in units of 8 octets (64 bits).  The

    first fragment has offset zero.

 

 

----

 

Versus

 

----

    leaf flags {

      type bits {

        bit reserved {

          position 0;

          description

            "Reserved. Must be zero.";

        }

        bit fragment {

          position 1;

          description

            "Setting value to 0 indicates may fragment, while setting

             the value to 1 indicates do not fragment.";

        }

        bit more {

          position 2;

          description

            "Setting the value to 0 indicates this is the last fragment,

             and setting the value to 1 indicates more fragments are

             coming.";

        }

      }

      description

        "Bit definitions for the flags field in IPv4 header.";

    }

 

    leaf offset {

      type uint16 {

        range "20..65535";

      }

 

      description

        "The fragment offset is measured in units of 8 octets (64 bits).

         The first fragment has offset zero. The length is 13 bits";

    }

 

[Jon4] So, a L4 ACE without "flags->more" defined and "allow", followed by
an ACE with "flags->more" = 1 and "drop", followed by an ACE with
"flags->more" = 0 and "drop" will cause all fragmented packets to get
dropped, but still allow through the non-fragmented packet.  So, we have a
solution for

"allow all traffic to port 53, but drop all fragmented packets".

 

[TR3] I don't think the above solution will work. In the above line, I think
you  meant L3 ACE, and the first fragment will match the first entry and is
allowed. 

 

[Jon5]No, the first ACE is a L3/L4 match.  If you have (a1 allows through
all non-fragmented packets, a2 & a3 drops all fragmented packets) the
following 

 

[TR4] The first fragment will have both L3 and L4 information, and matches
a1 and is allowed, but if the order is changed to a3, a1 and a2 (a3 will
drop all fragments except last-fragment, the last fragment will not have L4
info, so will not match a1 but will match a2 and get dropped).

 

[Jon6] - Yes - I stand corrected, your ordering is correct.  A2 no longer
needs destination-port.

~jon6

 

-Tiru

 

.

{

       "aces": [{

                                     "ace": {

                                                    "name": "a1",

                                                    "matches": [{

                                                                   "ipv4": {

 
"destination-network": "1.2.3.0/24"

                                                                   },

                                                                   "udp": {

 
"destination-port": 53

                                                                   }

                                                    }],

                                                    "actions": {

 
"forwarding": "accept"

                                                    }

                                     }

                      },

                      {

                                     "ace": {

                                                    "name": "a2",

                                                    "matches": [{

                                                                   "ipv4": {

 
"flags": {

 
"destination-network": "1.2.3.0/24",

 
"more": 0

 
},

 
"udp": {

 
"destination-port": 53

 
}

                                                                   }

                                                    }],

                                                    "actions": {

 
"forwarding": "drop"

                                                    }

 

                                     }

                      },

                      {

                                     "ace": {

                                                    "name": "a3",

                                                    "matches": [{

                                                                   "ipv4": {

 
"flags": {

 
"more": 1

 
}

                                                                   }

                                                    }],

                                                    "actions": {

 
"forwarding": "drop"

                                                    }

                                     }

                      }

       ]

}

.

[Jon5] It will work

 

-Tiru

 

~jon4

 

-Tiru

 

[Jon3] But as the final fragment of the sequence could have any offset, the
use of the offset field is not that helpful here.  Even if we do go with our
DOTS fragments definition (but widened to cover all fragments), we still
cannot generate a netmod-acl entry for onward processing by an upstream
mitigator.

 

[Jon3] FYI, for Juniper, you just need to set 'first-fragment' and
'is-fragment' in their ACL.  BGP FlowSpec does support fragmentation
detection properly (RFC5575 Type 12 Fragment).

 

 

-Tiru