Re: [Dots] Data Channel ACL fragments

<mohamed.boucadair@orange.com> Mon, 16 April 2018 11:11 UTC

Return-Path: <mohamed.boucadair@orange.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 C644712D80F for <dots@ietfa.amsl.com>; Mon, 16 Apr 2018 04:11:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, UNPARSEABLE_RELAY=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 1tNoUMxKoU7F for <dots@ietfa.amsl.com>; Mon, 16 Apr 2018 04:11:15 -0700 (PDT)
Received: from orange.com (mta136.mail.business.static.orange.com [80.12.70.36]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 5054A12D80E for <dots@ietf.org>; Mon, 16 Apr 2018 04:11:15 -0700 (PDT)
Received: from opfednr01.francetelecom.fr (unknown [xx.xx.xx.65]) by opfednr25.francetelecom.fr (ESMTP service) with ESMTP id D45631807DF; Mon, 16 Apr 2018 13:11:13 +0200 (CEST)
Received: from Exchangemail-eme2.itn.ftgroup (unknown [xx.xx.31.27]) by opfednr01.francetelecom.fr (ESMTP service) with ESMTP id 97DBB1A0054; Mon, 16 Apr 2018 13:11:13 +0200 (CEST)
Received: from OPEXCLILMA3.corporate.adroot.infra.ftgroup ([fe80::60a9:abc3:86e6:2541]) by OPEXCLILM7C.corporate.adroot.infra.ftgroup ([fe80::8007:17b:c3b4:d68b%19]) with mapi id 14.03.0389.001; Mon, 16 Apr 2018 13:11:13 +0200
From: mohamed.boucadair@orange.com
To: "Konda, Tirumaleswar Reddy" <TirumaleswarReddy_Konda@McAfee.com>, Jon Shallow <supjps-ietf@jpshallow.com>, "dots@ietf.org" <dots@ietf.org>
Thread-Topic: [Dots] Data Channel ACL fragments
Thread-Index: AdPMHAMfDWFlXvb3TSeAr5MVkYUzIgAA3pEAAAKPJoAAIuTfcAADWaQAAADopUAAyEgtgAACNjegABYTlwAAEYzK0AAHIEOAAAC6rLAAAzlEAAAAT7KgAAMBYAAAjfWr8AADyrCAAAQ1fKAAALVegAAiFUnQAHGmZqA=
Date: Mon, 16 Apr 2018 11:11:12 +0000
Message-ID: <787AE7BB302AE849A7480A190F8B93302DF0B47F@OPEXCLILMA3.corporate.adroot.infra.ftgroup>
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> <BN6PR16MB142519B30BC7F44E332B7077EAB30@BN6P R16MB1425.namprd16.prod.outlook.com> <00e901d3d30f$687eb1a0$397c14e0$@jpshallow.com> <BN6PR16MB1425DFC5475D456042FD6F11EAB30@BN6PR16MB1425.namprd16.prod.outlook.com> <013201d3d323$141409d0$3c3c1d70$@jpshallow.com> <BN6PR16MB1425743EE912AC51BE5C7788EAB20@BN6PR16MB1425.namprd16.prod.outlook.com>
In-Reply-To: <BN6PR16MB1425743EE912AC51BE5C7788EAB20@BN6PR16MB1425.namprd16.prod.outlook.com>
Accept-Language: fr-FR, en-US
Content-Language: fr-FR
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.168.234.2]
Content-Type: multipart/alternative; boundary="_000_787AE7BB302AE849A7480A190F8B93302DF0B47FOPEXCLILMA3corp_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/dots/-8Q3x4lMSfDFQj-bQWHYNEsh_yQ>
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: Mon, 16 Apr 2018 11:11:20 -0000

Hi all,

I do agree with the conclusion of this thread for IPv4 but not for IPv6.

For example, a DOTS client may send this POST request to filter fragmented packets (including atomic ones):

{
  "ietf-dots-data-channel:acls": {
    "acl": [
      {
        "name": "dns-fragments",
        "type": "ipv6-acl-type",
        "aces": {
          "ace": [
            {
              "name": "drop-all-fragments",
              "matches": {
                "ipv6": {
                  "protocol": 44
                }
              },
              "actions": {
                "forwarding": "drop"
              }
            }
          ]
          "ace": [
            {
              "name": "allow-dns-packets",
              "matches": {
                "ipv6": {
                  "destination-ipv6-network": "2001:db8::/32"
                }
                "udp": {
                  "destination-port": {
                    "operator": "eq",
                    "port": 53
                  }
                }
              },
              "actions": {
                "forwarding": "accept"
              }
            }
          ]
        }
      }
    ]
  }
}

But these ACEs are efficient only if the next-header of the IPv6 header points to 44. If the IPv6 packet includes other EHs and the Fragment header is not the one which is immediately preceding the base header, then fragmented packets won't match the "drop-all-fragments" ACE.

Cheers,
Med

De : Konda, Tirumaleswar Reddy [mailto:TirumaleswarReddy_Konda@McAfee.com]
Envoyé : samedi 14 avril 2018 06:48
À : Jon Shallow; BOUCADAIR Mohamed IMT/OLN; dots@ietf.org
Objet : RE: [Dots] Data Channel ACL fragments

Sure, Appendix looks like the right place to add the filtering rule examples for both IPv4 and IPv6.

-Tiru

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

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<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto: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<mailto:TirumaleswarReddy_Konda@McAfee.com>>; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto:dots@ietf.org>
Subject: RE: [Dots] Data Channel ACL fragments

Hi Tiru,

See inline [Jon6]

Regards

Jon

From: Dots [mailto: dots-bounces@ietf.org<mailto:dots-bounces@ietf.org>] On Behalf Of Konda, Tirumaleswar Reddy
Sent: 13 April 2018 10:03
To: Jon Shallow; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto: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<mailto:TirumaleswarReddy_Konda@mcafee.com>]
Sent: 10 April 2018 07:10
To: Jon Shallow; mohamed.boucadair@orange.com<mailto:mohamed.boucadair@orange.com>; dots@ietf.org<mailto: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