MXP over UDP Specification Draft 0.3

One of the MXP over UDP key concepts is to have a small set of UDP messages concentrated on connectivity, transport and distributed virtual environment scene graph synchronization which form the core of the protocol. All application specific information is transmitted as payload over the core UDP messages encoded in MXMP format. MXMP is designed to be XML but defined only to skeletal level as it is application specific in nature. Another key concept is to multiplex all the data (except binary assets) through one UDP port to simplify the session handling and networking like firewall and nat penetration.

Each UDP packet may contain one or more frames. Most messages will have length of just one frame.

All coordinates are always given in the coordinate system of the sending party.

Bubbles can be referenced with the following URI type:

mxp://<address>:<port>/<bubble-uuid>/<location>

Byte ordering

http://en.wikipedia.org/wiki/Endianness

Little-endian byte ordering is used.

Floating Point Encoding

The IEEE Standard for Binary Floating-Point Arithmetic (IEEE 754) is used for floating point encoding.

http://en.wikipedia.org/wiki/IEEE_754-1985

Universally Unique Identifier Encoding

http://www.ietf.org/rfc/rfc4122.txt

Types

double: signed 64 bit float

udouble: unsigned 64 bit float

float: signed 32 bit float

ufloat: unsigned 32 bit float

long: signed 64 bit integer

ulong: unsigned 64 bit integer

int: signed 32 bit integer

uint: unsigned 32 bit integer

short: signed 16 bit integer

ushort: unsigned 16 bit integer

string: UTF8 encoded string

byte: unsigned 8 bit integer

uuid: 16 byte Universally Unique Identifier

time: 64 bit timestamp. How to encode?

  • Proposal: microseconds since 1.1.2000 00:00

data: Binary data. If data consists of binary encoded primitive values then they should be encoded as defined here. Data may also contain for example XML-fragment.

UDP Packet Data

UDP packet data length is maximum of (1500-48(IPv6))=1452 bytes which consists of header bytes and as many frames as fit in the remaining bytes.

PACKET

packet header (14 bytes) - message frames (mxa 1438 bytes)

PACKET HEADER

4  : uint    : session_id /* Session id assigned by answering party. */
4  : uint    : packet id /* Id of the packet. */
4  : time    : first send time /* Time the packet was sent for the first time. */
1  : byte    : quaranteed /* Whether this is guaranteed and ACK is expected. */
1  : byte    : resend count /* Count of resends. */

Message Frame (maximum 256 bytes)

Largest message data sizes are limited to by maximum frame count and frame data size to ~15Mbytes. Could this protocol be used for transmitting larger amounts of data on background? If so another message type can be specified for large file transfers where each message transmit part of the file.

MESSAGE FRAME

frame header (10 bytes) - frame data (maximum 246 bytes)

FRAME HEADER

1  : byte    : type /* Type index from message type table. */
4  : uint    : message_id /* Message id assigned by the sender. */
2  : short   : frame_count /* Number of frames in this message. */
2  : short   : frame_index /* Index of the message part for long messages spanning over multiple packets. */
1  : byte    : frame_data_size (0-245)

Connection Control Messages

ACKNOWLEDGE 1 (not quaranteed)

1-64 X 4  : uint    : acknowledged_packet_id /* Repeated 1-64 times */

KEEPALIVE 2


THROTTLE 3

4  : uint    : transfer_rate /* Bytes per second sender is ready to receive */

Implementation Validation Messages

CHALLENGE REQUEST 4

64 : data     : challenge_request_data

CHALLENGE RESPONSE 5

64 : data     : challenge_response_data

Reusable Fragments

RESPONSE FRAGMENT

4  : uint    : request_message_id
1  : byte    : failure_code // 0 == success

PROGRAM FRAGMENT

40 : string  : program_name
1  : byte    : program_major_version
1  : byte    : program_minor_version
1  : byte    : protocol_major_version
1  : byte    : protocol_minor_version

OBJECT FRAGMENT

16 : uuid     : object_id /* Universally unique identifier of the object. */
4  : uint     : object_index /* One based index to table of objects known to bubble. */
16 : uuid     : type_id /* Type id of the object. */
16 : uuid     : parent_object_id /* Universally unique identifier of the parent object or empty uuid. */
20 : string   : object_name
20 : string   : type_name
16 : uuid     : owner_id /* Owner participant id. */ 
12 : vector3f : location
12 : vector3f : velocity
12 : vector3f : acceleration
16 : vector4f : orientation
16 : vector4f : angular_velocity
16 : vector4f : angular_acceleration
4  : float    : bounding_sphere_radius
4  : float    : mass
4  : string   : state_payload_dialect
4  : uint     : state_payload_length
X  : data     : state_payload

INTERACTION FRAGMENT

20 : string   : interaction_name
16 : uuid     : source_participant_id
16 : uuid     : source_object_id
16 : uuid     : target_participant_id
16 : uuid     : target_object_id
4  : string   : interaction_payload_dialect
4  : uint     : interaction_payload_length
X  : data     : interaction_payload_data

BUBBLE FRAGMENT

16 : uuid     : bubble_id
40 : string   : bubble_name
55 : string   : cloud_url /* Cloud web site url identifying the cloud in question. */
16 : uuid     : owner_id /* Participant who owns the bubble. */
40 : string   : bubble_server_address
4  : uint     : bubble_server_port
12 : vector3f : bubble_center /* This is expecetionally given in receiver coordinate space. */
4  : float    : bubble_range
4  : float    : bubble_perception_range
4  : time     : bubble_realtime

Frame data length == 195

Commands

Participant to Bubble Commands

JOIN REQUEST 10

16 : uuid     : bubble_id
32 : string   : location /* this could be parsed by human interface from uri */
95 : string   : identity_provider_url /* for example OpenId provider url */
32 : string   : participant_name
32 : string   : participant_passphrase
4  : time     : participant_realtime
PROGRAM FRAGMENT : client_program

JOIN RESPONSE 11

RESPONSE FRAGMENT
40 : string   : bubble_name
55 : string   : cloud_url /* Cloud web site url identifying the cloud in question. */
16 : uuid     : participant_id /* id of the participant if join was succesful or empty id. */
4  : time     : bubble_realtime
PROGRAM FRAGMENT : server_program

LEAVE REQUEST 12


LEAVE RESPONSE 13

RESPONSE FRAGMENT

INJECT REQUEST 14

OBJECT FRAGMENT

INJECT RESPONSE 15

RESPONSE FRAGMENT

MODIFY REQUEST 16

OBJECT FRAGMENT

MODIFY RESPONSE 17

RESPONSE FRAGMENT

EJECT REQUEST 18

16 : uuid     : object_id

EJECT RESPONSE 19

RESPONSE FRAGMENT

INTERACT REQUEST 20

INTERACTION FRAGMENT: request

INTERACT RESPONSE 21

RESPONSE FRAGMENT
INTERACTION FRAGMENT: response

EXAMINE REQUEST 22

16 : uuid     : object_id
4  : uint     : object_index

Either object_id or object_index will be set to default value. (uuid default==empty uuid=="0000-000....")

EXAMINE RESPONSE 23

RESPONSE FRAGMENT
OBJECT FRAGMENT

Participant to Bubble and Bubble to Bubble and Commands

LIST BUBBLES REQUEST 25

1  : byte    : list_type /* [0=attached,1=hosted] */

LIST BUBBLES RESPONSE 26

N X BUBBLE FRAGMENT

Each fragment is in separate frame.

Bubble to Bubble Commands

ATTACH REQUEST 30

16 : uuid     : target_bubble_id
BUBBLE FRAGMENT (source bubble) 
PROGRAM FRAGMENT (source bubble server) 

ATTACH RESPONSE 31

RESPONSE FRAGMENT 
BUBBLE FRAGMENT (target bubble) 
PROGRAM FRAGMENT (target bubble) 

DETACH REQUEST 32


DETACH RESPONSE 33

RESPONSE FRAGMENT 

HANDOVER REQUEST 34

16 : uuid     : source_bubble_id
16 : uuid     : target_bubble_id
OBJECT FRAGMENT

HANDOVER RESPONSE 35

RESPONSE FRAGMENT 

Events

PERCEPTION EVENT 40: an object has been observed for the first time or modified

OBJECT FRAGMENT

DISAPPEARANCE EVENT 45: Object disappears for another reason than ejection.

4  : uint     : object_index

MOVEMENT EVENT 41 (not quaranteed)

4  : uint     : object_index
12 : vector3f : location
16 : vector4f : orientation

ACTION EVENT 60: Object acts in a way which does not affect other objects.

20 : string   : action_name
16 : uuid     : source_object_id
4  : float    : observation_radius
4  : string   : action_request_payload_dialect
4  : uint     : action_request_payload_length
X  : data     : action_request_payload_data

HANDOVER EVENT 53: Object was handed over from one bubble to another

HANDOVER REQUEST

Event Candidates

COMPRESSED MOVEMENT EVENT 42 (not quaranteed)

N X {
4  : uint     : object_index
6  : vector3f : location
4  : vector3b : orientation
} /* N=1-12 (One message can contain 1-17 movement perceptions) 

This event is optimized for social 3d environments with size of ~1000 meters and accuracy of 6 centimeters. Environments with similar accuracy requirements can use this message as well. This message is one third of the size of MOVEMENT EVENT.

compressed location = range * location / (bubble observation radius)

compressed velocity = range * velocity / (bubble observation radius)

compressed orientation = axis angle with unit vector with components scaled to +-max value. Angle is presented in +-180 degress scaled to +-max value.

Total size 14 bytes + ~1 byte from all headers per message => total of ~15 bytes per compressed movement message.

Obsolete Events

INJECTION 50: An object has been injected.

OBJECT FRAGMENT

EJECTION 51: An object has been ejected. Contains the same eject.

EJECT REQUEST

INTERACTION 52: Participant and object or two objects have interacted. Sent only if interaction is public.

INTERACTION REQUEST AND INTERACTION RESPONSE
0 Attachments 0 Attachments
1526 Views

CloudDeck Splash

bubble_cloud_demo_4_small.png

Bubble Bouncher Demo 1

Idealist Viewer 1

Bubble Bouncher Demo 2