Sponge
CS144's user-space TCP library
Static Public Member Functions | List of all members
TCPState Class Reference

Summary of a TCPConnection's internal state. More...

#include <tcp_state.hh>

Static Public Member Functions

static std::string state_summary (const TCPReceiver &receiver)
 Summarize the state of a TCPReceiver in a string. More...
 
static std::string state_summary (const TCPSender &receiver)
 Summarize the state of a TCPSender in a string. More...
 

Detailed Description

Summary of a TCPConnection's internal state.

Most TCP implementations have a global per-connection state machine, as described in the TCP specification. Sponge is a bit different: we have factored the connection into two independent parts (the sender and the receiver). The TCPSender and TCPReceiver maintain their interval state variables independently (e.g. next_seqno, number of bytes in flight, or whether each stream has ended). There is no notion of a discrete state machine or much overarching state outside the sender and receiver. To test that Sponge follows the TCP spec, we use this class to compare the "official" states with Sponge's sender/receiver states and two variables that belong to the overarching TCPConnection object.

Definition at line 23 of file tcp_state.hh.

Member Function Documentation

◆ state_summary() [1/2]

string TCPState::state_summary ( const TCPReceiver receiver)
static

Summarize the state of a TCPReceiver in a string.

Definition at line 5 of file tcp_state.cc.

◆ state_summary() [2/2]

string TCPState::state_summary ( const TCPSender receiver)
static

Summarize the state of a TCPSender in a string.

Definition at line 17 of file tcp_state.cc.


The documentation for this class was generated from the following files: