flync_4_tsn¶
Time Synchronization (gPTP)¶
Hint
Find a YAML example for gPTP inside the Switch example (key ptp_config).
- class PTPTimeTransmitterConfig¶
Bases:
FLYNCBaseModelConfiguration for a PTP (Precision Time Protocol) time transmitter.
This class defines the settings required for a device acting as a time transmitter in a PTP domain.
Parameters¶
- log_tx_periodint
Logarithmic mean message interval for Sync messages, expressed as 2^x seconds. Valid range is -7 (128 messages/sec) to 1 (1 message every 2 seconds).
- two_stepbool, optional
Flag indicating whether two-step synchronization is used. Default is True.
- tlvlist of str, optional
Optional list of TLV (Type-Length-Value) extensions included in Sync messages.
- class PTPTimeReceiverConfig¶
Bases:
FLYNCBaseModelConfiguration for a PTP (Precision Time Protocol) time receiver.
This class defines the settings required for a device acting as a time receiver in a PTP domain.
Parameters¶
- sync_timeoutint
Timeout for receiving Sync messages, in milliseconds or implementation-specific units.
- sync_followup_timeoutint
Timeout in miliseconds for receiving Follow_Up messages after a Sync message.
- class PTPPdelayConfig¶
Bases:
FLYNCBaseModelConfiguration for PTP peer delay (PDelay) messages.
This class defines the interval for transmitting peer delay measurement messages used to estimate path delay between devices.
Parameters¶
- log_tx_periodint
Logarithmic mean message interval for PDelay messages (2^x seconds). Valid range: -4 to 3.
- class PTPPort¶
Bases:
FLYNCBaseModelPTP port configuration for an ECU (Electronic Control Unit).
This class defines the configuration of a PTP port that may act as a transmitter or receiver, and optionally support peer delay measurements.
Parameters¶
- domain_idint
PTP domain identifier used to separate multiple time sync domains. Must be greater than or equal to 0.
- src_port_identityint
Unique identity for the source port. Must be >= 0.
- sync_config
PTPTimeTransmitterConfigorPTPTimeReceiverConfig Sync behavior configuration for this port.
- pdelay_config
PTPPdelayConfig, optional Configuration for peer delay (PDelay) measurements.
- class PTPConfig¶
Bases:
FLYNCBaseModelTop-level PTP configuration for an ECU.
Parameters¶
- cmlds_linkport_enabledbool
Enable the Common Mean Link Delay Service (CMLDS) on the physical Link Port that these PTP ports share. True → share meanLinkDelay/neighborRateRatio across all domains using delayMechanism=COMMON_P2P. False → instance-specific peer delay.
- ptp_portslist of
PTPPort List of PTP port configurations contained in this ECU.
Quality of Service (QoS)¶
- class FrameFilter¶
Bases:
FLYNCBaseModelDefines filtering rules for frames based on MAC/IP addresses, VLAN, and transport protocol ports.
Parameters¶
- src_mac
MacAddressorMACAddressEntryor list of (MacAddress |MACAddressEntry), optional Source MAC address(es) to filter by. Acceptable formats are
xx:xx:xx:xx:xx:xxorxx-xx-xx-xx-xx-xx(hexadecimal).- dst_mac
MacAddressorMACAddressEntryor list of (MacAddress |MACAddressEntry), optional Destination MAC address(es) to filter by. Same format rules as
src_mac.- vlan_taggedbool, optional
Whether the frame has a 802.1Q VLAN tag.
- vlanidint or
ValueRangeor list of (int |ValueRange), optional VLAN Identifier(s) to match. Integer values must be in the range 0-4095.
ValueRangecan specify an inclusive interval.- pcpint or list of int, optional
Priority Code Point (IEEE 802.1p traffic class). Values 0-7.
- src_ipv4
IPv4AddressEntryorIPv4Addressor list of (IPv4AddressEntry|IPv4Address), optional Source IPv4 address(es) to filter by.
- dst_ipv4
IPv4AddressEntryorIPv4Addressor list of (IPv4AddressEntry|IPv4Address), optional Destination IPv4 address(es) to filter by.
- src_ipv6
IPv6AddressEntryorIPv6Addressor list of (IPv6AddressEntry|IPv6Address), optional Source IPv6 address(es) to filter by.
- dst_ipv6
IPv6AddressEntryorIPv6Addressor list of (IPv6AddressEntry|IPv6Address), optional Destination IPv6 address(es) to filter by.
- protocolLiteral[“tcp”, “udp”], optional
Transport protocol to filter by.
- src_portint or
ValueRangeor list of (int |ValueRange), optional Source transport layer port(s). Integers must be > 0.
- dst_portint or
ValueRangeor list of (int |ValueRange), optional Destination transport layer port(s). Integers must be > 0.
- src_mac
Ingress Per-Stream Filtering and Policing¶
Hint
Find a YAML example for Ingress Streams inside the Switch example (key ingress_streams).
- class Stream¶
Bases:
FLYNCBaseModelRepresents an IEEE 802.1Qci stream with optional traffic policing, and filtering.
Parameters¶
- namestr
Unique name of the stream.
- stream_identificationlist of
FrameFilter List of filters used to identify stream traffic.
- drop_at_ingressbool, optional
Whether to drop traffic at ingress. Default is False.
- max_sdu_sizeint, optional
Maximum size of the Service Data Unit in bytes. Default is 1522 bytes.
- policer
SingleRateTwoColorMarker,SingleRateThreeColorMarker, orDoubleRateThreeColorMarker, optional Optional traffic policer configuration for this stream. Determines how traffic is metered or marked. The correct subclass is selected based on the type discriminator.
- ipvint, optional
Internal Priority Value (0-7) assigned to the stream, if used.
- ats
ATSInstance, optional Optional Asynchronous Traffic Shaping configuration for ingress streams.
- class ATSInstance¶
Bases:
FLYNCBaseModelDefines an ATS (Asynchronous Traffic Shaping) instance configuration for an ingress stream. ATS shaping is applied on egress when an
ATSShaperis configured.Parameters¶
- committed_information_rateint
Guaranteed data rate in kilobits per second (kbps).
- committed_burst_sizeint
Maximum burst size allowed within the committed rate in kilobytes (kB).
- max_residence_timeint
Maximum time a frame can reside within the switch in microseconds (µs).
- class SingleRateTwoColorMarker¶
Bases:
FLYNCBaseModelPolicer model implementing a single-rate, two-color marker.
This model marks traffic based on a single committed rate (CIR), with two traffic colors: conforming and exceeding. It does not support excess information rate (EIR) and operates without coupling.
Parameters¶
- typeLiteral[“single_rate_two_color”]
Literal identifier specifying the policer type. Defaults to “single_rate_two_color” for schema identification.
- cirint
Committed Information Rate in kilobits per second (kbps). Must be greater than 0.
- cbsint
Committed Burst Size in kilobytes (kB). Must be greater than 0.
- eirLiteral[0]
Excess Information Rate. Fixed at 0 for this model.
- ebsint
Excess Burst Size in kilobytes (kB). Must be greater than or equal to 0.
- couplingLiteral[False]
Coupling flag. Disabled for the two-color model.
- class SingleRateThreeColorMarker¶
Bases:
FLYNCBaseModelPolicer model implementing a single-rate, three-color marker.
This model uses a single committed rate (CIR) and marks packets as conforming, exceeding, or violating based on bucket fill levels. Coupling is enabled to allow the excess bucket to draw from the committed bucket.
Parameters¶
- typeLiteral[“single_rate_three_color”]
Literal identifier specifying the policer type. Defaults to “single_rate_three_color” for schema identification.
- cirint
Committed Information Rate in kilobits per second (kbps). Must be greater than 0.
- cbsint
Committed Burst Size in kilobytes (kB). Must be greater than 0.
- eirLiteral[0]
Excess Information Rate. Fixed at 0 for this model.
- ebsint
Excess Burst Size in kilobytes (kB). Must be greater than 0.
- couplingLiteral[True]
Coupling flag. Enabled for three-color behavior.
- class DoubleRateThreeColorMarker¶
Bases:
FLYNCBaseModelPolicer model implementing a double-rate, three-color marker.
This model supports both committed and excess information rates (CIR and EIR) and marks traffic with three colors: conforming, exceeding, and violating. Coupling behavior is configurable.
Parameters¶
- typeLiteral[“double_rate_three_color”]
Literal identifier specifying the policer type. Defaults to “double_rate_three_color” for schema identification.
- cirint
Committed Information Rate in kilobits per second (kbps). Must be greater than 0.
- cbsint
Committed Burst Size in kilobytes (kB). Must be greater than 0.
- eirint
Excess Information Rate in kilobits per second (kbps). Must be greater than 0.
- ebsint
Excess Burst Size in kilobytes (kB). Must be greater than 0.
- couplingbool
Coupling flag. Determines whether the excess bucket draws from the committed bucket.
Egress Traffic Shaping¶
Hint
Find a YAML example for Traffic Classes inside the Switch example (key traffic_classes).
- class TrafficClass¶
Bases:
FLYNCBaseModelDefines a traffic class for prioritizing and shaping traffic on device egress queues.
Parameters¶
- namestr
Name or description of the traffic class.
- priorityint
Traffic Class priority value. Valid range: 0-7.
- frame_priority_valueslist of int, optional
Mapped priority values from Ethernet frames (PCP values). Valid range for each entry: 0-7. Default is an empty list.
- internal_priority_valueslist of int, optional
Mapped internal switch priority values (IPV). Valid range for each entry: 0-7. Default is an empty list.
- selection_mechanisms
CBSShaperorATSShaper, optional Optional shaping mechanism applied to the traffic class. Can be a CBS (Credit-Based Shaper) or ATS (Asynchronous Traffic Shaper) instance. The correct subclass is selected using the type discriminator.
Shapers¶
- class CBSShaper¶
Bases:
FLYNCBaseModelCredit-Based Shaper (CBS) configuration model.
This class represents the configuration for a CBS traffic shaping mechanism, which manages bandwidth allocation and latency for time-sensitive networking (TSN) streams. CBS uses a credit-based algorithm to control frame transmission rates.
Parameters¶
- typeLiteral[“cbs”]
Literal identifier specifying the shaper type. Defaults to “cbs” for schema identification.
- idleslopeint
The rate at which credits accumulate when the stream is not transmitting. Determines bandwidth allocation. Value specified in kilobits per second (kbps). Must be between 0 and 1000000.
- class ATSShaper¶
Bases:
FLYNCBaseModelSpecifies a shaper using the ATS (Asynchronous Traffic Shaping) mechanism.
This shaper applies to a specific stream ATS instance configured on an
ATSInstance.Parameters¶
- typeLiteral[“ats”]
Literal identifier specifying the shaper type. Defaults to “ats” for schema identification.
- class HTBInstance¶
Bases:
FLYNCBaseModelDefines an HTB (Hierarchical Token Bucket) instance for traffic shaping and class-based bandwidth management.
Parameters¶
- root_idstr
Identifier for the root of the HTB hierarchy. Must follow the format “number:”.
- default_classint, optional
Default class ID to which traffic is assigned if it does not match any child class.
- child_classeslist of
ChildClass List of child classes under the HTB root, defining traffic priorities, guaranteed rates, ceilings, and filters.
- class HTBFilter¶
Bases:
FrameFilterDefines a filter for HTB (Hierarchical Token Bucket) child classes.
Parameters¶
- prioint
Priority of the filter.
- class ChildClass¶
Bases:
FLYNCBaseModelDefines a child class for HTB (Hierarchical Token Bucket).
Parameters¶
- classidint
Unique identifier for the child class.
- rateint
Minimum guaranteed bandwidth for this child class in Mbps.
- ceilint
Maximum bandwidth this class can consume if leftover capacity is available (in Mbps).
- filterlist of
HTBFilter, optional List of filters applied to identify traffic belonging to this class.
- child_classeslist of
ChildClass, optional Nested child classes under this HTB class.