drxsim usage guide

Overview

BSR is a host-based software replication that has a fundamental limitation on replication I/O transfer performance. These limits are measured at up to 5-6G bps transmissions on TCP / IP-based 10Gbps networks. Therefore, in such environments, it is difficult to measure the underlying performance of DRX's buffering or compression. In order to measure the performance of any equipment or software, data must be input without limitation and the resulting output can be calculated. In this regard, drxsim is a tool developed to solve performance measurement problems.

drxsim simulates a basic bsr connection and simulates unlimited replicated data transfers to provide an environment for measuring the inherent performance of DRX. The added advantage of I/O simulation also eliminates the need to pre-configure the replication resources (disks, network connections) that need to be prepared for testing.

Main Functions

  • bsr connection simulation
    • Simulates connection of Acceptor/Connector's two channels
  • data transmission
    • Transfer large amounts of data without hard disk access to measure DRX performance
    • Data type
      • zero-fill: Data filled with 0x00
      • sequencial: Data that sequentially increases from 0x00 to 0xFF
      • random: Randomly generated data
      • Specifying a file: Repeatedly sending the contents of the specified file
  • Data Integrity Check
    • Includes low-level data integrity checking to determine only packet headers and data start / end to prioritize performance (CRC check)

How to use

drbdsim
[root@proxy1 drxsim_demo]# ./drxsim
Usage: .\drxsim.exe [options] command {command_arguments...}
Global options:
  -h [ --help ]                         Help message.
  -l [ --stdout-log-level ] arg (=info) Standard output log level
  -f [ --file-log-level ] arg (=debug)  File log level
  -o [ --output ] arg                   Output file
  --command arg                         Command to execute
  --subargs arg                         Arguments for command

Commands:
  standby, control, wait, send-once, send

Log levels:
  trace(T), debug(D), info(I), warning(W), error(E), critical(C), off(O)

 * last modified : Nov 19 2018, 17:41:41

drxsim has stand alone mode (wait, send-once, send) and standby / control mode (standby, control).

Common options:

  • l / stdout-log-level: Specify the level of the log output on the screen
  • f / file-log-level: Specify the level of the log output to the file
  • o / output: Specify file name to save log

StandAlone mode

wait mode

usage: drxsim [options] wait peer_ip peer_port

In the most basic mode, establish a connection with the remote drxsim and wait.

option:

  • i / ip:Specify Listen IP (default is 0.0.0.0)
  • p / port: Specify Listen port (default: 7780)
  • peer_ip: IP of remote drxsim or DRX
  • peer_port: Port of remote drxsim or DRX
wait mode
[root@proxy1 drxsim_demo]# ./drxsim wait -p 5000 200.60.211.252 5000
[08:33:24.794367] [t81616] [app:info] Start
[08:33:24.794482] [t81616] [resource:info] Start (Listen 5000, Peer 200.60.211.252:5000)
[08:33:24.794589] [t81616] [resource:info] [C] Connect to 200.60.211.252:5000
[08:33:24.794629] [t81616] [resource:info] [A] Listen 0.0.0.0:5000
[08:33:24.794632] [t81616] [resource:info] [A] Accept...
[08:33:24.794823] [t81619] [resource:error] [C] Can't connect to 200.60.211.252:5000. Connection refused
[08:33:34.653542] [t81619] [resource:info] [A] Accepted 200.60.211.252:41072
[08:33:34.710491] [t81620] [resource:info] [C] Connected. Send magic packet
[08:33:34.710534] [t81619] [resource:info] [C:meta] Start process
[08:33:34.710546] [t81619] [resource:info] [A:data] Start process

An intermediate connection error occurs because the remote drxsim is not yet running.

send-once mode

usage: drxsim [options] send-once peer_ip peer_port

In order to check whether data transfer is normally performed, it is a mode for performing one data transfer after connection.
The DRX plug-in is designed to check if the plug-in works normally through packet sniffing.

Additional options:

  • t / packet-type: Specifying Packet Type
    • z / zero-fill
    • s / sequencial
    • r / random
  • packet-file: File-based packet.
send-once mode
[root@proxy1 drxsim_demo]# ./drxsim send-once -p 5000 -t random 200.60.211.252 5000
[08:38:17.514085] [t82488] [app:info] Start
[08:38:17.514271] [t82488] [resource:info] Start (Listen 5000, Peer 200.60.211.252:5000)
[08:38:17.514398] [t82488] [resource:info] [C] Connect to 200.60.211.252:5000
[08:38:17.514449] [t82488] [resource:info] [A] Listen 0.0.0.0:5000
[08:38:17.514452] [t82488] [resource:info] [A] Accept...
[08:38:17.514650] [t82491] [resource:error] [C] Can't connect to 200.60.211.252:5000. Connection refused
[08:38:19.558009] [t82491] [resource:info] [A] Accepted 200.60.211.252:41210
[08:38:19.617391] [t82491] [resource:info] [C] Connected. Send magic packet
[08:38:19.617439] [t82492] [resource:info] [C:meta] Start process
[08:38:19.617453] [t82492] [resource:info] [A:data] Start process
[08:38:19.617460] [t82492] [resource:info] [repl_test] Prepare test...
[08:38:19.621709] [t82492] [resource:info] [repl_test] Start packet test (packet_type: random)
[08:38:19.621770] [t82492] [resource:info] [repl_test] Test finished
[08:38:20.621796] [t82491] [resource:info] [statistics] TX Bandwidth: 524.34 Kbps / 64.01 KB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:38:21.621784] [t82492] [resource:info] [statistics] TX Bandwidth: 262.17 Kbps / 32.00 KB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:38:22.621789] [t82491] [resource:info] [statistics] TX Bandwidth: 174.78 Kbps / 21.33 KB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:38:23.621766] [t82492] [resource:info] [statistics] TX Bandwidth: 131.08 Kbps / 16.00 KB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s

When data transmission is performed, the B/W measurement result is output. The B/W is output once per second and uses the average value by summing the total of 4 past data, so that the B/W measurement result of 4 seconds is outputted by one data transmission.

send mode

usage: drxsim [options] send peer_ip peer_port

It is a mode to perform continuous data transmission. It is used to measure network performance or DRX performance.

Additional options:

  • t / packet-type: Specifying Packet Type
    • z / zero-fill
    • s / sequencial
    • r / random
  • packet-file: File-based packet assignment. Repeatedly transfers the contents of the specified file.
  • s / transfer-duration: Specify transmission time (in seconds)
  • b / bps-limits: Transfer rate limit (in bps)
[root@proxy1 drxsim_demo]# ./drxsim send -p 5000 200.60.211.252 5000 -s 5 -b 6G -t s
[08:46:23.997586] [t83947] [app:info] Start
[08:46:23.998114] [t83947] [resource:info] Start (Listen 5000, Peer 200.60.211.252:5000)
[08:46:23.998241] [t83947] [resource:info] [C] Connect to 200.60.211.252:5000
[08:46:23.998289] [t83947] [resource:info] [A] Listen 0.0.0.0:5000
[08:46:23.998292] [t83947] [resource:info] [A] Accept...
[08:46:23.998488] [t83950] [resource:error] [C] Can't connect to 200.60.211.252:5000. Connection refused
[08:46:25.167158] [t83950] [resource:info] [A] Accepted 200.60.211.252:43890
[08:46:25.199745] [t83950] [resource:info] [C] Connected. Send magic packet
[08:46:25.199780] [t83951] [resource:info] [C:meta] Start process
[08:46:25.199793] [t83951] [resource:info] [A:data] Start process
[08:46:25.199800] [t83951] [resource:info] [repl_test] Prepare test...
[08:46:25.199888] [t83951] [resource:info] [repl_test] Start replication test (duration: 5s, limits: 6.00 Gbps, packet_type: sequencial)
[08:46:26.199980] [t83950] [resource:info] [statistics] TX Bandwidth: 6.00 Gbps / 715.66 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:27.199975] [t83951] [resource:info] [statistics] TX Bandwidth: 6.00 Gbps / 715.50 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:28.199975] [t83950] [resource:info] [statistics] TX Bandwidth: 6.00 Gbps / 715.45 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:29.199977] [t83951] [resource:info] [statistics] TX Bandwidth: 6.00 Gbps / 715.42 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:30.199901] [t83951] [resource:info] [repl_test] Test finished
[08:46:30.199974] [t83950] [resource:info] [statistics] TX Bandwidth: 6.00 Gbps / 715.31 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:31.199971] [t83951] [resource:info] [statistics] TX Bandwidth: 4.50 Gbps / 536.48 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:32.199997] [t83950] [resource:info] [statistics] TX Bandwidth: 3.00 Gbps / 357.64 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s
[08:46:33.200004] [t83951] [resource:info] [statistics] TX Bandwidth: 1.50 Gbps / 178.80 MB/s, RX Bandwitdh: 0.00 bps / 0.00 B/s

Standby/Control mode

standby mode

usage: drxsim.exe [options] standby

Standby mode waiting for external control. Open the TCP port for control and wait.

Additional options:

  • i / ip: Control Server IP (default is 0.0.0.0)
  • p / port: Control server port number (default: 9101)
[root@proxy1 drxsim_demo]# ./drxsim standby -p 9101
[08:51:56.413599] [t18932] [app:info] Start standby mode (port: 9101)

Control mode

usage: drxsim.exe [options] control [actions...]

This mode controls drxsim running in standby mode.

Additional options:

  • i / peer_ip: The IP of drxsim to control. (Default: 127.0.0.1)
  • p / peer_port: The port number of drxsim to control. (Default: 9091)
  • json: Output the results in JSON format. It only works when the standard output log is Off. (Default is 0)

In this mode, you must disable the standard output of the log to get the result of the operation.

list - Output resource list

Print a list of added resources.

[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 list
{"code": 0, "result": ["r0", "r1"]}
[root@proxy1 drxsim_demo]# ./drxsim control -l=O list
code: 0
result:
  r0
  r1
[root@proxy1 drxsim_demo]# ./drxsim control -l=O -p 9102 list
code: 0
result: empty

add - add resource

add [resource_name] [listen_ip] [listen_port] [peer_ip] [peer_port]

[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=0 -p 9101 add r0 0.0.0.0 9000 127.0.0.1 9001
code: 0
result: ok
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 -p 9102 add r0 0.0.0.0 9001 127.0.0.1 9000
{"code": 0, "result": "ok"}

del - del resource

del [resource_name]

[root@proxy1 drxsim_demo]# ./drxsim control -l=O del r0
code: 0
result: ok
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 del r0
{"code": -3000, "error": "There is no resource 'r0'.", "result": "failed"}

send - Data transmission

send [resource_name] [packet_type or filename] [total_length] [duration] [bps_limit]

option list:

  • packet_type or filename: Packet type or filename. Available packet types are the same as Standalone mode.
    • z / zero-fill
    • s / sequencial
    • r / random
  • total_length: The length of the data to be transmitted.
  • duration: Transmission duration. 0 is unlimited, and if the specified data length is reached within the time, the transmission is terminated.
  • bps_limit: Transfer rate limit. 0 is unlimited.
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 -p 9101 send r0 data.db 1G 0 100M
{"code": 0, "result": "ok"}

stop - Stop sending data

stop [resource_name]

[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 -p 9101 stop r0
{"code": 0, "result": "ok"}

states - Resource status output

states [resource_name or all]

Outputs the status of the active resource. If you enter 'all', all resource information is displayed.

Output items:

  • rx_bps, tx_bps, rx_bps_to_human, tx_bps_to_human: Transmission speed.
  • state: Status of the resource
    • connecting: Attempting to connect
    • connected
  • testing: True if the packet is being sent, false if not
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=0 -p 9101 states r0
code: 0
result:
  rx_bps: 0
  rx_bps_to_human: 0.00 bps
  state: connected
  testing: true
  tx_bps: 12501528
  tx_bps_to_human: 100.01 Mbps
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 -p 9102 states r0
{"code": 0, "result": {"rx_bps": 12501528, "rx_bps_to_human": "100.01 Mbps", "state": "connected", "testing": false, "tx_bps": 0, "tx_bps_to_human": "0.00 bps"}}
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=0 -p 9101 states all
code: 0
result:
  r0:
    rx_bps: 0
    rx_bps_to_human: 0.00 bps
    state: connected
    testing: false
    tx_bps: 0
    tx_bps_to_human: 0.00 bps
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 -p 9102 states all
{"code": 0, "result": {"r0": {"rx_bps": 0, "rx_bps_to_human": "0.00 bps", "state": "connected", "testing": false, "tx_bps": 0, "tx_bps_to_human": "0.00 bps"}}}

quit - End

Exit drxsim, the standby mode. On success, there is no extra output.

[root@proxy1 drxsim_demo]# ./drxsim control -l=O quit
[root@proxy1 drxsim_demo]# ./drxsim control -l=O --json=1 quit
{"code": -6000, "error": "Communication error: No connection could be made because the target machine actively refused it", "result": "failed"}