API: Hiding the complexity

Introduction

In the previous (  📄 Timing and automation ) section, we explain the different timestamps for TCP and HTTP in ByteBlower. In this section, we explain the best way to use this with the ByteBlower API.

Raw data

The T1, T2, and T3 values can be retrieved from the HTTP.SessionInfo object. This real-time status object should always be refreshed first. It then takes a snapshot from the ByteBlower server and makes sure you get the latest timestamp values. The API calls are:

  • T1.Get
  • T2.Get
  • T3.Get
Intuitive wrappers

Because the meaning of the server values T1, T2, and T3 are different in different situations, using them is error-prone. To hide this complexity, the ByteBlower API offers more intuitive wrapper methods around these values. The wrappers are:

  • Time.Request.Start.Get
  • Time.Request.Packet.First.Get
  • Time.Request.Packet.Last.Get
  • Time.Response.Start.Get
  • Time.Response.Packet.First.Get
  • Time.Response.Packet.First.Get
  • Time.Data.Packet.First.Get
  • Time.Data.Packet.Last.Get

Both the availability of the result and the result value of these calls still depend on the situation (GET or PUT, client or server). Their values are explained in the tables below:

HTTP Get Client Server
Time.Request.Start.GetT1 (A)N/A
Time.Request.Packet.First.GetN/AT1 (D)
Time.Request.Packet.Last.GetN/AN/A
Time.Response.Start.GetN/AT1 (D)
Time.Response.Packet.First.GetT2 (B)T2 (D')
Time.Response.Packet.Last.GetT3 (C)T3 (E)
Time.Data.Packet.First.GetT2 (B)T2 (D')
Time.Data.Packet.Last.GetT3 (C)T3 (E)

HTTP PUT Client Server
Time.Request.Start.GetT1 (A)N/A
Time.Request.Packet.First.GetN/AT1 (D)
Time.Request.Packet.Last.GetT2 (B)T2 (E)
Time.Response.Start.GetN/AT3 (E')
Time.Response.Packet.First.GetT3 (C)N/A
Time.Response.Packet.First.GetN/AN/A
Time.Data.Packet.First.GetT1 (A)T1 (D)
Time.Data.Packet.Last.GetT2 (B)T2 (
Average Throughput

The most common use case for the timestamps and events is calculating the average throughput. 

Luckily there is an average throughput API call:

  • AverageThroughput.Get

This value is calculated using the first and last data packet timestamps, or in other words:


Method

Client

Server

HTTP Get

AverageThroughput.Get

RXbytes / (T3 - T2)

TXbytes / (T3 - T2)

HTTP PUT

AverageThroughput.Get

TXbytes / (T2 - T1)

RXbytes / (T2 - T1)


Next: 📄 GUI: TCP flow direction, duration and throughput