-std::string Launcher::help() const throw() {
- std::string result = "\n";
- result += "\n ------------- HELP -------------\n";
- result += "\n";
- result += "\nOVERVIEW";
- result += "\n--------";
- result += "\n";
- result += "\nThe ADL (ANNA Diameter Launcher) process is a complete diameter agent with client and server";
- result += "\n capabilities as well as balancer (proxy) features. It could be used as diameter server";
- result += "\n (i.e. to simulate PCRF nodes, OCS systems, etc.), as diameter client (GGSNs, DPIs, etc.),";
- result += "\n and balancer systems to provide failover to external round-robin launchers. Also, auxiliary";
- result += "\n encoder/decoder/loader function could be deployed to reinterpret certain external flow and";
- result += "\n send it to another process.";
- result += "\n";
- result += "\nThe ANNA::diameter_comm built-in module provides a great set of characteristics as multiple connections";
- result += "\n on both server and client side, definition for multiple-server entities (and not only two as standard";
- result += "\n establish as minimum), separate statistics analyzer per each resource, automatic CER/CEA and DWR/DWA";
- result += "\n generation, expiration control and many more features.";
- result += "\n";
- result += "\nProcess traces are dump on \"launcher.trace\" and could have any trace level (POSIX levels), usually";
- result += "\n 'debug' or 'warning'. See ANNA documentation for more details.";
- result += "\n";
- result += "\nAs any other ANNA process, context dump could be retrieved sending SIGUSR1 signal:";
- result += "\n kill -10 <pid>";
- result += "\n or";
- result += "\n kill -s SIGUSR1 <pid>";
- result += "\n and then";
- result += "\n vi /var/tmp/anna.context.<pid>";
- result += "\n";
- result += "\nA complete xml report will show all the context information (counters, alarms, statistics,";
- result += "\n handlers, diameter dictionary, etc.), and a powerful log module could dump all the events";
- result += "\n processed and flow information. Statistics could be analized at context dump and optionally";
- result += "\n written to disk as sample files (useful for graphs and spreadsheet reports) with all the";
- result += "\n measurements.";
- result += "\n";
- result += "\nAlso SIGUSR2 is handled for management purposes. We will talk later about this.";
- result += "\n";
- result += "\n";
- result += "\nCOMMAND LINE";
- result += "\n------------";
- result += "\n";
- result += "\nStart the launcher process without arguments in order to see all the startup configuration";
- result += "\n posibilities, many of which could be modified on the air through the management interface";
- result += "\n (we will talk later about this great feature). Some of the more common parameters are:";
- result += "\n";
- result += "\nAs mandatory, the stack definition given through the xml dictionary:";
- result += "\n -dictionary <path to dictionary file>";
- result += "\n";
- result += "\nActing as a diameter server (accepting i.e. 10 connections), you would have:";
- result += "\n -diameterServer localhost:3868 -diameterServerSessions 10 -entityServerSessions 0";
- result += "\n";
- result += "\nActing as a diameter client (launching i.e. 10 connections to each entity server), you would have:";
- result += "\n -entity 192.168.12.11:3868,192.168.12.21:3868 -entityServerSessions 10 -diameterServerSessions 0";
- result += "\n";
- result += "\nIf you act as a proxy or a translation agent, you need to combine both former setups, and probably";
- result += "\n will need to program the answers to be replied through the operations interface. To balance the";
- result += "\n traffic at your client side you shall use '-balance' and '-sessionBasedModelsClientSocketSelection'";
- result += "\n arguments in order to define the balancing behaviour.";
- result += "\n";
- result += "\nThe process builds automatically CER and DWR messages as a client, but you could specify your own";
- result += "\n customized ones using '-cer <xml message file>' and '-dwr <xml message file>'.";
- result += "\nThe process builds automatically CEA and DWA messages as a server, but you could program your own";
- result += "\n customized ones using operations interface.";
- result += "\n";
- result += "\n";
- result += "\nDYNAMIC OPERATIONS";
- result += "\n------------------";
- result += "\n";
- result += "\nADL supports several operations which could be reconized via HTTP interface or SIGUSR2 caugh.";
- result += "\nAn operation is specified by mean a string containing the operation name and needed arguments";
- result += "\n separated by pipes. These are the available commands:";
- result += "\n";
- result += "\n--------------------------------------------------------------------------------------- General purpose";
- result += "\n";
- result += "\nhelp This help. Startup information-level traces also dump this help.";
- result += "\n";
- result += "\n------------------------------------------------------------------------------------ Parsing operations";
- result += "\n";
- result += "\ncode|<source_file>|<target_file> Encodes source file (pathfile) into target file (pathfile).";
- result += "\ndecode|<source_file>|<target_file> Decodes source file (pathfile) into target file (pathfile).";
- result += "\nloadxml|<source_file> Reinterpret xml source file (pathfile).";
- result += "\n";
- result += "\n------------------------------------------------------------------------------------------- Hot changes";
- result += "\n";
- result += "\ndiameterServerSessions|<integer> Updates the maximum number of accepted connections to diameter";
- result += "\n server socket.";
- result += "\ncollect Reset statistics and counters to start a new test stage of";
- result += "\n performance measurement. Context data is written at";
- result += "\n '/var/tmp/anna.context.<pid>' by mean 'kill -10 <pid>'.";
- result += "\nforceCountersRecord Forces dump to file the current counters of the process.";
- result += "\n";
- result += "\n<visibility action>|[<address>:<port>]|[socket id]";
- result += "\n";
- result += "\n Actions: hide, show (update state) and hidden, shown (query state).";
- result += "\n Acts over a client session for messages delivery (except CER/A, DWR/A, DPR/A).";
- result += "\n If missing server (first parameter) all applications sockets will be affected.";
- result += "\n If missing socket (second parameter) for specific server, all its sockets will be affected.";
- result += "\n";
- result += "\n All application client sessions are shown on startup, but standard delivery only use primary";
- result += "\n server ones except if fails. Balance configuration use all the allowed sockets. You could also";
- result += "\n use command line 'sessionBasedModelsClientSocketSelection' to force traffic flow over certain";
- result += "\n client sessions, but for this, hide/show feature seems easier.";
- result += "\n";
- result += "\n--------------------------------------------------------------------------------------- Flow operations";
- result += "\n";
- result += "\nsendxml2e|<source_file> Sends xml source file (pathfile) through configured entity.";
- result += "\nsendxml2c|<source_file> Sends xml source file (pathfile) to client.";
- result += "\nsendxml|<source_file> Same as 'sendxml2e'.";
- result += "\nanswerxml2e|[source_file] Answer xml source file (pathfile) for incoming request with same code from entity.";
- result += "\n The answer is stored in a FIFO queue for a specific message code, then there are";
- result += "\n as many queues as different message codes have been programmed.";
- result += "\nanswerxml2c|[source_file] Answer xml source file (pathfile) for incoming request with same code from client.";
- result += "\n The answer is stored in a FIFO queue for a specific message code, then there are";
- result += "\n as many queues as different message codes have been programmed.";
- result += "\nanswerxml|[source_file] Same as 'answerxml2c'.";
- result += "\nanswerxml(2e/2c) List programmed answers (to entity/client) if no parameter provided.";
- result += "\nanswerxml(2e/2c)|dump Write programmed answers (to entity/client) to file 'programmed_answer.<message code>.<sequence>',";
- result += "\n where 'sequence' is the order of the answer in each FIFO code-queue of programmed answers.";
- result += "\nanswerxml(2e/2c)|clear Clear programmed answers (to entity/client).";
- result += "\nanswerxml(2e/2c)|exhaust Disable the corresponding queue rotation, which is the default behaviour.";
- result += "\nanswerxml(2e/2c)|rotate Enable the corresponding queue rotation, useful in performance tests.";
- result += "\n Rotation consists in add again to the queue, each element retrieved for answering.";
- result += "\n";
- result += "\nSend operations are available using hexadecimal content (hex formatted files) which also allow to test";
- result += "\nspecial scenarios (protocol errors):";
- result += "\n";
- result += "\nsendhex2e|<source_file> Sends hex source file (pathfile) through configured entity.";
- result += "\nsendhex2c|<source_file> Sends hex source file (pathfile) to client.";
- result += "\nsendhex|<source_file> Same as 'sendhex2e'.";
- result += "\n";
- result += "\nAnswer programming in hexadecimal is not really neccessary (you could use send primitives) and also";
- result += "\n is intended to be used with decoded messages in order to replace things like hop by hop, end to end,";
- result += "\n subscriber id, session id, etc. Anyway you could use 'decode' operation and then program the xml created.";
- result += "\n";
- result += "\nIf a request is received, answer map (built with 'answerxml<[2c] or 2e>' operations) will be";
- result += "\n checked to find a corresponding programmed answer to be replied(*). If no ocurrence is found,";
- result += "\n or answer message was received, the message is forwarded to the other side (entity or client),";
- result += "\n or nothing but trace when no peer at that side is configured. Answer to client have sense when";
- result += "\n diameter server socket is configured, answer to entity have sense when entity does.";
- result += "\n";
- result += "\nIn the most complete situation (process with both client and server side) there are internally";
- result += "\n two maps with N FIFO queues, one for each different message code within programmed answers.";
- result += "\nOne map is for answers towards the client, and the other is to react entity requests. Then in";
- result += "\n each one we could program different answers corresponding to different request codes received.";
- result += "\n";
- result += "\n(*) sequence values (hop-by-hop and end-to-end), Session-Id and Subscription-Id avps, are mirrored";
- result += "\n to the peer which sent the request. If user wants to test a specific answer without changing it,";
- result += "\n use sendxml/sendhex operations better than programming.";
- result += "\n";
- result += "\nBalance ('-balance' command line parameter) could be used to forward server socket receptions through";
- result += "\n entity servers by mean a round-robin algorithm. Both diameter server socket and entity targets should";
- result += "\n have been configured, that is to say: launcher acts as client and server. If no balance is used, an";
- result += "\n standard delivery is performed: first primary entity server, secondary when fails, etc.";
- result += "\n";
- result += "\n--------------------------------------------------------------------------- Processing types (log tags)";
- result += "\n";
- result += "\nUsed as log file extensions (when '-splitLog' is provided on command line) and context preffixes on log";
- result += "\n details when unique log file is dumped:";
- result += "\n";
- result += "\n [sent2e/send2eError] Send to entity (success/error)";
- result += "\n [sent2c/send2cError] Send to client (success/error)";
- result += "\n [fwd2e/fwd2eError] Forward to entity a reception from client (success/error)";
- result += "\n [fwd2c/fwd2cError] Forward to client a reception from entity (success/error)";
- result += "\n [recvfc] Reception from client";
- result += "\n [recvfe] Reception from entity";
- result += "\n [req2c-expired] A request sent to client has been expired";
- result += "\n [req2e-expired] A request sent to entity has been expired";
- result += "\n [recvfc-ans-unknown] Reception from client of an unknown answer (probably former [req2c-expired]";
- result += "\n has been logged)";
- result += "\n [recvfe-ans-unknown] Reception from entity of an unknown answer (probably former [req2e-expired]";
- result += "\n has been logged)";
- result += "\n";
- result += "\n-------------------------------------------------------------------------------------------- Load tests";
- result += "\n";
- result += "\nburst|<action>|[parameter] Used for performance testing, we first program diameter requests";
- result += "\n messages in order to launch them from client side to the configured";
- result += "\n diameter entity. We could start the burst with an initial load";
- result += "\n (non-asynchronous sending), after this, a new request will be sent";
- result += "\n per answer received or expired context. There are 10 actions: clear,";
- result += "\n load, start, push, pop, stop, repeat, send, goto and look.";
- result += "\n";
- result += "\n burst|clear Clears all loaded burst messages.";
- result += "\n burst|load|<source_file> Loads the next diameter message into launcher burst.";
- result += "\n burst|start|<initial load> Starts (or restarts if already in progress) the message sending with";
- result += "\n a certain initial load.";
- result += "\n burst|push|<load amount> Sends specific non-aynchronous load.";
- result += "\n burst|pop|<release amount> Skip send burst messages in order to reduce over-the-air requests.";
- result += "\n Popping all OTA requests implies burst stop because no more answer";
- result += "\n will arrive to the process. Burst output file (-burstLog command";
- result += "\n line parameter) shows popped messages with crosses (x). Each cross";
- result += "\n represents one received answer for which no new request is sent.";
- result += "\n burst|stop Stops the burst cycle. You can resume pushing 1 load amount.";
- result += "\n burst|repeat|[[yes]|no] Restarts the burst launch when finish. If initial load or push load";
- result += "\n amount is greater than burst list size, they will be limited when";
- result += "\n the list is processed except when repeat mode is enabled.";
- result += "\n burst|send|<amount> Sends messages from burst list. The main difference with start/push";
- result += "\n operations is that burst won't be awaken. Externally we could control";
- result += "\n sending time (no request will be sent for answers).";
- result += "\n burst|goto|<order> Updates current burst pointer position.";
- result += "\n burst|look|<order> Show programmed burst message for order provided.";
- result += "\n";
- result += "\n";
- result += "\nUSING OPERATIONS INTERFACE";
- result += "\n--------------------------";
- result += "\n";
- result += "\n------------------------------------------------------------------------- Operations via HTTP interface";
- result += "\n";
- result += "\nAll the operations described above can be used through the optional HTTP interface. You only have";
- result += "\n to define the http server at the command line with something like: '-httpServer localhost:9000'.";
- result += "\nTo send the task, we shall build the http request body with the operation string. Some examples";
- result += "\n using curl client could be:";
- result += "\n";
- result += "\n curl -m 1 --data \"diameterServerSessions|4\" localhost:9000";
- result += "\n curl -m 1 --data \"code|ccr.xml\" localhost:9000";
- result += "\n curl -m 1 --data \"decode|ccr.hex\" localhost:9000";
- result += "\n curl -m 1 --data \"sendxml2e|ccr.xml\" localhost:9000";
- result += "\n etc.";
- result += "\n";
- result += "\n------------------------------------------------------------------------- Operations via SIGUSR2 signal";
- result += "\n";
- result += "\nThe alternative using SIGUSR2 signal requires the creation of the task(s) file which will be read at";
- result += "\n signal event:";
- result += "\n echo \"<<operation>\" > "; result += SIGUSR2_TASKS_INPUT_FILENAME;
- result += "\n then";
- result += "\n kill -12 <pid>";
- result += "\n or";
- result += "\n kill -s SIGUSR2 <pid>";
- result += "\n and then see the results:";
- result += "\n cat "; result += SIGUSR2_TASKS_OUTPUT_FILENAME;
- result += "\n";
- result += "\nYou could place more than one line (task) in the input file. Output reports will be appended in that";
- result += "\n case over the output file. Take into account that all the content of the task file will be executed";
- result += "\n sinchronously by the process. If you are planning traffic load, better use the asynchronous http";
- result += "\n interface.";
- result += "\n";
- result += "\n";
- return result;