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

rx-bps-l2 calculation missing s-vlan and fcs #177

Open SoerenBusse opened 1 year ago

SoerenBusse commented 1 year ago

Describe the bug

When configuring an access-interface with QinQ enabled, I would expect the rx-bps-l2 bandwidth in session statistics to include the S-VLAN as well as the FCS, but it's not included (maybe because it's stripped by the network card?)

I configured a packet-length of 128b with PPPoverL2TP, so that the l2-size on access-interface would be: Ethernet (14) + QinQ (8) + PPP (8) + Payload (128) + FCS (4) = 162b. However, BNG Blaster reports only 154b. The same value as in the capture file.

I know that it's a matter of faith, whether FCS is part of a L2-bandwidth, however other testing solutions sees the FCS as part of the L2 bandwidth: https://support.spirent.com/SC_KnowledgeView?id=FAQ20004

To Reproduce

Version (bngblaster -v):

Version: DEV
Compiler: GNU (11.3.0)
GIT:
  REF: dev
  SHA: 1d3b7ccb5429ff7e976d5e5b4790e2ea0cec225c
IO Modes: packet_mmap_raw (default), packet_mmap, raw, dpdk

JSON configuration:

{
{
  "interfaces": {
    "capture-include-streams": true,
    "tx-interval": 0.1,
    "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",
        "stream-group-id": 1
      }
    ]
  },
  "pppoe": {
    "reconnect": true,
    "discovery-timeout": 3,
    "discovery-retry": 10
  },
  "ppp": {
    "mru": 1492,
    "authentication": {
      "username": "lacgfnw",
      "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
    }
  ],
  "streams": [
    {
      "stream-group-id": 1,
      "name": "Teststream",
      "type": "ipv4",
      "direction": "downstream",
      "pps": 100000,
      "length": 128
    },
    {
      "stream-group-id": 1,
      "name": "Teststream",
      "type": "ipv4",
      "direction": "upstream",
      "pps": 1000,
      "length": 128
    }
  ]
}
}

Screenshots image

GIC-de commented 1 year ago

The stats are based on the length of the packet as received from driver, which might be without offloaded most outer VLAN and FCS. But I could provide a configuration option to adjust the packet stats by N byte per packet if this helps?