The Entity Identifier

--MUTS provides a single uniform object for addressing machines, endpoints and groups. We call machines, endpoint and groups entities, and the --MUTS address for this the entity identifier, or EID in short. EIDs supports multiple transport protocols and priorities, and are able to distinguish between incarnations (i.e., each reboot of a machine forms a new incarnation).

For most use, an EID should be considered an opaque. It is 16 bytes, and it is structured as follows:

#BITS:	'    8     '  3   '    5     '   48    '     32      '  32   '
The priority of each entity is built into its EID for convenience. 0 is lowest, and 255 is highest. The type of an entity can be currently one of three: A site may have multiple endpoints. A group may span multiple endpoints, usually, but not necessarily, on multiple sites.

The protocol field identifies which network protocol is used. Currently Horus defines the following protocols:

The address part has 6 bytes worth of space for some representation of the address for this particular protocol type.

The incarnation is usually the time at which the machine was booted, or the Horus process started. However, anything unique to the incarnation of the entity may be used here.

The demux field is necessary when the address is shared by multiple entities.




#include "muts.h"


struct mt_eid {
	uint8_t priority;		/* priority */
	uint8_t type_mode_and_protocol;	/* see above */
	uint8_t tpaddr[6];		/* transport address */
	int32_t incarnation;		/* incarnation number of host */
	int32_t demux;			/* port in incarnation */
typedef struct mt_eid eid_t;
This is the C representation of an entity identifier. The type_mode_and_protocol field consists of two bit fields. In the lower 3 bits, the eid type is defined. In the upper 5 bits, the protocol type is defined. For convenience, the macro MT_PROT_SHIFT has been defined to be 3, and the macro MT_PROTOCOL is a bit mask for the protocol.


6 bytes is not enough for all protocol's addresses. Therefore we're considering sacrificing the incarnation number.