Re: [OSPF] [karp] Security Extension for OSPFv2 when using Manual Key Management

Michael Barnes <mjbarnes@cisco.com> Tue, 01 March 2011 02:13 UTC

Return-Path: <mjbarnes@cisco.com>
X-Original-To: ospf@core3.amsl.com
Delivered-To: ospf@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id A987B3A6C6F; Mon, 28 Feb 2011 18:13:21 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.599
X-Spam-Level:
X-Spam-Status: No, score=-10.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id v06krYYgAR0x; Mon, 28 Feb 2011 18:13:20 -0800 (PST)
Received: from sj-iport-4.cisco.com (sj-iport-4.cisco.com [171.68.10.86]) by core3.amsl.com (Postfix) with ESMTP id 75D623A6C4C; Mon, 28 Feb 2011 18:13:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=mjbarnes@cisco.com; l=5754; q=dns/txt; s=iport; t=1298945662; x=1300155262; h=message-id:date:from:mime-version:to:cc:subject: references:in-reply-to:content-transfer-encoding; bh=YJU1oGSgaMncxAWN6sKjXO9kL6otgN5maqEBbafATlo=; b=Cydz4ahG3KJuqtkcwENzZm/WqG/q3Pqzely+i7QaN3lrf7adU6MAflfz jnO+OyrTItJYlLJI8qJrqV8NFO1XBKeA+V7sXMFxqbktk8YGu5vg9JgE4 MWudt+C1undAujUqc2hYOgv9iH1FeD3R3JpjkEUFUKLzBa05QDBbNUnq8 s=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvsEADfla02rR7Ht/2dsb2JhbACmSXSfSptrhWEEhRKHDYM+iFM
X-IronPort-AV: E=Sophos;i="4.62,245,1297036800"; d="scan'208";a="266842501"
Received: from sj-core-1.cisco.com ([171.71.177.237]) by sj-iport-4.cisco.com with ESMTP; 01 Mar 2011 02:14:22 +0000
Received: from [10.21.150.85] (sjc-vpn7-1621.cisco.com [10.21.150.85]) by sj-core-1.cisco.com (8.13.8/8.14.3) with ESMTP id p212EL9s004094; Tue, 1 Mar 2011 02:14:21 GMT
Message-ID: <4D6C567D.5030501@cisco.com>
Date: Mon, 28 Feb 2011 18:14:21 -0800
From: Michael Barnes <mjbarnes@cisco.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Thunderbird/3.0.10
MIME-Version: 1.0
To: Sam Hartman <hartmans-ietf@mit.edu>
References: <7C362EEF9C7896468B36C9B79200D8350CFB03C880@INBANSXCHMBSA1.in.alcatel-lucent.com> <4D2FD840.3040908@cisco.com> <7C362EEF9C7896468B36C9B79200D8350CFB0DF0F7@INBANSXCHMBSA1.in.alcatel-lucent.com> <4D3029F7.6040107@cisco.com> <tsl39ovbr54.fsf@mit.edu> <4D3720F2.70301@cisco.com> <tsloc7chid7.fsf@mit.edu> <4D372F7B.9030507@cisco.com> <tslhbd2cpke.fsf@mit.edu>
In-Reply-To: <tslhbd2cpke.fsf@mit.edu>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Cc: "ospf@ietf.org" <ospf@ietf.org>, "karp@ietf.org" <karp@ietf.org>
Subject: Re: [OSPF] [karp] Security Extension for OSPFv2 when using Manual Key Management
X-BeenThere: ospf@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: The Official IETF OSPG WG Mailing List <ospf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ospf>, <mailto:ospf-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ospf>
List-Post: <mailto:ospf@ietf.org>
List-Help: <mailto:ospf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ospf>, <mailto:ospf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Mar 2011 02:13:21 -0000

Hi Sam,

On 01/21/2011 06:13 AM, Sam Hartman wrote:
>>>>>> "Michael" == Michael Barnes<mjbarnes@cisco.com>  writes:
>
>      Michael>  I don't think the bandwidth is really an issue, but CPU
>      Michael>  is. It is important that processing of these packets can be
>      Michael>  completed as quickly as possible. We are constantly being
>      Michael>  asked to scale to ever larger number of neighbors and
>      Michael>  adding overhead to Hello packets could make this security
>      Michael>  mechanism undesirable in those settings.
>
> So, I don't think we can avoid a bit of overhead when we are bringing up
> a new neighbor association: we're trying to do new things in that
> situation.  I've thought about it and the overhead in that situation of
> having the exchange in the hello is less than with extra challenge
> response packets.
>
> So, we're left with the question of what's the overhead when we already
> have a neighbor relationship That's the common path and so it is our
> primary goal for optimization.
>
> I went to read the description of receiver behavior in the draft to
> confirm my understanding of what the overhead is.  I found a bug: it
> turns out that the behavior of hello packets for neighbors in two-way or
> greater is unspecified.  It's intended to be the same as the behavior
> for non-hello packets.
> So, let's look at what that behavior is:
>
>          <t>If a packet other than a hello is received with the new
>          cryptographic authentication option, it must correspond to an existing
>          neighbor relationship in at least the 2-way state. If the neighbor is
>          not in 2-way state or greater, the packet is discarded. If the session
>          ID does not match the session ID recorded with the neighbor, the
>          packet is discarded. If the sequence number in the cryptographic
>          authentication option is not strictly greater than the sequence number
>          associated with the neighbor, then the packet is discarded. If the
>          cryptographic verification of the checksum fails, the packet is
>          discarded. Otherwise, the packet is accepted by the cryptographic
>          authentication and the sequence number associated with the neighbor is
>          updated to be the sequence number in the packet.</t>
>
> So, if we update that first sentence to say that section applies to all
> packets where the neighbor is in 2-way state or greater, we get correct
> behavior.  So, what new overhead do we need?  First, we need a compare
> against the neighbor state; if it is not 2-way or greater, we need to go
> to a less optimal path.  Then we need to compare the session ID.
>
> That's the only new behavior.  We change the sequence number check from
> greater than or equal to to strictly greater than, but on all hardware
> I'm aware of, that's the same performance.  So, we've added two
> operations to the reception of packets for existing neighbors. The
> operations can be executed in parallel. On a general purpose CPU, both
> operations would be single instructions.
>
> My opinion is that is likely to be acceptable to any environment where
> cryptographic authentication is acceptable.
>
> Note that while we send additional information in a hello packet, we
> only need to look at that information when setting up a new neighbor.
>
> So, let's take a look at what we've done to sending a hello packet
> because that's also a common operation.
>
> We've added two items of state for each neighbor: the session ID and
> nonce. I guess copying these values into a constructed outgoing packet
> could be considered per-neighbor overhead. However, an implementation
> could choose to construct the neighbor list of the outgoing hello packet
> and store it in a buffer, updating only when the neighbor list
> changes. So, there is an implementation strategy that does not change
> the cost of sending a hello in the steady state.
>
> I'll also note that the effort required for the "slow" path (updating
> set of neighbors) is modest: we're talking about a couple of compares
> and neighbor structure updates.
>
> This conversation has been fairly useful.  I've noticed a couple of
> places where we can optimize receiver behavior to reduce number of
> packets and to improve convirgence in case of reboot.  We might even be
> able to optimize what locks you're likely to hold when a bit. (I realize
> that where locks are in a data structure is very implementation
> dependent, but there are things we can do like minimizing the cases
> where fields need to be updated that are valuable here.)
>
> So, I'll work with the other authors to fix the bug I pointed out above
> and to improve the receiver behavior.
>
> Now that I've thought about the tradeoffs between challenge packets and
> using the hello, I think that the CPU impact of hello packets will be
> lower than that of challenge packets. So, my preference is to stick with
> our original design.

I do have a concern which I don't think you addressed. The size of the 
packet may have increased significantly (for some link types we may have 
more than a handful of neighbors). So when considering a stable link it 
may be hundreds of thousands of Hello packets exchanged for a given 
interface where that extra data is not needed yet the hash algorithm 
must be run, on both sender and receiver, for all of that unused data. 
Multiply by dozens or perhaps even hundreds of interfaces. I disagree 
that over the long term the CPU impact will be lower than if challenge 
response packets were used. I'm not really happy about wasting CPU 
cycles that way.

Regards,
Michael