How does the NATS protocol work?
At the beginning of this chapter, we mentioned that NATS is designed to cater to the requirements of modern distributed systems while providing a simple interface to work with the clients. That is why the NATS protocol, which defines the interaction between the NATS server and the NATS client, has a simple set of commands that are based on plain text messages with a publish and subscribe type model. A simple TCP client such as Telnet can communicate with the NATS server using these protocol commands.
Protocol conventions
The NATS protocol uses a set of conventions to make sure that both the client and server understand the messages that are shared: