iof-tools / confFileGenerator @ 7c83f065
|baseFiles||4dcd8a7e||over 2 years||tiamilani||mrai value imported from graphml file to conf f...|
|templates||7c83f065||about 2 years||Marco Nesler||Added network ns and ip configuration script|
|Edge.py||11.9 KB||227f2eb7||about 2 years||tiamilani||no mrai implemented|
|Node.py||6.05 KB||7c83f065||about 2 years||Marco Nesler||Added network ns and ip configuration script|
|README.md||2.6 KB||30fd1706||about 2 years||tiamilani||updated README|
|confFileGen.py||4.72 KB||7c83f065||about 2 years||Marco Nesler||Added network ns and ip configuration script|
|constants.py||3.45 KB||7c83f065||about 2 years||Marco Nesler||Added network ns and ip configuration script|
gen2 for now stable but it still uses
/30 networks for the point to point networks between nodes
The generator require a well formed graph defined in graphml format generated with the function
internet_as_graph() by the networkx library.
The function is not by default on the networkx library, you have to download and install it following this link:
The latest update use the graph generated by the branch 'degree_bug', there is a little modification, now the peer link are bidirectional and not repeated. I suggest to download this version.
Are also required the following python library: * getopt * os.path * shutil * sys * ipaddress
launch the generator on a basic test
python3 confFileGen.py --graph small_g.graphml --out out/
If the file small_g.graphml is not founded it will be created with a predefined number of nodes (defined inside
If the dir 'out/' does not exists it will be created
Now inside the folder
out you will find all the files needed to start the nodes
Mandatory args are: * --graph [file name]: name of the graphml (only graphml files are accepted) file that will be used to generate the conf files, this file needs to be correctly formatted and created. Only nodes of type 'C' generates routes. If this does not exists yet it will be created with a predefined number of nodes (20). * --out [folder name]: folder where the conf files will be saved
Not mandatory args: * --nnodes [number]: redefine the default number of nodes used to create the file, if the file already exists this parameter will be ignored * --directories: this args does not require parameters, if present the output will be formatted to folders for each bird node * --help, -h: show this help * --nomrai: this option will override the mrai in the graphml file and preclude mrai commands to be in the conf file * --mraitype: define the type of mrai that will be used in the conf files, default is 0
Example complete command:
python3 confFileGen.py --graph graph.graphml --out out/ --nnodes 10 --directories
This command generate the file graph.graphml if it does not exists and will be used only 10 nodes (instead of 20, default for new files).
Will be used the 'out' directory to save the files, and thanks to
--directories all files will be moved to the corresponding directory.
with this command will also be inserted the commands for mrai, to avoid this is possible to use the following command:
python3 confFileGen.py --graph graph.graphml --out out/ --nnodes 10 --directories --nomrai
Also available in: Atom