With the proliferation of machine-to-machine communication, there are many communication protocols standardized for IoT applications. Performances of these protocols may significantly deviate from each other even under the same operating conditions. In this paper, we quantitatively compare the performances of a set of well-known IoT communication protocols, namely CoAP (Constrained Application Protocol), MQTT (Message Queuing Telemetry Transport) and XMPP (Extendible Message Persistent Protocol) in a real-world testbed. CoAP employs UDP packets for transmission while others use TCP. For this purpose, we design as small testbed that collects real-time environmental data. By designing such a system, we aim to reveal the differences among protocols in terms of packet creation time and packet transmission time. The obtained results show that XMPP is worse than other protocols in both metrics and MQTT and CoAP perform almost equally.