Merge branch 'develop' into enhancement/poetry-invoke
This commit is contained in:
commit
9c13803e52
4 changed files with 70 additions and 16 deletions
|
@ -510,6 +510,10 @@ class CoreClient:
|
||||||
except grpc.RpcError as e:
|
except grpc.RpcError as e:
|
||||||
self.app.show_grpc_exception("Edit Node Error", e)
|
self.app.show_grpc_exception("Edit Node Error", e)
|
||||||
|
|
||||||
|
def send_servers(self) -> None:
|
||||||
|
for server in self.servers.values():
|
||||||
|
self.client.add_session_server(self.session_id, server.name, server.address)
|
||||||
|
|
||||||
def start_session(self) -> StartSessionResponse:
|
def start_session(self) -> StartSessionResponse:
|
||||||
self.ifaces_manager.reset_mac()
|
self.ifaces_manager.reset_mac()
|
||||||
nodes = [x.core_node for x in self.canvas_nodes.values()]
|
nodes = [x.core_node for x in self.canvas_nodes.values()]
|
||||||
|
@ -538,6 +542,7 @@ class CoreClient:
|
||||||
emane_config = None
|
emane_config = None
|
||||||
response = StartSessionResponse(result=False)
|
response = StartSessionResponse(result=False)
|
||||||
try:
|
try:
|
||||||
|
self.send_servers()
|
||||||
response = self.client.start_session(
|
response = self.client.start_session(
|
||||||
self.session_id,
|
self.session_id,
|
||||||
nodes,
|
nodes,
|
||||||
|
@ -749,6 +754,7 @@ class CoreClient:
|
||||||
"""
|
"""
|
||||||
Send to daemon all session info, but don't start the session
|
Send to daemon all session info, but don't start the session
|
||||||
"""
|
"""
|
||||||
|
self.send_servers()
|
||||||
self.create_nodes_and_links()
|
self.create_nodes_and_links()
|
||||||
for config_proto in self.get_wlan_configs_proto():
|
for config_proto in self.get_wlan_configs_proto():
|
||||||
self.client.set_wlan_config(
|
self.client.set_wlan_config(
|
||||||
|
|
|
@ -42,10 +42,11 @@ class CanvasNode:
|
||||||
x, y, anchor=tk.CENTER, image=self.image, tags=tags.NODE
|
x, y, anchor=tk.CENTER, image=self.image, tags=tags.NODE
|
||||||
)
|
)
|
||||||
label_y = self._get_label_y()
|
label_y = self._get_label_y()
|
||||||
|
label = self.get_label()
|
||||||
self.text_id: int = self.canvas.create_text(
|
self.text_id: int = self.canvas.create_text(
|
||||||
x,
|
x,
|
||||||
label_y,
|
label_y,
|
||||||
text=self.core_node.name,
|
text=label,
|
||||||
tags=tags.NODE_LABEL,
|
tags=tags.NODE_LABEL,
|
||||||
font=self.app.icon_text_font,
|
font=self.app.icon_text_font,
|
||||||
fill="#0000CD",
|
fill="#0000CD",
|
||||||
|
@ -123,9 +124,16 @@ class CanvasNode:
|
||||||
self.antennas.clear()
|
self.antennas.clear()
|
||||||
self.antenna_images.clear()
|
self.antenna_images.clear()
|
||||||
|
|
||||||
|
def get_label(self) -> str:
|
||||||
|
label = self.core_node.name
|
||||||
|
if self.core_node.server:
|
||||||
|
label = f"{self.core_node.name}({self.core_node.server})"
|
||||||
|
return label
|
||||||
|
|
||||||
def redraw(self) -> None:
|
def redraw(self) -> None:
|
||||||
self.canvas.itemconfig(self.id, image=self.image)
|
self.canvas.itemconfig(self.id, image=self.image)
|
||||||
self.canvas.itemconfig(self.text_id, text=self.core_node.name)
|
label = self.get_label()
|
||||||
|
self.canvas.itemconfig(self.text_id, text=label)
|
||||||
for edge in self.edges:
|
for edge in self.edges:
|
||||||
edge.redraw()
|
edge.redraw()
|
||||||
|
|
||||||
|
|
|
@ -284,6 +284,7 @@ class CoreXmlWriter:
|
||||||
self.write_service_configs()
|
self.write_service_configs()
|
||||||
self.write_configservice_configs()
|
self.write_configservice_configs()
|
||||||
self.write_session_origin()
|
self.write_session_origin()
|
||||||
|
self.write_servers()
|
||||||
self.write_session_hooks()
|
self.write_session_hooks()
|
||||||
self.write_session_options()
|
self.write_session_options()
|
||||||
self.write_session_metadata()
|
self.write_session_metadata()
|
||||||
|
@ -318,6 +319,15 @@ class CoreXmlWriter:
|
||||||
add_attribute(origin, "y", y)
|
add_attribute(origin, "y", y)
|
||||||
add_attribute(origin, "z", z)
|
add_attribute(origin, "z", z)
|
||||||
|
|
||||||
|
def write_servers(self) -> None:
|
||||||
|
servers = etree.Element("servers")
|
||||||
|
for server in self.session.distributed.servers.values():
|
||||||
|
server_element = etree.SubElement(servers, "server")
|
||||||
|
add_attribute(server_element, "name", server.name)
|
||||||
|
add_attribute(server_element, "address", server.host)
|
||||||
|
if servers.getchildren():
|
||||||
|
self.scenario.append(servers)
|
||||||
|
|
||||||
def write_session_hooks(self) -> None:
|
def write_session_hooks(self) -> None:
|
||||||
# hook scripts
|
# hook scripts
|
||||||
hooks = etree.Element("session_hooks")
|
hooks = etree.Element("session_hooks")
|
||||||
|
@ -572,6 +582,7 @@ class CoreXmlReader:
|
||||||
self.read_session_metadata()
|
self.read_session_metadata()
|
||||||
self.read_session_options()
|
self.read_session_options()
|
||||||
self.read_session_hooks()
|
self.read_session_hooks()
|
||||||
|
self.read_servers()
|
||||||
self.read_session_origin()
|
self.read_session_origin()
|
||||||
self.read_service_configs()
|
self.read_service_configs()
|
||||||
self.read_mobility_configs()
|
self.read_mobility_configs()
|
||||||
|
@ -635,6 +646,16 @@ class CoreXmlReader:
|
||||||
logging.info("reading hook: state(%s) name(%s)", state, name)
|
logging.info("reading hook: state(%s) name(%s)", state, name)
|
||||||
self.session.add_hook(state, name, data)
|
self.session.add_hook(state, name, data)
|
||||||
|
|
||||||
|
def read_servers(self) -> None:
|
||||||
|
servers = self.scenario.find("servers")
|
||||||
|
if servers is None:
|
||||||
|
return
|
||||||
|
for server in servers.iterchildren():
|
||||||
|
name = server.get("name")
|
||||||
|
address = server.get("address")
|
||||||
|
logging.info("reading server: name(%s) address(%s)", name, address)
|
||||||
|
self.session.distributed.add_server(name, address)
|
||||||
|
|
||||||
def read_session_origin(self) -> None:
|
def read_session_origin(self) -> None:
|
||||||
session_origin = self.scenario.find("session_origin")
|
session_origin = self.scenario.find("session_origin")
|
||||||
if session_origin is None:
|
if session_origin is None:
|
||||||
|
|
|
@ -12,6 +12,28 @@ run on one of the emulation servers or on a separate machine.
|
||||||
Each machine that will act as an emulation will require the installation of a
|
Each machine that will act as an emulation will require the installation of a
|
||||||
distributed CORE package and some configuration to allow SSH as root.
|
distributed CORE package and some configuration to allow SSH as root.
|
||||||
|
|
||||||
|
## CORE Configuration
|
||||||
|
|
||||||
|
CORE configuration settings required for using distributed functionality.
|
||||||
|
|
||||||
|
Edit **/etc/core/core.conf** or specific configuration file being used.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# uncomment and set this to the address that remote servers
|
||||||
|
# use to get back to the main host, example below
|
||||||
|
distributed_address = 129.168.0.101
|
||||||
|
```
|
||||||
|
|
||||||
|
### EMANE Specific Configurations
|
||||||
|
|
||||||
|
EMANE needs to have controlnet configured in **core.conf** in order to startup correctly.
|
||||||
|
The names before the addresses need to match the names of distributed servers configured.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
controlnet = core1:172.16.1.0/24 core2:172.16.2.0/24 core3:172.16.3.0/24 core4:172.16.4.0/24 core5:172.16.5.0/24
|
||||||
|
emane_event_generate = True
|
||||||
|
```
|
||||||
|
|
||||||
## Configuring SSH
|
## Configuring SSH
|
||||||
|
|
||||||
Distributed CORE works using the python fabric library to run commands on
|
Distributed CORE works using the python fabric library to run commands on
|
||||||
|
@ -88,6 +110,16 @@ PermitRootLogin without-password
|
||||||
sudo systemctl restart sshd
|
sudo systemctl restart sshd
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Fabric Config File
|
||||||
|
|
||||||
|
Make sure the value used below is the absolute path to the file
|
||||||
|
generated above **~/.ssh/core**"
|
||||||
|
|
||||||
|
Add/update the fabric configuration file **/etc/fabric.yml**:
|
||||||
|
```yaml
|
||||||
|
connect_kwargs: {"key_filename": "/home/user/.ssh/core"}
|
||||||
|
```
|
||||||
|
|
||||||
## Add Emulation Servers in GUI
|
## Add Emulation Servers in GUI
|
||||||
|
|
||||||
Within the core-gui navigate to menu option:
|
Within the core-gui navigate to menu option:
|
||||||
|
@ -152,26 +184,13 @@ to arrange the topology such that the number of tunnels is minimized. The
|
||||||
tunnels carry data between servers to connect nodes as specified in the topology.
|
tunnels carry data between servers to connect nodes as specified in the topology.
|
||||||
These tunnels are created using GRE tunneling, similar to the Tunnel Tool.
|
These tunnels are created using GRE tunneling, similar to the Tunnel Tool.
|
||||||
|
|
||||||
### EMANE Configuration and Issues
|
|
||||||
|
|
||||||
EMANE needs to have controlnet configured in **core.conf** in order to startup correctly.
|
|
||||||
The names before the addresses need to match the servers configured in
|
|
||||||
**~/.core/servers.conf** previously.
|
|
||||||
|
|
||||||
```shell
|
|
||||||
controlnet = core1:172.16.1.0/24 core2:172.16.2.0/24 core3:172.16.3.0/24 core4:172.16.4.0/24 core5:172.16.5.0/24
|
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
|
||||||
emane_event_generate = True
|
|
||||||
```
|
|
||||||
|
|
||||||
## Distributed Checklist
|
## Distributed Checklist
|
||||||
|
|
||||||
1. Install CORE on master server
|
1. Install CORE on master server
|
||||||
1. Install distributed CORE package on all servers needed
|
1. Install distributed CORE package on all servers needed
|
||||||
1. Installed and configure public-key SSH access on all servers (if you want to use
|
1. Installed and configure public-key SSH access on all servers (if you want to use
|
||||||
double-click shells or Widgets.) for both the GUI user (for terminals) and root for running CORE commands
|
double-click shells or Widgets.) for both the GUI user (for terminals) and root for running CORE commands
|
||||||
|
1. Update CORE configuration as needed
|
||||||
1. Choose the servers that participate in distributed emulation.
|
1. Choose the servers that participate in distributed emulation.
|
||||||
1. Assign nodes to desired servers, empty for master server.
|
1. Assign nodes to desired servers, empty for master server.
|
||||||
1. Press the **Start** button to launch the distributed emulation.
|
1. Press the **Start** button to launch the distributed emulation.
|
||||||
|
|
Loading…
Add table
Reference in a new issue