Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the differences between mqtt protocol and tcp protocol

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Editor to share with you what is the difference between mqtt protocol and tcp protocol, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Differences: 1. MQTT was born in the early days of the Internet in 1999, and the TCP protocol was born during the Cold War in 1974. 2. TCP is the transport layer communication protocol of OSI layer 4, and MQTT is the application layer protocol based on TCP. 3. The core idea of TCP is packet switching, and the core idea of MQTT is simplicity and adaptation to the environment of the Internet of things.

The operating environment of this tutorial: windows7 system, Dell G3 computer.

The difference between MQTT and TCP

Birth time

The TCP agreement was born in 1974 during the Cold War.

MQTT was born in the early days of the Internet in 1999, and TCP protocol was born 25 years earlier than MQTT protocol.

Ashton also put forward the concept of IoT in 1999, so the MQTT agreement was born at the right time. At that time, MIT Auto-ID Labs's Kevin Ashton first put forward the concept of IoT in 1999 in order to connect the RFID tags in P & G's supply chain with the Internet.

Protocol location

TCP is the transport layer protocol of layer 4 of OSI.

MQTT is a seven-layer application layer protocol based on TCP.

Protocol positioning

TCP is designed to consider connection-oriented, reliable, byte-stream-based transport layer communication protocols.

MQTT is an application layer protocol for relatively reliable data transmission in an unreliable network with low bandwidth and high delay.

Design thought

The core idea of TCP is packet switching.

The core idea of MQTT is to be simple and adapt to the Internet of things environment.

Transmission unit

The transmission unit of TCP is packet. When the application layer sends an 8-bit byte data stream for internetwork transmission to the TCP layer, TCP divides the data stream into message segments of appropriate length, and the maximum transmission segment size (MSS) is usually limited by the maximum transmission unit (MTU) of the data link layer of the network connected by the computer.

The transmission unit of MQTT is messages. The upper limit of each message byte is set on the MQTT Broker proxy server, and the upper limit of messages larger than 1m can be set. In this way, thousands of collected data can be sent in one message, or larger device shadow files.

Technical challenge

The problem that TCP needs to solve is to deal with many problems in heterogeneous network environment, such as network congestion, packet loss, disorder, duplicate packets and so on in the process of IP packet transmission.

MQTT solves the problem of relatively reliable data transmission in an unreliable network with low bandwidth and high delay and in a hardware environment with limited resources.

Quality of service

TCP is a reliable streaming service. Through ACK acknowledgement and retransmission mechanism, all bytes sent are guaranteed to be exactly the same at the time of receipt, and the byte order is correct.

MQTT provides three optional QoS service levels for message publishing. MQTT client and MQTT proxy server ensure the reliability of message transmission through session mechanism. Developers can choose one of these according to their business needs.

Application case

TCP is used in many Internet applications, such as WWW, email, FTP, SSH, P2P, streaming media. MQTT is also based on TCP.

MQTT can be used for Internet of things data transmission, IM chat software and so on.

These are all the contents of this article entitled "what are the differences between mqtt and tcp protocols?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report