This article introduces you to MQTT protocol widely used in IoT.
MQTT is a publish/subscribe (pubsub) wire protocol designed with small devices in mind. Pubsub systems work like a message bus. You send a message to a topic, and any software with a subscription for that topic gets a copy of your message. As a sender you just provide your information to a set of topics and listen for any other topics you might care about.