Layer-3 endpoints can manipulate their own transmission parameters using a variety of internal scripts, known as Endpoint Scripts. Using the lf_endp_script.pl CLI script, you can operate those internal endpoints behaviours. |
This cookbook talks about Endpoint Scripts and CLI scripts at the same time. In this chapter, if the term script is used, assume Endpoint Script. Additionally, the terms operating and running can also be confusing. To keep the activities distinct, a LANforge user will operate a CLI script from a terminal. The LANforge server will run the Endpoint Script. A CLI script is a user-space perl script that issues CLI commands to a LANforge server. A CLI command is an instruction obeyed by the LANforge server.
There are a number of subsystems running while we operate an automated Endpoint Script, so let's review them:
We recommend starting your first script off by the LANforge GUI to save an endpoint with an Endpoint Script. Next, inspect the LANforge database on the server for the script parameters. Take those parameters and adapt them to the operator's CLI script.
set_script tutorial-cx-A bunny-script 37120 ScriptHunt '5000 5000 100000,20000,100000,20,56000,30000,1,100000, 60,128,256,512,1024,1280,1460,1472,1514 1472 0,100,300,500,550,600,650,700,750,850,900,950 NONE' ALL 20
C:\> .\lf_endp_script.pl --mgr jedtest --resource 1 ^ --action set_script --script_type Hunt --script_name bunny-script ^ --endp_name tutorial-CX-A -loops 1 --flags 37120 ^ --private "5000 5000 100000,20000,100000,20,56000,30000,1,100000, 60,128,256,512,1024,1280,1460,1472,1514 1472 0,100,300,500,550,600,650,700,750,850,900,950 NONE"
In a Linux terminal, we can use double
$ ./lf_endp_script.pl --mgr jedtest --resource 1 \ --action set_script --script_type Hunt --script_name bunny-script \ --endp_name tutorial-CX-A -loops 1 --flags 37120 \ --private '5000 5000 100000,20000,100000,20,56000,30000,1,100000, 60,128,256,512,1024,1280,1460,1472,1514 1472 0,100,300,500,550,600,650,700,750,850,900,950 NONE'
lf_endp_script --mgr jedtest --resource 1 --action start_cx --cx_name tutorial-CX
lf_endp_script --mgr jedtest --resource 1 --action quiesce_cx --cx_name tutorial-CX
We could also use action stop_cx to immediately stop the connection.
lf_endp_script.pl --action show_report --endp_name tutorial-CX-A --quiet no
Or to save it to a text file:
lf_endp_script.pl --action show_report --endp_name tutorial-CX-A --quiet no > /home/lanforge/Documents/report.txt
lf_endp_script.pl --action remove_script --endp_name tutorial-CX-A
We have covered creating endpoints in earlier cookbooks. The perl script lf_endp_script.pl was created to modify endpoints and operate their Endpoint Scripts. That script is using the set_script CLI command (documented here). A call to it looks like:
set_script tutorial-cx-A bunny-script 37120 ScriptHunt '...' ALL 20
That vague '...' section is the private parameter which is a parameter list each script type requires. The private parameter combines a series of constraints (sub-parameters). For the ScriptHunt, we might use:
run_duration pause_duration constraints payload_sizes_a payload_sizes_b attenuations attenuator 5000 | | | | | | 5000 | | | | | 100000,20000,100000,20,56000,30000,1,100000 | | | | | 60,128,256,512,1024,1280,1460,1472,1514 | | | | 1472 | | | 0,100,300,500,550,600,650,700,750,850,900,950 | v 1.1.14 drops,jitter_us,latency_us,max_steps,start_rate,accuracy,is_bps,max_tx_slowdown
Accuracy is also Threshold, max_tx_slowdown is also Underrun. The result is a very long line that has to be surrounded the the CLI level by one pair of single quotes:
'5000 5000 100000,20000,100000,20,56000,30000,1,100000, 60,128,256,512,1024,1280,1460,1472,1514 1472 0,100,300,500,550,600,650,700,750,850,900,950 NONE'