[ogpx] State "Partitions" should be Abelian (was: My take on Teleports and protocol resilience)

Carlo Wood <carlo@alinoe.com> Wed, 28 October 2009 12:03 UTC

Return-Path: <carlo@alinoe.com>
X-Original-To: ogpx@core3.amsl.com
Delivered-To: ogpx@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 0CAD228C11B for <ogpx@core3.amsl.com>; Wed, 28 Oct 2009 05:03:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.2
X-Spam-Level:
X-Spam-Status: No, score=-0.2 tagged_above=-999 required=5 tests=[AWL=1.074, BAYES_00=-2.599, HELO_EQ_AT=0.424, HOST_EQ_AT=0.745, SUBJECT_FUZZY_TION=0.156]
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 wE2J01DUmuKz for <ogpx@core3.amsl.com>; Wed, 28 Oct 2009 05:03:32 -0700 (PDT)
Received: from viefep18-int.chello.at (viefep18-int.chello.at [62.179.121.38]) by core3.amsl.com (Postfix) with ESMTP id A61903A67DD for <ogpx@ietf.org>; Wed, 28 Oct 2009 05:03:31 -0700 (PDT)
Received: from edge05.upc.biz ([192.168.13.212]) by viefep18-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20091028120343.XII10721.viefep18-int.chello.at@edge05.upc.biz>; Wed, 28 Oct 2009 13:03:43 +0100
Received: from mail9.alinoe.com ([77.250.43.12]) by edge05.upc.biz with edge id yC3f1c03y0FlQed05C3g2k; Wed, 28 Oct 2009 13:03:43 +0100
X-SourceIP: 77.250.43.12
Received: from carlo by mail9.alinoe.com with local (Exim 4.69) (envelope-from <carlo@alinoe.com>) id 1N37FL-0003Bj-Uh; Wed, 28 Oct 2009 13:03:23 +0100
Date: Wed, 28 Oct 2009 13:03:23 +0100
From: Carlo Wood <carlo@alinoe.com>
To: Vaughn Deluca <vaughn.deluca@gmail.com>
Message-ID: <20091028120323.GA9827@alinoe.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: ogpx@ietf.org
Subject: [ogpx] State "Partitions" should be Abelian (was: My take on Teleports and protocol resilience)
X-BeenThere: ogpx@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Virtual Worlds and the Open Grid Protocol <ogpx.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/ogpx>
List-Post: <mailto:ogpx@ietf.org>
List-Help: <mailto:ogpx-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ogpx>, <mailto:ogpx-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 28 Oct 2009 12:03:33 -0000

On Tue, Oct 27, 2009 at 10:32:39PM +0100, Vaughn Deluca wrote:
> OK, you convinced me regarding the bandwith. We are talking very low frequency
> user generated changes, and a small amount of data is passed by reference.
> Should be no problem.
> 
> I am still worried about the detour, but  i have no argument, just a gut
> feeling  :)
> 
> I do not see the need to send the movement instructions via the AS. It will ony
> generate unneeded delays, and that info is not part of the avatar state anyhow.
> Why "even" movment?

I meant that even movement of the avatar is low bandwidth.
But you're right that for teleportation it is not needed to use
the AS as authority, because movements are location updates
and that state is replaced during change of region.

---

Note that, apart from the authority- and unidirectional- story,
it is in general also important that state changes are ordered.

If we expect messages that update state to be lost, then there
two several ways to recover:

1) ask for a resent and queue "later" messages until the missing
   one is received.
2) send a full resync every time.

1 introduces possible lag, and in the case of extreme packetloss
might even cause memory problems because the later messages have
to be queued. 2 is only possible when the total state data is
very small, but possible for example in the case of attachments.

Abstract example:

Consider a case where a state has three possible values:
    A, B or C; which are internally represented by 1, 2 and 3.

Instead of sending only *changes*: +1, -1, +2, -1, -1, ...
It makes much more sense to send "full updates": B, A, C, B, A, ..

In both cases however it is necessary to include a sequence
number if the messages can be received out of order.

---

Thus, assuming that sending "full states" makes sense in most
cases, we have to try to devide a state into uncorrelated parts.

Example, suppose a state exists of a vector of uncorrelated
data: { d1, d2, d3, d4, ... }, then instead of sending the
whole vector when 'd3' changes, it suffices to only send the
"full update" for 'd3'.

The question is: what means uncorrelated here?

In the light of synchronization (our main concern), I believe
that it means that a commutating operator can be defined. That means,
if two (or more) state-parts correlate but the net result is the same,
independent of the order they are applied in, then we can treat
them as "uncorrelated" in the light of the above, and send separate
"full state changes" for each (or state updates if we wish, of course).

Example: If the sum (f) of states a and b can be considered
as a binary operator f(a, b), and f(a, b) = f(b, a) (commutative)
then a and b can be treated as uncorrelated because their
order (in which they are applied) doesn't matter.

This is the case for animations of different priority (I believe,
but I might be wrong), and for animations that act on a different
part of the avatar. It is also the case for attachments of different
attachment points.

Hence, we can send "full updates" PER attachment point (just send
"attachment point XYZ now contains attachment ABC"), and ignore
all the other attachment points, BECAUSE the net result of such
operations of all attachments points is order-insensitive.


The reason I brought this up is because, in the past, I've been
thinking about the implementation of multiple attachments on a
single attachment point and from a (human) management point of
view came to the conclusion that attach/detach operations for
a single attachment point also have to commute. Meaning, if you
attach X to point P, and then attach Y to point P, then the
result must be the same as first attaching Y to point P and
then X to point P.

Now note that if that is the case, then you can consider the
full set of attachments as a binary vector of zeroes and ones,
one for each attachment (not point), and send "full updates"
per bit. Basically you'd be saying: XYZ is now attached (plus
sequence number) and XYZ is now detached, etc.

So, in that case we have all the benefits :)... these ARE
"full updates", but clearly they are also "state CHANGES"
for the whole-state "attachments".


Conclusion, we have to keep a close eye on the commutativity
of operations and use it to dissect larger states into smaller
parts and use that to our advantange. We have to be aware of
the crucial part that commutativity plays, down to the lowest
level of protocol and synchronization issues.

-- 
Carlo Wood <carlo@alinoe.com>