Create the Interest Operation
The interest operation allows a requestor to discover possible providers. The requestor will create and broadcast (or flood) an interest operation and any compatible provider will respond with its provide operation.
In this example, we will create two providers for the requestor to discover. We'll do this by sending interest for a specific object id and interface id as well as any provider that is already providing (using DOFInterestLevel.WATCH). This action will establish routes to providers of the Time-based Alarm.
Interest Operations
Requestors can perform interest operations for a variety of reasons, such as the following:
- To discover whether a specific provider is currently running and connected to the network
- To discover multiple providers of an interface
- To support operations that require interest
- To cause a provider that is capable of providing an interface on demand to begin providing it
- To cause datagram connections between a requestor and provider to be upgraded to streaming connections
- To optimize network traffic by mapping a route between a requestor and provider
Interest Levels
A requestor can express the following enumerated interest levels:
- WATCH. This level of interest enables requestors to discover providers that are already providing an interface. It also causes direct routes to be set up between providers and interested requestors.
- ACTIVATE. This level of interest includes all the functionality of the WATCH level. In addition, it causes providers that are capable of providing an interface but not already providing it to begin providing it.
- CONNECT. This level of interest includes all the functionality of the ACTIVATE level. In addition, it causes streaming connections to be established among all nodes between the requestor and the provider—if those nodes are capable of establishing streaming connections.
How It Works
Mapping a route between a requestor and provider must be carefully balanced against the fact that interest operations flood the network and are stored in state on every network node. Use of interest operations where not otherwise required by an operation should be carefully managed by a system designer.