The Internet of Things (IOT) is an Internet-based network that covers everything. Message Queuing Telemetry Transport (MQTT) is one of the commonly used communication protocols for any platform in the Internet of Things. Whether it is from the perspective of overall security or device compatibility and resource consumption, the MQTT protocol has certain advantages and is the most competitive communication protocol in the current Internet of Things. However, the user password login form adopted by the MQTT protocol has a certain degree of security problems. IOTA is an encrypted currency, and the Tangle network it uses is a new distributed structure. Based on this situation, this article innovatively combines the Tangle network with the MQTT protocol, and proposes a new communication option for MQTT nodes. When a new node enters the network, start from the Broker with the help of a “walker”, by judging the connection and survival of the node, using the Markov Chain Monte Carlo (MCMC) random walk algorithm to complete the node selection, and finally realize MQTT Communication between nodes. This article puts forward the design idea of this scheme, and realizes the scheme through simulation experiment.