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
216 stars 35 forks source link

BNGBlaster counts rx-packets when disabling qdisc-bypass #206

Open SoerenBusse opened 1 year ago

SoerenBusse commented 1 year ago

Describe the bug

When configuring qdisc-bypass: false and a downstream-only stream, BNG-Blaster shows rx-packets on the network-interface, although no rx-packets are received: image

This wrongly counted rx-packets are included in the report, too:

Interface: veth1.1
------------------------------------------------------------------------------
  TX:                     66034 packets         18876671 bytes
  TX Polled:                  0
  RX:                     66086 packets         18881052 bytes
  RX Protocol Error:          0 packets
  RX Unknown:                 0 packets
  RX Polled:                945

A10NSP Interface: veth1.1
  TX:                     66034 packets         18549487 bytes
  RX:                     66086 packets         18881052 bytes
  TX Stream:              66021 packets
  RX Stream:                 33 packets                0 loss
  Session-Traffic:
    TX IPv4:                 33 packets
    RX IPv4:                 33 packets                0 loss
    TX IPv6:                  0 packets
    RX IPv6:                  0 packets                0 loss
    TX IPv6PD:                0 packets
    RX IPv6PD:                0 packets                0 loss

Interface: veth1.2
------------------------------------------------------------------------------
  TX:                        54 packets             4655 bytes
  TX Polled:                  0
  RX:                     66087 packets         18617162 bytes
  RX Protocol Error:          0 packets
  RX Unknown:                 0 packets
  RX Polled:                945

Access Interface: veth1.2
  TX:                        54 packets             4655 bytes
  RX:                     66087 packets         18617162 bytes
  RX Multicast:               0 packets                0 loss
  TX Stream:                 33 packets
  RX Stream:              66021 packets                0 loss
  Session-Traffic:
    TX IPv4:                 33 packets
    RX IPv4:                 33 packets                0 loss
    TX IPv6:                  0 packets
    RX IPv6:                  0 packets                0 loss
    TX IPv6PD:                0 packets
    RX IPv6PD:                0 packets                0 loss

When setting qdisc-bypass: true the rx-packets are not counted: image

To Reproduce Use the PPPoE Quick-Start guide and disable qdisc-bypass.

Version (bngblaster -v):

Version: DEV
Compiler: GNU (11.4.0)
GIT:
  REF: HEAD (0.8.23)
  SHA: 2aba470164a8b779579f10c329e7a9790cb9f454
IO Modes: packet_mmap_raw (default), packet_mmap, raw, dpdk

JSON configuration:

{
    "interfaces": {
        "qdisc-bypass": false,
        "a10nsp": [
            {
                "__comment__": "PPPoE Server",
                "interface": "veth1.1"
            }
        ],
        "access": [
            {
                "__comment__": "PPPoE Client",
                "interface": "veth1.2",
                "type": "pppoe",
                "outer-vlan-min": 1,
                "outer-vlan-max": 4000,
                "inner-vlan": 7,
                "stream-group-id": 1
            }
        ]
    },
    "pppoe": {
        "reconnect": true
    },
    "dhcpv6": {
        "enable": false
    },
    "session-traffic": {
        "ipv4-pps": 1
    },
    "streams": [
        {
            "stream-group-id": 1,
            "name": "S1",
            "type": "ipv4",
            "direction": "downstream",
            "priority": 128,
            "length": 256,
            "pps": 2000,
            "a10nsp-interface": "veth1.1"
        }
    ]
}

Steps to reproduce the behavior:

  1. Configure qdisc-bypass: false
  2. Run BNG Blaster and observe rx-packets

Additional context

We want to bypass qdisc in egress to apply tc netem rules for simulating network issues like packet loss, latency etc.

SoerenBusse commented 2 months ago

Hi @GIC-de, the issue still exists on 0.9.7. Do you have any idea, what is the reason for it?