Skip to content

ESYNet User Manual : Traffic Generator

wangeddie67 edited this page Jun 17, 2019 · 2 revisions

Traffic Generator

ESYNet provides EsynetPacketGenerator to inject packets into the network in two ways. First, ESYNet can inject packets according to traffic profiles. Options select the traffic profile and specifies the packet injection rate. Second, ESYNet can inject packets based on benchmark trace file which is specified by options as well.

Traffic Profile

ESYNet can generate packets according to selected traffic profile if neither option -traffic_injection_disable nor option -input_trace_enable appears. The traffic profile is selected by option -traffic_rule, the traffic packet injection rate is determined by option -traffic_pir, and the size of packets is determined by option -packet_size.

-traffic_rule [Uniform|Transpose1|Transpose2|Bitreversal|Butterfly|Shuffle] -traffic_pir <double> -packet_size <integar>

Traffic profiles specifies certain rules to generate the source and destination address for packets. ESYNet implements six traffic profiles as below.

Profile Note
Uniform Select source id and destination id randomly.
Transpose1 From NI (x,y) to NI (network size - 1 - y, network size - 1 -x).
Transpose2 From NI (x,y) to NI (y,x).
Bitreversal Destination NI id is the bit reversal of source NI id.
Butterfly Destination id is the right loop shift of source id.
Shuffle Get destination id by swaping the LSDB and MSB of source id.

Uniform rules works for all topologies because it does not depends on the geometry transform. Other rules work on 2D mesh and torus topology which one router only connects with one NI. The coordinate of NI in the table is as same as the coordinate of connected router.

The source NI are selected uniformly among the router. The destination address are determined from the source address except Uniform profile. The traffic generated by Uniform profiles covers all possible pathes and the traffic on these paths are also unform. The traffic generated by other profiles only covers a part of possible pathes. For example, the traffic of Transpose1 and Transpose2 only covers the pathes from top-left to bottom-right or from top-right to bottom-left. The traffic profiles except Uniform are used to study the network performance under certain kind of applications.

ESYNet generates packets following a binomial distribution with constant probility. The probaility dominates the number of packet injected per cycle per NI, which is called packet injection rate (PIR). Option -traffic_pir determines the PIR for simulation. ESYNet cannot generate more than one packets for one NI in one cycle. Thus, the value of -traffic_pir ranges from 0.0 to 1.0. If PIR is 0.0 packet/cycle/NI, no packet is injected actually. If PIR is 1.0 packet/cycle/NI, each NI injects one packet every cycle. If option -traffic_pir is higher than 1.0, the actual PIR is 1.0.

Option -packet_size determines the number of flits in one packet. Therefore, the flit injection rate (FIR) of entire network equals to the product of PIR of one NI, the total number of NI, and the size of packet.

EsynetPacketGenerator::generatePacket are called at every cycle to generate packets for each NI. It is called when Network platform handle ROUTER events with pipeline time as 1.0. One uniform distributed random number is generated and compared with PIR. If the random value is lower than PIR, one new packet is generated. Otherwise, no packet is generated.

EsynetPacketGenerator is not a simulation components. Thus, EsynetPacketGenerator::generatePacket returns the list of injected packets rather than injects them into the event queue.

Input Benchmark Trace

EsynetPacketGenerator can generate packets according to benchmark trace if option -input_trace_enable appears.

Benchmark trace file (.bencht or .benchb) records the source NI, destination NI and size of the packets in the order of injecion time. As all the trace in ESYSim, benchmark trace can be in text format (.bencht) as well as binary format (.benchb). EsyDataFileIStream< EsyDataItemBenchmark > can parse the benchmark trace file (See also [Trace file interface]). Each record in benchmark trace has following fields:

Field Type Note
EsyDataItemBenchmark::m_time double Injection time in cycle. The time when packets are injected into NI.
EsyDataItemBenchmark::m_src short Source NI.
EsyDataItemBenchmark::m_dst short Destiniation NI.
EsyDataItemBenchmark::m_size short Packet size in flit.

The benchmark trace file is specified by option -input_trace_file_name. It is not necessary to provide file extension name because input stream adds the file extension name according format. The benchmark trace file is in binary format by default. The file is in text format if option -input_trace_file_text_enable appears. option -input_trace_buffer_size specifies the buffer size for the input stream to reduce the file syscall and the execution time.

-input_trace_enable -input_trace_buffer_size <integar> -input_trace_file_name <file path without extension>

or

-input_trace_enable -input_trace_file_text_enable -input_trace_buffer_size <integar> -input_trace_file_name <file path without extension>

Becnhmark trace file can make sure that each simulation uses exactly same traffic so that the effect of random algorithm can be avoid. Moreover, benchmark trace can record the traffic of real application, e.g. PARSEC benchmarks, so that the simulation can be close to the real situation. Moreover, benchmark trace of real application can have variation in time-domain. For example, the packet injection rate can be higher in some period than other period. Traffic profile cannot perform such variation. At last, benchmark trace can be used generate special traffic for special case. For example, add high traffic stream on specified paths to create deadlock.

Benchmark trace file can be dumpped from a full system simulator, like ESYSim. ESYSim can dump the benchmark trace when real applications run. Also, benchmark trace in text format can be edit by hand to create special traffic.

EsynetPacketGenerator provides the pointer (EsynetPacketGenerator::m_tracein) to input stream EsyDataFileIStream< EsyDataItemBenchmark >. In the function EsynetPacketGenerator::generatePacket, the traffic generator reads records from benchmark trace file and returns the packets which should be injected not later than current simulation cycle.