0

markdown I'm trying to run HTTP emulation experiments using NEST (Network Emulation and Simulation Testbed) but encountering parser errors with httperf output due to regex pattern mismatches.

Problem

When running the HTTP point-to-point example, I get AttributeError: 'NoneType' object has no attribute 'group' at line 155 in the httperf parser. The regex pattern for min_connection_time is not matching the httperf output.

Environment

  • OS: Ubuntu 22.04 in Docker container
  • NEST Version: Latest (from repository)
  • httperf Version: httperf-0.9.0 compiled without DEBUG without TIME_SYSCALLS
  • Python: 3.10.12

Error Details

The error occurs in /usr/local/lib/python3.10/dist-packages/nest/experiment/parser/httperf.py at line 155:

output_pattern[
    "min_connection_time"
] = r"Connection time \[ms\]: min (?P<minConnectionTime>\d+.\d*)"
output_value["min_connection_time"] = re.search(
    output_pattern["min_connection_time"], raw_stats_out
).group("minConnectionTime")  # Line 155 - fails here
NEST Parser Code Details
The complete httperf parser uses extensive regex patterns. Here are the key connection time patterns:

python
# From lines 147-175 in httperf.py
output_pattern["min_connection_time"] = r"Connection time \[ms\]: min (?P<minConnectionTime>\d+.\d*)"
output_value["min_connection_time"] = re.search(
    output_pattern["min_connection_time"], raw_stats_out
).group("minConnectionTime")

output_pattern["avg_connection_time"] = r"Connection time \[ms\]: min \d+.\d* avg (?P<avgConnectionTime>\d+.\d*)"
output_value["avg_connection_time"] = re.search(
    output_pattern["avg_connection_time"], raw_stats_out
).group("avgConnectionTime")

output_pattern["max_connection_time"] = r"Connection time \[ms\]: min \d+.\d* avg \d+.\d* max (?P<maxConnectionTime>\d+.\d*)"
output_value["max_connection_time"] = re.search(
    output_pattern["max_connection_time"], raw_stats_out
).group("maxConnectionTime")
My HTTP Example Code
I'm running http-point-to-point-3.py from NEST examples:

python
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2019-2025 NITK Surathkal

"""
This example shows how two nodes can be connected in a point to point fashion
and how an HTTP flow can be set up between them.
"""

import time

from nest import config
from nest.topology import Node, connect
from nest.topology.network import Network
from nest.topology.address_helper import AddressHelper
from nest.clean import cleanup

from nest.experiment import Experiment
from nest.experiment.flow import Flow

# pylint: disable=too-many-locals
def main():
    """
    This example demonstrates point to point connectivity with HTTP flows.

    Two nodes: `n1` and `n2` are created. They are connected by a wired link.
    An HTTP flow is set up between them.

    The following statistics are collected for the flow at the receiver:
    - Throughput (in Kbps)
    """

    # Create two nodes
    n1 = Node("n1")
    n2 = Node("n2")

    # Connect the two nodes using a wired link
    (n1_n2, n2_n1) = connect(n1, n2, "n1-n2")

    # Assign IPv4 addresses to the interfaces
    AddressHelper.assign_addresses()

    # Set the attributes of the link between n1 and n2
    n1_n2.set_attributes("100mbit", "5ms")  # 100 Mbps, 5ms delay
    n2_n1.set_attributes("100mbit", "5ms")  # 100 Mbps, 5ms delay

    # Create an experiment
    experiment = Experiment("HTTP Point to Point 3")

    # Create an HTTP flow from n1 to n2 on port 8082
    flow = Flow(n1, n2, n2_n1.get_address(), 0, 8082, 100)

    # Add the flow to the experiment
    experiment.add_http_flow(flow)

    # Run the experiment
    experiment.run()

if __name__ == "__main__":
    main()

when I tried to change the various parameters I get the following error
 Running experiment HTTP Point to Point 3 

Experiment Progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████| 20/20 [00:20<00:00,  1.00s/it]

[INFO] : Cleaning up all the spawned child processes...
[INFO] : Parsing statistics...
Process Process-15:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nest/experiment/parser/httperf.py", line 155, in parse
    ).group("minConnectionTime")
AttributeError: 'NoneType' object has no attribute 'group'
Process Process-16:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nest/experiment/parser/httperf.py", line 155, in parse
    ).group("minConnectionTime")
AttributeError: 'NoneType' object has no attribute 'group'
Process Process-17:
Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/nest/experiment/parser/httperf.py", line 155, in parse
    ).group("minConnectionTime")
AttributeError: 'NoneType' object has no attribute 'group'
[INFO] : Parsing statistics complete!
[INFO] : Output results as JSON dump...
[INFO] : Plotting results...
[INFO] : Plotting complete!
[INFO] : Experiment HTTP Point to Point 3 complete!
[INFO] : Cleaned up environment!
I have been given to choice:
1)Make change to the code so that it is compatible with all the tools in the nest project.
2)Try to adapt the code to the latest/recent version of httperf as that is the issue

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.