摘要

The development of wireless technology like Internet Protocol version 6 over Low power Wireless Personal Area Networks, which defines IP communication for resource-constrained networks enables communication on the lower layers, while the diverging and incompatible application layer protocols lead to barriers in the way of information transferring between heterogeneous networks. Fortunately, extensible messaging and presence protocol (XMPP) is a preferential protocol to solve the problem of interoperability between heterogeneous networks. Hence, it is attractive to extend XMPP to the Internet of Things (IoT). However, XMPP protocol is initially designed for the Internet where the equipment is rich in resources, considering the characteristics of the IoT, the XMPP protocol needs to be optimized to meet the requirements of IoT, e.g., downsized protocol, publish/subscribe service and sleeping mechanism. In this paper, by staying true to the IoT visions, we propose a lightweight XMPP publish/subscribe scheme for resource-constrained IoT devices to perform data exchange either periodically or upon any value change. According to the subscribers needs, the publisher can adjust the data information published to the server. Inherit the merits of XEP-0060, the server maintains and manages the publish/subscribe relationships with multiple subscribers, as well as distributes the received data sent by publisher to all subscribers, yielding less complexity of publication and energy efficiency. In addition, the proposed scheme strongly supports publish/subscribe architecture of the sleeping clients that actually prolongs the lifetime of battery-powered devices. Thus, based on the standardized XMPP protocol, we present a down-sized and trimmed XMPP to implement this scheme. Through the experimental results, we demonstrate our work on optimizing and improving XMPP publish/subscribe scheme for resource-constrained IoT devices and show the simplicity and efficiency of this scheme.