Commit 757b5a04 authored by Léa Thibout's avatar Léa Thibout

Add synchronization on server + add synchronization job for network_packet_loss

parent 5ad5b846
......@@ -51,22 +51,32 @@ def delay_simultaneous(
scenario.add_constant('client_ip', client_ip)
scenario.add_constant('duration', duration)
synchro_ntp = None
wait_finished = []
if max_synchro_off is not None and max_synchro_off > 0.0:
synchro_ntp = synchronization(
synchro_ntp_client = synchronization(
scenario, server_entity,
max_synchro_off,
synchronization_timeout)
synchro_ntp_server = synchronization(
scenario, client_entity,
max_synchro_off,
synchronization_timeout)
wait_finished = []
for function in scenario.openbach_functions:
if isinstance(function, StartJobInstance):
wait_finished.append(function)
srv = ditg_packet_rate(
scenario, client_entity, server_entity,
'$server_ip', '$client_ip', 'UDP', packet_rate=1,
duration='$duration', meter='rttm',
wait_finished=synchro_ntp)
wait_finished=wait_finished)
fping_measure_rtt(
scenario, client_entity, '$server_ip', '$duration',
wait_launched=srv, wait_delay=1,
wait_finished=synchro_ntp)
wait_finished=wait_finished)
return scenario
......@@ -79,18 +89,27 @@ def delay_sequential(
scenario.add_constant('client_ip', client_ip)
scenario.add_constant('duration', duration)
synchro_ntp = None
wait_finished = []
if max_synchro_off is not None and max_synchro_off > 0.0:
synchro_ntp = synchronization(
synchro_ntp_client = synchronization(
scenario, client_entity,
max_synchro_off,
synchronization_timeout)
synchro_ntp_server = synchronization(
scenario, server_entity,
max_synchro_off,
synchronization_timeout)
wait_finished = []
for function in scenario.openbach_functions:
if isinstance(function, StartJobInstance):
wait_finished.append(function)
ditg = ditg_packet_rate(
scenario, client_entity, server_entity,
'$server_ip', '$client_ip', 'UDP', packet_rate=1,
duration='$duration', meter='rttm',
wait_finished=synchro_ntp)
wait_finished=wait_finished)
fping_measure_rtt(
scenario, client_entity, '$server_ip', '$duration',
wait_finished=ditg)
......
......@@ -49,17 +49,27 @@ def jitter(
scenario.add_constant('packets_interval', packets_interval)
synchro_ntp = None
wait_finished = []
if max_synchro_off is not None and max_synchro_off > 0.0:
synchro_ntp = synchronization(
synchro_ntp_client = synchronization(
scenario, client_entity,
max_synchro_off,
synchronization_timeout)
synchro_ntp_server = synchronization(
scenario, server_entity,
max_synchro_off,
synchronization_timeout)
wait_finished = []
for function in scenario.openbach_functions:
if isinstance(function, StartJobInstance):
wait_finished.append(function)
owamp_measure_owd(
scenario, client_entity, server_entity,
'$server_ip', '$count', '$packets_interval',
wait_finished=synchro_ntp)
wait_finished=wait_finished)
return scenario
......
......@@ -51,12 +51,18 @@ def one_way_delay(
scenario.add_constant('server_ip', server_ip)
scenario.add_constant('client_ip', client_ip)
synchro_ntp = None
wait_finished = []
if max_synchro_off is not None and max_synchro_off > 0.0:
synchro_ntp = synchronization(scenario, client_entity, max_synchro_off, synchronization_timeout)
synchro_ntp_client = synchronization(scenario, client_entity, max_synchro_off, synchronization_timeout)
synchro_ntp_server = synchronization(scenario, server_entity, max_synchro_off, synchronization_timeout)
wait_finished = []
for function in scenario.openbach_functions:
if isinstance(function, StartJobInstance):
wait_finished.append(function)
owamp_measure_owd(scenario, client_entity, server_entity, '$server_ip', wait_finished=synchro_ntp)
ditg_packet_rate(scenario, client_entity, server_entity, '$server_ip', '$client_ip', 'UDP', packet_rate=1, wait_finished=synchro_ntp)
owamp_measure_owd(scenario, client_entity, server_entity, '$server_ip', wait_finished=wait_finished)
ditg_packet_rate(scenario, client_entity, server_entity, '$server_ip', '$client_ip', 'UDP', packet_rate=1, wait_finished=wait_finished)
return scenario
......
......@@ -30,6 +30,7 @@ from scenario_builder import Scenario
from scenario_builder.helpers.network.d_itg import ditg_packet_rate
from scenario_builder.helpers.postprocessing.time_series import time_series_on_same_graph
from scenario_builder.helpers.postprocessing.histogram import cdf_on_same_graph
from scenario_builder.helpers.admin.synchronization import synchronization
from scenario_builder.openbach_functions import StartJobInstance, StartScenarioInstance
SCENARIO_NAME = 'network_packet_loss'
......@@ -41,7 +42,8 @@ It can then, optionally, plot the packet loss measurements using time-series and
def packet_loss(
server_entity, client_entity, server_ip, client_ip, duration,
packet_size, packet_rate, scenario_name=SCENARIO_NAME):
packet_size, packet_rate, max_synchro_off=None,
synchronization_timeout=60, scenario_name=SCENARIO_NAME):
scenario = Scenario(scenario_name, SCENARIO_DESCRIPTION)
scenario.add_constant('server_ip', server_ip)
scenario.add_constant('client_ip', client_ip)
......@@ -49,10 +51,28 @@ def packet_loss(
scenario.add_constant('packet_size', packet_size)
scenario.add_constant('packet_rate', packet_rate)
wait_finished = []
if max_synchro_off is not None and max_synchro_off > 0.0:
synchro_ntp_client = synchronization(
scenario, client_entity,
max_synchro_off,
synchronization_timeout)
synchro_ntp_server = synchronization(
scenario, server_entity,
max_synchro_off,
synchronization_timeout)
wait_finished = []
for function in scenario.openbach_functions:
if isinstance(function, StartJobInstance):
wait_finished.append(function)
ditg = ditg_packet_rate(
scenario, client_entity, server_entity,
'$server_ip', '$client_ip', 'UDP', packet_rate='$packet_rate',
packet_size='$packet_size', duration='$duration', meter='owdm')
packet_size='$packet_size', duration='$duration', meter='owdm',
wait_finished=wait_finished)
return scenario
......@@ -60,10 +80,12 @@ def packet_loss(
def build(
server_entity, client_entity, server_ip, client_ip, duration,
packet_size, packet_rate, post_processing_entity=None, scenario_name=SCENARIO_NAME):
packet_size, packet_rate, max_synchro_off=None, synchronization_timeout=60,
post_processing_entity=None, scenario_name=SCENARIO_NAME):
scenario = packet_loss(
server_entity, client_entity, server_ip, client_ip,
duration, packet_size, packet_rate, scenario_name)
duration, packet_size, packet_rate, max_synchro_off,
synchronization_timeout, scenario_name)
if post_processing_entity is not None:
waiting_jobs = []
......
......@@ -50,17 +50,25 @@ def voip(
scenario_name=SCENARIO_NAME):
scenario = Scenario(scenario_name, SCENARIO_DESCRIPTION)
synchro_ntp = None
wait_finished = []
if max_synchro_off is not None and max_synchro_off > 0.0:
synchro_ntp = synchronization(
synchro_ntp_client = synchronization(
scenario, client_entity,
max_synchro_off,
synchronization_timeout)
synchro_ntp_server = synchronization(
scenario, server_entity,
max_synchro_off,
synchronization_timeout)
wait_finished = []
for function in scenario.openbach_functions:
if isinstance(function, StartJobInstance):
wait_finished.append(function)
voip_qoe(
scenario, server_entity, client_entity,
client_ip, server_ip, server_port,
duration, codec, wait_finished=synchro_ntp)
duration, codec, wait_finished=wait_finished)
return scenario
......
......@@ -54,6 +54,13 @@ def main(argv=None):
'--packet-size', default=500, help='Size of the packets (bytes)')
observer.add_scenario_argument(
'--packet-rate', default=10, help='The number of packets to send per second (pps)')
observer.add_scenario_argument(
'--max-synchro-off', type=float,
help='maximal offset difference in milliseconds where we have to do a NTP '
'resynchronization; if omitted, no NTP checks are performed')
observer.add_scenario_argument(
'--synchronization-timeout', type=float, default=60,
help='maximal synchronization duration in seconds')
observer.add_scenario_argument(
'--post-processing-entity', help='The entity where the post-processing will be '
'performed (histogram/time-series jobs must be installed) if defined')
......@@ -68,6 +75,8 @@ def main(argv=None):
args.duration,
args.packet_size,
args.packet_rate,
args.max_synchro_off,
args.synchronization_timeout,
args.post_processing_entity,
scenario_name=args.scenario_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment