Skip to content

IperfStateMachine

Bruce A. Mah edited this page Feb 27, 2014 · 2 revisions

Explanation of the Iperf State Machine

Introduction

This document describes the flow of control of Iperf at a very high level.

Client State Machine

TEST_START -> TEST_RUNNING -> TEST_END -> TEST_COMPLETE

TEST_START

  1. open control channel to the server
  2. exchange parameters with the server
  3. create and open test_streams
  4. -> TEST_RUNNING

TEST_RUNNING

  1. generate data on each stream (either n bytes or n seconds)
  2. service the periodic callback
  3. when all data has been sent close stream
  4. when all streams closed -> TEST_END

TEST_END

  1. request results from server
  2. close control channel
  3. -> TEST_COMPLETE

TEST_COMPLETE

  1. all connections closed
  2. structs are kept in tact for reporting and analysis

Server State Machine

TEST_WAIT -> TEST_START -> TEST_RUNNING -> TEST_END -> TEST_WAIT

TEST_WAIT

  1. listen for a control channel connection
  2. -> TEST_START

TEST_START

  1. wait for parameter exchange
  2. -> TEST_RUNNING

TEST_RUNNING

  1. create new streams as the arrive
  2. receive and discard data for each stream
  3. service results requests
  4. when no streams remain -> TEST_END
  5. if no new data after timeout seconds, then close all streams and control channel -> TEST_WAIT

TEST_END

  1. wait for results request or control channel closure
  2. if nothing happens after timeout seconds -> TEST_WAIT
  3. when control channel closed -> TEST_WAIT