GIMI

GIMI, or GIM Interface, is the application-layer communication API for GIMnet. It provides a simple C++ interface for basic operations like joining the network, sending and receiving data to and from other clients, as well as for advanced operations like subscribing data from other clients and searching for clients that provide data. GIMI encapsulates the low-level functionality of GIMnet into a simple function interface. As the users of GIMI have various programming abilities, it is also designed as user tolerant. For example, GIMI is fully thread safe. Another important aspect is that GIMI is not platform dependent.

GIMI features synchronized and unsynchronized data sending. Synchronized sending is used when the data must be delivered in real-time. The synchronization causes some loss in maximum throughput, but it prevents the data from being buffered in various TCP stacks. The sent data is limited to a given number of unreplied data packets, which enables the server to automatically send data at different rates to clients with different bandwidth capabilities.

GIMI has a service-based messaging system. A GIMnet application specifies its public interface as one or several services. A service may provide a specific data type, or accept a certain data type as input (e.g. control commands). Data types are mostly application specific and are created to suit the application's needs. In the INTEGRATOR project the services are related to mobile machines and teleoperation, including position, tele-control, image streams, etc.

GIMI implements an automatic service discovery that allows global querying of available services. The service discovery reveals all the registered services in the GIMnet and the name and location of the module that provides the services. Any client in the GIMnet can subscribe to any provided data service. The data is then sent as a multicast packet in the network. The service system removes the need for polling, as the newest data is automatically sent to all subscribers.

The handling of incoming messages is based on the service id's as well. Each received message is stored in a queue according to its type id and instance id until the application fetches it from the queue. The size of the queues can be freely set by the user. In case the queue is full it functions as a ring buffer. The queue system provides efficient fetching of specified types of messages. Moreover, for real-time purposes a ring buffer of size one always makes sure that the user has the most recent data available when requested.

GIMI uses the Bitestream library (Binary Transport Encoding) for encapsulating the data. Bitestream is a small C library that is used to collect labeled pieces of binary data into a single binary data packet that can be easily transmitted over a network. It is used to construct a FIFO stream of key-value pairs in memory prior to transmission. The keys, or labels, can be 24-bit integers, or text up to 255 bytes long, and associated with each label is binary data from 1 byte up to 1 gigabyte in length. Bitestream is designed to operate efficiently and to add very little overhead to the actual data.

GIMI API-documentation