You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+39-21
Original file line number
Diff line number
Diff line change
@@ -30,27 +30,39 @@ We use RSA 2048-bit encryption, and example configurations are provided below.
30
30
## User & Queue Configuration
31
31
32
32
Some scripts rely on `rabbitmqadmin`, so ensure that an administrator user is properly configured and that the default "guest" user is restricted to localhost access only.
33
-
34
-
From the `users.yaml` configuration, clients publish to the same exchange but use distinct routing keys, which correspond to their Common Name (CN) in their certificate.
35
-
These routing keys determine message distribution across tiers (which act as exchanges).
36
-
Each client is subscribed to its own private queue, which receives messages routed from the relevant tiers.
37
-
38
-
The `setup.sh` script automates the setup of queues, permissions, exchanges, and bindings as defined in `users.yaml`.
39
-
Client certificates and private keys, ensuring each client can authenticate securely.
40
-
41
-
The `eraseRabbit.sh` script removes all queues, bindings, exchanges, and users, except for the default "guest" user, ensuring continued access via `rabbitmqadmin`.
42
-
43
-
The `deleteUserBindings.sh` script removes all the bindings for the user passed as argument.
44
-
45
-
Once the setup is over it it is possible to refine the configuration with specific `rabbitmqctl` and `rabbitmqadmin` commands to create more bindings.
46
-
Previously issued certificates will continue to function as expected.
47
-
48
-
## Message Routing & Permissions
49
-
50
-
Each client can publish only using its assigned routing key to the defaultPeeringExchange and can subscribe only to its private queue.
51
-
Clients are categorized into four arbitrary tiers for message routing.
52
-
53
-
### A simple schema that illustrates a possible broker architecture
33
+
34
+
Users are defined in `users.yaml` and created via `setup.sh` along with their permissions.
35
+
Each client has a dedicated queue receiving messages from `routing_exchange` and publishes to `advertisement_exchange` (aggregates node IPs) and `rules_exchange` (informs the broker of filtering criteria). Messages are routed accordingly.
36
+
37
+
`LocalAgent` consists of two classes: `RulesManager` managing rules, and `RoutingManager` managing the advertisements.
38
+
39
+
`metrics.sh` updates node latency to every known client every 2 minutes in `metrics.yaml` and `RoutingManager` reads this to generate routing keys. If a client IP changes it updates both the file and the bindings.
40
+
41
+
Before the `RulesManager` sets up bindings, an ERP API validates client access to specific data.
42
+
43
+
Client authentication is secured via certificates.
44
+
45
+
`eraseRabbit.sh` removes all queues, bindings, exchanges, and users, except guest, and `deleteUserBindings.sh` removes all bindings for a given client.
46
+
47
+
After setup, additional bindings can be configured via rabbitmqctl/rabbitmqadmin.
48
+
Previously issued certificates remain valid.
49
+
50
+
## Message format and routing
51
+
52
+
Two types of messages are published on the exchanges.
53
+
The announcement contains the FLUIDOS node ID, including the IP.
54
+
55
+
The rule is a string representing the latency, bandwidth and geographical zones desired by the sender: the format is like:
56
+
`100.1.K-Z-J`
57
+
Where 100 is the maximum latency accepted in milliseconds, 1 is the minimum bandwidth accepted in Mbps and K, Z, J represent some geographical zones.
58
+
59
+
This rule is translated to three different bingding keys that will be applied with `rabbitmqctl`:
60
+
- 100.1.K
61
+
- 100.1.Z
62
+
- 100.1.J
63
+
If any message from the announcements has a routing key matching one of these bindings, that message will be routed to the queue of the client which sent the rule.
64
+
65
+
### A schema that illustrates broker's architecture
54
66
55
67
<palign="center">
56
68
<imgsrc="./docs/images/broker_server.jpg"/>
@@ -80,3 +92,9 @@ Clients are categorized into four arbitrary tiers for message routing.
0 commit comments