...
 
Commits (2)
...@@ -31,7 +31,7 @@ The topology is parsed using the information in `/var/emulab/boot/topomap` to ge ...@@ -31,7 +31,7 @@ The topology is parsed using the information in `/var/emulab/boot/topomap` to ge
For description of the non-standard fields used, see the NetworkGraph section of this document For description of the non-standard fields used, see the NetworkGraph section of this document
#### 3. add_routable_ipv6_addrs.py #### 2. add_routable_ipv6_addrs.py
This is an executable library which provides several methods for gathering the necessary information to construct IPv6 Unique Local Addresses, construct them, and push them to the hosts This is an executable library which provides several methods for gathering the necessary information to construct IPv6 Unique Local Addresses, construct them, and push them to the hosts
The suggested usage is: The suggested usage is:
...@@ -45,7 +45,9 @@ The suggested usage is: ...@@ -45,7 +45,9 @@ The suggested usage is:
- This adds an `interfaces` property to the nodes in the graph which maps the (Linux) interface name to the ULA IPv6 address - This adds an `interfaces` property to the nodes in the graph which maps the (Linux) interface name to the ULA IPv6 address
- Use ssh_helper to log out of each host in the network - Use ssh_helper to log out of each host in the network
#### 4. frr_configurator.py Additionally, this library has a method `add_default_routes` which is useful for assigning default routes to edge devices
#### 3. frr_configurator.py
This is an executable library which supports configuring and managing FRR (Free Range Routing) This is an executable library which supports configuring and managing FRR (Free Range Routing)
All methods in this library expect to be run on a NetGraph which has been annotated with the `interfaces` field by `add_routable_ipv6_addrs` All methods in this library expect to be run on a NetGraph which has been annotated with the `interfaces` field by `add_routable_ipv6_addrs`
...@@ -55,6 +57,16 @@ The most useful methods are: ...@@ -55,6 +57,16 @@ The most useful methods are:
- start_frr_on_network: Start frr on all nodes in the network - start_frr_on_network: Start frr on all nodes in the network
- stop_frr_on_network: Stop frr on all nodes in the network - stop_frr_on_network: Stop frr on all nodes in the network
#### 4. osfp_sniffer_configurator.py
Support installing and controlling the OSPF sniffer
The most useful methods are:
- clone_repo_on_network: Download a repo, presumably the one which contains the OSPF sniffer code
- start_sniffer_on_network: Run the OSPF sniffer in the background
- Starting two sniffers is likely to cause problems, chief among which being the original PID file being overwritten
- stop_sniffer_on_network: Kill the OSPF sniffer running in the background
- If stop is run multiple times, the PID file will be invalid, so there is the unlikely event of another process being assigned the same PID and killed
#### 5. sysctl_configurator.py #### 5. sysctl_configurator.py
This is an executable library which supports running sysctl commands This is an executable library which supports running sysctl commands
...@@ -68,7 +80,6 @@ Once this codebase is finished, this section should go away. But great works are ...@@ -68,7 +80,6 @@ Once this codebase is finished, this section should go away. But great works are
The basic goal is to take all the scripts from <https://gitlab.flux.utah.edu/safeedge/sripv6-linux> and convert them to not assume anything about the experiment topology The basic goal is to take all the scripts from <https://gitlab.flux.utah.edu/safeedge/sripv6-linux> and convert them to not assume anything about the experiment topology
1. Replace `install_default_route_on_hosts.sh`
2. Replace `start_all_ovs.sh` 2. Replace `start_all_ovs.sh`
3. Replace `start_all_ospf_monitor.sh` 3. Replace `start_all_ospf_monitor.sh`
......
...@@ -33,20 +33,20 @@ DEFAULT_REPO_BRANCH='release' ...@@ -33,20 +33,20 @@ DEFAULT_REPO_BRANCH='release'
DEFAULT_REPO_URL="https://gitlab.flux.utah.edu/safeedge/ospfv3_monitor.git" DEFAULT_REPO_URL="https://gitlab.flux.utah.edu/safeedge/ospfv3_monitor.git"
def generate_repo_clone_command(repo: str, branch: str, path: str) -> str: def _generate_repo_clone_command(repo: str, branch: str, path: str) -> str:
return "git clone -b {branch} --single-branch -- {repo} {path}".format(repo=repo, branch=branch, path=path) return "git clone -b {branch} --single-branch -- {repo} {path}".format(repo=repo, branch=branch, path=path)
def generate_repo_update_command(path: str) -> str: def _generate_repo_update_command(path: str) -> str:
return "pushd {path}; git pull; popd".format(path=path) return "pushd {path}; git pull; popd".format(path=path)
def generate_start_command(path:str=DEFAULT_CLONE_PATH, def _generate_start_command(path:str=DEFAULT_CLONE_PATH,
executable: str=DEFAULT_EXECUTABLE, executable: str=DEFAULT_EXECUTABLE,
controller: str=DEFAULT_CONTROLLER, controller: str=DEFAULT_CONTROLLER,
logfile: str=DEFAULT_LOGFILE, logfile: str=DEFAULT_LOGFILE,
pidfile: str=DEFAULT_PIDFILE, pidfile: str=DEFAULT_PIDFILE,
) -> str: ) -> str:
""" """
Generate a command which launches the OSPF sniffer Generate a command which launches the OSPF sniffer
...@@ -67,7 +67,7 @@ def generate_start_command(path:str=DEFAULT_CLONE_PATH, ...@@ -67,7 +67,7 @@ def generate_start_command(path:str=DEFAULT_CLONE_PATH,
pidfile=pidfile, pidfile=pidfile,
) )
def generate_stop_command(pidfile: str=DEFAULT_PIDFILE) -> str: def _generate_stop_command(pidfile: str=DEFAULT_PIDFILE) -> str:
return "kill $(cat {pidfile})".format(pidfile=pidfile) return "kill $(cat {pidfile})".format(pidfile=pidfile)
...@@ -90,7 +90,7 @@ def clone_repo_on_network(graph: networkx.Graph, ...@@ -90,7 +90,7 @@ def clone_repo_on_network(graph: networkx.Graph,
:return: :return:
""" """
if ignore_nodes is None: ignore_nodes = [] if ignore_nodes is None: ignore_nodes = []
command = generate_repo_clone_command(repo=repo, branch=branch, path=path) command = _generate_repo_clone_command(repo=repo, branch=branch, path=path)
hosts = [host for host in graph.nodes if host not in ignore_nodes] hosts = [host for host in graph.nodes if host not in ignore_nodes]
commands = [command for host in hosts] commands = [command for host in hosts]
...@@ -113,7 +113,7 @@ def clone_repo_on_network(graph: networkx.Graph, ...@@ -113,7 +113,7 @@ def clone_repo_on_network(graph: networkx.Graph,
raise raise
# Update anything which needed updating # Update anything which needed updating
commands = [generate_repo_update_command(path)] * len(sessions_needing_updating) commands = [_generate_repo_update_command(path)] * len(sessions_needing_updating)
outputs = ssh_helper.run_commands_on_many_hosts(sessions_needing_updating, commands) outputs = ssh_helper.run_commands_on_many_hosts(sessions_needing_updating, commands)
pass pass
...@@ -136,13 +136,13 @@ def start_sniffer_on_network(graph: networkx.Graph, ...@@ -136,13 +136,13 @@ def start_sniffer_on_network(graph: networkx.Graph,
:return: :return:
""" """
if ignore_nodes is None: ignore_nodes = [] if ignore_nodes is None: ignore_nodes = []
command = generate_start_command(path=path, executable=executable, controller=controller, pidfile=pidfile) command = _generate_start_command(path=path, executable=executable, controller=controller, pidfile=pidfile)
hosts = [host for host in graph.nodes if host not in ignore_nodes] hosts = [host for host in graph.nodes if host not in ignore_nodes]
commands = [command for host in hosts] commands = [command for host in hosts]
sessions = [graph._node[host]['session'] for host in hosts] sessions = [graph._node[host]['session'] for host in hosts]
# Since this command puts the sniffer in the background, the naïve default error checking does not work # Since this command puts the sniffer in the background, the naive default error checking does not work
# First the command is echoed # First the command is echoed
echos = ssh_helper.unchecked_run_commands_on_many_hosts(sessions, commands) echos = ssh_helper.unchecked_run_commands_on_many_hosts(sessions, commands)
# Next we check for potential outputs # Next we check for potential outputs
...@@ -170,7 +170,7 @@ def stop_sniffer_on_network(graph: networkx.Graph, ...@@ -170,7 +170,7 @@ def stop_sniffer_on_network(graph: networkx.Graph,
hosts = [host for host in graph.nodes if host not in ignore_nodes] hosts = [host for host in graph.nodes if host not in ignore_nodes]
sessions = [graph._node[host]['session'] for host in hosts] sessions = [graph._node[host]['session'] for host in hosts]
commands = [generate_stop_command(pidfile=pidfile)] * len(hosts) commands = [_generate_stop_command(pidfile=pidfile)] * len(hosts)
output = ssh_helper.run_commands_on_many_hosts(sessions, commands) output = ssh_helper.run_commands_on_many_hosts(sessions, commands)
pass pass
......