NetBurner 3.5.6
PDF Version
TCP Stress Test

TCP Stress Test Application

Overview

This is a NetBurner embedded TCP stress testing application designed to measure various network performance metrics and response times. The application runs a series of sequential tests to evaluate TCP connection handling, data transfer speeds, and select() function performance.

Description

The TCP Stress Test application is designed to work in conjunction with a Windows program to exercise various test cases and measure network performance. It provides comprehensive testing of TCP socket operations including connection establishment, data exchange, and bulk data transfer capabilities.

Features

The application performs five sequential stress tests:

1. Listening Test

  • Listens for incoming TCP connections on port 10000
  • Exchanges single characters with connecting clients
  • Measures the time and number of connections processed
  • Terminates when it receives an 'X' character from a client

2. Connecting Test

  • First accepts one incoming connection to determine the client's IP address
  • Then repeatedly makes outgoing connections back to that client
  • Exchanges single characters with each connection
  • Measures connection establishment performance
  • Terminates when it receives an 'X' character

3. Response Test

  • Tests worst-case TCP performance by sending one byte at a time
  • Listens for incoming bytes and echoes them back immediately
  • Measures response time for single-byte exchanges
  • Demonstrates TCP overhead for minimal data transfers

4. Select Response Test

  • Tests the select() function performance for monitoring multiple file descriptors
  • Uses select() to wait for data availability before reading
  • Measures the response time of the select() system call
  • Includes error handling for select() failures

5. Bulk Speed Test

  • Tests maximum data transfer throughput
  • Sends large buffers (TCP_BUFFER_SEGMENTS * 1460 bytes per write)
  • Uses socket options for optimized bulk transfer (SO_NOPUSH)
  • Measures total bytes transferred until connection closes

Configuration

  • Listen Port: 10000 (default)
  • Buffer Size: 20,000 bytes for bulk data test
  • Time Resolution: 20 ticks per second (TICKS_PER_SECOND)
  • Stack Size: USER_TASK_STK_SIZE for the test task
  • Priority: MAIN_PRIO - 1 for the test task

Technical Details

Key Components

  • TestTask: Main task that runs all five tests sequentially in a loop
  • UserMain: Initialization function that sets up networking and creates the test task
  • DataBuffer: 20KB aligned buffer used for bulk data transfers
  • Socket Options: Uses SO_NOPUSH and custom ACK buffer settings for optimization

Network Requirements

  • Active network connection required
  • Compatible with NetBurner hardware platforms
  • Requires a Windows client program (not included in NetBurner project)
  • Uses standard TCP/IP sockets

Timing and Measurements

All timing measurements are reported in "ticks" where the default resolution is 20 ticks per second. The application measures:

  • Connection establishment time
  • Single-byte response time
  • Select() function response time
  • Bulk data transfer rates
  • Total connections processed

Usage

  1. Compile and deploy to NetBurner hardware
  2. Ensure network connectivity is established
  3. Run the corresponding Windows client program
  4. The application will automatically cycle through all five tests
  5. Press any key during execution to display network counters
  6. Monitor serial output for test results and timing information

Project Structure

tcp-stress-test/
main.cpp # Main application source code
ReadMe.txt # Original documentation
pc/ # Windows client program (exclude from NetBurner build)
Warning
Do not include the pc folder in your NetBurner project build as it contains Windows-specific client code.

Output Format

Each test provides timing results in the following format: Output Format Each test provides timing results in the following format:

"Accepted X times in Y ticks" (Listening Test) "Connected X times in Y ticks" (Connecting Test) "Responded X times in Y ticks" (Response Test) "Select Responded X times in Y ticks" (Select Response Test) "Nsent = X" (Bulk Speed Test)