Skip to content

Code and Binaries

Ilya Baldin edited this page Aug 1, 2024 · 14 revisions

E2SAR Binaries

lbadm

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

$ ./build/bin/lbadm -h                                 
E2SAR Version: 0.1.0a3
Command-line options:
  -h [ --help ]         show this help message
  -l [ --lbname ] arg   specify name of the load balancer
  -i [ --lbid ] arg     specify id of the loadbalancer as issued by reserve 
                        call instead of using what is in EJFAT_URI
  -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  session id from 'register' call
  -q [ --queue ] arg    queue fill
  -c [ --ctrl ] arg     control signal value
  -r [ --ready ] arg    worker ready state
  -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 ]         prefer IPv6 control plane address if URI specifies 
                        hostname
  --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 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 (-s required). Uses instance or 
                        session token.
  --status              get and print LB status. Uses admin token.
  --state               send worker state update (must be done within 10 sec of
                        registration) (-q, -c, -r required). Uses admin token.
  --overview            return metadata and status information on all 
                        registered load balancers. Uses admin token.

lbmon

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

$ ./build/bin/lbmon -h                                                                                                                                                                                        [10:36:32]
Command-line options:
  -h [ --help ]         EJFAT LB Monitor 
                         EJFAT_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
  -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)

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