spFlow module

class panco.staticpriorities.spFlow.SpFlow(arrival_curve: List[TokenBucket], path: List[int], max_length: float, sp_class: int)

Bases: object

Class describing a Static priority flow

Parameters:
  • arrival_curve – arrival curve of the flow

  • path – path (sequence of TSN switches) of the flow

  • max_length – maximum packet length of the flow

  • sp_class – priority class of the flow

panco.staticpriorities.spFlow.aggregate_sp_flows(list_flows: List[SpFlow], num_servers: int) Tuple[List[List[Flow]], ndarray]

From a list of priority flows and number of servers, computes the list of flows per priority classe, and the maximum packet size for each class and each priority link.

Parameters:
  • list_flows – list of priority flows

  • num_servers – total number of servers

Returns:

the list of flows per class, and the maximum packet length

>>> flow1 = SpFlow([TokenBucket(1, 2)], [0, 1], 1024, 0)
>>> flow2 = SpFlow([TokenBucket(2, 1)], [1, 2], 508, 1)
>>> flow3 = SpFlow([TokenBucket(1, 3)], [0, 1, 2], 1024, 0)
>>> aggregate_sp_flows([flow1, flow2, flow3], 3)
([[<Flow: α(t) = min [1 + 2t]; π = [0, 1]>
, <Flow: α(t) = min [1 + 3t]; π = [0, 1, 2]>
], [<Flow: α(t) = min [2 + 1t]; π = [1, 2]>
]], array([[1024.,    0.],
       [1024.,  508.],
       [1024.,  508.]]))
panco.staticpriorities.spFlow.sp_num_classes(list_flows: List[SpFlow]) int

From a list of priority flows computes the number of classes,

Parameters:

list_flows – list of priority flows

Returns:

the number of classes

>>> flow1 = SpFlow([TokenBucket(1, 2)], [0, 1], 1024, 0)
>>> flow2 = SpFlow([TokenBucket(2, 1)], [1, 2], 1024, 1)
>>> flow3 = SpFlow([TokenBucket(1, 3)], [0, 1, 2], 1024, 0)
>>> sp_num_classes([flow1, flow2, flow3])
2