Book Image

ZeroMQ

By : Faruk Akgul
Book Image

ZeroMQ

By: Faruk Akgul

Overview of this book

<p>ØMQ (also spelled ZeroMQ, 0MQ, or ZMQ) is a high-performance asynchronous messaging library aimed at use in scalable distributed or concurrent applications. It provides a message queue, but unlike message-oriented middleware, a ØMQ system can run without a dedicated message broker. The library is designed to have a familiar socket-style API.<br /><br />"ZeroMQ" teaches you to use ZeroMQ through examples in C programming language. You will learn how to use fundamental patterns of message/queuing with a step-by-step tutorial approach and how to apply them. Then, you’ll learn how to use high level APIs and to work with multiple sockets and multithreaded programs through many examples.<br /><br />This book looks at how message/queue works in general and what kinds of problems it solves. Then, it explains how ZeroMQ works and how it differs from other message/queue libraries and how it can be used in different scenarios.<br /><br />You will also learn how to apply essential message/queue design patterns in different scenarios, and how they differ from each other. It shows you practical examples you can apply. You will also learn how to work with multiple sockets.<br /><br />You will learn the basics of ZeroMQ as well as how to use different patterns.</p>
Table of Contents (12 chapters)

TCP header


The following diagram shows the header format of TCP:

TCP header

The source port number and destination port number set the port numbers. The sequence number starts at the fourth byte in the message transmitted from the source node to the destination node, as shown in the figure demonstrating the three-way handshake protocol. The acknowledgement number is the next sequence number that the source node expects.

TCP flags

The following is the list of flags that are commonly used in ZeroMQ:

  • URG (0x20): Urgent

  • ACK (0x10): Acknowledgement

  • PSH (0x08): Push

  • RST (0x04): Reset

  • SYN (0x02): Synchronize

  • FIN (0x01): Finish

Properties of TCP

Some of the properties of TCP that make it popular among the users are as follows:

  • Reliability: This is the most important characteristic of TCP. As we have said earlier, TCP guarantees unduplicated transmission and data delivery.

  • Full-duplex: TCP allows full-duplex operations, hence two nodes can send messages to each other simultaneously.

  • Flow control: TCP...