def _create_single_stream(self, packet_size, pps, isg=0): packet = self._create_single_packet(packet_size) if self.pg_id: self.pg_id += 1 stl_flow = STLFlowLatencyStats(pg_id=self.pg_id) stream = STLStream(isg=isg, packet=packet, mode=STLTXCont(pps=pps), flow_stats=stl_flow) else: stream = STLStream(isg=isg, packet=packet, mode=STLTXCont(pps=pps)) return stream
def create_single_stream(self, packet_size, pps, isg=0): packet = self._create_single_packet(packet_size) if pps: stl_mode = STLTXCont(pps=pps) else: stl_mode = STLTXCont(pps=self.pps) if self.pg_id: LOGGING.debug("pg_id: %s", self.pg_id) stl_flow_stats = STLFlowLatencyStats(pg_id=self.pg_id) stream = STLStream(isg=isg, packet=packet, mode=stl_mode, flow_stats=stl_flow_stats) self.pg_id += 1 else: stream = STLStream(isg=isg, packet=packet, mode=stl_mode) return stream
def _create_stream(self, src_ip, dst_ip): base_frame = \ Pkt.Ether() / Pkt.IP(src=src_ip, dst=dst_ip) / Pkt.UDP(dport=12, sport=1025) frame_size = self.params["traffic_profile"]["frame_size"] pad_size = max(0, frame_size - len(base_frame)) frame = base_frame / ("x" * max(0, pad_size)) frame_rate = self.params["traffic_profile"]["frame_rate"] return STLStream(packet=STLPktBuilder(pkt=frame), mode=STLTXCont(pps=frame_rate))
def create_stream(self): return STLStream(packet=STLPktBuilder( pkt=Ether() / IP(src="16.0.0.1", dst="48.0.0.1") / UDP(dport=12, sport=1025) / (10 * 'x')), mode=STLTXCont())