... | ... | @@ -50,7 +50,7 @@ A more detailed description of the options available with the JSON network confi |
|
|
|
|
|
### Python Network Configuration
|
|
|
|
|
|
Beside having the JSON network configuration method, one can start and initialize the network using also the new Python `NetworkAPI`. Hereafter, we provide a simple example of how to use this new method and a comparison with the legacy JSON configuration file. If you need more information and instructions on how to exploit this functionality, please check out the documentation of *P4-Utils*.
|
|
|
Beside having the JSON network configuration method, one can start and initialize the network using also the new Python `NetworkAPI`. Hereafter, we provide a simple example of how to use this new method and a comparison with the legacy JSON configuration file. If you need more information and instructions on how to exploit this functionality, please check out the [***P4-Utils* documentation**](https://nsg-ethz.github.io/p4-utils/usage.html#python).
|
|
|
|
|
|
```python
|
|
|
from p4utils.mininetlib.network_API import NetworkAPI
|
... | ... | @@ -97,9 +97,7 @@ net.enableLogAll() |
|
|
net.startNetwork()
|
|
|
```
|
|
|
|
|
|
> You can read more about the `NetworkAPI` in the [**official *P4-Utils* documentation**](https://nsg-ethz.github.io/p4-utils/usage.html#python).
|
|
|
|
|
|
The Python script shown above is equivalent to the following JSON network configuration file. Indeed, both snippets define the same network topology.
|
|
|
The Python script shown above is equivalent to the following JSON network configuration file. Indeed, both snippets define the same network topology. You can read more about the JSON network configuration file in the [***P4-Utils* documentation**](https://nsg-ethz.github.io/p4-utils/usage.html#json).
|
|
|
|
|
|
```json
|
|
|
{
|
... | ... | @@ -140,6 +138,4 @@ The Python script shown above is equivalent to the following JSON network config |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
> You can read more about the JSON network configuration file in the
|
|
|
> [**official *P4-Utils* documentation**](https://nsg-ethz.github.io/p4-utils/usage.html#json). |
|
|
\ No newline at end of file |
|
|
``` |
|
|
\ No newline at end of file |