In the abstract, Gated models the operation of a human-configurable router as comprising (in the steady state) of the following primitive operations (in some order): receive protocol messages from neighbor routing entities, perform route computations, update one's own forwarding information base (FIB), and send protocol messages to neighbors.
Based on this model, we can factor out the following general mechanisms required, to varying degrees, by all routing protocol implementations:
Some of these mechanisms are provided by classical operating systems (such as UNIX). However, the underlying operating system's mechanisms can be inefficient for routing protocol implementations.
For this reason, Gated implements its own, highly optimized versions of these mechanisms. Gated, in its role as a routing daemon for BSD-based systems, was also built to run more than one protocol instance in a single box; using Gated's common substrate, these protocol instances could be made to share processor and memory resources more effectively.
We now give an overview of each of these mechanisms. Warp to this view to see how the Gated BGP implementation uses these mechanisms.
A task, is the thread of execution of a sequence of related primitive operations (such as reading a message, processing the message). These related operations can be scheduled independently of (i.e. arbitrarily interleaved with) the operation of other protocol instances or other operations within the same protocol instance.
Different protocol implementations use tasks differently. The simplest way to use tasks is to allocate a single task to all computation that happens within a protocol. Some, like BGP which maintains a transport connection to each individual peer, assign a task to protocol activity associated with the peer (see here).
Gated's timer abstraction allows protocol instances to express periodic or time-delayed computations. An example of such a computation is the monitoring of the state of a peer connection, or sending keep-alive messages in BGP.
Gated's job abstraction allows a protocol instance to schedule some computation for some convenient time in the future. The OSPF implementation, for instance, schedules an SPF computation using jobs.
To simplify protocol implementations, Gated provides abstract data types for physical interfaces, and routing neighbor gateways. These data types encapsulate information about these physical entities commonly used by different protocols.