• 沒有找到結果。

Chapter 4 On-The-Fly Capture and Replay Mechanisms (OFCR)

4.3 OFCR Replay Mode

Figure 6 is the components in the OFCR replay mode. The four major components in this mode: check module, capture module, replay module and reduction module. The check module does the same job as it is in the live mode, it is used to determine the effectiveness of the defect trace replay. The capture module extracts the defect trace Tr from buffer module in the live mode. The replay module forwards packet ri,j to different ports Di in order to transmit to the proper ports Ui in the DUT, where ri,j is last j-th packet (connection) to the DUT port Ui

in Tr. The reduction module downsizes the defect-triggering trace Tr to derive the minimum trace Tmin. According to the type of the defect, the reduction module uses different reduce approaches.

Figure 6: OFCR replay mode.

Capture Module

The capture module extracts the defect trace from the buffered trace T. The defect trace Tr has the same capture size cr = c, lr = l. The packet (connection) count to DUT port Ui ucri

may not be equal to uci because the DUT ports for replay can be different from the live mode when processing multi-port replay. The maximum packet length l may produce incomplete packets during capturing, so the capture module needs to recalculate the checksum of each packet in Tr to derive packet ri,j.

Replay Module

The replay module replays Tr to trigger defects. To reconstruct similar scenario as the DUT in the live mode, we replay each packet in Tr to the original DUT port as the live mode, ucri = cri for i = 1…N. It splits Tr into the Intranet side and Internet side, and then replays Tr

from ports R1 and R2 depending on which side the packet (connection) belongs. To forward packets ri,j to the corresponding port Di, the OF switch splits incoming packets by source IP addresses. The relations between source IP addresses and ports also need to be defined in a pre-defined configuration file. Figure 7 is the example of the replay module. There are two dorms in the live mode, so the OF switch splits the packets from R1 to D1 and D2 by their subnets.

Figure 7: Example of replay module.

Reduction Module

The reduction module identifies defect-triggering traces by hybrid defect reduction. It assumes the defect is overload defect and protocol defect, and then applies the overload defect reduction and the protocol defect reduction respectively. As illustrated in the left part of Figure 8, the hybrid defect reduction processes two reductions sequentially and derives two reduced trace To and Tp. The reduced traces To and Tp are generated by the overload defect reduction and protocol defect reduction. We can determine Tmin by comparing the traces To, Tp

and the original defect trace Tr.

Figure 8: Reduction module procedure.

There are two situations to derive the minimum trace Tmin. (1) If To = Tr and Tp = Tr, it means that Tr is not a defect-triggering trace or Tr is the minimum defect-triggering trace with no redundant packets. So we set Tmin as Tr. (2) Otherwise, we keep both reduced traces Tmin = To ∪ Tp. Because two reduced trace To and Tp may be different in packet (connection) count and max packet length, we preserve both traces to maintain more information for debugging.

In the right part of Figure 8 is the procedure of the overload defect reduction and the protocol defect reduction. Because the overload defects are usually caused by too many packets and the number of defect-triggering packets is unclear, when we process the reduction of packets, the results will be quite different each time. Therefore, to minimize the size of reduced trace, the overload defect reduction removes redundant payloads first, and then concentrates on reducing packet count. In contract, protocol defects are caused by a single or a few packets. To save processing time of replay in reduction, the protocol defect reduction downsizes the number of packets first and then finds critical parts of payloads.

Figure 9 is the flowchart of packet reduction and payload reduction with binary search.

The input trace of the reduction is Tin, the trace Tin is the subset of Tr and has two properties cini and lin. cini presents packet (connection) count through DUT port Ui and lin means the max packet length. The output trace of the reduction is Tout. Similarly, Tout has couti and lout. These two reductions have cut units cut or p respectively, and they have thresholds tc and tp

respectively to stop the reduction. When the cut unit meets the threshold, the reduction stops and generates Tout. Packet reduction removes redundant packets before/after the defect-triggering part. We use headi and taili to present the indexes of the first and the last packet (connection) to port i in the reduced trace Tin, the packet with index between headi and taili will keep in Tout. The left part of packet reduction in the figure deals with the packet reduction before the defect-triggering part, and the right part handles the reduction after the defect-triggering part. When the layer of devices is larger than 3, the cut unit cut changes to connection. The packet reduction will cut entire connection during reduction because incomplete connection cannot reproduce the connection state. The procedure of payload reduction is simpler than the one of packet reduction, because it only reduces the max packet length of the reduced trace Tin.

Figure 9: Packet reduction and payload reduction.

相關文件