+def create_streams_v46(base_pkt_a, base_pkt_b, vm1, vm2, frame_size):
+ """Create STLStream streams
+
+ :param base_pkt_a: Base packet a for stream_a
+ :param base_pkt_b: Base packet b for stream_b
+ :param vm1: vm for stream_a
+ :param vm2: vm for stream_b
+ :param frame_size: frame size or name of traffic profile
+ :type base_pkt_a: Eth (scapy)
+ :type base_pkt_b: Eth (scapy)
+ :type vm1: STLScVmRaw
+ :type vm2: STLScVmRaw
+ :frame_size: int or string
+ :return: stream_a, stream_b, stream_a_latency, stream_b_latency
+ :rtype: STLStream, STLStream, STLStream, STLStream
+ """
+
+ if type(frame_size) is int:
+
+ fsize_no_fcs = frame_size - 4 # no FCS
+ pkt_a = STLPktBuilder(pkt=base_pkt_a/generate_payload(
+ max(0, fsize_no_fcs-len(base_pkt_a))), vm=vm1)
+ pkt_b = STLPktBuilder(pkt=base_pkt_b/generate_payload(
+ max(0, fsize_no_fcs-len(base_pkt_b))), vm=vm2)
+ pkt_lat_a = STLPktBuilder(pkt=base_pkt_a/generate_payload(
+ max(0, fsize_no_fcs-len(base_pkt_a))))
+ pkt_lat_b = STLPktBuilder(pkt=base_pkt_b/generate_payload(
+ max(0, fsize_no_fcs-len(base_pkt_b))))
+ lat_stream1 = STLStream(packet=pkt_lat_a,
+ flow_stats=STLFlowLatencyStats(pg_id=0),
+ mode=STLTXCont(pps=1000))
+ # second traffic stream with a phase of 10ns (inter stream gap)
+ lat_stream2 = STLStream(packet=pkt_lat_b,
+ isg=10.0,
+ flow_stats=STLFlowLatencyStats(pg_id=1),
+ mode=STLTXCont(pps=1000))
+
+ stream1 = STLStream(packet=pkt_a,
+ mode=STLTXCont(pps=1000))
+ # second traffic stream with a phase of 10ns (inter stream gap)
+ stream2 = STLStream(packet=pkt_b,
+ isg=10.0,
+ mode=STLTXCont(pps=1000))
+ elif type(frame_size) is str:
+ lat_stream1 = []
+ lat_stream2 = []
+ stream1 = []
+ stream2 = []
+
+ for x in stream_table[frame_size]:
+ fsize_no_fcs = x['size'] - 4 # no FCS
+ pkt_a = STLPktBuilder(pkt=base_pkt_a/generate_payload(
+ max(0, fsize_no_fcs-len(base_pkt_a))), vm=vm1)
+ pkt_b = STLPktBuilder(pkt=base_pkt_b/generate_payload(
+ max(0, fsize_no_fcs-len(base_pkt_b))), vm=vm2)
+
+ stream1.append(STLStream(packet=pkt_a,
+ isg=x['isg'],
+ mode=STLTXCont(pps=x['pps'])))
+ stream2.append(STLStream(packet=pkt_b,
+ isg=x['isg'],
+ mode=STLTXCont(pps=x['pps'])))