Skip to content

Commit

Permalink
Merge pull request #14 from rtbrick/dev
Browse files Browse the repository at this point in the history
Dev > Master - L2TP, LI and more ...
  • Loading branch information
GIC-de authored Feb 26, 2021
2 parents f6fce68 + f18783a commit 99a537f
Show file tree
Hide file tree
Showing 34 changed files with 4,758 additions and 317 deletions.
10 changes: 7 additions & 3 deletions cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import socket
import os
import json
import ast

def usage():
print("""
Expand All @@ -14,6 +15,8 @@ def usage():
{c} run.sock session-info outer-vlan 1 inner-vlan 1
{c} run.sock igmp-join outer-vlan 1 inner-vlan 1 group 239.0.0.1 source1 1.1.1.1 source2 2.2.2.2 source3 3.3.3.3
{c} run.sock igmp-info outer-vlan 1 inner-vlan 1
{c} run.sock l2tp-csurq tunnel-id 1 sessions [1,2]
""".format(c=sys.argv[0]))
sys.exit(1)

Expand All @@ -33,11 +36,12 @@ def main():
if(len(sys.argv)) > 4:
request["arguments"] = {}
for i in range(3, len(sys.argv), 2):
arg = sys.argv[i+1]
try:
request["arguments"][sys.argv[i]] = int(sys.argv[i+1])
request["arguments"][sys.argv[i]] = int(arg)
except:
request["arguments"][sys.argv[i]] = sys.argv[i+1]

request["arguments"][sys.argv[i]] = ast.literal_eval(arg)
#print(json.dumps(request).encode('utf-8'))
if os.path.exists(socket_path):
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
Expand Down
4 changes: 3 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
- [Reports](reports.md)
- [Traffic](traffic.md)
- [Control Socket](ctrl.md)
- [Multicast](multicast.md)
- [Multicast](multicast.md)
- [L2TPv2](l2tp.md)
- [Legal Interception](li.md)
54 changes: 54 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ Attribute | Description | Default
`reconnect` | Automatically reconnect sessions if terminated | false
`discovery-timeout` | PPPoE discovery (PADI and PADR) timeout in seconds | 5
`discovery-retry` | PPPoE discovery (PADI and PADR) max retry | 10
`service-name` | PPPoE discovery service name |
`host-uniq` | PPPoE discovery host-uniq | false

## PPP

Expand Down Expand Up @@ -442,3 +444,55 @@ Attribute | Description | Default
`ipv4-pps` | Generate bidirectional IPv4 traffic between network interface and all session framed IPv4 addresses | 0 (disabled)
`ipv6-pps` | Generate bidirectional IPv6 traffic between network interface and all session framed IPv6 addresses | 0 (disabled)
`ipv6pd-pps` | Generate bidirectional Ipv6 traffic between network interface and all session delegated IPv6 addresses | 0 (disabled)

## l2TP Server

This section describes all attributes of the `l2tp-server` (LNS) hierarchy.

The BNG Blaster supports multiple L2TPv2 servers (LNS) over the network interface
as shown in the example below.

```json
{
"interfaces": {
"network": {
"interface": "eth2",
"address": "10.0.0.1",
"gateway": "10.0.0.2"
}
},
"l2tp-server": [
{
"name": "LNS1",
"address": "10.0.0.10",
"secret": "test1",
},
{
"name": "LNS2",
"address": "10.0.0.11",
"secret": "test2",
},
]
}
```

There is actually no hard limit in the amount of L2TP servers.

Attribute | Description | Default
--------- | ----------- | -------
`name` | Mandatory L2TP LNS server hostname (AVP 7) |
`address` | Mandatory L2TP server address |
`secret` | Tunnel secret |
`receive-window-size` | Control messages receive window size | 4
`max-retry` | Control messages max retry | 30
`congestion-mode` | Control messages congestion mode | default
`data-control-priority` | Set the priority bit in the L2TP header for all non-IP data packets (LCP, IPCP, ...) | false
`data-length` | Set length bit for all data packets | false
`data-offset` | Set offset bit with offset zero for all data packets | false

The BNG Blaster supports different congestion modes for the
reliable delivery of control messages. The `default` mode
is described in RFC2661 appendix A (Control Channel Slow Start and
Congestion Avoidance). The mode `slow` uses a fixed control window
size of 1 where `aggressive` sticks to max permitted based on peer
received window size.
32 changes: 32 additions & 0 deletions docs/ctrl.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Attribute | Description
`session-traffic-disabled` | Disable session traffic for all sessions
`multicast-traffic-start` | Start sending multicast traffic from network interface
`multicast-traffic-stop` | Stop sending multicast traffic from network interface
`li-flows` | List all LI flows with detailed statistics

### Session Commands

Expand Down Expand Up @@ -147,3 +148,34 @@ Attribute | Description | Mandatory Arguments | Optional Arguments
`igmp-join` | Join group | `group` | `source1`, `source2`, `source3`
`igmp-leave` | Leave group | `group` |
`igmp-info` | IGMP information | |

### L2TP Commands

Attribute | Description | Mandatory Arguments | Optional Arguments
--------- | ----------- | ------------------- | ------------------
`l2tp-tunnels` | L2TP tunnel information | |
`l2tp-sessions` | L2TP session information | | `tunnel-id`, `session-id`
`l2tp-csurq`| Send L2TP CSURQ | `tunnel-id` | `sessions`

The L2TP CSURQ command expects the local tunnel-id and a list of remote
session-id for which a connect speed update is requested.

`$ cat command.json | jq .`
```json
{
"command": "l2tp-csurq",
"arguments": {
"tunnel-id": 1,
"sessions": [
1,
2,
3,
4
]
}
}
```

This command can be executed as shown below using the CLI tool.

`$ sudo ./cli.py run.sock l2tp-csurq tunnel-id 1 sessions [1,2,3,4]`
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
- [Traffic](traffic)
- [Control Socket](ctrl)
- [Multicast](multicast)
- [L2TPv2](li)
- [Legal Interception](li)

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

Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Usage: bngblaster [OPTIONS]
-h --help
-C --config <args>
-l --logging error|igmp|io|lcp|ncp|normal|pcap|timer|timer-detail|ip
-l --logging error|igmp|io|pppoe|normal|pcap|timer|timer-detail|ip
-L --log-file <args>
-u --username <args>
-p --password <args>
Expand Down
Loading

0 comments on commit 99a537f

Please sign in to comment.