`Hub` gathers connections from apps or clients, for each connection, it also creates an associate relay.
## Relay
```
+-----------------------------------------------+
| Relay |
| +-----------+ +----------+ |
---->| Inbound |->| Pipe | |
| +-----------+ |----------| |
| | Preset | |
| |----------| |
| | Preset | |
| |----------| +------------+ |
| | ... |->| Outbound |---->
| +----------+ +------------+ |
+-----------------------------------------------+
```
Relay handle both inbound and outbound endpoints, the type of inbound or outbound can be different. Once a relay created, it also creates an associate pipe.
Similar to TCP/IP protocol stack, you can define your own protocol in each layer. Application data are processed **step by step** from the lowest layer to the top. Preset here act as specific layers in the stack.
Like the graph above, each preset implements specific protocol or a part of protocol, for examples you can check out [src/presets](../../../src/presets).