Table of Contents
The difference between MQTT and TCP
Home Common Problem What is the difference between mqtt protocol and tcp protocol

What is the difference between mqtt protocol and tcp protocol

May 08, 2021 am 11:27 AM
mqtt protocol tcp protocol

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

What is the difference between mqtt protocol and tcp protocol

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

The difference between MQTT and TCP

Birth time

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

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

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

Protocol location

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

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

What is the difference between mqtt protocol and tcp protocol

Protocol positioning

TCP design considers connection-oriented, reliable, byte-based Transport layer communication protocol for streams.

MQTT is an application layer protocol for relatively reliable data transmission under low-bandwidth, high-latency and unreliable networks.

Design Idea

The core idea of ​​TCP is packet switching.

The core idea of ​​MQTT is to be simple and adaptable to the Internet of Things environment.

Transmission unit

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

The transmission unit of MQTT is a message. The upper limit of bytes of each message is set on the MQTT Broker proxy server. The upper limit of message size exceeding 1M can be set. In this way, you can send thousands of pieces of collected data or relatively large device shadow files with one message.

Technical Challenges

The problem that TCP needs to solve is to deal with network congestion, packet loss, disorder, and duplication in a heterogeneous network environment during the transmission of IP packets. Packages and other issues.

The problem MQTT solves is relatively reliable data transmission under low-bandwidth, high-latency, unreliable networks and limited resource hardware environments.

Quality of Service

TCP is a reliable streaming service. Through the ACK confirmation and retransmission mechanism, it can ensure that all bytes sent are exactly the same when received. , and the byte order is also correct.

MQTT provides three optional QoS service levels for message publishing. The MQTT client and MQTT proxy server ensure the reliability of message transmission through the session mechanism. Developers can choose one of them based on business needs.

Application Case

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

MQTT can be used for IoT data transmission, IM chat software, etc.

For more related knowledge, please visit the FAQ column!

The above is the detailed content of What is the difference between mqtt protocol and tcp protocol. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Exploration of the application of Redis in the Internet of Things Exploration of the application of Redis in the Internet of Things Nov 07, 2023 am 11:36 AM

Exploration of the application of Redis in the Internet of Things In today's era of rapid development of the Internet of Things (IoT), a large number of devices are connected together, providing us with rich data resources. As the application of the Internet of Things becomes more and more widespread, the processing and storage of large-scale data have become urgent problems that need to be solved. As a high-performance memory data storage system, Redis has excellent data processing capabilities and low latency, bringing many advantages to IoT applications. Redis is an open

PHP client library recommendations and usage instructions for MQTT protocol PHP client library recommendations and usage instructions for MQTT protocol Jul 09, 2023 pm 02:33 PM

PHP client library recommendations and usage instructions for the MQTT protocol MQTT (MessageQueuingTelemetryTransport) is a lightweight message transmission protocol that is widely used in fields such as the Internet of Things and sensor networks. In PHP development, in order to facilitate communication with the MQTT server using the MQTT protocol, we can choose to use some PHP client libraries to simplify this process. In this article, we will recommend several commonly used PHP client libraries and provide usage instructions.

How to change tcp protocol in win11? Details of how to change tcp protocol in win11 system How to change tcp protocol in win11? Details of how to change tcp protocol in win11 system Feb 01, 2024 pm 05:30 PM

One of the transport protocols in Windows systems is the TCP protocol, which is required when running and using certain functions. Recently, some Win11 users have encountered problems with the TCP protocol and need to modify it. However, many people don’t know how to make successful modifications. In order to solve this problem, this Win11 tutorial will provide you with detailed setting methods. Please visit this site for the complete steps if you need them. How to change the TCP protocol in win11: 1. First, right-click the network icon in the lower right corner to open the network and internet settings. 3. Then open more network adapter options under relevant settings. 5. After opening, you can find the tcp protocol. Double-click it to open it. 7. You can also click Advanced to repair

TCP protocol and asynchronous IO processing technology in Go language TCP protocol and asynchronous IO processing technology in Go language Jun 02, 2023 am 09:10 AM

With the continuous development of Internet technology, TCP protocol and asynchronous IO processing technology have become increasingly important. As a modern programming language, Go language naturally supports TCP protocol and asynchronous IO processing technology, which makes Go language extremely convenient and efficient in developing network applications. This article will discuss the advantages of Go language in network application development from two aspects: TCP protocol and asynchronous IO processing technology. 1. TCP protocol The TCP protocol is a reliable, connection-oriented network transmission protocol. It can ensure the reliability of network transmission,

Which layer of protocol does tcp belong to? Which layer of protocol does tcp belong to? Jul 05, 2023 am 10:52 AM

tcp is a "transport layer" protocol. TCP refers to "Transmission Control Protocol", which is a connection-oriented, reliable, byte stream-based transport layer communication protocol. TCP complements the Internet Protocol. It defines the IP address used to identify systems on the Internet. It mainly Ensure end-to-end data transfer between different nodes.

How to change TCP protocol settings in Windows 11 system How to change TCP protocol settings in Windows 11 system Apr 02, 2024 pm 01:43 PM

In the Windows 11 operating system, the TCP protocol, as a key part of the underlying communication architecture, plays an indispensable role in the stable operation of many functions in the system. When users intend to make personalized adjustments to the TCP protocol according to their own needs, they may face operational confusion. To this end, here are the detailed steps on how to change TCP protocol settings in Windows 11 system. Let’s take a look. Change method 1. Right-click the network icon in the taskbar in the lower right corner, and then select "Network and Internet Settings" in the option list. 2. After entering the new interface, click the "Advanced Network Settings" option on the right. 3. Then click "More Network Adapter Options" in "Related Settings". 4. of

Introduction to MQTT protocol and its application in PHP development Introduction to MQTT protocol and its application in PHP development Jul 09, 2023 pm 01:39 PM

Introduction to MQTT protocol and its application in PHP development With the rapid development of the Internet of Things, networking and data transmission of various devices have become more and more important. MQTT (MessageQueueTelemetryTransport) protocol, as a lightweight publish/subscribe message transmission protocol, is widely used in the field of Internet of Things. This article will introduce the basic principles of the MQTT protocol and provide specific examples of using the MQTT protocol in PHP development. 1. Basic principles of MQTT protocol MQ

Workerman development: How to implement instant messaging based on TCP protocol Workerman development: How to implement instant messaging based on TCP protocol Nov 07, 2023 am 10:34 AM

Workerman development: How to implement instant messaging based on TCP protocol Introduction: With the development of the Internet era, instant messaging plays an important role in our daily lives. Instant messaging based on the TCP protocol has become a common solution. This article will introduce how to use the Workerman framework to implement instant messaging based on the TCP protocol by writing specific code examples. 1. Introduction to Workerman Workerman is a high-performance PHPSocket service framework