To download the VM image, we have to use the following link:
**[6.7GB Size] - Lubuntu 20.04 x64** - Mininet-WiFi with P4 (pass: wifi)
After downloading, we have to perform the login (user: wifi, pass: wifi) and clone the repository as follows:
$ git clone <https://github.com/rafaelsilvag/m-polka.git>
To compile the P4 M-PolKA codes, you have to perform the following command:
$ cd m-polka/m-polka$ make
Is import to note that for each mofification, we have to recompile by using the previous command.
This test explore a linear topology as shown in the figure below:
Linear Topology
To create the topology by using Mininet, we have to perform the following command:
$ sudo python3 run_linear_topology.py
Installing the polka library by using PIP
$ python3 -m pip install polka-routing --user
Considering that reducible polynomials were already calculated, we can see the list āsā with node-ID definition for each node. Hence, as the first step, we have to set the transmission state for all of them. Therefore, the route-ID is a composition of a set of node-ID and transmission state.
#!/usr/bin/env python3
from polka.tools import calculate_routeid, print_poly
DEBUG=False
def _main():
print("Insering irred poly (node-ID)")
s = [
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1], # s1
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1], # s2
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1], # s3
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1], # s4
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1], # s5
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1], # s6
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1], # s7
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1], # s8
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1], # s9
[1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1], # s10
]
print("From h1 to h3 ====")
# defining the nodes from h1 to h3
nodes = [
s[0],
s[1],
s[2]
]
# defining the transmission state for each node from h1 to h3
o = [
[1, 0], # s1
[1, 0, 0], # s2
[1], # s3
]
print_poly(calculate_routeid(nodes, o, debug=DEBUG))
print("From h3 to h1 ====")
# defining the nodes from h1 to h3
nodes = [
s[2],
s[1],
s[0]
]
# defining the transmission state for each node from h1 to h3
o = [
[1, 0], # s3
[1, 0], # s2
[1], # s1
]
print_poly(calculate_routeid(nodes, o, debug=DEBUG))
if __name__ == '__main__':
_main()