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
202 stars 34 forks source link

Missing PPP-Max-Payload-Tag in PADI and PADR according to RFC4638 #155

Closed SoerenBusse closed 1 year ago

SoerenBusse commented 1 year ago

Describe the bug

BNG Blaster supports to change the PPP MRU to a higher value than 1492. According to RFC4638, the client has to send the PPP-Max-Payload-Tag in PADR to notify the peer that a higher MRU is supported. However, when setting an MRU of 1500 in BNG-Blaster, the PADR don't contain a PPP-Max-Payload-Tag in PADR, but afterward tries to negotiate a higher MRU during LCP handshake, which is not allowed when not sending the PPP-Max-Payload-Tag before.

PPP-PADI PPP-PADR

As reference, a PADI Request from a FritzBox 5530 with the latest labor firmware, which supports RFC4638:

PPP-FritzBox

To Reproduce

Version (bngblaster -v):

Version: DEV
Compiler: GNU (11.3.0)
GIT:
  REF: release-0.8.13
  SHA: 2c5bf6857d7be26fe071883c8d1686b1f4d91c29
IO Modes: packet_mmap_raw (default), packet_mmap, raw, dpdk

JSON configuration:

{
  "interfaces": {
    "network": {
      "interface": "enp1s0f1np1",
      "address": "10.189.214.2",
      "gateway": "10.189.214.1"
    },
    "access": [
      {
        "interface": "enp1s0f0np0",
        "outer-vlan-min": 109,
        "outer-vlan-max": 109,
        "inner-vlan-min": 7,
        "inner-vlan-max": 7,
        "qinq": true,
        "authentication-protocol": "CHAP"
      }
    ]
  },
  "pppoe": {
    "reconnect": true,
    "discovery-timeout": 3,
    "discovery-retry": 10
  },
  "ppp": {
    "mru": 1500,
    "authentication": {
      "username": "lac",
      "password": "password",
      "timeout": 1,
      "retry": 60
    },
    "lcp": {
      "conf-request-timeout": 5,
      "conf-request-retry": 30,
      "keepalive-interval": 30,
      "keepalive-retry": 3
    },
    "ipcp": {
      "enable": true
    },
    "ip6cp": {
      "enable": true
    }
  },
  "l2tp-server": [
    {
      "name": "LNS1",
      "address": "10.189.214.2",
      "secret": "bngblaster",
      "receive-window-size": 8
    }
  ],
  "session-traffic": {
    "autostart": true,
    "ipv4-pps": 1
  }
}

Steps to reproduce the behavior:

  1. Run BNG-Blaster using the above configuration

Expected behavior

Set PPP-Max-Payload-Tag to 1500 as the Fritz!Box does

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

GIC-de commented 1 year ago

I will add a dedicated option to enable max-payload-tag. The reason is simple, would like to be able to test how a BNG behaves if a client behaves wrong by sending MRU > 1492 without max-payload-tag.

SoerenBusse commented 1 year ago

Hey there, thanks for the implementation. I'll try it.

Just by looking at the commit. Shouldn't it be sent in the PADR, too?

So currently PPP-Max-Payload is only supported when using a PPP-Server, which is not BNG-Blaster, right? Because I don't see code for the PADS and PADO send by the PPP server, when using BNGBlaster with an A10-NSP.

GIC-de commented 1 year ago

The PPP-Max-Payload tag will be included in PADI and PADR and is accepting any values between 1 and 65535, so it can be also used to test PPPoE servers for robustness. The A10NSP lightweight PPPoE server does not support the PPP-Max-Payload tag. 

GIC-de commented 1 year ago

I just pushed one more commit, so should work now (d3b2b4b619ce7c877202dd43c881547d24c76d6c).

GIC-de commented 1 year ago

Please verify with latest version 0.8.15 and close.

SoerenBusse commented 1 year ago

Max-Payload-Tag works correctly. Compared it to a Fritzbox and it's now identical. Thank you very much for the great work!