next up previous contents
Next: Testing and Experimenting with Up: Overview of How Peep Previous: Events, States, and Heartbeats   Contents

Auto-Discovery and Leasing

The auto-discovery and leasing mechanism is there to make your life easier. While the role of the mechanism changes slightly depending on the underlying protocol used in your Peep server, it's general role is to allow servers and clients to automatically find each other via broadcasting and only send information while the server is functioning correctly, i.e, the connection is valid. In the case of a pure UDP Peep system, the connectionless nature makes it difficult for clients to determine whether a server is still listening and functioning correctly. A connection leasing mechanism is then used to circumvent this problem.

Peep's autodiscovery mechanism uses a domain-class concept to maintain bindings between clients and their respective servers. When a server initializes, it broadcasts its existence to the subnets associated with its classes and announces the classes of which it is a part. The clients that are members of those classes register themselves with the server and begin sending it data. Conversely, should a client start up and broadcast its existence, the server associated with its class will tell it to begin sending. A broadcast only occurs once during the initialization of each client or server, after which a list of hosts is maintained on both sides and communications are direct. Both clients and servers can belong to multiple classes at the same time and clients can communicate with many servers concurrently.

When running purely over UDP, leasing is used to ensure that clients do not waste network bandwidth and system resources sending packets to servers that are no longer listening. The server sends a lease time to the client during auto-discovery. Just before the lease expires, the server tells the client to renew the lease. The client responds by telling the server that it is still alive and still needs to know about lease information. If the client has not heard from a server after the least time has expired, it will no longer send packets to that server. Similarly if a server does not receive lease acknowledgement from a client, it will no longer attempt to renew its lease with that client.

Using auto-discovery and leasing is entirely optional. Clients can be run alternatively as ''dumb'' clients, as Auto-discovery and leasing isn't the solution in every situation. Clients can have their auto-discovery disabled with the -noautodiscovery option and then use the -server and -port options to figure out where to send their data.


next up previous contents
Next: Testing and Experimenting with Up: Overview of How Peep Previous: Events, States, and Heartbeats   Contents
Collin Starkweather 2002-11-03