spServer module

class panco.staticpriorities.spServer.SpServer(service_curve: List[RateLatency], max_service_curve: List[TokenBucket], max_length: List[float])

Bases: object

Class describing a static priority server:

Parameters:
  • service_curve – the minimal service curve of the server

  • max_service_curve – the maximum service curve of the server

  • max_length – the maximum packet length for each static priority class

property length_bar_simple: List[float]

Computes the maximum length of a packet with strictly lower priority. This is used when computing a (min,plus) residual service curve.

Returns:

the maximum packet length of classes with strictly higher priority, for each class.

>>> sp_server = SpServer([RateLatency(5, 0)], [TokenBucket(1, 10)], [508, 1024, 508])
>>> sp_server.length_bar_simple
[1024, 508, 0]
property length_bar_strict: List[float]

Computes the maximum length of a packet with lower or equal priority. This is used when a strict residual service curve is omputed

Returns:

the maximum packet length of classes with higher or equal priority, for each class.

>>> sp_server = SpServer([RateLatency(5, 0)], [TokenBucket(1, 10)], [508, 1024, 508])
>>> sp_server.length_bar_strict
[1024, 1024, 508]
residual(cross_traffic: List[TokenBucket], i: int, is_strict: bool) Server

Computes the residual service curve of class i, assuming this is the highest priority, in the server (all other priorities have been handled). Two cases are considered: whether the residual needs to be strict or not.

Parameters:
  • cross_traffic – the arrival curve of the cross traffic of class i

  • i – the class to remove from the service

  • is_strict – True if the residual service needs to be strict, False otherwise.

“return: the server with the residual service curve

>>> sp_server = SpServer([RateLatency(5, 0)], [TokenBucket(1, 10)], [3, 1, 1])
>>> sp_server.residual([TokenBucket(1, 1)], 0,  True)
<Server: β(t) = max [4(t - 1.0)_+]
         σ(t) = min [1 + 10t]>

>>> sp_server = SpServer([RateLatency(5, 0)], [TokenBucket(1, 10)], [3, 1, 1])
>>> sp_server.residual([TokenBucket(1, 1)], 0,  False)
<Server: β(t) = max [4(t - 0.5)_+]
         σ(t) = min [1 + 10t]>