Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
GIC-de committed May 10, 2021
2 parents 851ab14 + dbd7c94 commit 73ec2ba
Show file tree
Hide file tree
Showing 37 changed files with 1,908 additions and 390 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ Mkfile.old
dkms.conf

# Build Files
build/
build/

# SonarQube
.scannerwork
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

![Build](https://github.com/rtbrick/bngblaster/workflows/Build/badge.svg?branch=main)

The BNG Blaster is a test tool to simulate thousands of PPPoE or IPoE subscribers including IPTV,
L2TPv2, traffic verification and convergence testing capabilities.
The BNG Blaster is a test tool to simulate more than hundred thousand PPPoE and IPoE
subscribers including IPTV, L2TPv2, QoS, forwarding verification and convergence
testing capabilities.

A short introduction can be found on [YouTube](https://youtu.be/EHJ70p0_Sw0 "BNG Blaster")
or checkout the [documentation](https://rtbrick.github.io/bngblaster/) for details.
Expand Down
33 changes: 17 additions & 16 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ Attribute | Description | Default
`interface` | Access interface name (e.g. eth0, ...)
`type` | Switch the access type between `pppoe` (PPP over Ethernet) and `ipoe` (IP over Ethernet) | pppoe
`vlan-mode` | Set VLAN mode `1:1` or `N:1` | 1:1
`outer-vlan-min` |Outer VLAN minimum value | 0 (untagged)
`outer-vlan-min` | Outer VLAN minimum value | 0 (untagged)
`outer-vlan-max` | Outer VLAN maximum value | 0 (untagged)
`outer-vlan` |Set outer-vlan-min/max equally
`inner-vlan-min` | Inner VLAN minimum value | 0 (untagged)
`inner-vlan-max` |Inner VLAN maximum value | 0 (untagged)
`inner-vlan-max` | Inner VLAN maximum value | 0 (untagged)
`inner-vlan` |Set inner-vlan-min/max equally
`third-vlan` | Add a fixed third VLAN (most inner VLAN) as required for some lab environments | 0 (untagged)
`address` | Static IPv4 base address (IPoE only)
`address-iter` |Static IPv4 base address iterator (IPoE only)
`gateway` |Static IPv4 gateway address (IPoE only)
`gateway` |Static IPv4 gateway address iterator (IPoE only)
`address-iter` | Static IPv4 base address iterator (IPoE only)
`gateway` | Static IPv4 gateway address (IPoE only)
`gateway-iter` | Static IPv4 gateway address iterator (IPoE only)
`username` | Optionally overwrite the username from authentication section per access configuration
`password` | Optionally overwrite the password from authentication section per access configuration
`authentication-protocol` | Optionally overwrite the username from authentication section per access configuration
Expand Down Expand Up @@ -413,6 +415,7 @@ Attribute | Description | Default
`conf-request-retry` | LCP configuration request max retry | 10
`keepalive-interval` | LCP echo request interval in seconds (0 means disabled) | 30
`keepalive-retry` | PPP LCP echo request max retry | 3
`start-delay` | PPP LCP initial request delay in milliseconds | 0

### PPP IPCP

Expand Down Expand Up @@ -455,9 +458,11 @@ This section describes all attributes of the `dhcp` hierarchy.

Attribute | Description | Default
--------- | ----------- | -------
`enable` | This option allows to enable or disable DHCP | true

**WARNING**: DHCP (IPv4) is currently not supported!
`enable` | This option allows to enable or disable DHCP | false
`broadcast` | DHCP broadcast flag | false
`timeout` | DHCP timeout in seconds | 5
`tos` | IPv4 TOS for all DHCP control traffic | 0
`vlan-priority` | VLAN PBIT for all DHCP control traffic | 0

## DHCPv6

Expand Down Expand Up @@ -573,25 +578,21 @@ as explained in [Traffic Streams](streams).
Attribute | Description | Default
--------- | ----------- | -------
`name` | Mandatory stream name |
`stream-group-id` | Mandatory stream group identifier |
`stream-group-id` | Stream group identifier | 0 (raw)
`type` | Mandatory stream type (`ipv4`, `ipv6` or `ipv6pd`) |
`direction` | Mandatory stream direction (`upstream`, `downstream` or `both`) | `both`
`priority` | IPv4 TOS / IPv6 TC | 0
`vlan-priority` | VLAN priority | 0
`length` | Layer 3 (IP + payload) traffic length (76 - 1500) | 128
`pps` | Stream traffic rate in packets per second | 1
`bps` | Stream traffic rate in bits per second (layer 3) |
`network-ipv4-address` | Overwrite network interface IPv4 address |
`network-ipv4-address` | Overwrite network interface IPv4 address |
`network-ipv6-address` | Overwrite network interface IPv6 address |
`destination-ipv4-address` | Overwrite the IPv4 destination address |
`destination-ipv6-address` | Overwrite the IPv6 destination address |
`threaded` | Run those streams in separate threads | false

For L2TP downstream traffic the IPv4 TOS is applied to the outer IPv4 and inner IPv4 header.

The `pps` option has priority over `bps` where second is only a helper to calculate the `pps`
based on given `bps` and `length`.

With threading enabled, those streams will be started in a dedicated thread per flow. This
means one thread per session and stream direction. A threaded , bidirectional stream assigned
to 10 sessions will therefore run in 20 threads.

**WARNING**: The threading support is experimental and should be used with caution!
8 changes: 5 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
- [Installation](install)
- [Configuration](config)
- [Reports](reports)
- [Traffic](traffic)
- [Control Socket](ctrl)
- [Multicast](multicast)
- [PPPoE](pppoe)
- [L2TPv2](l2tp)
- [Legal Interception](li)
- [IPoE](ipoe)
- [Traffic](traffic)
- [Traffic Streams](streams)
- [Multicast](multicast)
- [Legal Interception](li)

A short introduction can be found on [YouTube](https://youtu.be/EHJ70p0_Sw0 "BNG Blaster").

Expand Down
17 changes: 16 additions & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ make all
There are also CPack files generated which allows to easily generate a debian
package by just executing `cpack` from build directory.

It is also recommended to provide the GIT commit details to be included in the
manually build version as shown below:
```
cmake -DGIT_REF=`git rev-parse --abbrev-ref HEAD` -DGIT_SHA=`git rev-parse HEAD` ..
```

*Example:*
```
$ bngblaster -v
GIT:
REF: dev
SHA: df453a5ee9dbf6440aefbfb9630fa0f06e326d44
IO Modes: packet_mmap_raw (default), packet_mmap, raw
```

### Install

Then BNG Blaster can be installed using make install target.
Expand All @@ -68,7 +83,7 @@ sudo apt install libcmocka-dev

The option `BNGBLASTER_TESTS` enables to build unit tests.
```
cmake -DBNGBLASTER_TESTS=ON .
cmake -DCMAKE_BUILD_TYPE=Debug -DBNGBLASTER_TESTS=ON .
make all
make test
```
Expand Down
6 changes: 3 additions & 3 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Therefore we decided to build our own BNG test solution which is completely buil
targeted for max scaling with small resource footprint, simple to use and easy to integrate in
our test automation infrastructure.

The BNG Blaster is able to simulate more than hundred thousand PPPoE subscribers including IPTV,
L2TPv2, QoS, forwarding verification and convergence testing capabilities.
The BNG Blaster is able to simulate more than hundred thousand PPPoE and IPoE subscribers including
IPTV, L2TPv2, QoS, forwarding verification and convergence testing capabilities.

* *High Scaling:* > 100K sessions
* *Low CPU and Memory Footprint:* < 100MB memory for 16K sessions
Expand Down Expand Up @@ -38,7 +38,7 @@ Usage: bngblaster [OPTIONS]
-v --version
-h --help
-C --config <args>
-l --logging debug|error|igmp|io|pppoe|normal|pcap|timer|timer-detail|ip|loss|l2tp
-l --logging debug|error|igmp|io|pppoe|normal|pcap|timer|timer-detail|ip|loss|l2tp|dhcp
-L --log-file <args>
-u --username <args>
-p --password <args>
Expand Down
95 changes: 95 additions & 0 deletions docs/ipoe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# IPoE

The BNG Blaster is able to emulate IP over Ethernet (IPoE)
subscribers with static and dynamic address assignment
supporting 1:1 and N:1 VLAN mode.

**INFO**: Currently there is only IPv4 support for IPoE.

## Static Addresses

Static addresses means that the IP address and gateway is assigned
statically as shown in the example below.

```json
{
"interfaces": {
"access": [
{
"interface": "eth1",
"type": "ipoe",
"vlan-mode": "1:1",
"outer-vlan-min": 128,
"outer-vlan-max": 4000,
"address": "200.0.0.1",
"address-iter": "0.0.0.4",
"gateway": "200.0.0.2",
"gateway-iter": "0.0.0.4",
}
]
}
}
```

## DHCP

The most common case for IPoE is using DHCP as shown below.

```json
{
"interfaces": {
"access": [
{
"interface": "eth1",
"type": "ipoe",
"outer-vlan": 7,
"vlan-mode": "N:1"
}
]
},
"dhcp": {
"enable": true,
},
"access-line": {
"agent-remote-id": "DEU.RTBRICK.{session-global}",
"agent-circuit-id": "0.0.0.0/0.0.0.0 eth 0:{session-global}"
}
}
```

`$ sudo ./cli.py run.sock session-info session-id 1`
```json
{
"status": "ok",
"code": 200,
"session-information": {
"type": "ipoe",
"session-id": 1,
"session-state": "Established",
"interface": "veth2",
"outer-vlan": 0,
"inner-vlan": 0,
"mac": "02:00:00:00:00:01",
"agent-circuit-id": "0.0.0.0/0.0.0.0 eth 0:1",
"agent-remote-id": "DEU.RTBRICK.1",
"ipv4-address": "100.0.0.100",
"ipv4-netmask": "255.255.255.0",
"ipv4-gateway": "100.0.0.1",
"dhcp-state": "Bound",
"dhcp-server": "100.0.0.1",
"dhcp-lease-time": 60,
"dhcp-lease-expire": 59,
"dhcp-lease-expire-t1": 29,
"dhcp-lease-expire-t2": 51,
"dhcp-tx-discover": 1,
"dhcp-tx-request": 2,
"dhcp-tx-release": 0,
"dhcp-rx-offer": 1,
"dhcp-rx-ack": 2,
"dhcp-rx-nak": 0,
"tx-packets": 8,
"rx-packets": 11,
"rx-fragmented-packets": 0
}
}
```
5 changes: 5 additions & 0 deletions docs/pppoe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# PPPoE

Emulating PPP over Ethernet (PPPoE) sessions was the main
use case of the BNG Blaster supporting 1:1 and N:1 VLAN
mode.
38 changes: 38 additions & 0 deletions docs/streams.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,44 @@ Each flow can be queried separately using jsonpath expression with name and dire
}
```

## RAW Streams

Streams with default `stream-group-id` set to zero are considered as raw streams not
bound to any session which is supported in downstream only. For those streams the
destination address must be explicitly set.

```json
{
"streams": [
{
"name": "RAW",
"type": "ipv4",
"direction": "downstream",
"priority": 128,
"network-ipv4-address": "10.0.0.20",
"destination-ipv4-address": "1.1.1.1",
"length": 256,
"pps": 1
}
]
}
```

If `destination-ipv4-address` is set to a multicast IP address (224.0.0.0 - 239.255.255.255),
the BNG Blaster will set the the destination MAC address to the corresponding
multicast MAC address.

## Threaded Streams

**WARNING**: The threading support is experimental and should be used with caution!

With threading enabled, those streams will be started in a dedicated thread per flow. This
means one thread per session and stream direction. A threaded , bidirectional stream assigned
to 10 sessions will therefore run in 20 threads.

In most environments we see that 200.000 PPS single threaded is working. Depending on actual setup this
can be also more. With threaded streams we are also able to scale up to three million PPS or more.

## Start/Stop Session Stream Information

Session stream traffic can be started/stopped dynamically
Expand Down
Loading

0 comments on commit 73ec2ba

Please sign in to comment.