Networks may provide connectivity among stand-alone devices and personal computers (PCs) from many different vendors. A network may include a multitude of devices including those in the productivity domain (like desktop PCs, printers, and scanners), the entertainment domain (like televisions and audio sets), home control (like lighting and thermostat control), and the mobile domain (like laptops, universal remote controls, mobile phones, and personal digital assistants). These devices may be removably connected to the network to create a network with a dynamic configuration and transient reachability of devices. One such network is a UPnP™ (a certification mark of the UPnP Implementers Corporation) network.
To reduce or eliminate the requirement for network administrators, devices added to a network may be “plug and play”. There may be seamless roaming of devices between different networks. The number of devices may range from a few to thousands in a single network. All or part of the network may be wireless and may have a low maximum packet size, which places strict upper bounds on the size of multicast User Datagram Protocol (UDP) packets. Wireless networks may have low reliability, low bandwidth, and frequent changes in topology. The devices may have limited processing and memory capabilities.
The network may include two logical entities: clients and devices. Devices act as servers to clients. One physical device, like a PC, can host multiple logical entities. Thus, a physical device can be a client and a device at the same time. A client may discover devices that are on the network and may find out what services they deliver. When needed, the client may make use of these services. In a UPnP™ network, clients may be termed “control points”.
A Liveness Ping Protocol may be defined for a network 10 that includes clients 20 and devices 30 as shown in
A client may check for the presence of a device by sending an LPING message, which may be sent using unicast User Datagram Protocol (UDP). The device may reply with an LREPLY message, which may be in a UDP unicast packet. If the client does not receive a reply before a timeout, it may retransmit the LPING messages a number of times, for example three times. If the device does not reply to the LPING message, or the retransmissions if used, with an LREPLY message within a certain length of time, the client may conclude that the device is unreachable. The use of unicast instead of multicast communication may reduce network and device load in larger networks. UDP may be preferred over TCP, which requires more time and resources to setup and maintain connections, to support high dynamics in resource-constrained devices.
The following are exemplary definitions of the LPING and LREPLY messages in Backus-Naur Form (BNF) notation. Words in double quotes are terminals. Other words are non-terminals.
The extensions are optional. A sender of a message is never required to include extensions. A receiver of a message may ignore any extensions that are included in a message.
The LPING and LREPLY messages may contain the following information:
When a device receives an LPING message from a client, the device may increase an internal counter, for example PINGCOUNT, by an amount, which may be a constant amount such as PINGINCREASE, to provide a ping control mechanism. The PINGLOAD of a device may be computed as the difference between two successive ping counts, for example PINGCOUNT and LASTPINGCOUNT, divided by the length of time between the two counts, for example PERIOD, which may be expressed in seconds:
It will be appreciated that the internal counter may be of a limited size and may wrap-around when the ping count goes beyond the maximum count that can be represented by the internal counter. The difference between two successive ping counts may be computed in a manner that recognizes that the counter has wrapped-around and produces a difference value as though the counter were large enough not to wrap-around. Other methods of computing PINGLOAD may be used such as using a period that encompasses several received LPING messages, computing a running average for PINGLOAD, or computing PINGLOAD at fixed intervals.
In one embodiment, the device may compute a device ping load, such as PINGLOAD, and return the value of the device ping load to the client that sent the LPING message in the LREPLY response message. In another embodiment, the device may return the current value of PINGCOUNT to the client that sent the LPING message in the LREPLY response message. An exemplary behavior of the device in this embodiment may be described by the following pseudo-code:
To limit the PINGLOAD of a device, clients may be required to have at least a certain DELAY, which may further include a small randomization value, between two consecutive LPING messages. The value of this DELAY may be specified by a set of rules. Clients may be allowed to wait longer than the DELAY to send an LPING message. Thus DELAY may be a lower bound for PERIOD. When a client detects that the PINGLOAD on a device is higher than a certain threshold, for example HIGHTHRESHOLD, it may increase this DELAY to lower the effective PINGLOAD. When a client detects that the PINGLOAD falls below a certain threshold, for example LOWTHRESHOLD, it may decrease this DELAY to raise the effective PINGLOAD. This may be captured by the following exemplary adaptation rules:
The parameters HIGHTHRESHOLD and LOWTHRESHOLD may be fixed constants expressed in pings per unit time, for example pings per second. The constants may be defined such that they lead to an acceptable load on the device. The difference between HIGHTHRESHOLD and LOWTHRESHOLD may be made large enough that the DELAY stabilizes between HIGHTHRESHOLD and LOWTHRESHOLD quickly. In an exemplary embodiment, an increase of DELAY with a constant of 2 in rule R1 and the decrease of DELAY with a constant of ⅔ in rule R2 were used. The ratio LOWTHRESHOLD/HIGHTHRESHOLD in this exemplary embodiment was smaller than ⅔, so that the DELAY quickly attained a value between HIGHTHRESHOLD and LOWTHRESHOLD. The choice for these values may be based on simulation results.
In a similar way, if client CP2 stops pinging the device, the PINGLOAD decreases. CP1 will see the following PINGCOUNT increase by 100 rather than 200 as it did while CP2 was pinging. When the PINGLOAD is smaller than the low threshold, rule R2 may be applied and CP1 may decrease its DELAY.
In dynamic environments, the set of clients that is interested in a single device may change rapidly. While rules R1 and R2 may automatically adapt DELAYs to changed conditions, a sudden reduction in the number of clients can lead to a too low PINGLOAD to ensure timely detection of device unavailability. It can take a long time until the remaining clients ping again and notice that they can increase their ping frequency. To limit this effect, the maximum DELAY may be bounded by a factor that may be termed MAXDELAY. Adaptation rule R1 may become:
Similarly, a sudden influx of new clients can temporarily lead to a PINGLOAD above the high threshold. To limit this effect, a minimum DELAY, MINDELAY, may be introduced. Adaptation rule R2 may become:
Devices may tune their PINGLOAD by choosing, either statically or dynamically, the value of the variable PINGINCREASE that increments PINGCOUNT for each ping received by the device. When the protocol stabilizes, the maximum number of LPING messages per second that the device serves is:
In the exemplary embodiment shown in
The Liveness Ping Protocol may ensure that the PINGLOAD of one device does not go above MAXPINGPERSEC. Devices may not have to send and receive more than 2× MAXPINGPERSEC packets/second. As an exception to this rule, to ensure self-healing in a dynamic environment, clients may be allowed to ping once every MAXDELAY seconds, even if the number of clients grows beyond MAXDELAY×MAXPINGPERSEC. If there are #C clients and #D devices, then the number of messages involved in the Liveness Ping Protocol may be as follows:
The Liveness Ping Protocol may limit the overhead of PING messages on devices by increasing the time between successive pings from a client. This may increase the length of time it takes a client to detect the disappearance of a device from the network. A Proxy-Bye Protocol may be used to notify clients more quickly of the disappearance of a device from the network. The Proxy-Bye Protocol takes place only among clients. If a large number of clients are checking liveness of the same device, the clients will have long DELAYs between consecutive LPING messages (due to PINGLOAD control). To ensure that clients discover as soon as possible that the device becomes unreachable, the first client that detects that the device is gone notifies the others through the Proxy-Bye Protocol.
A client CP may check for the presence of the device by sending an LPING message. The device may respond to the client CP with an LREPLY message. If the client does not receive a reply before a timeout, it may retransmit the LPING messages a number of times. If the device does not reply to the LPING message, or the retransmissions if used, within a certain length of time, the client may conclude that the device is unreachable and the Proxy-Bye Protocol may be invoked.
Whenever a client decides that the device has become unreachable, it notifies other clients by sending proxy-bye messages. A proxy-bye message contains the address of the device and the LASTPINGCOUNT received by the client that generates the proxy-bye message. The LASTPINGCOUNT information enables other clients to discard duplicate proxy-bye messages.
Address information may be exchanged between clients piggybacked on the LREPLY messages to provide a zero-message overhead dynamic membership mechanism. The address may consist of an IP address and UDP port. To facilitate this exchange of information, each device may maintain the address information for the last several clients that sent an LPING, and may return this address information in the LREPLY. In one embodiment, each device may maintain address information for the last two clients that sent an LPING. The LREPLY message may contain the following information:
Clients may use this information to dynamically determine which other clients are checking the same device in the Proxy-Bye Protocol. This may occur without any direct communication among the group members and without any additional messages.
A client may send the proxy-bye message to all other known clients that are checking the same device by using a combination of multicast and unicast messages. If there is at least one client on the local link, the proxy-bye message is multicast on the local link. All off-link clients are reached by means of unicast messages.
Upon receiving a proxy-bye message, a client may check whether the proxy-bye message is a duplicate (i.e. a similar message was already received) or the device is still reachable, before deciding that the device is unreachable. If the proxy-bye message is not a duplicate and the device is not reachable, the device may forward the proxy-bye message. This may protect dynamic, routed networks where messages can appear out of order from propagating duplicate or outdated messages, and spoof attacks in case of malicious proxy-bye messages.
Each time a client CP1 receives an LREPLY message, it may receive the addresses of a number, such as two, preceding clients CP2, CP3. After a sequence of LPINGS by client CP1, differences in ping frequencies make it likely that it has received the addresses of a larger set of clients {CP2, . . . , CPn}. This effect may improve reliability of the Proxy-Bye Protocol, but may increase bandwidth and processing requirements of the protocol. To limit the size of this set {CP2, . . . , CPn}, CP1 may be allowed to forget about old clients. When CP1 receives information about CPi at time T, it may have to keep the information about CPi at least until T+MAXDELAY. Afterwards information about CPi is old and may be removed. This may assure that a client is known by at least two other clients at all times, unless these clients left the network. Moreover, since the proxy-bye message may be multicast on the local link, in small, bridged networks all clients may be notified at the same time. The propagation pattern of proxy-bye messages may be called the spreading effect. With high probability the forwarding graph may have a depth of log(#clients), which may allow fast propagation, even across the Internet. After each liveness ping, the forwarding connections between clients may be automatically updated to reflect the latest set of interested clients. Therefore it is likely that the proxy-bye messages will reach all clients.
It will be appreciated that the Liveness Ping Protocol may be used with or without the Proxy-Bye Protocol. Also, that the Proxy-Bye Protocol without the Liveness Ping Protocol. Both may be used advantageously together by placing a PINGLOAD or PINGCOUNT value and client addresses in the same LREPLY message. In other embodiments, PINGLOAD or PINGCOUNT values and client addresses may be sent in different messages. While the Liveness Ping Protocol and the Proxy-Bye Protocol have been described in the context of UPnP™ networks, these protocols may be used with other types of networks.
While certain exemplary embodiments have been described and shown in the accompanying drawings, it is to be understood that such embodiments are merely illustrative of and not restrictive on the broad invention, and that this invention not be limited to the specific constructions and arrangements shown and described, since various other modifications may occur to those ordinarily skilled in the art.
This application claims the benefit of U.S. Provisional Applications No. 60/467,294, filed May 1, 2003, and No. 60/489,860, filed Jul. 23, 2003.
| Number | Date | Country | |
|---|---|---|---|
| 60467294 | May 2003 | US | |
| 60489860 | Jul 2003 | US |