Skip to content

Commit dde80bb

Browse files
committed
Update docs for new --config option
1 parent 95f4698 commit dde80bb

8 files changed

Lines changed: 67 additions & 71 deletions

File tree

TODO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ TODO: Testcase for invalid signature
6161

6262
TODO: Test case for: if signature validation fails, return fragment to pool
6363

64-
TODO: Error message if --client or --hub does not exist in topology
64+
TODO: Error message if --client or --hub does not exist in configuration
6565

6666
TODO: Check SAE IDs on GET share, just as we do for POST share
6767

common/configuration.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Configuration for a DSKE topology.
2+
Configuration for DSKE manager.
33
"""
44

55
import pprint
@@ -9,12 +9,11 @@
99
from common.node import Node, NodeType
1010

1111
DEFAULT_BASE_PORT = 8100
12-
DEFAULT_CONFIGURATION_FILE = "topology.yaml"
1312

1413

1514
class Configuration:
1615
"""
17-
Configuration for a DSKE topology.
16+
Configuration for the DSKE manager.
1817
"""
1918

2019
_nodes: list[Node]
@@ -44,7 +43,7 @@ def _assign_ports_and_urls(self):
4443
port += 1
4544

4645

47-
def parse_configuration_file(filename: str = DEFAULT_CONFIGURATION_FILE):
46+
def parse_configuration_file(filename: str):
4847
"""
4948
Parse the configuration file.
5049
"""

docs/developer-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ $ <b>open htmlcov/index.html</b>
8686
For full and up-to-date documentation of the API endpoints, each network node provides OpenAPI
8787
documentation.
8888
To view the documentation go to URL `http://localhost:PORT/docs` where PORT is the port number
89-
for the network node as reported when the topology is started.
89+
for the network node as reported when the network is started.
9090

9191
Here we provide a summary of the API endpoints and their purpose.
9292

docs/getting-started-guide.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,12 @@ Install de dependencies:
6666
pip install -r requirements.txt
6767
```
6868

69-
## The example topology
69+
## The default configuration
7070

71-
View the example topology file `topology.yaml`:
71+
View the default configuration file `dske-config.yaml`:
7272

7373
```
74-
$ cat topology.yaml
74+
$ cat dske-config.yaml
7575
hubs:
7676
- name: hank
7777
- name: helen
@@ -95,7 +95,7 @@ clients:
9595
- name: susan
9696
```
9797

98-
This is a diagram of the topology:
98+
This is a diagram of the network topology::
9999

100100
![Topology diagram](figures/topology.png)
101101

@@ -105,13 +105,12 @@ The `manager.py` is used to manage topologies.
105105
Use the `--help` option to see how it is used:
106106

107107
```
108-
$ ./manager.py topology.yaml --help
109-
usage: manager.py [-h] [--client CLIENT | --hub HUB] configfile {start,stop,status,etsi-qkd} ...
108+
$ ./manager.py --help
109+
usage: manager.py [-h] [--config CONFIG_FILE] [--client CLIENT] [--hub HUB] {start,stop,status,etsi-qkd} ...
110110
111111
DSKE Manager
112112
113113
positional arguments:
114-
configfile Configuration filename
115114
{start,stop,status,etsi-qkd}
116115
start Start all hubs and clients
117116
stop Stop all hubs and clients
@@ -120,6 +119,7 @@ positional arguments:
120119
121120
options:
122121
-h, --help show this help message and exit
122+
--config CONFIG_FILE Configuration file name (default: dske-config.yaml)
123123
--client CLIENT Filter on client name
124124
--hub HUB Filter on hub name
125125
```
@@ -138,7 +138,7 @@ Start a capture on loopback interface `lo0` and filter on HTTP messages.
138138
Use the `manager.py` script to start the topology:
139139

140140
```
141-
$ ./manager.py topology.yaml start
141+
$ ./manager.py start
142142
Waiting for all nodes to be stopped
143143
Starting hub hank on port 8100
144144
Starting hub helen on port 8101
@@ -172,7 +172,7 @@ You will get different key IDs and key values, but they should match.
172172

173173

174174
```
175-
$ ./manager.py topology.yaml etsi-qkd sam sofia get-key-pair
175+
$ ./manager.py etsi-qkd sam sofia get-key-pair
176176
Invoke ETSI QKD Get Key API on client (KME) carol port 8105 master encryptor (SAE) sam slave encryptor (SAE) sofia:
177177
{
178178
"keys": {
@@ -204,7 +204,7 @@ The protocol is explained in the [protocol guide](protocol-guide.md).
204204
Use the `manager.py` script to view the internal state of a node, in this case client carol:
205205

206206
```
207-
$ ./manager.py topology.yaml --client carol status
207+
$ ./manager.py --client carol status
208208
Status for client carol on port 8105
209209
{
210210
"name": "carol",
@@ -250,7 +250,7 @@ Status for client carol on port 8105
250250
Use the `manager.py` script to stop the topology:
251251

252252
```
253-
$ ./manager.py topology.yaml stop
253+
$ ./manager.py stop
254254
Stopping client curtis on port 8109
255255
Stopping client connie on port 8108
256256
Stopping client cindy on port 8107

docs/protocol-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We say "inspired by" because:
4141
## Network topology
4242

4343
The following figure shows the topology that we use in all of our examples and which is specified
44-
in file `topology.yaml`:
44+
in file `dske-config.yaml`:
4545

4646
![Example network topology](figures/topology.png)
4747

docs/user-guide.md

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ For a detailed description of the DSKE protocol, see the
1919
If you are a software developer and would like more details about the implementation, see the
2020
[developer guide](developer-guide.md).
2121

22-
## Topology file
22+
## Configuration file
2323

24-
We first need a topology YAML file which describes the topology of the network.
24+
We first need a configuration YAML file which describes the topology of the network.
2525
It lists the names of
2626
the DSKE security hubs (hubs for short),
2727
the DSKE clients (clients for short),
2828
and the encryptors.
2929
.
3030

31-
The repository contains an example `topology.yaml` file:
31+
The repository contains an example `dske-config.yaml` file, which is the default configuration:
3232

3333
<pre>
34-
$ <b>cat topology.yaml</b>
34+
$ <b>cat dske-config.yaml</b>
3535
hubs:
3636
- name: hank
3737
- name: helen
@@ -88,7 +88,7 @@ options:
8888
You can also use the `--help` option to see the command line parameters for a specific sub-command:
8989

9090
<pre>
91-
$ <b>./manager.py topology.yaml etsi-qkd --help</b>
91+
$ <b>./manager.py etsi-qkd --help</b>
9292
usage: manager.py configfile etsi-qkd [-h] master_sae_id slave_sae_id {get-status,get-key,get-key-with-key-ids,get-key-pair} ...
9393

9494
positional arguments:
@@ -110,7 +110,7 @@ options:
110110
To start all nodes in the DSKE topology, use the manager `start` command:
111111

112112
<pre>
113-
$ <b>./manager.py topology.yaml start</b>
113+
$ <b>./manager.py start</b>
114114
Waiting for all nodes to be stopped
115115
Starting hub hank on port 8100
116116
Starting hub helen on port 8101
@@ -125,9 +125,6 @@ Starting client curtis on port 8109
125125
Waiting for all nodes to be started
126126
</pre>
127127

128-
`topology.yaml` is the topology file that specifies the names of the hubs and clients that
129-
are part of the topology.
130-
131128
The output reports that 10 nodes are started in total: 5 hub nodes (hank, helen, hilary, holly,
132129
and hugo) and 5 client nodes (carol, celia, cindy, connie, and curtis).
133130

@@ -139,7 +136,7 @@ each node.
139136
To stop all nodes in the topology, use the manager `stop` command:
140137

141138
<pre>
142-
$ <b>./manager.py topology.yaml stop</b>
139+
$ <b>./manager.py stop</b>
143140
Stopping client curtis on port 8109
144141
Stopping client connie on port 8108
145142
Stopping client cindy on port 8107
@@ -182,7 +179,7 @@ This is why the `start` command explicitly waits for all nodes to be started (it
182179
reports `Waiting for all nodes to be started` at the end):
183180

184181
<pre>
185-
$ <b>./manager.py topology.yaml start</b>
182+
$ <b>./manager.py start</b>
186183
Waiting for all nodes to be stopped
187184
Starting hub hank on port 8100
188185
...
@@ -200,7 +197,7 @@ This is why the `start` command explicitly waits for all needed TCP ports to be
200197
(it reports `Waiting for all nodes to be stopped` at the beginning).
201198

202199
<pre>
203-
$ <b>./manager.py topology.yaml start</b>
200+
$ <b>./manager.py start</b>
204201
<b>Waiting for all nodes to be stopped</b>
205202
Starting hub hank on port 8100
206203
...
@@ -213,7 +210,7 @@ If it takes longer than expected for a node to stop and for the TCP port to beco
213210
waiting (this should not take longer than 60 seconds):
214211

215212
<pre>
216-
$ <b>./manager.py topology.yaml stop</b>
213+
$ <b>./manager.py stop</b>
217214
Stopping client curtis on port 8109
218215
...
219216
Stopping hub hank on port 8100
@@ -230,7 +227,7 @@ client node.
230227
For example, to start one individual client carol:
231228

232229
<pre>
233-
$ <b>./manager.py topology.yaml --client carol start</b>
230+
$ <b>./manager.py --client carol start</b>
234231
Waiting for client carol to be stopped
235232
Starting client carol on port 8105
236233
Waiting for client carol to be started
@@ -241,15 +238,15 @@ hub node.
241238
For example, to stop one individual hub hugo:
242239

243240
<pre>
244-
$ <b>./manager.py topology.yaml --hub hugo stop</b>
241+
$ <b>./manager.py --hub hugo stop</b>
245242
Stopping hub hugo on port 8104
246243
Waiting for hub hugo to be stopped
247244
</pre>
248245

249246
You can use the `--client` and `--hub` command line options multiple times.
250247
For example:
251248

252-
<pre>$ <b>./manager.py topology.yaml --client carol --client corrie --hub hank start</b>
249+
<pre>$ <b>./manager.py --client carol --client corrie --hub hank start</b>
253250
Waiting for client carol, client corrie, hub hank to be stopped
254251
Starting hub hank on port 8100
255252
Starting client carol on port 8105
@@ -328,7 +325,7 @@ Use the manager `get-key` sub-command under the `etsi-qkd` command to invoke the
328325
The `get-key` sub-command has the following command-line options:
329326

330327
<pre>
331-
$ <b>./manager.py topology.yaml etsi-qkd sam sunny get-key --help</b>
328+
$ <b>./manager.py etsi-qkd sam sunny get-key --help</b>
332329
usage: manager.py configfile etsi-qkd master_sae_id slave_sae_id get-key [-h] [--size SIZE]
333330

334331
options:
@@ -340,7 +337,7 @@ In the following example we invoke the Get Key API for the QKD link between mast
340337
slave SAE Serena:
341338

342339
<pre>
343-
$ <b>./manager.py topology.yaml etsi-qkd sam serena get-key</b>
340+
$ <b>./manager.py etsi-qkd sam serena get-key</b>
344341
Invoke ETSI QKD Get Key API on client (KME) carol port 8105 master encryptor (SAE) sam slave encryptor (SAE) serena:
345342
{
346343
"keys": {
@@ -360,7 +357,7 @@ ETSI QKD 014 "Get Key" API to retrieve a key for a pair of SAEs on the slave SAE
360357
The `get-key` sub-command has the following command-line options:
361358

362359
<pre>
363-
$ <b>./manager.py topology.yaml etsi-qkd sam serena get-key-with-key-ids --help</b>
360+
$ <b>./manager.py etsi-qkd sam serena get-key-with-key-ids --help</b>
364361
usage: manager.py configfile etsi-qkd master_sae_id slave_sae_id get-key-with-key-ids [-h] key_id
365362

366363
positional arguments:
@@ -375,7 +372,7 @@ SAE Sam and slave SAE Serena, where the Key ID is d6a116f1-104e-4213-8cf1-0557cf
375372
Key ID returned by the Get Key API call above):
376373

377374
<pre>
378-
$ <b>./manager.py topology.yaml etsi-qkd sam serena get-key-with-key-ids 6a116f1-104e-4213-8cf1-0557cf33cb29</b>
375+
$ <b>./manager.py etsi-qkd sam serena get-key-with-key-ids 6a116f1-104e-4213-8cf1-0557cf33cb29</b>
379376
Invoke ETSI QKD Get Key with Key IDs API on client (KME) celia port 8106 master encryptor (SAE) sam slave encryptor (SAE) serena:
380377
{
381378
"keys": [
@@ -395,7 +392,7 @@ As a matter of convenience, there is also a `get-key-pair` sub-command to combin
395392
The `get-key-pair` sub-command has the following command-line options:
396393

397394
<pre>
398-
$ <b>./manager.py topology.yaml etsi-qkd carol curtis get-key-pair --help</b>
395+
$ <b>./manager.py etsi-qkd carol curtis get-key-pair --help</b>
399396
usage: manager.py configfile etsi-qkd master_sae_id slave_sae_id get-key-pair [-h] [--size SIZE]
400397

401398
options:
@@ -406,7 +403,7 @@ options:
406403
In the following example, we ask for a key pair between master SAE Sam and slave SAE Sunny:
407404

408405
<pre>
409-
$ <b>./manager.py topology.yaml etsi-qkd sam sunny get-key-pair</b>
406+
$ <b>./manager.py etsi-qkd sam sunny get-key-pair</b>
410407
Invoke ETSI QKD Get Key API on client (KME) carol port 8105 master encryptor (SAE) sam slave encryptor (SAE) sunny:
411408
{
412409
"keys": {
@@ -429,7 +426,7 @@ Key values match
429426
And, finally, there is a `status` subcommand to invoke the "Status" ETSI QKD 014 API:
430427

431428
<pre>
432-
$ <b<>./manager.py topology.yaml etsi-qkd sam sunny get-status</b>
429+
$ <b<>./manager.py etsi-qkd sam sunny get-status</b>
433430
Invoke ETSI QKD Status API on client (KME) carol port 8105 master encryptor (SAE) sam slave encryptor (SAE) sunny:
434431
{
435432
"source_kme_id": "carol",
@@ -452,7 +449,7 @@ Use the manager `status` command (not to be confused with the `etsi-qkd status`
452449
to report the status of each node in the topology:
453450

454451
<pre>
455-
$ <b>./manager.py topology.yaml status</b>
452+
$ <b>./manager.py status</b>
456453
Status for hub hank on port 8100
457454
{
458455
"name": "hank",
@@ -493,7 +490,7 @@ You can also use the `--client` or `--hub` command-line option to only report th
493490
client or hub node, for example:
494491

495492
<pre>
496-
$ <b>./manager.py topology.yaml --client celia status</b>
493+
$ <b>./manager.py --client celia status</b>
497494
Status for hub hank on port 8100
498495
{
499496
"name": "hank",
@@ -537,7 +534,7 @@ A useful trick is to use the `tail -n +2` command to skip the first line of outp
537534
the remaining output (which is JSON) through the `jq` command to colorize the JSON output:
538535

539536
<pre>
540-
$ <b>./manager.py topology.yaml --client carol status | tail -n +2 | jq</b>
537+
$ <b>./manager.py --client carol status | tail -n +2 | jq</b>
541538
{
542539
"name": "carol",
543540
"encryptor_names": [
@@ -583,7 +580,7 @@ In the following example we display the information about the local pool for pee
583580
on client carol:
584581

585582
<pre>
586-
$ <b>./manager.py topology.yaml --client carol status | tail -n +2 | jq '(.peer_hubs[] | select(.hub_name == "hank") .local_pool)'</b>
583+
$ <b>./manager.py --client carol status | tail -n +2 | jq '(.peer_hubs[] | select(.hub_name == "hank") .local_pool)'</b>
587584
{
588585
"blocks": [
589586
{

0 commit comments

Comments
 (0)