diff options
Diffstat (limited to 'rumba/prototypes/irati_templates.py')
-rw-r--r-- | rumba/prototypes/irati_templates.py | 188 |
1 files changed, 124 insertions, 64 deletions
diff --git a/rumba/prototypes/irati_templates.py b/rumba/prototypes/irati_templates.py index 877ac21..d5beea5 100644 --- a/rumba/prototypes/irati_templates.py +++ b/rumba/prototypes/irati_templates.py @@ -62,6 +62,129 @@ da_map_base = { } +def generate_qos_cube( + name, + cube_id, + initial_credit=200, + ordered=False, + delay=None, + loss=None, + reliable=False, + data_rxms_nmax=5, + initial_rtx_time=1000 +): + cube = { + "name": name, + "id": cube_id, + "partialDelivery": False, + "orderedDelivery": ordered, + "efcpPolicies": { + "dtpPolicySet": { + "name": "default", + "version": "0" + }, + "initialATimer": 0, + "dtcpPresent": True, + "dtcpConfiguration": { + "dtcpPolicySet": { + "name": "default", + "version": "0" + }, + "rtxControl": False, + "flowControl": True, + "flowControlConfig": { + "rateBased": False, + "windowBased": True, + "windowBasedConfig": { + "maxClosedWindowQueueLength": 10, + "initialCredit": initial_credit + } + } + } + } + } + if delay is not None: + cube["delay"] = delay + if loss is not None: + cube["loss"] = loss + if reliable: + cube["maxAllowableGap"] = 0 + cube["efcpPolicies"]["dtcpConfiguration"]["rtxControl"] = True + cube["efcpPolicies"]["dtcpConfiguration"]["rtxControlConfig"] = { + "dataRxmsNmax": data_rxms_nmax, + "initialRtxTime": initial_rtx_time + } + return cube + + +qos_cube_u_base = { + "name": "unreliablewithflowcontrol", + "id": 1, + "partialDelivery": False, + "orderedDelivery": True, + "efcpPolicies": { + "dtpPolicySet": { + "name": "default", + "version": "0" + }, + "initialATimer": 0, + "dtcpPresent": True, + "dtcpConfiguration": { + "dtcpPolicySet": { + "name": "default", + "version": "0" + }, + "rtxControl": False, + "flowControl": True, + "flowControlConfig": { + "rateBased": False, + "windowBased": True, + "windowBasedConfig": { + "maxClosedWindowQueueLength": 10, + "initialCredit": 200 + } + } + } + } +} + +qos_cube_r_base = { + "name": "reliablewithflowcontrol", + "id": 2, + "partialDelivery": False, + "orderedDelivery": True, + "maxAllowableGap": 0, + "efcpPolicies": { + "dtpPolicySet": { + "name": "default", + "version": "0" + }, + "initialATimer": 0, + "dtcpPresent": True, + "dtcpConfiguration": { + "dtcpPolicySet": { + "name": "default", + "version": "0" + }, + "rtxControl": True, + "rtxControlConfig": { + "dataRxmsNmax": 5, + "initialRtxTime": 1000 + }, + "flowControl": True, + "flowControlConfig": { + "rateBased": False, + "windowBased": True, + "windowBasedConfig": { + "maxClosedWindowQueueLength": 10, + "initialCredit": 200 + } + } + } + } +} + + # Template for a normal DIF configuration file normal_dif_base = { "difType": "normal-ipc", @@ -80,70 +203,7 @@ normal_dif_base = { }, "qosCubes": [ - { - "name": "unreliablewithflowcontrol", - "id": 1, - "partialDelivery": False, - "orderedDelivery": True, - "efcpPolicies": { - "dtpPolicySet": { - "name": "default", - "version": "0" - }, - "initialATimer": 0, - "dtcpPresent": True, - "dtcpConfiguration": { - "dtcpPolicySet": { - "name": "default", - "version": "0" - }, - "rtxControl": False, - "flowControl": True, - "flowControlConfig": { - "rateBased": False, - "windowBased": True, - "windowBasedConfig": { - "maxClosedWindowQueueLength": 10, - "initialCredit": 200 - } - } - } - } - }, { - "name": "reliablewithflowcontrol", - "id": 2, - "partialDelivery": False, - "orderedDelivery": True, - "maxAllowableGap": 0, - "efcpPolicies": { - "dtpPolicySet": { - "name": "default", - "version": "0" - }, - "initialATimer": 0, - "dtcpPresent": True, - "dtcpConfiguration": { - "dtcpPolicySet": { - "name": "default", - "version": "0" - }, - "rtxControl": True, - "rtxControlConfig": { - "dataRxmsNmax": 5, - "initialRtxTime": 1000 - }, - "flowControl": True, - "flowControlConfig": { - "rateBased": False, - "windowBased": True, - "windowBasedConfig": { - "maxClosedWindowQueueLength": 10, - "initialCredit": 200 - } - } - } - } - } + qos_cube_u_base, qos_cube_r_base ], "knownIPCProcessAddresses": [], |