Skip to content

Code and Binaries

Ilya Baldin edited this page Sep 25, 2024 · 10 revisions

E2SAR Binaries

OS Packages

Pre-built .deb packages can be found here. For Ubuntu 20, 22 and 24 there are e2sar_<version>_amd64.deb containing E2SAR include files, library, python bindings and binaries. In addition to assist with developing E2SAR, .deb packages are provided containing just the dependencies for E2SAR called e2sar-deps_<version>_amd64.deb (these generally contain gRPC and Boost libraries of appropriate versions). All installs go under /usr/local/.

OS-specific instructions

Be sure to set your PATH to include /usr/local/bin and LD_LIBRARY_PATH to include /usr/local/lib. Similarly /usr/local/include should be on your include path when compiling:

$ export PATH=/usr/local/bin:$PATH
$ export LD_LIBRARY_PATH=/usr/local/lib

Ubuntu 20.04

  • Installation of Python3.10 is required:
$ sudo apt-get -yq update
$ sudo apt-get install -yq software-properties-common
$ sudo add-apt-repository -y ppa:deadsnakes/ppa
$ sudo apt-get -yq update
$ sudo apt-get -yq install python3.10
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2

lbadm

A command-line utility for issuing control plane gRPC commands.

$ ./build/bin/lbadm -h                                                                                                                                        [11:51:11]
E2SAR Version: 0.1.2
Command-line options:
  -h [ --help ]         show this help message
  -l [ --lbname ] arg   specify name of the load balancer
  -i [ --lbid ] arg     override/provide id of the loadbalancer
  -a [ --address ] arg  node IPv4/IPv6 address, can be used multiple times for 
                        'reserve' call
  -d [ --duration ] arg specify duration as '[hh[:mm[:ss]]]'
  -u [ --uri ] arg      specify EJFAT_URI on the command-line instead of the 
                        environment variable
  -n [ --name ] arg     specify node name for registration
  -p [ --port ] arg     node starting listening port number
  -w [ --weight ] arg   node weight
  -c [ --count ] arg    node source count
  -s [ --session ] arg  override/provide session id
  -q [ --queue ] arg    queue fill
  -t [ --ctrl ] arg     control signal value
  -r [ --ready ] arg    worker ready state (1 or 0)
  -o [ --root ] arg     root cert for SSL communications
  -v [ --novalidate ]   don't validate server certificate (conflicts with 
                        'root')
  --minfactor arg       node min factor, multiplied with the number of slots 
                        that would be assigned evenly to determine min number 
                        of slots for example, 4 nodes with a minFactor of 0.5 =
                        (512 slots / 4) * 0.5 = min 64 slots
  --maxfactor arg       multiplied with the number of slots that would be 
                        assigned evenly to determine max number of slots for 
                        example, 4 nodes with a maxFactor of 2 = (512 slots / 
                        4) * 2 = max 256 slots set to 0 to specify no maximum
  -6 [ --ipv6 ]         force using IPv6 control plane address if URI specifies
                        hostname (disables cert validation)
  -4 [ --ipv4 ]         force using IPv4 control plane address if URI specifies
                        hostname (disables cert validation)
  -e [ --export ]       suppresses other messages and prints out 'export 
                        EJFAT_URI=<the new uri>' returned by the LB
  --reserve             reserve a load balancer (-l, -a, -d required). Uses 
                        admin token.
  --free                free a load balancer. Uses instance or admin token.
  --version             report the version of the LB. Uses admin or instance 
                        token.
  --register            register a worker (-n, -a, -p, -w, -c required), note 
                        you must use 'state' within 10 seconds or worker is 
                        deregistered. Uses instance or admin token.
  --deregister          deregister worker. Uses instance or session token.
  --status              get and print LB status. Uses admin or instance token.
  --state               send worker state update (must be done within 10 sec of
                        registration) (-q, -c, -r required). Uses session 
                        token.
  --overview            return metadata and status information on all 
                        registered load balancers. Uses admin token.
  --addsenders          add 'safe' sender IP addresses to CP (one or more -a 
                        required). Uses instance token.
  --removesenders       remove 'safe' sender IP addresses from CP (one or more 
                        -a required). Uses instance token.

lbmon

A command-line utility to monitor a particular instance of load balancer.

$ ./build/bin/lbmon -h                                                                                                                                        [11:51:16]
E2SAR Version: 0.1.2
Command-line options:
  -h [ --help ]         EJFAT LB MonitorThis tool can be used to either check 
                        the status of a reserved LB with an instance tokenor to
                        check the overview of the LB with an admin tokenIf lbid
                        is specified in EJFAT_URI/argument, it will default to 
                        status of LBEJFAT_URI must be specified in this format 
                        ejfat[s]://<token>@<cp name or ip>:<cp port>/lb/<lbid>
  -i [ --lbid ] arg     specify id of the loadbalancer as issued by reserve 
                        call instead of using what is in EJFAT_URI
  -o [ --root ] arg     root cert for SSL communications
  -v [ --novalidate ]   don't validate server certificate (conflicts with 
                        'root')
  -6 [ --ipv6 ]         prefer IPv6 control plane address if URI specifies 
                        hostname (disables cert validation)
  -4 [ --ipv4 ]         prefer IPv4 control plane address if URI specifies 
                        hostname (disables cert validation)
  -u [ --uri ] arg      specify EJFAT_URI on the command-line instead of the 
                        environment variable
  -t [ --time ] arg     specify refresh time in ms (default is 5000ms)

e2sar_perf

A command-line performance testing utility, somehwat similar to iperf, but specific to E2SAR

$ ./build/bin/e2sar_perf -h                                                                                                                                   [13:06:09]
E2SAR Version: 0.1.2
Command-line options:
  -h [ --help ]                   show this help message
  -s [ --send ]                   send traffic
  -r [ --recv ]                   receive traffic
  -l [ --length ] arg (=1048576)  event buffer length (defaults to 1024^2) [s]
  -u [ --uri ] arg                specify EJFAT_URI on the command-line instead
                                  of the environment variable
  -n [ --num ] arg (=10)          number of event buffers to send (defaults to 
                                  10) [s]
  -e [ --enum ] arg (=0)          starting event number (defaults to 0) [s]
  -m [ --mtu ] arg (=1500)        MTU (default 1500) [s]
  --src arg (=1234)               Event source (default 1234) [s]
  --dataid arg (=4321)            Data id (default 4321) [s]
  -t [ --threads ] arg (=1)       number of receive threads (defaults to 1) [r]
  --rate arg (=1)                 send rate in Gbps (defaults to 1.0)
  -p [ --period ] arg (=1000)     receive side reporting thread sleep period in
                                  ms (defaults to 1000) [r]
  -b [ --bufsize ] arg (=3145728) send or receive socket buffer size (default 
                                  to 3MB)
  -d [ --duration ] arg (=0)      duration for receiver to run for (defaults to
                                  0 - until Ctrl-C is pressed)
  -c [ --withcp ]                 enable control plane interactions
  -i [ --ini ] arg                INI file to initialize SegmenterFlags [s]] or
                                  ReassemblerFlags [r]. Values found in the 
                                  file override --withcp, --mtu and --bufsize
  --ip arg (=127.0.0.1)           IP address (IPv4 or IPv6) from which sender 
                                  sends from or on which receiver listens. 
                                  Defaults to 127.0.0.1. [s,r]
  --port arg (=10000)             Starting UDP port number on which receiver 
                                  listens. Defaults to 10000. [r] 
  -6 [ --ipv6 ]                   force using IPv6 control plane address if URI
                                  specifies hostname (disables cert validation)
                                  [s,r]
  -4 [ --ipv4 ]                   force using IPv4 control plane address if URI
                                  specifies hostname (disables cert validation)
                                  [s,r]
  -v [ --novalidate ]             don't validate server certificate

snifgen

A scapy script that can generate and listen for dataplane and sync control plane UDP messages. It can listen/generate sync UDP packets, data plane UDP packets with LB+RE headers and dataplane with only RE headers and arbitrary payloads:

$ ./snifgen.py -h 
usage: snifgen.py [-h] (-l | -g) [-p PORT] [-c COUNT] [--ip IP] [--show] [--entropy ENTROPY] [--event EVENT] [--rate RATE] [--dataid DATAID] [--srcid SRCID] [--mtu MTU] [--pld PLD] [--iface IFACE] (--sync | --lbre | --re)

options:
  -h, --help            show this help message and exit
  -l, --listen          listen for incoming packets and try to parse and validate them
  -g, --generate        generate new packets of specific types
  -p PORT, --port PORT  UDP port (for -l and -g)
  -c COUNT, --count COUNT
                        number of packet streams (if pld larger than mtu, otherwise packets) to generate or expect
  --ip IP               IP address to which to send the packet(s) or listen from
  --show                only show the packet without sending it (with -g)
  --entropy ENTROPY     entropy value for LB+RE packet
  --event EVENT         event number for sync, LB+RE and RE packet
  --rate RATE           event rate in Hz for Sync packet
  --dataid DATAID       data id for RE packet
  --srcid SRCID         source id for Sync packet
  --mtu MTU             set the MTU length, so LB+RE and RE packets can be fragmented.
  --pld PLD             payload for LB+RE or RE packets. May be broken up if MTU size insufficient
  --iface IFACE         which interface should we listen on (defaults to all)
  --sync                listen for or generate sync packets
  --lbre                listen for or generate packets with LB+RE header
  --re                  listen for or generate packets with just the RE header

Typical uses may include (note the scripts have sane defaults for everything, but can be overridden with command line):

Generate a LB+RE header packet with a specific payload. Only show it without sending (doesn't need root privilege)

$ ./snifgen.py -g --lbre --pld "this is payload" --show -c 1 

Generate and send a LB+RE header packet to 192.168.100.10 with a specific payload. Use default MTU of 1500.

$ ./snifgen.py -g --lbre --pld "this is payload" --ip "192.168.100.10" -c 1 

Generate and send a RE header packet to 192.168.100.10 with a specific payload. Use MTU of 50.

$ ./snifgen.py -g --re --pld "this is payload" --ip "192.168.100.10" --mtu 50 -c 1 

Listen for 10 Sync packets sent to port 18347 then exit.

$ ./snifgen -l -p 18347 -c 10 --sync

Listen for 10 Sync packets sent to 192.168.100.10 port 18347 then exit.

$ ./snifgen -l -p 18347 -c 10 --ip "192.168.100.10" --sync

Docker

The binaries are offered as part of a docker image available through DockerHub. To run e.g. lbadm from inside the container you can do something like this (in this example issuing a version() command):

$ docker run --rm ibaldin/e2sar:latest lbadm --version -u "ejfats://[email protected]:18347/" -v