# Network Measurement and Performance Analysis at Server Side
## 3 Measurement Methodology
### Performance Analysis  
Based on the metrics inferred in above subsections, EVA analyzes the performance problems of TCP flows. Since the network conditions and state of sender and receiver can change over time, an analysis granularity is needed to track these changes. Existing work [7] adopts two kinds of approaches: fixed number of packets (e.g., 256 packets) or fixed time interval (e.g., 15 s). However, today's network conditions have changed dramatically from a dozen years ago: NICs evolved from Mbps to Gbps and network latency can vary from less than one millisecond to hundreds of milliseconds. As a result, fixed granularity cannot adapt to such variations any more. Instead, EVA diagnoses performance problems per acknowledgment flight, as shown in Figure 1. In the following, we first show our method of grouping packets into flights, and then analyze performance bottlenecks for each flight. The latter is summarized in Table 1.  
Flight size is the amount of data that have been sent but not yet acknowledged. It changes dynamically and is affected by many factors:  
* When slow start limited, flight size increases exponentially. * When application limited, flight size is the amount of data the application is willing to send. * When receive window limited, flight size is bounded by receive window. * When send buffer limited, flight size is bounded by send buffer size. * Otherwise, flight size is determined by network and congestion control. Since flight size is used to diagnose several TCP limiting factors, it must be measured continuously. Algorithm 2 shows EVA's approach: It keeps track of data sequence from server and acknowledgment sequence from client, and then finds the boundary of each flight. The algorithm not only groups data sent, but also acknowledgments received. ```
Input:TCP flow F
1 last_ack_seq \(\gets\) 0
2 flight_start_seq \(\leftarrow\) 0
3 whileF.has_more_ack()do
4 ACK \(\leftarrow\) F.capture_new_ack()
5 ifACK_ack_seq \(>\) last_ack_seq then
6 last_ack_seq \(\leftarrow\) ACK_ack_seq
7
8 end if
9 iflast_ack_seq \(>\) flight_start_seq then
10 flight_size \(\leftarrow\) F.next_data_seq \(-\) flight_start_seq
11 flight_start_seq \(\leftarrow\) F.next_data_seq
12F.end_old_flight(flight_size)
13F.start_new_flight()
14
15 end if
16
17 end while
```  
**Algorithm 2**Group packets into flights. **Slow start limited. ** During slow start, the sender explores the bottleneck capacity exponentially, doubling the sending rate each round trip. To recognize this pattern, we test whether consecutive flight size fits the exponential relationship. If it is satisfied, this flight is considered slow start limited, otherwise the flow is considered to have left slow start. For a TCP flow that starts from the middle, we  
Figure 1: Group packets into flights. assume that its first flight is in a slow start stage, and, if not, it will quit on the next flight (exponential relationship is not satisfied). **Receive window limited. ** A TCP flow is considered receive window limited if the window clamps a flight size. Specifically, for each flight \(f\), we calculate:  
\[space=\min_{ack\in f}ack\_seq+ack\_win-curr\_data\_seq \tag{3}\]  
If \(space\leq 3\cdot MSS\), the flight is considered receive window limited. For a TCP flow that has just started from the middle, we may get the wrong result since window scale option has not converged yet. It is worth noting that the delivery rate collected by this flight will not be used to update BtlBw  
**Congestion limited. ** We use the following three conditions to determine congestion limited:  
* Packet retransmissions are seen in current flight. * At least one RTT sample is larger than \(1.5\cdot RTprop\). * The flight is not slow start limited or receive window limited. **Send buffer limited. ** The send buffer in network stack can clamp the flight size if it is too small. A flight is considered send buffer limited if all three of the following conditions are met:  
* The flight size \(F<0.8\cdot BtlBw\cdot RTprop\).