aboutsummaryrefslogtreecommitdiffstats
path: root/GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py
diff options
context:
space:
mode:
Diffstat (limited to 'GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py')
-rw-r--r--GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py b/GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py
index a010fe1613..c2a004bc52 100644
--- a/GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py
+++ b/GPL/traffic_profiles/trex/trex-astf-ethip4udp-1024h.py
@@ -53,6 +53,9 @@ class TrafficProfile(TrafficProfileBaseClass):
# Headers length
self.headers_size = 42 # 14B l2 + 20B ipv4 + 8B udp
+ # Required UDP keepalive value for T-Rex
+ self.udp_keepalive = 2000 # 2s (2,000 msec)
+
def define_profile(self):
"""Define profile to be used by advanced stateful traffic generator.
@@ -67,12 +70,22 @@ class TrafficProfile(TrafficProfileBaseClass):
# client commands
prog_c = ASTFProgram(stream=False)
- prog_c.send_msg(self.udp_req) # size and fill not supported in v2.73
+ # set the keepalive timer for UDP flows to not close udp session
+ # immediately after packet exchange
+ prog_c.set_keepalive_msg(self.udp_keepalive)
+ # send REQ message
+ prog_c.send_msg(self.udp_req)
+ # receive RES message
prog_c.recv_msg(1)
# server commands
prog_s = ASTFProgram(stream=False)
+ # set the keepalive timer for UDP flows to not close udp session
+ # immediately after packet exchange
+ prog_c.set_keepalive_msg(self.udp_keepalive)
+ # receive REQ message
prog_s.recv_msg(1)
+ # send RES message
prog_s.send_msg(self.udp_res)
# ip generators