From: Jeffrey Altman <jaltman@auristor.com>
To: David Howells <dhowells@redhat.com>,
David Laight <David.Laight@ACULAB.COM>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-afs@lists.infradead.org" <linux-afs@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 4/9] rxrpc: Randomise epoch and starting client conn ID values
Date: Mon, 5 Sep 2016 22:12:49 -0400 [thread overview]
Message-ID: <1f4c3840-d8a7-7d36-542f-7a24b840371e@auristor.com> (raw)
In-Reply-To: <3378.1473092663@warthog.procyon.org.uk>
[-- Attachment #1.1: Type: text/plain, Size: 2504 bytes --]
Reply inline ....
On 9/5/2016 12:24 PM, David Howells wrote:
> [cc'ing Jeff Altman for comment]
>
> David Laight <David.Laight@ACULAB.COM> wrote:
>
>>> Create a random epoch value rather than a time-based one on startup and set
>>> the top bit to indicate that this is the case.
>>
>> Why set the top bit?
>> There is nothing to stop the time (in seconds) from having the top bit set.
>> Nothing else can care - otherwise this wouldn't work.
>
> This is what I'm told I should do by purveyors of other RxRPC solutions.
The protocol specification requires that the top bit be 1 for a random
epoch and 0 for a time derived epoch.
>
>>> Also create a random starting client connection ID value. This will be
>>> incremented from here as new client connections are created.
>>
>> I'm guessing this is to make duplicates less likely after a restart?
Its to reduce the possibility of duplicates on multiple machines that
might at some point exchange an endpoint address either due to mobility
or NAT/PAT.
>
> Again, it's been suggested that I do this, but I would guess so.
>
>> You may want to worry about duplicate allocations (after 2^32 connects).
>
> It's actually a quarter of that, but connection != call, so a connection may
> be used for up to ~16 billion RPC operations before it *has* to be flushed.
>
>> There are id allocation algorithms that guarantee not to generate duplicates
>> and not to reuse values quickly while still being fixed cost.
>> Look at the code NetBSD uses to allocate process ids for an example.
>
> I'm using idr_alloc_cyclic()[*] with a fixed size "window" on the active conn
> ID values. Client connections with IDs outside of that window are discarded
> as soon as possible to keep the memory consumption of the tree down (and to
> force security renegotiation occasionally). However, given that there are a
> billion IDs to cycle through, it will take quite a while for reuse to become
> an issue.
>
> I like the idea of incrementing the epoch every time we cycle through the ID
> space, but I'm told that a change in the epoch value is an indication that the
> client rebooted - with what consequences I cannot say.
State information might be recorded about an rx peer with the assumption
that state will be reset when the epoch changes. The most frequent use
of this technique is for rx rpc statistics monitoring.
>
> [*] which is what Linux uses to allocate process IDs.
>
> David
>
[-- Attachment #1.2: jaltman.vcf --]
[-- Type: text/x-vcard, Size: 410 bytes --]
begin:vcard
fn:Jeffrey Altman
n:Altman;Jeffrey
org:AuriStor, Inc.
adr:Suite 6B;;255 West 94Th Street;New York;New York;10025-6985;United States
email;internet:jaltman@auristor.com
title:Founder and CEO
tel;work:+1-212-769-9018
note;quoted-printable:LinkedIn: https://www.linkedin.com/in/jeffreyaltman=0D=0A=
Skype: jeffrey.e.altman=0D=0A=
url:https://www.auristor.com/
version:2.1
end:vcard
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4333 bytes --]
next prev parent reply other threads:[~2016-09-06 2:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-04 21:02 [PATCH net-next 0/9] rxrpc: Small fixes David Howells
2016-09-04 21:02 ` [PATCH net-next 1/9] rxrpc: fix undefined behavior in rxrpc_mark_call_released David Howells
2016-09-04 21:02 ` [PATCH net-next 2/9] rxrpc: Fix uninitialised variable warning David Howells
2016-09-04 21:02 ` [PATCH net-next 3/9] rxrpc: The client call state must be changed before attachment to conn David Howells
2016-09-04 21:02 ` [PATCH net-next 4/9] rxrpc: Randomise epoch and starting client conn ID values David Howells
2016-09-05 15:01 ` David Laight
2016-09-05 16:24 ` David Howells
2016-09-06 2:12 ` Jeffrey Altman [this message]
2016-09-04 21:02 ` [PATCH net-next 5/9] rxrpc: Don't change the epoch David Howells
2016-09-04 21:03 ` [PATCH net-next 6/9] fs/afs/vlocation: Remove deprecated create_singlethread_workqueue David Howells
2016-09-04 21:03 ` [PATCH net-next 7/9] fs/afs/rxrpc: " David Howells
2016-09-04 21:03 ` [PATCH net-next 8/9] fs/afs/callback: " David Howells
2016-09-04 21:03 ` [PATCH net-next 9/9] fs/afs/flock: " David Howells
2016-09-06 20:53 ` [PATCH net-next 0/9] rxrpc: Small fixes David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1f4c3840-d8a7-7d36-542f-7a24b840371e@auristor.com \
--to=jaltman@auristor.com \
--cc=David.Laight@ACULAB.COM \
--cc=dhowells@redhat.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®