|
1 | | -# Datacenter Topology File Format |
| 1 | +# General configs information |
2 | 2 |
|
3 | | -This document describes the structure of the YAML file used to define datacenter network topologies, including hosts, |
4 | | -switches, and links between them. |
| 3 | +## Units data format |
5 | 4 |
|
6 | | -## Structure Overview |
| 5 | +In all configs you may see fields that contains time, size and speed. All of them have same format: `<value><unit>` where `value` is an integer and `unit` is small string suffix. For each unit where are fixed list of available units that you may see below. |
7 | 6 |
|
8 | | -The topology file is divided into multiple sections, each representing a different network topology. Each topology |
9 | | -consists of: |
| 7 | +### Available time units: |
10 | 8 |
|
11 | | -- `devices`: Defines devices: senders, receivers and switches. |
| 9 | +- `ns`: Nanosecond |
| 10 | +- `us`: Microsecond |
| 11 | +- `ms`: Millisecond |
| 12 | +- `s`: Second |
12 | 13 |
|
13 | | -- `links`: Specifies connections between devices with network parameters. |
| 14 | +### Available size units: |
14 | 15 |
|
15 | | -## Sections |
| 16 | +- `b`: bit |
| 17 | +- `B`: Byte |
| 18 | +- `Mb`: Megabit |
| 19 | +- `MB`: Megabyte |
| 20 | +- `Gb`: Gigabit |
| 21 | +- `GB`: Gigabyte |
16 | 22 |
|
17 | | -### Devices |
| 23 | +### Available speed units: |
18 | 24 |
|
19 | | -Each host entry represents a device: |
| 25 | +- `Mbps`: Megabits per second |
| 26 | +- `Gbps`: Gigabits per second |
20 | 27 |
|
21 | | -```yaml |
22 | | -devices: |
23 | | - device_name: |
24 | | - type: [ sender | receiver | switch ] |
25 | | -``` |
| 28 | +Examples: |
| 29 | +- Time: `1ns`, `2s`, |
| 30 | +- Size: `1Mb`, `5GB` |
| 31 | +- Speed: `2Gpbs`, `3Mbps` |
26 | 32 |
|
27 | | -- `device_name`: Unique identifier for the device. |
| 33 | +## Presets |
28 | 34 |
|
29 | | -- `type`: Defines device type. |
30 | | - |
31 | | -### Links |
| 35 | +For some config parts you may create presets - common set of fields for the objects. For example, in topology configs it may looks like |
| 36 | +```yaml |
| 37 | +presets: |
| 38 | + links: |
| 39 | + best-link: |
| 40 | + latency: 1000ns |
| 41 | + throughput: 10Gbps |
| 42 | + ingress_buffer_size: 4096B |
| 43 | + egress_buffer_size: 4096B |
| 44 | + switches: |
| 45 | + really-best-switch: |
| 46 | + ecn: |
| 47 | + min: 0.2 |
| 48 | + max: 0.4 |
| 49 | + probability: 0.8 |
| 50 | + bad-switch: |
| 51 | + ecn: |
| 52 | + min: 1.0 |
| 53 | + max: 1.0 |
| 54 | + probability: 0.0 |
| 55 | +``` |
32 | 56 |
|
33 | | -Each link defines a connection between two devices: |
| 57 | +To use your preset, fill in `preset-name` field in concrete object description: |
34 | 58 |
|
35 | 59 | ```yaml |
| 60 | +switches: |
| 61 | + switch-1: |
| 62 | + preset-name: really-best-switch |
| 63 | + switch-2: |
| 64 | + preset-name: bad-switch |
36 | 65 | links: |
37 | | - link_id: |
38 | | - from: <source_device> |
39 | | - to: <destination_device> |
40 | | - latency: <value><unit> |
41 | | - throughput: <value><unit> |
42 | | - ingress_buffer_size: <value>B |
43 | | - egress_buffer_size: <value>B |
| 66 | + link1-2: |
| 67 | + preset-name: best-link |
| 68 | + from: switch-1 |
| 69 | + to: switch-2 |
| 70 | + link2-1: |
| 71 | + preset-name: best-link |
| 72 | + from: switch-2 |
| 73 | + to: switch-1 |
| 74 | + throughput: 10Gpps # overrides value from preset |
44 | 75 | ``` |
45 | 76 |
|
46 | | -- `link_id`: Unique identifier for the link. |
47 | | - |
48 | | -- `from`: Source device name. |
49 | | - |
50 | | -- `to`: Destination device name. |
| 77 | +## Default preset |
51 | 78 |
|
52 | | -- `latency`: Transmission delay (e.g., 5ns). |
| 79 | +To shorten the configs length, you may fill default preset that used for all objects in description of which `preset-name` does not set (or set to `default`): |
53 | 80 |
|
54 | | -- `throughput`: Link bandwidth (e.g., 1Gbps). |
55 | | - |
56 | | -- `ingress_buffer_size`: Link ingress buffer size in bytes (e.g., 1024B) |
57 | | - |
58 | | -- `egress_buffer_size`: Link egress buffer size in bytes (e.g., 1024B) |
59 | | - |
60 | | -### Examples images |
| 81 | +```yaml |
| 82 | +presets: |
| 83 | + links: |
| 84 | + default: |
| 85 | + latency: 1000ns |
| 86 | + throughput: 10Gbps |
| 87 | + ingress_buffer_size: 4096B |
| 88 | + egress_buffer_size: 4096B |
| 89 | +links: |
| 90 | + link-1: |
| 91 | + from: device-1 |
| 92 | + to: device-2 |
| 93 | + # other fields takes from default preset |
| 94 | + link-1: |
| 95 | + preset-name: default # works similarly with link-1 |
| 96 | + from: device-2 |
| 97 | + to: device-1 |
61 | 98 |
|
62 | | -You may generate images of topologies using the [generator](../scripts/generate_image.py) script. |
| 99 | +``` |
0 commit comments