Re: Pseudorandom Flow Labels

Fernando Gont <> Wed, 06 April 2011 18:32 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 5A0FF3A690A for <>; Wed, 6 Apr 2011 11:32:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -3.599
X-Spam-Status: No, score=-3.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 0M11ZT10tqzS for <>; Wed, 6 Apr 2011 11:32:41 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 8DE733A68B9 for <>; Wed, 6 Apr 2011 11:32:41 -0700 (PDT)
Received: by yxk30 with SMTP id 30so811758yxk.31 for <>; Wed, 06 Apr 2011 11:34:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:sender:message-id:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:openpgp:content-type:content-transfer-encoding; bh=EMIPNH3b7sRoWoA0zen0Zs0MtHXfXgZNMvAVwUIJwv8=; b=XzZGz1lMiXch+jSZ9jYfSXDCKeQ81RbQQdTbjhGskgI3AQ5O4B99xvAP0k6siczPIZ uDtAREQbJhRoHAUkaW/lOIpV6j2qOhE/pOR+0KgcLsLZ46b/wpwJLrP79HotcE3bsfnn nUa7aDQNPTaqIZ2y+4M686jSCDS1CMjrrPsmg=
DomainKey-Signature: a=rsa-sha1; c=nofws;; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:openpgp:content-type :content-transfer-encoding; b=CGKmOG5KkA/M+ih3aQRPvMejHhqpHiE6OyHsE8SmaXUiYXHzojOQffi5FwQp23nGIT RZTJ8tvsfhq8BX5S5d1ZCQ2fbetYaHhgpdCT/mpnbxJuaJZ0ZsROYgUaePurnnv2fzSX W5an62ZstrEElpYuScTnj74f2TgUKDVZPmG5I=
Received: by with SMTP id e48mr839086yhg.458.1302114865387; Wed, 06 Apr 2011 11:34:25 -0700 (PDT)
Received: from [] ([]) by with ESMTPS id h63sm287457yhm.86.2011. (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2011 11:34:24 -0700 (PDT)
Sender: Fernando Gont <>
Message-ID: <>
Date: Wed, 06 Apr 2011 15:34:19 -0300
From: Fernando Gont <>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: Shane Amante <>
Subject: Re: Pseudorandom Flow Labels
References: <> <> <>
In-Reply-To: <>
X-Enigmail-Version: 1.1.1
OpenPGP: id=D076FFF1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: Thomas Narten <>, 6man List <>
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "IPv6 Maintenance Working Group \(6man\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 06 Apr 2011 18:32:42 -0000


On 05/04/2011 06:23 p.m., Shane Amante wrote:
> As I pointed out below, we already have pseudorandom distribution of
> flows today, given that most host implementations use RFC 6056 and
> (IPv4) load-balancing routers/switches use the 5-tuple as input-keys
> ... included in those input-keys is a "pseudorandom ephemeral port".

Note that e.g. Linux implements the hash-based algorithm in RFC 6056,
rather than the random()-based algorithms. -- FWIW, see my response to
Thomas wrt the terminology that we are using.

>> I think we can assume that if we use both the src/dst, we will get
>> a good degree of distribution in the values. Adding the Flow Label
>> gives more. I am just not convinced that to get good distribution
>> we need to *require* (or strongly suggest) psuedo randomness in the
>> Flow Lable. We know that by simply incrementing the Flow Label by 1
>> for each flow, we get sufficient distribution. That is *way* easier
>> to implement than something else.
> Unfortunately, if: a)  All hosts at a site start off selecting "1"
> for their flow-labels; 

We should have already learned the lesson that this is a really bad choice.

> or, b)  Don't cycle through the full-range of
> flow-label values; 

This would be an implementation bug.

> or, c)  a [large] set of hosts experience
> synchronization of flow-label values; 

Given that the FL field is large enough, and that the offset itself is
random, I deem this as *very* unlikely. Also, for synchronization to
occur, all those hosts would need to have the same frequency of
flows/time. -- and since the src IP would be also used for ECMP/LAG,
then I don't think that this would be a big deal, either.

> or, d)  Reset back to
> flow-label "1" after some short time period ... 

This would be a really dumb thing to do, btw.

Note: I'm not arguing that a random()-based algorithm would be a bad
idea. I'm arguing that such an algorithm is not necessarily the only
possible one, and not necessarily the best possible option, either.

Fernando Gont
e-mail: ||
PGP Fingerprint: 7809 84F5 322E 45C7 F1C9 3945 96EE A9EF D076 FFF1