Running EI¶
There are two services that must always be run- the Service Node Manager (SNM) and the Pipe Terminus (PT). The SNM should be started first, and opens a listening TCP socket for all other services to connect to.
The basic invocation for a service is:
./pox.py config=ext/ei/ei.cfg ei.<servicename> --dom_id=$DOM --sn_id=$SN ei.<servicename>=tcp:<snm_ip> ei.<servicename>:connection=ptcp:<service_ip>
This will start the service by connecting to snm_ip
and listening for config tree commands on service_ip
.
You can also use the scripts/start.sh
script file to start up a set of desired services. This script
also will include the necessary LD_PRELOAD
variable when running with ASAN enabled.
The ei.cfg
config file contains information on log levels that should be used by various components.
If you do not wish to compile without logging, you can set the different log levels of EI modules here.
Configuring Reachability¶
Once SNMs are running, they need to be configured to create connections between one another and confirm
reachability. Only one half of an SNM connection pair needs to be configured. This is done
using the bin/ctl
script to add the other SNM’s IP into the config tree.
For example, if node 1.1 wants to reach 1.2, and 1.2’s SNM is listening is on 127.0.1.2:10299
:
./pox/ext/ei/bin/ctl 1 1 tree_add --tree=config --path='./"cp"/"persistent"/"tcp:127.0.1.2:12099"'
This must be done before enabling pipes between two nodes. If a persistent SNM connection is not made, pipes between them cannot be enabled and services cannot use them.
Creating Pipes¶
Once EI is running, you’ll need to make some pipes inbetween nodes. A pipe allows bidirectional UDP traffic between services. A service sending a packet on a pipe will always reach the matching service instance on the opposite end of the pipe.
Pipes are defined in the EI tree, and you can modify this using bin/ctl
.
For example, this command will define a pipe on 1.1 to 1.2 with a logical ID of 1:
./pox/ext/ei/bin/ctl 1 1 pipe_new_basic --remote=1.2 --r-addr=127.0.1.2 --l-addr=127.0.1.1 --l-id=1
./pox/ext/ei/bin/ctl 1 1 pipe_enable=1
Note that the pipe needs to be enabled before it can be used. You will also have to define the opposite end of the pipe at 1.2:
./pox/ext/ei/bin/ctl 1 2 pipe_new_basic --remote=1.1 --r-addr=127.0.1.1 --l-addr=127.0.1.2 --l-id=1
./pox/ext/ei/bin/ctl 1 2 pipe_enable=1
Once this is done the pipe will be activated and any running services will be notified and able to use it.
Host Stacks¶
There is a special type of pipe for host stacks; these solely connect the host stack of a service to the service itself. Creating these will allow host stacks to communicate with the main component of a service, primarily by processing any incoming IPCs they have on the Unix domain socket from applications:
./pox/ext/ei/bin/ctl 1 1 pipe_new_host_stack --id=5
./pox/ext/ei/bin/ctl 1 1 pipe_enable=5
The Unix domain socket for a host stack is defined as part of the Pipe Terminus’ command line args,
specifically the --hs-ipc-socket-name
arg.