Skip to content

Commit

Permalink
update mooncli readme
Browse files Browse the repository at this point in the history
  • Loading branch information
emmericp authored Oct 30, 2017
1 parent 8e166da commit ce693bb
Showing 1 changed file with 28 additions and 19 deletions.
47 changes: 28 additions & 19 deletions interface/README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
# MoonGen Interface
This interface is supposed to be an easier to understand, use and maintain alternative to the Lua-scripts needed to run MoonGen. Instead these scripts are replaced by configuration Files containing flows in a BibTeX-like syntax.
# Simple MoonGen Interface
This interface is supposed to be an easier to understand, use and maintain alternative to the Lua-scripts needed to run MoonGen.
Instead, these scripts are replaced by configuration files containing flows in a BibTeX-like syntax.

## How to use
`./mginterface start load-latency:0:1:rate=1000,timeLimit=10m`
## Getting started - examples
`sudo ./moongen-simple start load-latency:0:1:rate=1000,timeLimit=10m`

Similar to `examples/l3-load-latency.lua` with rate set to 1000 mbit/s but stops automatically after 10 minutes. Will send on port `0` and receive on port `1`. Packet content is defined in `flows/examples.lua`.
Similar to `examples/l3-load-latency.lua` with rate set to 1000 mbit/s, but stops automatically after 10 minutes.
Will send on port `0` and receive on port `1`. Packet content is defined in `flows/examples.lua`.

For quick adjustments the packet content can also be changed from the command-line using:

`./mginterface start load-latency:0:1:rate=1000,timeLimit=10m:udpSrc=4321`
`sudo ./moongen-simple start load-latency:0:1:rate=1000,timeLimit=10m:udpSrc=4321`

More info on options like `rate=1000`, `timeLimit=10m` and similar options can be found
using `./mginterface help options`.
using `./moongen-simple help options`.

### More Examples
- `./mginterface start udp-simple:0:1:rate=1000mbit/s,ratePattern=poisson`
- `./mginterface start qos-foreground:0:1 qos-background:0:1`
- `./mginterface start udp-load:0:1:rate=1gp/s,mode=all,timestamp`
- `./mginterface start "udp-load:0::rate=1000:udpDst=range(100,200)"`
- `./mginterface start "load-latency:0,1:0,1:rate=1000:ip4Dst=ip'192.168.0.1'"`
- `sudo ./moongen-simple start udp-simple:0:1:rate=1000mbit/s,ratePattern=poisson`
- `sudo ./moongen-simple start qos-foreground:0:1 qos-background:0:1`
- `sudo ./moongen-simple start udp-load:0:1:rate=1mp/s,mode=all,timestamp`
- `sudo ./moongen-simple start "udp-load:0::rate=1000:udpDst=range(100,200)"`
- `sudo ./moongen-simple start "load-latency:0,1:0,1:rate=1000:ip4Dst=ip'192.168.0.1'"`

## Commands

### Start
`mginterface start <flow> [<flow>] ...`
`<flow>` -> `<name>:[<tx-ports>]:[<rx-ports>]:[<options>]:[<overwrites>]`
`sudo ./moongen-simple start <flow> [<flow>] ...`
`<flow>` -> `<name>:[<tx-ports>]:[<rx-ports>]:[<options>]:[<overrides>]`

Start all the flows supplied as arguments. All arguments besides the name can be `,`-separated lists. Trailing `:` can be omitted.
Start all the flows supplied as arguments. All arguments besides the name can be `,`-separated lists, e.g., `flow:0,1` sends `flow` on ports 0 and 1. You can pass the same interface multiple times to transmit the same flow from multiple cores.
Trailing `:` can be omitted.

See `./moongen-simple help options` for a list of options.

`overrides` can be used to override fields in the flow definition using the same syntax as in the flow configuration file.

### List
`mginterface list [<entry>] ...`
`./moongen-simple list [<entry>] ...`

Show a tabular view of all flows available in the directories or files passed (default is `flows`). Useful to remember the name of a particular flow or find the file a flow resides in.

### Debug
`mginterface debug <flow>`
`./moongen-simple debug <flow>`

Shows hex-dumps of the packets resulting from a certain flow without sending anything. Can be used to test the results of more complicated flow configurations. Will also adapt to some options and all overwrites passed.

See `start` command for syntax of `<flow>`.

## Help
All commands can be invoked with a `-h` flag to show info on available options. Additionally calling `mginterface help` will list all available help texts that can be read using `mginterface help <topic>`.
All commands can be invoked with a `-h` flag to show info on available options. Additionally calling `./moongen-simple help` will list all available help texts that can be read using `./moongen-simple help <topic>`.

## Configuration
First, all configuration files in a directory (excluding subdirectories) are scanned. The flows can then be started by name. The following Flow is meant as a demonstration of capabilities. Look in `MoonGen/flows` for useful base flows or use `mginterface help configuration` for more information.
First, all configuration files in a directory (excluding subdirectories) are scanned. The flows can then be started by name. The following Flow is meant as a demonstration of capabilities. Look in `MoonGen/flows` for useful base flows or use `./moongen-simple help configuration` for more information.

```lua
Flow{"example", Packet.Udp{
Expand All @@ -63,3 +70,5 @@ Flow{"example", Packet.Udp{
timestamp = true
}
```

The protocol fields rely on libmoon's magic protocol stack which means you'll unfortunately have to dig through the (libmoon protocol definitions)[https://github.com/libmoon/libmoon/tree/master/lua/proto]. Everything that's available as `setXXX` there is available as variable here.

0 comments on commit ce693bb

Please sign in to comment.