- self.udp_req += self._gen_padding(self.headers_size + len(self.udp_req))
- self.udp_res += self._gen_padding(self.headers_size + len(self.udp_res))
+ # IPs used in packet headers.
+ p1_src_start_ip = u"192.168.0.0"
+ p1_src_end_ip = u"192.168.3.255"
+ p1_dst_start_ip = u"20.0.0.0"
+ p1_dst_end_ip = u"20.0.3.255"
+
+ # Headers length
+ headers_size = 46 # 18B L2 + 20B IPv4 + 8B UDP.
+
+ # UDP messages, not padded yet.
+ udp_req = u"GET"
+ udp_res = u"ACK"
+
+ # Padd to the required frame size.
+ udp_req += self._gen_padding(headers_size + len(udp_req))
+ udp_res += self._gen_padding(headers_size + len(udp_res))
+
+ # No need to set keepalive, both programs end just after start&send.