Re: [Spud] SPUD magic number

Tom Herbert <tom@herbertland.com> Fri, 10 April 2015 17:26 UTC

Return-Path: <tom@herbertland.com>
X-Original-To: spud@ietfa.amsl.com
Delivered-To: spud@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0AB3E1A8859 for <spud@ietfa.amsl.com>; Fri, 10 Apr 2015 10:26:37 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.978
X-Spam-Level:
X-Spam-Status: No, score=-1.978 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
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 RNW2LT0VFBjK for <spud@ietfa.amsl.com>; Fri, 10 Apr 2015 10:26:35 -0700 (PDT)
Received: from mail-ig0-f178.google.com (mail-ig0-f178.google.com [209.85.213.178]) (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 9BF831A885E for <spud@ietf.org>; Fri, 10 Apr 2015 10:26:35 -0700 (PDT)
Received: by iget9 with SMTP id t9so18283345ige.1 for <spud@ietf.org>; Fri, 10 Apr 2015 10:26:35 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=WSzOqHSpg9qeyyCvCMK63ItcDP1lzw76JrAKFg534io=; b=TkX79WfL3fk1r1TMVOz2cSqZn6RpAXKe0XK8L+vPUdeHuN/SmAPjE5qnS+exY8ViWW M+SS9KbDAuiyrNU1IqvxPIgVd5uZg3NezNEd59lVg7n2ilDzJYTnFLYGTNbLG9K4lFw9 IyD/eYnqA5n6YvevGz1e8JDQZi1cr/HWlO7BMvwZe8/XWtvViNzd796mXZ7apyVutLPV y4s4xt9cNZIUfQiUf0mDgr3FGN7ir2qG32qpFI/F+nyPixwXmRBUnAjWkMhkqK247COI Hl0pExnSroJ4ChKOMxaeldro36d0kvTe1di5YX2uacFxcT1vVBMfw+TjE7beWIa3QzqQ r5Ag==
X-Gm-Message-State: ALoCoQkd5KtU7xfJNnoivFbsIGUCB1zuMvWzZzUZ7WZ9z4QI5kHF7Ev2n0lpKK7gaLa6QL0ZwGIA
MIME-Version: 1.0
X-Received: by 10.107.130.165 with SMTP id m37mr4259558ioi.62.1428686795068; Fri, 10 Apr 2015 10:26:35 -0700 (PDT)
Received: by 10.107.149.15 with HTTP; Fri, 10 Apr 2015 10:26:34 -0700 (PDT)
In-Reply-To: <430F4C7C-7565-48C1-833B-45F9E0D5F6B2@cisco.com>
References: <CALx6S379MDL+dtnncB7J1Xz9xSbgS3gyEyKuQ7NaRNnHvh7E6w@mail.gmail.com> <430F4C7C-7565-48C1-833B-45F9E0D5F6B2@cisco.com>
Date: Fri, 10 Apr 2015 10:26:34 -0700
Message-ID: <CALx6S362LFQJKEEscWAsaHvWHAT+57+Fsj9VchMDicU6UDzMgg@mail.gmail.com>
From: Tom Herbert <tom@herbertland.com>
To: "Pal Martinsen (palmarti)" <palmarti@cisco.com>
Content-Type: text/plain; charset=UTF-8
Archived-At: <http://mailarchive.ietf.org/arch/msg/spud/OZQk2MnSqyenq6dwIG4CmDNrbEo>
Cc: "spud@ietf.org" <spud@ietf.org>
Subject: Re: [Spud] SPUD magic number
X-BeenThere: spud@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Session Protocol Underneath Datagrams <spud.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spud>, <mailto:spud-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/spud/>
List-Post: <mailto:spud@ietf.org>
List-Help: <mailto:spud-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spud>, <mailto:spud-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Apr 2015 17:26:37 -0000

On Fri, Apr 10, 2015 at 12:12 AM, Pal Martinsen (palmarti)
<palmarti@cisco.com> wrote:
>
>> On 10 Apr 2015, at 04:35, Tom Herbert <tom@herbertland.com> wrote:
>>
>> Hi,
>>
>> The SPUD magic number seems like a good idea and in fact I anticipate
>> that we'll want to adopt this technique in other UDP encapsulation
>> protocols.
>>
> +1
>
> STUN (RFC5389) also uses this trick in section 6 (https://tools.ietf.org/html/rfc5389#section-6)
>
>> I believe the magic number could be applied in two different ways:
>>
>> 1) A middlebox must match both the UDP destination port and the magic
>> number before accepting the packet is SPUD protocol. In this case ,
>> the magic number is used to distinguish SPUD from other arbitrary uses
>> of a SPUD assigned port.
>> 2) A middlebox matches the magic number in any UDP packet regardless
>> of destination port and declares it to be SPUD. This is nice because
>> we would not need to configure SPUD ports on middleboxes, but
>> increases the chances of misinterpreting something which is not SPUD
>> at all (a larger magic number size might be warranted).
>>
>> What is the intended use for this in the SPUD prototype protocol?
>>
> This was actually the first bet we implemented (https://github.com/iptube/SPUDlib). Mostly due to your 2) bullet point.
>
32 bits seems a little light to me for this usage #2, especially if
when some application packet inadvertently matches the magic number
packet is dropped when it would have otherwise been accepted if magic
numbers weren't being checked. 64 bits might be safer.

For UDP encapsulations (GUE, Geneve, VXLAN, etc), we probably would
the magic number to be optional since we'll already have a port number
to identify the protocol (at the client) and might not need middlebox
support within a data center. To make the magic number optional, we
need a way to distinguish the magic number from a valid encapsulation
header. I was thinking to set the first byte of magic number to 0xff
and declaring that indicates an invalid header for the encapsulation
protocol. 0xff works nicely since most of the new UDP encapsulations
have a version number in the first byte and haven't got past version
zero, so this gives forward compatibility.

Tom