rtbrick / bngblaster

The BNG Blaster is an open-source network tester for access and routing protocols.
https://rtbrick.github.io/bngblaster/
BSD 3-Clause "New" or "Revised" License
204 stars 34 forks source link

circuit-id and remote-id included in non-relay DHCPv6 request #157

Closed aleheux-tc closed 1 year ago

aleheux-tc commented 1 year ago

Describe the bug

When using the agent-remote-id and agent-circuit-id BNGBlaster inserts these into the regular DHCPv6 SOLICIT requests. RFC8415 seems to require that these two options are only used in RELAY-FORW requests.

JunOS 20.4R3-S5.4 (or possibly earlier) does not accept these requests with the following error message:

Feb 17 12:58:13.459218 [MSTR][NOTE] [default:BNG-Users][RLY][INET6][demux0.3221238073] dhcpv6_packet_handle: Invalid packet, received interface-id 0xad05ce9 remote-id 0xad05d0a in a non relay packet

Version (bngblaster -v):

root@compute01-slot7:/home/spoc# bngblaster/build/bngblaster --version
IO Modes: packet_mmap_raw (default), packet_mmap, raw

(?)

root@compute01-slot7:/home/spoc/bngblaster/code/common/src# git status
On branch dev
Your branch is up to date with 'origin/dev'.

As of Fri 17 Feb 2023 01:04:06 PM UTC

JSON configuration:

{
    "interfaces": {
        "tx-interval": 0.1,
        "rx-interval": 0.1,
        "io-slots": 8192,
    "network": {
        "interface": "ens2f1",
        "address": "10.134.40.30",
        "gateway": "10.134.40.29",
        "address-ipv6": "XXXX:YYYY:6810:1::b",
        "gateway-ipv6": "XXXX:YYYY:6810:1::a"
    },
        "access": [
        {
            "interface": "ens2f0",
            "type": "ipoe",
            "outer-vlan-min": 100,
            "outer-vlan-max": 200,
            "inner-vlan-min": 1100,
            "inner-vlan-max": 3000,
        "stream-group-id": 1
        }
     ]  
    },
    "sessions": {
        "count": 1,
        "session-time": 0,
        "max-outstanding": 800,
        "start-rate": 300,
        "stop-rate": 300
    },
    "access-line": {
    "agent-remote-id": "bngblaster-lab.LAB-A-12345:{session-global}",
        "agent-circuit-id": "bngblaster-lab.LAB-A-12345:{session-global}"
    },
    "dhcp": {
        "enable": true,
        "broadcast": true
    },
    "dhcpv6": {
        "enable": true
    },
    "session-traffic": {
        "autostart": true,
        "ipv4-pps": 1,
        "ipv6-pps": 1,
        "ipv6pd-pps": 1
    },
        "streams": [
        {
            "name": "BestEffort-1",
            "stream-group-id": 1,
            "type": "ipv4",
            "direction": "both",
            "length": 400,
            "pps": 150,
            "threaded": true,
            "thread-group": 1
        },
        {
            "name": "BestEffort-2",
            "stream-group-id": 1,
            "type": "ipv4",
            "direction": "both",
            "length": 400,
            "pps": 150,
            "threaded": true,
            "thread-group": 2
        },
        {
            "name": "BestEffort-3",
            "stream-group-id": 1,
            "type": "ipv6",
            "direction": "both",
            "length": 400,
            "pps": 150,
            "threaded": true,
            "thread-group": 3
        }
    ]
}

Steps to reproduce the behavior:

  1. ...

Expected behavior

I expect the Juniper MX router to accept the DHCPv6 requests sent by BNGBlaster.

Additional context

We use BNGBlaster to run tests on our FTTH platform. In a production environment a client would be connected through an OLT which would relay the client's DHCP request(s) and insert the circuit-id and remote-id.

When we use BNGBlaster the OLT is not in the chain and we use it to emulate the traffic coming from the OLT.

The way to fix this issue is probably by adding a knob to BNGBlaster to have it wrap its requests in a RELAY-FORW.

Jonix71 commented 1 year ago

We also need this feature. Juniper MX when running BNG expects a LDRA header in the DHCP6 packet when setting DHCPv6 option 18 and option 37. Lightweight DHCPv6 Relay Agent explained in https://www.rfc-editor.org/rfc/rfc6221.

GIC-de commented 1 year ago

I will start to work on LDRA support today. Maybe will have first draft by tomorrow.

GIC-de commented 1 year ago

Please check: https://github.com/rtbrick/bngblaster/pull/164

GIC-de commented 1 year ago

Please verify/check with 0.8.17!

Jonix71 commented 1 year ago

LDRA works.