Init 5

Category: tutorial

Sol - An MQTT broker from scratch. Refactoring & eventloop

posted on 25 Sep 2019

UPDATE: 2020-02-07

In the previous 6 parts we explored a fair amount of common CS topics such as networks and data structures, the little journey ended up with a bugged but working toy to play with.

Sol - An MQTT broker from scratch. Part 6 - Handlers

posted on 8 Mar 2019

This part will focus on the implementation of the handlers, they will be mapped one-on-one with MQTT commands in an array, indexed by command type, making it trivial to call the correct function depending on the packet type.

Sol - An MQTT broker from scratch. Part 5 - Topic abstraction

posted on 8 Mar 2019

In the Part 4 we explored some useful concepts and implemented two data structures on top of those concepts.

Sol - An MQTT broker from scratch. Part 4 - Data structures

posted on 7 Mar 2019

Before proceeding to the implementation of all command handlers, we’re going to design and implement some of the most common data structures needed to the correct functioning of the server, namely hashtable, list and a trie.

Sol - An MQTT broker from scratch. Part 3 - Server

posted on 6 Mar 2019

This part deal with the implementation of the server part of our application, by using the network module we drafted on part-2 it should be relative easy to handle incoming commands from a MQTT clients respecting 3.1.1 standards as we defined on part 1.

Sol - An MQTT broker from scratch. Part 2 - Networking

posted on 4 Mar 2019

Let’s continue from where we left, in the part 1 we defined and roughly modeled the MQTT v3.1.1 protocol and our src/mqtt.c module has now all unpacking functions, we must add the remaining build helpers and the packing functions to serialize packet for output.

Sol - An MQTT broker from scratch. Part 1 - The protocol

posted on 3 Mar 2019

It’s been a while that for my daily work I deal with IoT architectures and research best patterns to develop such systems, including diving through standards and protocols like MQTT;