ChuanyuXue / tsnkit

A scheduling and benchmark toolkit for Time-Sensitive Networking in Python
https://tsnkit.readthedocs.io
Other
37 stars 9 forks source link

Regarding the number of frames in each stream #9

Open lvihelm opened 3 months ago

lvihelm commented 3 months ago

May I ask why it is not possible to set the number of frames per stream in the CSV file? I remember theoretically, streams in TSN allow for multiple frames, which is also an important difference between TSN and TTE. Thanks! 流集格式

ChuanyuXue commented 3 months ago

If you are referring to the number of frame instances in a hyper-period (GCL cycle), it is calculated by assuming that the GCL cycle is the LCM of all the streams' periods. Then number of frame instances for each stream is then determined by dividing the GCL cycle by the stream's period.

If you are referring to the number of frame instances within a stream's period, it is typically assumed that there is only one frame per period (except for preemption/fragmentation enabled methods). But if you want multiple frames for a particular stream's period, I believe you can achieve this by duplicating the stream with the same specifications here (if no constraint on the frame orders for one stream).

lvihelm commented 3 months ago

What I am referring to is the number of frame instances within a stream's period, so how should I configure the CSV file to maintain the order of frames in the stream and avoid two streams interleaving in the queue?

ChuanyuXue commented 4 days ago

Practically, you can enlarge the frame size or reduce the period to get a result with expected orders.

Let's say you have 2 frames in one period. You can either make size = 100 or period = 50000. In this way you remain orders. But extra constraints are added (size = 100: two frames send consecutively, period = 50000: two frames send with constant interspace)

Alternatively, if the order doesn't matter, you could add one more flow.