flync_4_ecu

ECU Config

Expand for Schematic
        classDiagram

    class ECUMetadata {
        type: Literal['ecu'] = 'ecu'
        author: str
        compatible_flync_version: BaseVersion
        extensions: dict[str, str] | None = None
        hardware: HardwareBaseMetadata | None = None
        software: SoftwareBaseMetadata | None = None
    }

    class OutputStrategy {
        <<Enumeration>>
        AUTO: int = 1
        FOLDER: int = 1
        SINGLE_FILE: int = 2
        OMMIT_ROOT: int = 4
        FIXED_ROOT: int = 8
    }

    class SocketTCP {
        name: str
        endpoint_address: IPvAnyAddress
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        endpoint_type: Literal['multicast', 'unicast'] | None = <lambda>
        multicast_tx: list[IPvAnyAddress] | None = list
        protocol: Literal['tcp'] = 'tcp'
        tcp_profile: int
    }

    class Switch {
        name: str
        switch_config: SwitchConfig
        host_controller: Controller | None = None
    }

    class MACMulticastEndpoints {
        endpoints: list[MACEndpointUnion] = list
    }

    class SwitchPortToXConnection {
        type: str
        id: str
        switch_port_name: str
        switch_name: str | None = None
    }

    class SOMEIPServiceDeployment {
        deployment_type: Literal['someip', 'someip_provider', 'someip_consumer']
        service: int
        major_version: int = 0
        instance_id: int
        someip_sd_timings_profile: str
    }

    class Socket {
        name: str
        endpoint_address: IPvAnyAddress
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        endpoint_type: Literal['multicast', 'unicast'] | None = <lambda>
        multicast_tx: list[IPvAnyAddress] | None = list
    }

    class Controller {
        name: str
        controller_metadata: EmbeddedMetadata
        ethernet_interfaces: list[EthernetInterface] | None = list
        can_interfaces: list[CANInterface] | None = list
        lin_interfaces: list[LINMasterInterface | LINSlaveInterface] | None = list
        compute_nodes: list[ComputeNode] | None = list
        switches: list[Switch] | None = list
        controller_topology: ControllerTopology | None = None
        app_bindings: AppBindings | None = None
        state_memberships: list[StateMembershipRef] | None = []
    }

    class EthernetInterface {
        name: str
        interface_config: EthernetInterfaceConfig
        sockets: list[SocketContainer] | None = list
    }

    class ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

    class SwitchPort {
        name: str
        silicon_port_no: int
        default_vlan_id: int
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        ptp_config: PTPConfig | None = None
        ingress_streams: list[Stream] | None = []
        traffic_classes: list[TrafficClass] | None = []
        macsec_config: MACsecConfig | None = None
    }

    class NamingStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FIELD_NAME: int = 0
        FIXED_PATH: int = 1
    }

    class SocketUDP {
        name: str
        endpoint_address: IPvAnyAddress
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        endpoint_type: Literal['multicast', 'unicast'] | None = <lambda>
        multicast_tx: list[IPvAnyAddress] | None = list
        protocol: Literal['udp'] = 'udp'
        udp_options: UDPOption | None = udp_cork=False
    }

    class InternalConnection {
        type: str
        id: str
    }

    class ImpliedStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FOLDER_NAME: int = 0
        FILE_NAME: int = 1
    }

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class SwitchPortToControllerInterface {
        type: Literal['switch_port_to_controller_interface'] = 'switch_port_to_controller_interface'
        id: str
        iface_name: str
        controller_name: str | None = None
        switch_port_name: str
        switch_name: str | None = None
    }

    class SOMEIPServiceProvider {
        deployment_type: Literal['someip_provider'] = 'someip_provider'
        service: int
        major_version: int
        instance_id: int
        someip_sd_timings_profile: str
        minor_version: int = 0
        provided_eventgroups: list[str] | None = None
        multicast_config: list[SOMEIPEventgroupMulticastConfig] | None = None
    }

    class MulticastGroupMembership {
        group: IPvAnyAddress | MacAddress
        description: str | None = ''
        mode: Literal['tx'] | Literal['rx'] = 'rx'
        vlan: int | None = 0
        src_ip: IPvAnyAddress | None = None
        solicited_node_multicast: bool | None = False
    }

    class SocketContainer {
        name: str
        vlan_id: int | None = 0
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class SOMEIPServiceConsumer {
        deployment_type: Literal['someip_consumer'] = 'someip_consumer'
        service: int
        major_version: int = 0
        instance_id: int
        someip_sd_timings_profile: str
        consumed_eventgroups: list[str] | None = None
    }

    class ECU {
        name: str
        ports: list[ECUPort] | None = list
        controllers: list[Controller]
        switches: list[Switch] | None = list
        topology: InternalTopology | None = None
        ecu_metadata: ECUMetadata
        mac_multicast_endpoints: MACMulticastEndpoints | None = None
        multicast_groups: list[MulticastGroupMembership] | None = list
        state_memberships: list[StateMembershipRef] | None = []
    }

    class FLYNCBaseModel {
    }

    class StateMembershipRef {
        group: str
        role: Literal['participant', 'observer'] = 'participant'
        relevance_bits: list[str] | None = None
        extensions: dict[str, str] | None = None
    }

    class InternalTopology {
        connections: list[InternalConnectionUnion] = list
    }

    Controller ..> Switch
    Controller ..> AppBindings
    Controller ..> ControllerTopology
    Controller ..> CANInterface
    Controller ..> StateMembershipRef
    Controller ..> EthernetInterface
    Controller ..> LINSlaveInterface
    Controller ..> ComputeNode
    Controller ..> LINMasterInterface
    Controller ..> EmbeddedMetadata
    EthernetInterface ..> EthernetInterfaceConfig
    EthernetInterface ..> SocketContainer
    InternalTopology ..> InternalConnectionUnion
    MACMulticastEndpoints ..> MACEndpointUnion
    MulticastGroupMembership ..> IPvAnyAddress
    MulticastGroupMembership ..> MacAddress
    ECUPort ..> RMII
    ECUPort ..> XFI
    ECUPort ..> MII
    ECUPort ..> BASET
    ECUPort ..> RGMII
    ECUPort ..> BASET1S
    ECUPort ..> SGMII
    ECUPort ..> BASET1
    SocketContainer ..> SocketTCP
    SocketContainer ..> SocketUDP
    Socket ..> IPvAnyAddress
    Socket ..> DeploymentUnion
    SocketTCP ..> IPvAnyAddress
    SocketTCP ..> DeploymentUnion
    SocketUDP ..> IPvAnyAddress
    SocketUDP ..> UDPOption
    SocketUDP ..> DeploymentUnion
    Switch ..> SwitchConfig
    Switch ..> Controller
    SwitchPort ..> RMII
    SwitchPort ..> XFI
    SwitchPort ..> MII
    SwitchPort ..> PTPConfig
    SwitchPort ..> MACsecConfig
    SwitchPort ..> TrafficClass
    SwitchPort ..> RGMII
    SwitchPort ..> Stream
    SwitchPort ..> SGMII
    ECUMetadata ..> BaseVersion
    ECUMetadata ..> SoftwareBaseMetadata
    ECUMetadata ..> HardwareBaseMetadata
    SOMEIPServiceProvider ..> SOMEIPEventgroupMulticastConfig
    ECU ..> InternalTopology
    ECU ..> Switch
    ECU ..> ECUPort
    ECU ..> ECUMetadata
    ECU ..> MACMulticastEndpoints
    ECU ..> MulticastGroupMembership
    ECU ..> StateMembershipRef
    ECU ..> Controller


    
class ECU

Bases: FLYNCBaseModel

Represents an Electronic Control Unit (ECU) in the network.

Parameters

namestr

Name of the ECU.

portslist of ECUPort, optional

List of physical Ethernet ECU ports. May be empty for a CAN/LIN-only ECU, but at least one port is required as soon as the ECU declares any Ethernet interface or switch.

controllerslist of Controller

Controllers associated with this ECU.

switcheslist of Switch, optional

Switches integrated within the ECU. If not provided, the ECU contains no internal switches.

topologyInternalTopology, optional

Internal topology defining the connectivity between ECU components. May be omitted for a CAN/LIN-only ECU, but is required as soon as the ECU declares any Ethernet interface or switch.

multicast_groupslist of MulticastGroupMembership, optional

Multicast group memberships of the ECU. This field is populated automatically internally.

mac_multicast_endpointsMACMulticastEndpoints, optional

MAC multicast endpoints configuration for the ECU.

ecu_metadataECUMetadata

Metadata information describing the ECU.

state_membershipslist of StateMembershipRef, optional

Assignments of this ECU to state management groups (whole-ECU granularity). Stored in state_memberships.flync.yaml inside the ECU folder.

ECU Ports Config

Expand for Schematic
        classDiagram

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class RMII {
        type: Literal['rmii'] = 'rmii'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

    class XFI {
        type: Literal['xfi'] = 'xfi'
        speed: Literal[10000] = 10000
        mode: Literal['mac', 'phy']
    }

    class MII {
        type: Literal['mii'] = 'mii'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

    class BASET {
        mode: Literal['base_t'] = 'base_t'
        speed: Literal[100, 1000]
        duplex: Literal['full'] = 'full'
        role: Literal['master', 'slave'] = 'slave'
        autonegotiation: bool = False
    }

    class FLYNCBaseModel {
    }

    class ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

    class RGMII {
        type: Literal['rgmii'] = 'rgmii'
        speed: Literal[10, 100, 1000] | None = 1000
        mode: Literal['mac', 'phy']
    }

    class BASET1S {
        mode: Literal['base_t1s'] = 'base_t1s'
        speed: Literal[10] = 10
        duplex: Literal['half', 'full'] = 'half'
        topology: Literal['p2p', 'multidrop'] = 'p2p'
        autonegotiation: bool = False
    }

    class SGMII {
        type: Literal['sgmii'] = 'sgmii'
        speed: Literal[10, 100, 1000, 2500] | None = 1000
        mode: Literal['mac', 'phy']
    }

    class BASET1 {
        mode: Literal['base_t1'] = 'base_t1'
        speed: Literal[100, 1000] = 100
        duplex: Literal['full'] = 'full'
        role: Literal['master', 'slave'] = 'slave'
        autonegotiation: bool = False
    }

    ECUPort ..> RMII
    ECUPort ..> XFI
    ECUPort ..> MII
    ECUPort ..> BASET
    ECUPort ..> RGMII
    ECUPort ..> BASET1S
    ECUPort ..> SGMII
    ECUPort ..> BASET1


    
Expand for a YAML example - 📄 ports.flync.yaml

Note

The external physical ports (and PHYs) of the ECUs of the system are configured in one dedicated file. For an ECU config, this file is mandatory since all ECUs need to define (at least) one port.

ports:
  - name: hpc1_p1
    mdi_config:
      mode: base_t1
      speed: 100
      duplex: full
      role: master
      autonegotiation: false
    mii_config:
      type: rmii
      speed: 100
      mode: phy

  - name: hpc1_p2
    mdi_config:
      mode: base_t1
      speed: 1000
      duplex: full
      role: master
      autonegotiation: false

  - name: hpc1_p3
    mdi_config:
      mode: base_t1
      speed: 1000
      duplex: full
      role: master
      autonegotiation: false

  - name: hpc1_p5
    mdi_config:
      mode: base_t1
      speed: 1000
      duplex: full
      role: master
      autonegotiation: false
    mii_config:
      type: sgmii
      speed: 1000
      mode: phy

Hint

In case of a port with an external PHY, we need to include mdi_config (see Media-Dependent Interfaces), and mii_config (see Media-Independent Interfaces).

class ECUPort

Bases: FLYNCBaseModel

Represents an ECU port and its configuration.

This class encapsulates both the media-dependent (MDI) and media-independent (MII) interface configurations for a port.

Parameters

namestr

Name of the ECU port.

mdi_configBASET1 or BASET1S or BASET

Media-dependent interface configuration, such as BASE-T1, BASE-T1S, or BASE-T.

mii_configMII or RMII or SGMII or RGMII, optional

Media-independent interface configuration, such as MII or RMII.

Private Attributes

_ecu :

The ECU of which the ECU Port is a part of.

_connected_component:

The switch port, controller interface or ecu port connected to the controller interface. This attribute is managed internally and is not part of the public API.

_type:

The type of the object generated. Set to ecu_port.

Controller Config

Changed in version 0.11.0: The Structure of the Controller configuration was significantly updated with Version 0.11.0! Make sure to upgrade your config to the new structure as described in the reference: ECUs - Controllers

Expand for Schematic
        classDiagram

    class Switch {
        name: str
        switch_config: SwitchConfig
        host_controller: Controller | None = None
    }

    class ControllerTopology {
        connections: list[ControllerConnectionUnion] = list
    }

    class VirtualControllerInterface {
        name: str
        vlanid: int | None = None
        addresses: list[IPv6AddressEndpoint | IPv4AddressEndpoint]
        multicast: list[IPvAnyAddress | MacAddress] | None = []
    }

    class Controller {
        name: str
        controller_metadata: EmbeddedMetadata
        ethernet_interfaces: list[EthernetInterface] | None = list
        can_interfaces: list[CANInterface] | None = list
        lin_interfaces: list[LINMasterInterface | LINSlaveInterface] | None = list
        compute_nodes: list[ComputeNode] | None = list
        switches: list[Switch] | None = list
        controller_topology: ControllerTopology | None = None
        app_bindings: AppBindings | None = None
        state_memberships: list[StateMembershipRef] | None = []
    }

    class IPv4AddressEndpoint {
        address: IPv4Address
        ipv4netmask: IPv4Address
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class PTPConfig {
        cmlds_linkport_enabled: bool = False
        ptp_ports: list[PTPPort] = []
    }

    class NamingStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FIELD_NAME: int = 0
        FIXED_PATH: int = 1
    }

    class EmbeddedMetadata {
        type: Literal['embedded'] = 'embedded'
        author: str
        compatible_flync_version: BaseVersion
        extensions: dict[str, str] | None = None
        hardware: HardwareBaseMetadata | None = None
        app: SoftwareBaseMetadata | None = None
        bootloader: SoftwareBaseMetadata | None = None
        target_system: str
    }

    class ImpliedStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FOLDER_NAME: int = 0
        FILE_NAME: int = 1
    }

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class StateMembershipRef {
        group: str
        role: Literal['participant', 'observer'] = 'participant'
        relevance_bits: list[str] | None = None
        extensions: dict[str, str] | None = None
    }

    class Firewall {
        default_action: Literal['reject', 'accept', 'drop'] | None = 'reject'
        input_rules: list[FirewallRule] | None = []
        output_rules: list[FirewallRule] | None = []
        forward_rules: list[FirewallRule] | None = []
    }

    class ComputeNode {
        name: str
        ethernet_interfaces: list[EthernetInterface] | None = list
        app_bindings: AppBindings | None = None
        compute_nodes: list[ComputeNode] | None = list
        virtual_switches: list[Switch] | None = list
    }

    class OutputStrategy {
        <<Enumeration>>
        AUTO: int = 1
        FOLDER: int = 1
        SINGLE_FILE: int = 2
        OMMIT_ROOT: int = 4
        FIXED_ROOT: int = 8
    }

    class AppBindings {
        app_refs: list[str] = list
    }

    class RouteEntry {
        destination: IPv4AddressEntry | IPv6AddressEntry
        default_gateway: IPvAnyAddress
        egress_interface: str
    }

    class MII {
        type: Literal['mii'] = 'mii'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

    class EthernetInterface {
        name: str
        interface_config: EthernetInterfaceConfig
        sockets: list[SocketContainer] | None = list
    }

    class IPv6AddressEndpoint {
        address: IPv6Address
        ipv6prefix: int
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class MACsecConfig {
        vlan_bypass: list[int]
        ethertype_bypass: list[Ethertype] = []
        src_mac_address_bypass: list[MacAddress] = []
        dest_mac_address_bypass: list[MacAddress] = []
        ckn: str
        mka_enabled: bool | None = True
        hello_time: int
        bounded_hello_time: int
        life_time: int
        sak_retire_time: int
        hello_time_rampup: list[int] = []
        sak_rekey_time: int | None = 3
        macsec_mode: Literal['disabled', 'integrity', 'integrity_confidentiality']
        kay_on: bool
        key_role: Literal['key_server_always', 'key_server_never']
        delay_protect: bool
        participant_activation: Literal['disabled', 'onoperup', 'always']
        sci_included: bool | None = False
        replay_protection_window: int = 0
        cipher_preference: list[IntegrityWithoutConfidentiality | IntegrityWithConfidentiality] = <lambda>
    }

    class RGMII {
        type: Literal['rgmii'] = 'rgmii'
        speed: Literal[10, 100, 1000] | None = 1000
        mode: Literal['mac', 'phy']
    }

    class Stream {
        name: str
        stream_identification: list[FrameFilter] = []
        drop_at_ingress: bool | None = False
        max_sdu_size: int | None = 1522
        policer: SingleRateTwoColorMarker | SingleRateThreeColorMarker | DoubleRateThreeColorMarker | None = None
        ipv: int | None = None
        ats: ATSInstance | None = None
    }

    class SGMII {
        type: Literal['sgmii'] = 'sgmii'
        speed: Literal[10, 100, 1000, 2500] | None = 1000
        mode: Literal['mac', 'phy']
    }

    class RMII {
        type: Literal['rmii'] = 'rmii'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

    class XFI {
        type: Literal['xfi'] = 'xfi'
        speed: Literal[10000] = 10000
        mode: Literal['mac', 'phy']
    }

    class HTBInstance {
        root_id: str
        default_class: int | None = None
        child_classes: list[ChildClass]
    }

    class SocketContainer {
        name: str
        vlan_id: int | None = 0
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class EthernetInterfaceConfig {
        mac_address: MacAddress | None = None
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        virtual_interfaces: list[VirtualControllerInterface] | None = list
        ptp_config: PTPConfig | None = None
        macsec_config: MACsecConfig | None = None
        firewall: Firewall | None = None
        htb: HTBInstance | None = None
        ingress_streams: list[Stream] | None = []
        traffic_classes: list[TrafficClass] | None = list
        routing_table: list[RouteEntry] | None = []
    }

    class CANInterface {
        name: str
        bus_ref: str
        sender_frames: list[CANFrameRef] = list
        receiver_frames: list[CANFrameRef] = list
        forwarder_frames: list[CANFrameForwarder] = list
        j1939_sender_frames: list[J1939FrameRef] = list
        j1939_receiver_frames: list[J1939FrameRef] = list
        j1939_name: int | None = None
        source_address: int | None = None
    }

    class FLYNCBaseModel {
    }

    class TrafficClass {
        name: str
        priority: int
        frame_priority_values: list[int] | None = []
        internal_priority_values: list[int] | None = []
        selection_mechanisms: CBSShaper | ATSShaper | None = None
    }

    class ControllerInterface {
        name: str
    }

    CANInterface ..> CANFrameRef
    CANInterface ..> CANFrameForwarder
    CANInterface ..> J1939FrameRef
    RouteEntry ..> IPvAnyAddress
    RouteEntry ..> IPv4AddressEntry
    RouteEntry ..> IPv6AddressEntry
    SocketContainer ..> SocketTCP
    SocketContainer ..> SocketUDP
    IPv4AddressEndpoint ..> SocketTCP
    IPv4AddressEndpoint ..> IPv4Address
    IPv4AddressEndpoint ..> SocketUDP
    IPv6AddressEndpoint ..> SocketUDP
    IPv6AddressEndpoint ..> SocketTCP
    IPv6AddressEndpoint ..> IPv6Address
    EmbeddedMetadata ..> BaseVersion
    EmbeddedMetadata ..> SoftwareBaseMetadata
    EmbeddedMetadata ..> HardwareBaseMetadata
    Firewall ..> FirewallRule
    MACsecConfig ..> IntegrityWithoutConfidentiality
    MACsecConfig ..> IntegrityWithConfidentiality
    MACsecConfig ..> Ethertype
    MACsecConfig ..> MacAddress
    HTBInstance ..> ChildClass
    PTPConfig ..> PTPPort
    Stream ..> FrameFilter
    Stream ..> ATSInstance
    Stream ..> SingleRateThreeColorMarker
    Stream ..> DoubleRateThreeColorMarker
    Stream ..> SingleRateTwoColorMarker
    TrafficClass ..> ATSShaper
    TrafficClass ..> CBSShaper
    VirtualControllerInterface ..> IPv6AddressEndpoint
    VirtualControllerInterface ..> IPvAnyAddress
    VirtualControllerInterface ..> IPv4AddressEndpoint
    VirtualControllerInterface ..> MacAddress
    EthernetInterfaceConfig ..> RMII
    EthernetInterfaceConfig ..> XFI
    EthernetInterfaceConfig ..> HTBInstance
    EthernetInterfaceConfig ..> VirtualControllerInterface
    EthernetInterfaceConfig ..> RouteEntry
    EthernetInterfaceConfig ..> MII
    EthernetInterfaceConfig ..> PTPConfig
    EthernetInterfaceConfig ..> Firewall
    EthernetInterfaceConfig ..> MACsecConfig
    EthernetInterfaceConfig ..> TrafficClass
    EthernetInterfaceConfig ..> RGMII
    EthernetInterfaceConfig ..> Stream
    EthernetInterfaceConfig ..> SGMII
    EthernetInterfaceConfig ..> MacAddress
    EthernetInterface ..> EthernetInterfaceConfig
    EthernetInterface ..> SocketContainer
    Controller ..> Switch
    Controller ..> AppBindings
    Controller ..> ControllerTopology
    Controller ..> CANInterface
    Controller ..> StateMembershipRef
    Controller ..> EthernetInterface
    Controller ..> LINSlaveInterface
    Controller ..> ComputeNode
    Controller ..> LINMasterInterface
    Controller ..> EmbeddedMetadata
    ComputeNode ..> EthernetInterface
    ComputeNode ..> ComputeNode
    ComputeNode ..> AppBindings
    ComputeNode ..> Switch
    Switch ..> SwitchConfig
    Switch ..> Controller
    ControllerTopology ..> ControllerConnectionUnion


    

Note

All controllers of an ECU are configured in the respective directory inside 📁 controllers/. This is a mandatory dir for the ECU configuration, since all ECUs need to define (at least) one controller.

class Controller

Bases: FLYNCBaseModel

Represents a controller device that contains multiple interfaces.

Parameters

namestr

Name of the controller.

controller_metadataEmbeddedMetadata

Metadata describing the embedded controller.

ethernet_interfaceslist of EthernetInterface, optional

Ethernet interfaces of the controller.

can_interfaceslist of CANInterface, optional

CAN bus interfaces of the controller.

lin_interfaceslist of AnyLINInterface, optional

LIN bus interfaces of the controller.

compute_nodeslist of ComputeNode, optional

Compute nodes hosted by this controller. Compute nodes nest arbitrarily deep; names must be unique across the whole subtree. Stored in the compute_nodes/ folder.

switcheslist of Switch, optional

Virtual switches hosted by this controller, modeled with the same class as a hardware switch. Stored in the switches/ folder.

controller_topologyControllerTopology, optional

Connectivity between the controller’s virtual switches and the Ethernet interfaces of the controller and of its compute nodes. Stored in controller_topology.flync.yaml.

app_bindingsAppBindings, optional

Applications a controller should bind to.

state_membershipslist of StateMembershipRef, optional

Assignments of this controller to state management groups. Stored in state_memberships.flync.yaml inside the controller folder.

Private Attributes

_typeLiteral[“controller”]

The type of the object generated. Defaults to "controller".

Ethernet Interfaces

Expand for a YAML example - 📄 interface_config.flync.yaml

Note

The configuration of a controller interface is defined in one file per Controller.

mac_address: 00:11:02:01:01:01
mii_config:
  type: rmii
  speed: 100
  mode: phy
virtual_interfaces:
  - name: hpc_c1_i1_viface1
    vlanid: 10
    addresses:
      - address: 10.0.10.5
        ipv4netmask: 255.255.255.0
    multicast:
    - 91:E0:F0:00:00:AA
    - 91:E0:F0:00:00:BB
  - name: hpc_c1_i1_viface2
    vlanid: 20
    addresses:
      - address: 10.0.20.5
        ipv4netmask: 255.255.255.0
    multicast:
      - 224.244.224.245
      - 224.0.0.15
  - name: hpc_c1_i1_viface3
    vlanid: 50
    addresses:
      - address: 10.0.50.5
        ipv4netmask: 255.255.255.0
  - name: hpc_c1_i1_viface4
    vlanid: 40
    addresses:
      - address: 10.0.40.5
        ipv4netmask: 255.255.255.0
    multicast:
    - 224.0.0.1
ptp_config:
  cmlds_linkport_enabled: false
  ptp_ports:
    - domain_id: 0
      src_port_identity: 1
      sync_config:
        type: time_receiver
        sync_timeout: 3
        sync_followup_timeout: 10
      pdelay_config:
        log_tx_period: 1
macsec_config:
  vlan_bypass: []
  ckn: hpc_s1_c1
  mka_enabled: true
  hello_time: 1000
  bounded_hello_time: 2000
  life_time: 100000
  sak_retire_time: 20000
  macsec_mode: integrity
  kay_on: true
  key_role: key_server_always
  delay_protect: false
  participant_activation: always

Hint

For controller interfaces that have an external PHY, the mii_config (see Media-Independent Interfaces) for that interface must be provided. For controller interfaces with integrated PHY, no mii_config is needed.

Warning

In any case, the MDI configuration is never configured on the controller interface, but on the ECU Ports. See ECU Ports Config for more details.

class EthernetInterface

Bases: ControllerInterface

An Ethernet Interface of a Controller.

Parameters

namestr

Name of the ethernet interface, implied from the folder name on disk.

interface_configEthernetInterfaceConfig

Configuration of the Ethernet interface.

socketslist of SocketContainer, optional

Socket containers for this Ethernet interface.

Private Attributes

_connected_component :

The switch port, controller interface, or ECU port connected to this interface. Managed internally; not part of the public API.

_type :

Fixed to "controller_interface".

_controller :

The Controller that owns this interface. Managed internally.

class ControllerInterface

Bases: FLYNCBaseModel

Base class for all controller interfaces (Ethernet, CAN, LIN).

Subclasses must declare name with an appropriate Implied strategy (FOLDER_NAME for Ethernet, FILE_NAME for the bus interfaces).

Parameters

namestr

Name of the interface, implied from its file or folder name on disk.

class VirtualControllerInterface

Bases: FLYNCBaseModel

A VLAN-tagged virtual interface stacked on top of a physical controller interface or a compute node.

Each virtual interface represents one logical network endpoint, identified by a VLAN ID and assigned one or more IP addresses. Multiple virtual interfaces can be defined on the same physical interface or compute node to separate traffic across different VLANs.

Parameters

namestr

Name of the virtual interface.

vlanidint, optional

VLAN identifier. Values 0-4094 are accepted; 4095 is reserved by IEEE 802.1Q and emits a warning when used. None denotes an untagged virtual interface.

addresseslist of IPv4AddressEndpoint or IPv6AddressEndpoint

Assigned IPv4 and IPv6 address endpoints.

multicastlist of IPvAnyAddress or MacAddress, optional

Allowed multicast addresses.

CAN Interfaces

Note

CAN interfaces are optional per controller (a controller must declare at least one interface of any kind). An ECU with only CAN/LIN/J1939 interfaces needs no ECU ports and no internal topology. Each interface’s bus_ref attaches it to a declared CAN bus; the system-wide attachment view is derived automatically (see CAN and LIN Bus Topology).

class CANInterface

Bases: ControllerInterface

CAN interface of a controller, declaring which frames the controller sends, receives, and forwards on a CAN bus.

Parameters

namestr

Name of the CAN interface, implied from the file name on disk.

bus_refstr

Name of the CANBus this interface connects to.

sender_frameslist of CANFrameRef

Frames transmitted by this controller on the bus.

receiver_frameslist of CANFrameRef

Frames received by this controller from the bus.

forwarder_frameslist of CANFrameForwarder

Frames received by this controller and re-emitted on one or more egresses.

j1939_sender_frameslist of J1939FrameRef, optional

J1939 frames (by PGN) transmitted by this node on the bus. Declaring any J1939 reference marks this interface as a J1939 node, so together with j1939_name.

j1939_receiver_frameslist of J1939FrameRef, optional

J1939 frames (by PGN) received by this node from the bus.

j1939_nameint, optional

64-bit J1939 NAME of the node this interface exposes; a node may be modeled by its NAME alone. Setting it marks the interface as a J1939 participant on bus_ref, which must then only carry J1939Frame frames.

source_addressint, optional

Preferred J1939 Source Address (SA) of the node, in the range [0, 253]. The SA is claimed at runtime through address claiming and may be left unset; when provided it is the address the node requests, not a hard assignment. Addresses 254 (NULL) and 255 (GLOBAL) are reserved by J1939.

class CANFrameRef

Bases: FLYNCBaseModel

Reference to a CAN frame by bus and CAN ID.

Parameters

bus_refstr

Name of the CANBus that owns the frame.

frame_refint

CAN ID of the CANFrame or CANFDFrame on the referenced bus.

J1939 over CAN

Note

J1939 rides on a regular CANInterface: a CAN interface participates in J1939 on its bus when it declares a 64-bit j1939_name (used for address claiming) and/or a source address (0-253; 254 NULL and 255 GLOBAL are reserved). A controller may be modeled with only J1939 CAN interfaces and still satisfy the “at least one interface” requirement. J1939 frames live on a CAN bus and are of type J1939Frame; a bus reached by a J1939-capable CAN interface may only carry J1939Frame frames.

LIN Interfaces

Note

A controller acts as either a LIN master or a LIN slave on a given bus. Exactly one master is required per LIN bus; this is checked when the CAN and LIN Bus Topology is derived from the interfaces’ bus_ref.

class LINMasterInterface

Bases: ControllerInterface

LIN interface for a controller acting as LIN master on a bus.

The master controls the schedule and initiates all frame transmissions.

Parameters

namestr

Name of the LIN interface, implied from the file name on disk.

node_typeLiteral[“master”]

Discriminator field. Always "master".

bus_refstr

Name of the LINBus this interface connects to.

lin_protocolLiteral[“1.3”, “2.0”, “2.1”, “2.2A”]

LIN protocol version supported by this node.

p2_minfloat

Minimum time (ms) between the end of a slave response and the start of the next frame header. Maps to P2_min in the LDF Nodes.Master block.

st_minfloat

Minimum separation time (ms) between consecutive frame headers transmitted by the master. Maps to ST_min in the LDF Nodes.Master block.

sender_frameslist of LINFrameRef

Frames transmitted (scheduled) by this master controller.

class LINSlaveInterface

Bases: ControllerInterface

LIN interface for a controller acting as LIN slave on a bus.

The slave responds to frame headers issued by the master.

Parameters

namestr

Name of the LIN interface, implied from the file name on disk.

node_typeLiteral[“slave”]

Discriminator field. Always "slave".

bus_refstr

Name of the LINBus this interface connects to.

lin_protocolLiteral[“1.3”, “2.0”, “2.1”, “2.2A”]

LIN protocol version supported by this node.

configured_nadint

Configured Node Address (0x00 – 0xFF). Written as configured_NAD in the LDF Node_attributes block.

initial_nadint

Initial Node Address (0x00 – 0xFF). Written as initial_NAD in the LDF Node_attributes block.

product_idstr, optional

Product identification string. Written as product_id in the LDF Node_attributes block.

response_errorstr, optional

Name of the signal used to report response errors. Written as response_error in the LDF Node_attributes block.

receiver_frameslist of LINFrameRef

Frames received by this slave controller from the bus.

class LINFrameRef

Bases: FLYNCBaseModel

Reference to a LIN frame by bus and LIN ID.

Parameters

bus_refstr

Name of the LINBus that owns the frame.

frame_refint

LIN ID of the LINFrame on the referenced bus.

Compute Nodes (experimental)

Expand for a YAML example - 📁 compute_nodes/

Note

A compute node is defined in one subfolder per node under 📁 compute_nodes/. It may declare its own virtual Ethernet interfaces, nest further compute nodes, and define virtual switches of its own.

mac_address: 00:11:01:01:01:02
virtual_interfaces:
  - name: eth_ecu_node1_viface1
    vlanid: 40
    addresses:
      - address: 10.0.40.7
        ipv4netmask: 255.255.255.0
      - address: 2001:db8:85a3::8a2e:370:7334
        ipv6prefix: 64
    multicast:
      - 224.0.0.1
ingress_streams:
  - name: stream_0
    stream_identification:
      - vlanid: [10, 20, 30, 40]
        dst_ipv4:
          address: 10.0.0.0
          ipv4netmask: 255.255.0.0
        protocol: udp
        dst_port:
          from_value: 32000
          to_value: 33000
    drop_at_ingress: false
    max_sdu_size: 1522
    policer:
      type: single_rate_two_color
      cir: 10000
      cbs: 10000
      eir: 0
      ebs: 5000
      coupling: false
  - name: stream_1
    stream_identification:
      - vlanid: 10
        dst_ipv4:
          address: 224.0.0.0
          ipv4netmask: 255.0.0.0
        protocol: tcp
    drop_at_ingress: false
    max_sdu_size: 1522
    policer:
      type: double_rate_three_color
      cir: 10000
      cbs: 10000
      eir: 20000
      ebs: 2000
      coupling: true
htb:
  root_id: "1:"
  default_class: 12
  child_classes:
    - classid: 11
      priority: 1
      rate: 5
      ceil: 10
      filter:
        - filter_priority: 1
          vlanid: 40
          dst_ipv4:
            address: 10.0.40.0
            ipv4netmask: 255.255.255.0
          protocol: tcp
    - classid: 12
      priority: 2
      rate: 5
      ceil: 10
      filter:
        - filter_priority: 2
          vlanid: 40
          dst_ipv4:
            address: 10.0.40.0
            ipv4netmask: 255.255.255.0
          protocol: udp
      child_classes: []
class ComputeNode

Bases: FLYNCBaseModel

A compute node hosted by a controller, or nested inside another compute node.

A compute node may own virtual Ethernet interfaces (EthernetInterface without a PHY), may declare its own virtual switches to bridge them, and may host further compute nodes. It is wired to the rest of the controller through the controller’s controller_topology.flync.yaml — a compute node never connects to anything outside its own controller.

Parameters

namestr

Name of the compute node, implied from the folder name on disk. Must be unique across the whole controller subtree.

ethernet_interfaceslist of EthernetInterface, optional

Virtual Ethernet interfaces exposed by this compute node. These carry no mii_config: a virtual NIC has no PHY.

app_bindingsAppBindings, optional

Applications this compute node should bind to.

compute_nodeslist of ComputeNode, optional

Compute nodes nested inside this one.

virtual_switcheslist of Switch, optional

Software MAC bridges defined inside this compute node.

Note

A compute node’s virtual_switches reuse the same Switch / SwitchPort model documented in Switch Config.

Socket Config

Expand for Schematic
        classDiagram

    class PDUForwarder {
        deployment_type: Literal['pdu_forwarder'] = 'pdu_forwarder'
        pdu_ref: str
        egresses: list[ForwarderEgress]
    }

    class PDUReceiver {
        deployment_type: Literal['pdu_receiver'] = 'pdu_receiver'
        pdu_ref: str
    }

    class SocketTCP {
        name: str
        endpoint_address: IPvAnyAddress
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        endpoint_type: Literal['multicast', 'unicast'] | None = <lambda>
        multicast_tx: list[IPvAnyAddress] | None = list
        protocol: Literal['tcp'] = 'tcp'
        tcp_profile: int
    }

    class DoIPDiscoveryDeployment {
        deployment_type: Literal['doip_discovery'] = 'doip_discovery'
        name: str | None = None
        vehicle_identification: bool = True
        vehicle_announcement: bool = True
        doip_timings_profile: str | None = None
    }

    class Socket {
        name: str
        endpoint_address: IPvAnyAddress
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        endpoint_type: Literal['multicast', 'unicast'] | None = <lambda>
        multicast_tx: list[IPvAnyAddress] | None = list
    }

    class IPv6AddressEndpoint {
        address: IPv6Address
        ipv6prefix: int
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class IPv4AddressEndpoint {
        address: IPv4Address
        ipv4netmask: IPv4Address
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class TCPOption {
        tcp_profile_id: int
        nagle: bool | None = False
        keepalive_enabled: bool | None = True
        keepidle: int | None = 10
        keepcount: int | None = 10
        keepintvl: int | None = 2
        user_timeout: int | None = 28
        congestion_avoidance: Literal['reno', 'cubic', 'bbr'] | None = 'reno'
        tcp_maxseg: int | None = 1460
        tcp_quickack: bool | None = False
        tcp_syncnt: int | None = 6
    }

    class DoIPServerDeployment {
        deployment_type: Literal['doip_server'] = 'doip_server'
        name: str
        logical_address: int
        uds_server: str
        doip_timings_profile: str | None = None
    }

    class DeploymentUnion {
        root: SOMEIPServiceConsumer | SOMEIPServiceProvider | SOMEIPSDDeployment | PDUSender | PDUReceiver | PDUForwarder | DoIPServerDeployment | DoIPDiscoveryDeployment
    }

    class SocketUDP {
        name: str
        endpoint_address: IPvAnyAddress
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        endpoint_type: Literal['multicast', 'unicast'] | None = <lambda>
        multicast_tx: list[IPvAnyAddress] | None = list
        protocol: Literal['udp'] = 'udp'
        udp_options: UDPOption | None = udp_cork=False
    }

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class SOMEIPServiceProvider {
        deployment_type: Literal['someip_provider'] = 'someip_provider'
        service: int
        major_version: int
        instance_id: int
        someip_sd_timings_profile: str
        minor_version: int = 0
        provided_eventgroups: list[str] | None = None
        multicast_config: list[SOMEIPEventgroupMulticastConfig] | None = None
    }

    class PDUSender {
        deployment_type: Literal['pdu_sender'] = 'pdu_sender'
        pdu_ref: str
    }

    class SOMEIPServiceConsumer {
        deployment_type: Literal['someip_consumer'] = 'someip_consumer'
        service: int
        major_version: int = 0
        instance_id: int
        someip_sd_timings_profile: str
        consumed_eventgroups: list[str] | None = None
    }

    class IPv6AddressEntry {
        address: IPv6Address
        ipv6prefix: int
    }

    class FLYNCBaseModel {
    }

    class SOMEIPSDDeployment {
        deployment_type: Literal['someip_sd'] = 'someip_sd'
        multicast: MulticastSDEndpoint | None = None
    }

    class IPv4AddressEntry {
        address: IPv4Address
        ipv4netmask: IPv4Address
    }

    class UDPOption {
        udp_cork: bool | None = False
    }

    class RootModel {
        root: RootModelRootType
    }

    RootModel ..> RootModelRootType
    IPv4AddressEntry ..> IPv4Address
    IPv6AddressEntry ..> IPv6Address
    PDUForwarder ..> ForwarderEgress
    SOMEIPSDDeployment ..> MulticastSDEndpoint
    SOMEIPServiceProvider ..> SOMEIPEventgroupMulticastConfig
    DeploymentUnion ..> PDUReceiver
    DeploymentUnion ..> PDUForwarder
    DeploymentUnion ..> SOMEIPServiceProvider
    DeploymentUnion ..> PDUSender
    DeploymentUnion ..> DoIPDiscoveryDeployment
    DeploymentUnion ..> SOMEIPServiceConsumer
    DeploymentUnion ..> SOMEIPSDDeployment
    DeploymentUnion ..> DoIPServerDeployment
    Socket ..> IPvAnyAddress
    Socket ..> DeploymentUnion
    SocketTCP ..> IPvAnyAddress
    SocketTCP ..> DeploymentUnion
    SocketUDP ..> IPvAnyAddress
    SocketUDP ..> UDPOption
    SocketUDP ..> DeploymentUnion
    IPv4AddressEndpoint ..> SocketTCP
    IPv4AddressEndpoint ..> IPv4Address
    IPv4AddressEndpoint ..> SocketUDP
    IPv6AddressEndpoint ..> SocketUDP
    IPv6AddressEndpoint ..> SocketTCP
    IPv6AddressEndpoint ..> IPv6Address


    
Expand for a YAML example - 📁 sockets/

Note

This directory contains files that define a group of sockets per VLAN for a specific ethernet interface. Each file defines the sockets (VLAN ID, address endpoint and port number) and lists the deployments that use each socket.

It is advisable to keep sockets that provide similar functionality together (e.g. all SOME/IP sockets in the same file).

vlan_id: 20
sockets:
- name: sd_multicast_socket
  endpoint_address: 10.0.20.5
  endpoint_type: multicast
  port_no: 30490
  protocol: udp
  multicast_tx:
  - 224.244.224.245
  deployments:
  - deployment_type: someip_sd
    multicast:
      ip_address: 224.244.224.245
      port: 30490
      ip_ttl: 1
- name: someip_client_socket_udp1
  endpoint_address: 10.0.20.5
  endpoint_type: unicast
  port_no: 30491
  protocol: udp
  deployments:
  - deployment_type: someip_consumer
    service: 0x0101
    instance_id: 0x00f4
    major_version: 1
    consumed_eventgroups:
    - eg2_all
    - eg5_events_and_fields_unreliable
    someip_sd_timings_profile: client_default
- name: someip_client_socket_udp2
  endpoint_address: 10.0.20.5
  endpoint_type: multicast
  port_no: 30511
  protocol: udp
  deployments:
  - deployment_type: someip_consumer
    service: 0x0101
    instance_id: 0x00f4
    major_version: 1
    consumed_eventgroups:
    - eg6_events_multicast
    someip_sd_timings_profile: client_default
- name: someip_client_socket_tcp1
  endpoint_address: 10.0.20.5
  endpoint_type: unicast
  port_no: 30491
  protocol: tcp
  tcp_profile: 1
  deployments:
  - deployment_type: someip_consumer
    service: 0x0101
    instance_id: 0x00f4
    major_version: 1
    consumed_eventgroups:
    - eg2_all
    someip_sd_timings_profile: client_default
- name: someip_server_socket_udp1
  endpoint_address: 10.0.20.5
  endpoint_type: unicast
  port_no: 30501
  protocol: udp
  multicast_tx:
  - 224.0.0.15
  deployments:
  - deployment_type: someip_provider
    service: 0x0101
    instance_id: 2
    major_version: 1
    minor_version: 0
    someip_sd_timings_profile: server_default
- name: someip_server_socket_tcp1
  endpoint_address: 10.0.20.5
  endpoint_type: unicast
  port_no: 30501
  protocol: tcp
  tcp_profile: 1
  deployments:
  - deployment_type: someip_provider
    service: 0x0101
    instance_id: 2
    major_version: 1
    minor_version: 0
    someip_sd_timings_profile: server_default
class SocketContainer

Bases: FLYNCBaseModel

Represents a socket container for the ecu.

Parameters

namestr

Name of the socket container, implied from the filename on disk.

vlan_idint, optional

ID of the virtual interface. Use None for an untagged container.

socketslist of SocketTCP or SocketUDP

Assigned TCP and UDP socket endpoints.

class Socket

Bases: FLYNCBaseModel

Defines a virtual-interface socket that is bound to a specific IP address.

Parameters

namestr

A readable identifier for the socket.

endpoint_addressIPv4Address or IPv6Address

The IP address assigned to the socket.

port_noint

The port number the socket uses for communication.

deploymentslist of DeploymentUnion, optional

Deployments of the socket.

endpoint_typeLiteral[“multicast”, “unicast”], optional

The type of the socket endpoint, which can be either “multicast” or “unicast”. This field is per default automatically determined based on the value of endpoint_address, but can be overridden by explicitly providing a value.

multicast_txlist of IPvAnyAddress, optional

Multicast addresses that the socket is allowed to transmit to (only applicable for sockets with a multicast endpoint_type).

class SocketUDP

Bases: Socket

Represents a UDP socket.

Parameters

protocolLiteral[“udp”]

Transport protocol for the socket. Defaults to "udp".

udp_optionsUDPOption, optional

The UDP options that can be configured for this socket.

class SocketTCP

Bases: Socket

Represents a TCP socket.

Parameters

protocolLiteral[“tcp”]

Transport protocol for the socket. Defaults to "tcp".

tcp_profileint

The unique identifier of the TCP profile whose options are applied to the socket.

Endpoints

class IPv4AddressEndpoint

Bases: IPv4AddressEntry

Represents an IPv4 address endpoint for a network interface.

Parameters
socketslist of SocketTCP or SocketUDP

Assigned TCP and UDP socket endpoints.

class IPv6AddressEndpoint

Bases: IPv6AddressEntry

Represents an IPv6 address endpoint for a network interface.

Parameters
socketslist of SocketTCP or SocketUDP

Assigned TCP and UDP socket endpoints.

Deployments

class DeploymentUnion

Bases: RootModel

Union type representing a deployment configuration for a socket. This model wraps a union of different deployment models and uses the deployment_type field as a discriminator to determine which specific deployment model is present.

Possible types

SOMEIPServiceConsumer or SOMEIPServiceProvider or SOMEIPSDDeployment or PDUSender or PDUReceiver or PDUForwarder or DoIPServerDeployment or DoIPDiscoveryDeployment

Switch Config

Expand for Schematic
        classDiagram

    class FrameFilter {
        ethertype: Ethertype | list[Ethertype] | None = None
        src_mac: str | MACAddressEntry | list[str | MACAddressEntry] | None = None
        dst_mac: str | MACAddressEntry | list[str | MACAddressEntry] | None = None
        vlan_tagged: bool | None = None
        vlanid: int | ValueRange | list[int | ValueRange] | None = None
        pcp: int | list[int] | None = None
        src_ipv4: IPv4AddressEntry | IPv4Address | list[IPv4AddressEntry | IPv4Address] | None = None
        dst_ipv4: IPv4AddressEntry | IPv4Address | list[IPv4AddressEntry | IPv4Address] | None = None
        src_ipv6: IPv6AddressEntry | IPv6Address | list[IPv6AddressEntry | IPv6Address] | None = None
        dst_ipv6: IPv6AddressEntry | IPv6Address | list[IPv6AddressEntry | IPv6Address] | None = None
        protocol: Literal['tcp'] | Literal['udp'] | None = None
        src_port: int | ValueRange | list[int | ValueRange] | None = None
        dst_port: int | ValueRange | list[int | ValueRange] | None = None
    }

    class Switch {
        name: str
        switch_config: SwitchConfig
        host_controller: Controller | None = None
    }

    class BASET {
        mode: Literal['base_t'] = 'base_t'
        speed: Literal[100, 1000]
        duplex: Literal['full'] = 'full'
        role: Literal['master', 'slave'] = 'slave'
        autonegotiation: bool = False
    }

    class Controller {
        name: str
        controller_metadata: EmbeddedMetadata
        ethernet_interfaces: list[EthernetInterface] | None = list
        can_interfaces: list[CANInterface] | None = list
        lin_interfaces: list[LINMasterInterface | LINSlaveInterface] | None = list
        compute_nodes: list[ComputeNode] | None = list
        switches: list[Switch] | None = list
        controller_topology: ControllerTopology | None = None
        app_bindings: AppBindings | None = None
        state_memberships: list[StateMembershipRef] | None = []
    }

    class Drop {
        ports: list[str] | None = list
        type: Literal['drop'] = 'drop'
    }

    class PortScopedAction {
        ports: list[str] | None = list
    }

    class PTPConfig {
        cmlds_linkport_enabled: bool = False
        ptp_ports: list[PTPPort] = []
    }

    class NamingStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FIELD_NAME: int = 0
        FIXED_PATH: int = 1
    }

    class EmbeddedMetadata {
        type: Literal['embedded'] = 'embedded'
        author: str
        compatible_flync_version: BaseVersion
        extensions: dict[str, str] | None = None
        hardware: HardwareBaseMetadata | None = None
        app: SoftwareBaseMetadata | None = None
        bootloader: SoftwareBaseMetadata | None = None
        target_system: str
    }

    class BASET1 {
        mode: Literal['base_t1'] = 'base_t1'
        speed: Literal[100, 1000] = 100
        duplex: Literal['full'] = 'full'
        role: Literal['master', 'slave'] = 'slave'
        autonegotiation: bool = False
    }

    class ImpliedStrategy {
        <<Enumeration>>
        AUTO: int = 0
        FOLDER_NAME: int = 0
        FILE_NAME: int = 1
    }

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class FrameMask {
        data: int
        mask: int | None = None
        offset: int
    }

    class TCAMRule {
        name: str
        id: int
        match_filter: FrameFilter | None = None
        frame_mask: list[FrameMask] | None = list
        frame_window: int | None = None
        match_ports: list[str] | None = list
        action: list[Drop | Mirror | VLANOverwrite | ForceEgress | RemoveVLAN] | None = list
        vehicle_state: Bitmask | None = None
    }

    class VLANOverwrite {
        ports: list[str] | None = list
        type: Literal['vlan_overwrite'] = 'vlan_overwrite'
        overwrite_vlan_id: int | None = None
        overwrite_vlan_pcp: int | None = None
    }

    class VLANEntry {
        name: str
        id: int
        default_priority: int
        ports: list[str]
        multicast: list[MulticastGroup] | None = []
    }

    class Bitmask {
        data: int
        mask: int | None = None
    }

    class OutputStrategy {
        <<Enumeration>>
        AUTO: int = 1
        FOLDER: int = 1
        SINGLE_FILE: int = 2
        OMMIT_ROOT: int = 4
        FIXED_ROOT: int = 8
    }

    class MII {
        type: Literal['mii'] = 'mii'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

    class MACsecConfig {
        vlan_bypass: list[int]
        ethertype_bypass: list[Ethertype] = []
        src_mac_address_bypass: list[MacAddress] = []
        dest_mac_address_bypass: list[MacAddress] = []
        ckn: str
        mka_enabled: bool | None = True
        hello_time: int
        bounded_hello_time: int
        life_time: int
        sak_retire_time: int
        hello_time_rampup: list[int] = []
        sak_rekey_time: int | None = 3
        macsec_mode: Literal['disabled', 'integrity', 'integrity_confidentiality']
        kay_on: bool
        key_role: Literal['key_server_always', 'key_server_never']
        delay_protect: bool
        participant_activation: Literal['disabled', 'onoperup', 'always']
        sci_included: bool | None = False
        replay_protection_window: int = 0
        cipher_preference: list[IntegrityWithoutConfidentiality | IntegrityWithConfidentiality] = <lambda>
    }

    class SwitchPort {
        name: str
        silicon_port_no: int
        default_vlan_id: int
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        ptp_config: PTPConfig | None = None
        ingress_streams: list[Stream] | None = []
        traffic_classes: list[TrafficClass] | None = []
        macsec_config: MACsecConfig | None = None
    }

    class RGMII {
        type: Literal['rgmii'] = 'rgmii'
        speed: Literal[10, 100, 1000] | None = 1000
        mode: Literal['mac', 'phy']
    }

    class Stream {
        name: str
        stream_identification: list[FrameFilter] = []
        drop_at_ingress: bool | None = False
        max_sdu_size: int | None = 1522
        policer: SingleRateTwoColorMarker | SingleRateThreeColorMarker | DoubleRateThreeColorMarker | None = None
        ipv: int | None = None
        ats: ATSInstance | None = None
    }

    class BASET1S {
        mode: Literal['base_t1s'] = 'base_t1s'
        speed: Literal[10] = 10
        duplex: Literal['half', 'full'] = 'half'
        topology: Literal['p2p', 'multidrop'] = 'p2p'
        autonegotiation: bool = False
    }

    class SGMII {
        type: Literal['sgmii'] = 'sgmii'
        speed: Literal[10, 100, 1000, 2500] | None = 1000
        mode: Literal['mac', 'phy']
    }

    class RemoveVLAN {
        ports: list[str] | None = list
        type: Literal['remove_vlan'] = 'remove_vlan'
    }

    class RMII {
        type: Literal['rmii'] = 'rmii'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

    class XFI {
        type: Literal['xfi'] = 'xfi'
        speed: Literal[10000] = 10000
        mode: Literal['mac', 'phy']
    }

    class ForceEgress {
        ports: list[str] | None = list
        type: Literal['force_egress'] = 'force_egress'
    }

    class Mirror {
        ports: list[str] | None = list
        type: Literal['mirror'] = 'mirror'
    }

    class FLYNCBaseModel {
    }

    class SwitchConfig {
        meta: EmbeddedMetadata
        tcam_rules: list[TCAMRule] | None = []
        ports: list[SwitchPort]
        vlans: list[VLANEntry]
        dynamic_address_aging_time: int | None = None
    }

    class TrafficClass {
        name: str
        priority: int
        frame_priority_values: list[int] | None = []
        internal_priority_values: list[int] | None = []
        selection_mechanisms: CBSShaper | ATSShaper | None = None
    }

    Controller ..> Switch
    Controller ..> AppBindings
    Controller ..> ControllerTopology
    Controller ..> CANInterface
    Controller ..> StateMembershipRef
    Controller ..> EthernetInterface
    Controller ..> LINSlaveInterface
    Controller ..> ComputeNode
    Controller ..> LINMasterInterface
    Controller ..> EmbeddedMetadata
    VLANEntry ..> MulticastGroup
    EmbeddedMetadata ..> BaseVersion
    EmbeddedMetadata ..> SoftwareBaseMetadata
    EmbeddedMetadata ..> HardwareBaseMetadata
    MACsecConfig ..> IntegrityWithoutConfidentiality
    MACsecConfig ..> IntegrityWithConfidentiality
    MACsecConfig ..> Ethertype
    MACsecConfig ..> MacAddress
    FrameFilter ..> IPv4AddressEntry
    FrameFilter ..> MACAddressEntry
    FrameFilter ..> IPv6Address
    FrameFilter ..> IPv6AddressEntry
    FrameFilter ..> IPv4Address
    FrameFilter ..> Ethertype
    FrameFilter ..> ValueRange
    PTPConfig ..> PTPPort
    Stream ..> FrameFilter
    Stream ..> ATSInstance
    Stream ..> SingleRateThreeColorMarker
    Stream ..> DoubleRateThreeColorMarker
    Stream ..> SingleRateTwoColorMarker
    TrafficClass ..> ATSShaper
    TrafficClass ..> CBSShaper
    SwitchPort ..> RMII
    SwitchPort ..> XFI
    SwitchPort ..> MII
    SwitchPort ..> PTPConfig
    SwitchPort ..> MACsecConfig
    SwitchPort ..> TrafficClass
    SwitchPort ..> RGMII
    SwitchPort ..> Stream
    SwitchPort ..> SGMII
    TCAMRule ..> VLANOverwrite
    TCAMRule ..> FrameFilter
    TCAMRule ..> FrameMask
    TCAMRule ..> Drop
    TCAMRule ..> ForceEgress
    TCAMRule ..> Mirror
    TCAMRule ..> Bitmask
    TCAMRule ..> RemoveVLAN
    SwitchConfig ..> TCAMRule
    SwitchConfig ..> SwitchPort
    SwitchConfig ..> EmbeddedMetadata
    SwitchConfig ..> VLANEntry
    Switch ..> SwitchConfig
    Switch ..> Controller


    
Expand for a YAML example - 📁 switches/

Note

The switches directory contains the individual configuration files for every ethernet switch that is present in that ECU. This is a non-mandatory directory for the ECU configuration, since not all ECUs have switches.

meta:
  author: Dev
  compatible_flync_version:
    version_schema: semver
    version: 0.11.0
  target_system: flync_os
ports:
- name: hpc_s1_p0
  silicon_port_no: 0
  default_vlan_id: 1
  mii_config:
    type: rmii
    speed: 100
    mode: mac
  ptp_config:
      cmlds_linkport_enabled: false
      ptp_ports:
        - domain_id: 0
          src_port_identity: 2
          sync_config:
            type: time_receiver
            sync_timeout: 3
            sync_followup_timeout: 10
          pdelay_config:
            log_tx_period: 1
  ingress_streams:
    - name: stream_0
      stream_identification:
        - vlanid: [10, 20, 30, 40]
          dst_ipv4:
            address: 10.0.0.0
            ipv4netmask: 255.255.0.0
          protocol: udp
          dst_port:
            from_value: 32000
            to_value: 33000
      drop_at_ingress: false
      max_sdu_size: 1522
      policer:
        type: single_rate_two_color
        cir: 10000
        cbs: 10000
        eir: 0
        ebs: 5000
        coupling: false
    - name: stream_1
      stream_identification:
        - vlanid: 10
          dst_ipv4:
            address: 224.0.0.0
            ipv4netmask: 255.0.0.0
          protocol: tcp
      drop_at_ingress: false
      max_sdu_size: 1522
      policer:
        type: double_rate_three_color
        cir: 10000
        cbs: 10000
        eir: 20000
        ebs: 2000
        coupling: true
  traffic_classes:
    - name: high_prio
      priority: 7
      frame_priority_values: [7, 6, 5, 4]
      selection_mechanisms:
        type: cbs
        idleslope: 50000
    - name: best_effort
      priority: 1
      frame_priority_values: [3, 2, 1, 0]
      selection_mechanisms:
        type: cbs
        idleslope: 10000
  macsec_config:
    vlan_bypass: []
    ckn: hpc1_z1
    mka_enabled: true
    hello_time: 1000
    bounded_hello_time: 2000
    life_time: 100000
    sak_retire_time: 20000
    macsec_mode: integrity
    kay_on: true
    key_role: key_server_never
    delay_protect: false
    participant_activation: always

- name: hpc_s1_p1
  silicon_port_no: 1
  default_vlan_id: 1
  mii_config:
    type: rmii
    speed: 100
    mode: mac
  ptp_config:
      cmlds_linkport_enabled: false
      ptp_ports:
        - domain_id: 0
          src_port_identity: 3
          sync_config:
            type: time_transmitter
            log_tx_period: -3
            two_step: true
            tlv: []
  macsec_config:
      vlan_bypass: []
      ckn: hpc_s1_c1
      mka_enabled: true
      hello_time: 1000
      bounded_hello_time: 2000
      life_time: 100000
      sak_retire_time: 20000
      macsec_mode: integrity
      kay_on: true
      key_role: key_server_never
      delay_protect: false
      participant_activation: always

- name: hpc_s1_p2
  silicon_port_no: 2
  default_vlan_id: 1
  mii_config:
    type: rmii
    speed: 100
    mode: mac
  macsec_config:
      vlan_bypass: []
      ckn: hpc_s1_c2
      mka_enabled: true
      hello_time: 1000
      bounded_hello_time: 2000
      life_time: 100000
      sak_retire_time: 20000
      macsec_mode: integrity
      kay_on: true
      key_role: key_server_never
      delay_protect: false
      participant_activation: always

- name: hpc_s1_p3
  silicon_port_no: 3
  default_vlan_id: 1
  ptp_config:
      cmlds_linkport_enabled: false
      ptp_ports:
        - domain_id: 0
          src_port_identity: 4
          sync_config:
            type: time_transmitter
            log_tx_period: -3
            two_step: true
            tlv: []
  ingress_streams:
    - name: stream_0
      stream_identification:
        - vlanid: [10, 20, 30, 40]
          dst_ipv4:
            address: 10.0.0.0
            ipv4netmask: 255.255.0.0
          protocol: udp
          dst_port:
            from_value: 32000
            to_value: 33000
      drop_at_ingress: false
      max_sdu_size: 1522
      policer:
        type: single_rate_two_color
        cir: 10000
        cbs: 10000
        eir: 0
        ebs: 5000
        coupling: false
    - name: stream_1
      stream_identification:
        - vlanid: 10
          dst_ipv4:
            address: 224.0.0.0
            ipv4netmask: 255.0.0.0
          protocol: tcp
      drop_at_ingress: false
      max_sdu_size: 1522
      policer:
        type: double_rate_three_color
        cir: 10000
        cbs: 10000
        eir: 20000
        ebs: 2000
        coupling: true
  traffic_classes:
    - name: high_prio
      priority: 7
      frame_priority_values: [7, 6, 5, 4]
      selection_mechanisms:
        type: cbs
        idleslope: 50000
    - name: best_effort
      priority: 1
      frame_priority_values: [3, 2, 1, 0]
      selection_mechanisms:
        type: cbs
        idleslope: 10000
  macsec_config:
      vlan_bypass: []
      ckn: hpc1_eth_ecu
      mka_enabled: true
      hello_time: 1000
      bounded_hello_time: 2000
      life_time: 100000
      sak_retire_time: 20000
      macsec_mode: integrity
      kay_on: true
      key_role: key_server_never
      delay_protect: false
      participant_activation: always

- name: hpc_s1_p4
  silicon_port_no: 4
  default_vlan_id: 1
  ptp_config:
      cmlds_linkport_enabled: false
      ptp_ports:
        - domain_id: 0
          src_port_identity: 5
          sync_config:
            type: time_transmitter
            log_tx_period: -3
            two_step: true
            tlv: []
  ingress_streams:
    - name: stream_0
      stream_identification:
        - vlanid: [10, 20, 30, 40]
          dst_ipv4:
            address: 10.0.0.0
            ipv4netmask: 255.255.0.0
          protocol: udp
          dst_port:
            from_value: 32000
            to_value: 33000
      drop_at_ingress: false
      max_sdu_size: 1522
      policer:
        type: single_rate_two_color
        cir: 10000
        cbs: 10000
        eir: 0
        ebs: 5000
        coupling: false
    - name: stream_1
      stream_identification:
        - vlanid: 10
          dst_ipv4:
            address: 224.0.0.0
            ipv4netmask: 255.0.0.0
          protocol: tcp
      drop_at_ingress: false
      max_sdu_size: 1522
      policer:
        type: double_rate_three_color
        cir: 10000
        cbs: 10000
        eir: 20000
        ebs: 2000
        coupling: true
  traffic_classes:
    - name: high_prio
      priority: 7
      frame_priority_values: [7, 6, 5, 4]
      selection_mechanisms:
        type: cbs
        idleslope: 50000
    - name: best_effort
      priority: 1
      frame_priority_values: [3, 2, 1, 0]
      selection_mechanisms:
        type: cbs
        idleslope: 10000
  macsec_config:
      vlan_bypass: []
      ckn: hpc1_z2
      mka_enabled: true
      hello_time: 1000
      bounded_hello_time: 2000
      life_time: 100000
      sak_retire_time: 20000
      macsec_mode: integrity
      kay_on: true
      key_role: key_server_never
      delay_protect: false
      participant_activation: always

- name: hpc_s1_p6
  silicon_port_no: 6
  default_vlan_id: 1
  mii_config:
    type: sgmii
    speed: 1000
    mode: mac

- name: hpc_s1_cpu_port
  silicon_port_no: 5
  default_vlan_id: 30

vlans:
- name: VLAN10
  id: 10
  default_priority: 0
  ports:
    - hpc_s1_p0
    - hpc_s1_p1

- name: VLAN20
  id: 20
  default_priority: 0
  ports:
    - hpc_s1_p0
    - hpc_s1_p1
    - hpc_s1_p4

- name: VLAN30
  id: 30
  default_priority: 0
  ports:
    - hpc_s1_p0
    - hpc_s1_p2
    - hpc_s1_cpu_port

- name: VLAN40
  id: 40
  default_priority: 0
  ports:
    - hpc_s1_p6
    - hpc_s1_p2
    - hpc_s1_p3
    - hpc_s1_p4
    - hpc_s1_p1
    - hpc_s1_p0
    - hpc_s1_cpu_port

- name: VLAN50
  id: 50
  default_priority: 0
  ports:
    - hpc_s1_p1
    - hpc_s1_cpu_port

Hint

A switch configuration contains key details regarding the following parameters:

  • switch (logical) ports

  • VLAN configuration

  • multicast configuration

  • TimeSync configuration

  • QoS configuration

Hint

Similar to controller config, each port of switch with an external PHY has an mii_config (see Media-Independent Interfaces), describing the various properties of the MII connected to that port. For switch ports using an integrated PHY, no mii_config is needed.

Note

Each switch folder holds a 📄 switch.flync.yaml file (the SwitchConfig — ports, VLANs, TCAM rules, dynamic address aging) and, optionally, a 📁 switch_host_controller/ sub-folder. That sub-folder is a regular Controller Config (name, ethernet interfaces, virtual interfaces, …) and models the switch’s own host controller — the CPU that manages the switch via its CPU port. Because it is a full Controller, its interfaces are linked to the switch’s CPU port through a SwitchPortToHostControllerInterface connection in the ECU’s internal topology.

class Switch

Bases: FLYNCBaseModel

Represents an automotive Ethernet network switch configuration.

Parameters

namestr

Name of the switch. Implied from the folder name.

switch_configSwitchConfig

The core switch configuration loaded from switch.flync.yaml.

host_controllerController, optional

The host controller managing the switch, stored in the switch_host_controller/ sub-folder.

class SwitchConfig

Bases: FLYNCBaseModel

Core switch configuration data stored in switch.flync.yaml.

This model holds the switch metadata, ports, VLANs, and TCAM rules. It is loaded from the switch.flync.yaml file inside each switch folder.

Parameters

metaEmbeddedMetadata

Metadata associated with the switch.

portslist of SwitchPort

List of switch ports.

vlanslist of VLANEntry

List of VLAN entries configured on the switch.

tcam_ruleslist of TCAMRule, optional

List of TCAM rules configured on the switch.

dynamic_address_aging_timeint, optional

Aging time, in seconds, for dynamically learned address entries in the switch’s Filtering Database (FDB). A learned MAC address is removed if no matching frame is seen within this interval. Must be a positive value.

class SwitchPort

Bases: FLYNCBaseModel

Represents a Switch Port and its configuration.

Parameters

namestr

Name of the Switch Port.

silicon_port_noint

Silicon hardware port number (vendor-specific). Must be greater or equal to 0.

default_vlan_idint

VLAN ID to be added to an untagged frame ingressing on the port (>= 0 and <= 4095). Use None for an untagged port (no default VLAN).

mii_configMII or RMII or SGMII or RGMII, optional

Media-independent interface configuration (e.g., MII or RMII).

ptp_configPTPConfig, optional

Precision Time Protocol configuration.

ingress_streamslist of Stream, optional

Stream-based IEEE 802.1Qci configuration.

traffic_classeslist of TrafficClass, optional

Traffic class definitions and traffic shaping configuration applied to egress port queues.

macsec_configMACsecConfig, optional

MACsec configuration for the port.

Private Attributes

_type :

The type of the object generated. Set to controller_interface.

_mdi_config : BaseT1 or BaseT1S or BaseT

_connected_component:

The switch port, controller interface or ecu port connected to the switch port. This attribute is managed internally and is not part of the public API.

class VLANEntry

Bases: FLYNCBaseModel

Represents a VLAN entry for a switch.

Parameters

namestr

Human-readable name for the VLAN.

idint

VLAN ID. Values 0-4094 are accepted; 4095 is reserved by IEEE 802.1Q and emits a warning when used.

default_priorityint

Default frame priority for the VLAN (0-7).

portslist of str

List of switch port names members of this VLAN.

multicastlist of MulticastGroup, optional

List of multicast group configurations associated with this VLAN.

TCAM

class TCAMRule

Bases: FLYNCBaseModel

Definition of a TCAM (ternary content-addressable memory) rule for a switch.

Parameters

namestr

Name for the description of the TCAM rule (minimum length 1).

idStrictInt

Unique TCAM rule ID. Must be greater or equal to 0.

match_filterFrameFilter, optional

Packet-matching filter for layer-based matching on MAC/IP/VLAN/ports. Mutually exclusive with frame_mask.

frame_masklist of FrameMask, optional

Packet-matching criteria for byte-level pattern matching on raw frame data. The masks of one rule must inspect disjoint byte ranges of the frame.

frame_windowint, optional

Maximum number of leading frame bytes the frame_mask entries may inspect. Unbounded when omitted. Must be greater or equal to 1.

match_portslist of str, Optional

Ports to which the rule is bound. Defaults to all ports of the switch if kept empty or undefined.

actionlist of Drop or Mirror or ForceEgress or VLANOverwrite or RemoveVLAN

One or more actions performed when the rule matches. The type field of each action class acts as the discriminating key for Pydantic.

A single port must not be targeted by more than one of drop, force_egress or mirror, nor by more than one of remove_vlan or vlan_overwrite.

vehicle_stateBitmask, optional

Vehicle-state pattern the rule is gated on: it applies only when (current_state & vehicle_state.mask) == vehicle_state.data. Both data and mask must fit in the 8-bit vehicle-state register. None (default) means the rule is not gated on vehicle state.

class FrameMask

Bases: Bitmask

Byte-level pattern matching of an Ethernet frame, i.e. a Bitmask bound to a frame position.

A frame matches if (frame[offset:offset + byte_length] & mask) == data, e.g. a two-byte pattern at offset=12 matches on the EtherType field.

Parameters

offsetint

Byte position in the frame where the pattern match begins. Must be greater or equal to 0.

Actions

class Drop

Bases: PortScopedAction

Action that discards traffic on the selected egress ports.

Parameters
typeLiteral[“drop”]

Discriminator used by Pydantic.

portslist of str, Optional

Egress ports where the drop action should be applied. Defaults to all ports of the switch if kept empty or undefined.

class Mirror

Bases: PortScopedAction

Action that mirrors incoming traffic to additional egress ports.

Parameters
typeLiteral[“mirror”]

Discriminator used by Pydantic.

portslist of str, Optional

Egress ports that will receive the mirrored traffic. Defaults to all ports of the switch if kept empty or undefined.

class ForceEgress

Bases: PortScopedAction

Action that forces a packet to leave through a given set of ports, bypassing the normal forwarding decision.

Parameters
typeLiteral[“force_egress”]

Discriminator used by Pydantic.

portslist of str, Optional

Egress ports to which the messages are force-forwarded. Defaults to all ports of the switch if kept empty or undefined.

class VLANOverwrite

Bases: PortScopedAction

Action that overwrites VLAN ID and/or PCP values on selected ports.

Parameters
typeLiteral[“vlan_overwrite”]

Discriminator used by Pydantic.

overwrite_vlan_idint, optional

New VLAN identifier (0-4095). If None, the VLAN ID is left unchanged.

overwrite_vlan_pcpint, optional

New PCP value (0-7). If None, the PCP value is left unchanged.

portslist of str, Optional

Egress ports at which the overwriting should take place. Defaults to all ports of the switch if kept empty or undefined.

class RemoveVLAN

Bases: PortScopedAction

Action that removes the VLAN tag from packets on the given ports.

Parameters
typeLiteral[“remove_vlan”]

Discriminator used by Pydantic.

portslist of str, Optional

Egress ports where the VLAN tag will be removed. Defaults to all ports of the switch if kept empty or undefined.

Router Config

class RouteEntry

Bases: FLYNCBaseModel

Represents a static routing table entry.

Parameters

destinationIPv4AddressEntry or IPv6AddressEntry

The destination network expressed as address and mask (e.g. address="10.0.0.0", ipv4netmask="255.255.255.0").

default_gatewayIPvAnyAddress

Gateway IP for this route. If the next hop is a router, this is that router’s VCI address on the shared subnet. If the next hop is a controller interface (directly connected), this is the controller interface’s IP address.

egress_interfacestr

Name of the VirtualControllerInterface on this interface through which this route is forwarded.

PHY Config

Media-Dependent Interfaces

class BASET

Bases: FLYNCBaseModel

Represents a BASE-T Ethernet interface configuration.

Parameters

modeLiteral[“base_t”]

Interface mode. Defaults to "base_t".

speedint

Supported link speed in megabits per second. Valid values are 100 or 1000.

duplexLiteral[“full”]

Duplex mode. Defaults to "full".

roleLiteral[“master”, “slave”]

Role of the PHY, either master or slave. Defaults to "slave".

autonegotiationbool, optional

Indicates whether autonegotiation is enabled (defaults to False).

class BASET1

Bases: FLYNCBaseModel

Represents a BASE-T1 Ethernet interface configuration.

Parameters

modeLiteral[“base_t1”]

Interface mode. Defaults to "base_t1".

speedint

Supported link speed in megabits per second. Valid values are 100 or 1000.

duplexLiteral[“full”]

Duplex mode. Defaults to "full".

roleLiteral[“master”, “slave”]

Role of the PHY, either master or slave.

autonegotiationbool, optional

Indicates whether autonegotiation is enabled (defaults to False).

class BASET1S

Bases: FLYNCBaseModel

10BASE-T1S PHY, IEEE 802.3-2022 Clause 147.

Half duplex on a shared multidrop segment (with PLCA) or full duplex on a point-to-point link.

There is no role field. DME is self-clocked, so no side of the link supplies a clock; a config that still sets role loads with a warning and drops the key.

Parameters

modeLiteral[“base_t1s”]

Interface mode. Defaults to "base_t1s".

speedint

Link speed in megabits per second. Defaults to 10.

duplexLiteral[“half”, “full”]

Duplex mode. Defaults to "half". "full" is valid only with topology="p2p": a shared medium is always half duplex.

topologyLiteral[“p2p”, “multidrop”]

Whether the PHY sits on a point-to-point link or a shared multidrop segment. Defaults to "p2p".

autonegotiationbool, optional

Autonegotiation enabled (defaults to False). Valid on a point-to-point link only: a mixing segment is shared, so there is no peer to negotiate with.

Media-Independent Interfaces

class MII

Bases: FLYNCBaseModel

Represents a Media Independent Interface (MII) configuration.

Parameters

typeLiteral[“mii”]

Interface type. Defaults to "mii".

speedint, optional

Highest link speed this interface carries, in megabits per second. Valid values are 10 or 100. Defaults to 100 Mbps. The clock scales with the link rate (25/2.5 MHz), so a port may pair this with a slower MDI.

modeLiteral[“mac”, “phy”]

Operating mode, either MAC or PHY.

class RMII

Bases: FLYNCBaseModel

Represents a Reduced Media Independent Interface (RMII) configuration.

Parameters

typeLiteral[“rmii”]

Interface type. Defaults to "rmii".

speedint, optional

Highest link speed this interface carries, in megabits per second. Valid values are 10 or 100. Defaults to 100 Mbps. The 50 MHz reference clock never slows down; a 10 Mbps link is carried by holding each dibit for 10 clock cycles, so a port may pair this with a slower MDI.

modeLiteral[“mac”, “phy”]

Operating mode, either MAC or PHY.

class SGMII

Bases: FLYNCBaseModel

Represents a Serial Gigabit Media Independent Interface (SGMII or SGMII+) configuration.

Parameters

typeLiteral[“sgmii”]

Interface type. Defaults to "sgmii".

speedint, optional

Highest link speed this interface carries, in megabits per second. Valid values are 10, 100, 1000, or 2500. Defaults to 1000 Mbps. The serdes never slows down; a slower link is carried by repeating each code group (10x at 100 Mbps, 100x at 10 Mbps), so a port may pair this with a slower MDI.

modeLiteral[“mac”, “phy”]

Operating mode, either MAC or PHY.

class RGMII

Bases: FLYNCBaseModel

Represents a Reduced Gigabit Media Independent Interface (RGMII) configuration.

Parameters

typeLiteral[“rgmii”]

Interface type. Defaults to "rgmii".

speedint, optional

Highest link speed this interface carries, in megabits per second. Valid values are 10, 100, or 1000. Defaults to 1000 Mbps. The clock scales with the link rate (125/25/2.5 MHz), so a port may pair this with a slower MDI.

modeLiteral[“mac”, “phy”]

Operating mode, either MAC or PHY.

class XFI

Bases: FLYNCBaseModel

Represents a 10-Gigabit Ethernet (10GbE) serial electrical interface (XFI) configuration.

Parameters

typeLiteral[“xfi”]

Interface type. Defaults to “xfi”.

speedLiteral[10000]

Supported speed in Mbps. Defaults to 10000.

modeLiteral[“mac”, “phy”]

Operating mode of the interface, either MAC or PHY.

ECU Internal Topology

Expand for Schematic
        classDiagram

    class Switch {
        name: str
        switch_config: SwitchConfig
        host_controller: Controller | None = None
    }

    class SwitchPortToSwitchPort {
        type: Literal['switch_to_switch_same_ecu'] = 'switch_to_switch_same_ecu'
        id: str
        switch_port_name: str
        switch_name: str | None = None
        switch2_port_name: str
        switch2_name: str | None = None
    }

    class SwitchPortToXConnection {
        type: str
        id: str
        switch_port_name: str
        switch_name: str | None = None
    }

    class Controller {
        name: str
        controller_metadata: EmbeddedMetadata
        ethernet_interfaces: list[EthernetInterface] | None = list
        can_interfaces: list[CANInterface] | None = list
        lin_interfaces: list[LINMasterInterface | LINSlaveInterface] | None = list
        compute_nodes: list[ComputeNode] | None = list
        switches: list[Switch] | None = list
        controller_topology: ControllerTopology | None = None
        app_bindings: AppBindings | None = None
        state_memberships: list[StateMembershipRef] | None = []
    }

    class EthernetInterface {
        name: str
        interface_config: EthernetInterfaceConfig
        sockets: list[SocketContainer] | None = list
    }

    class ECUPortToSwitchPort {
        type: Literal['ecu_port_to_switch_port'] = 'ecu_port_to_switch_port'
        id: str
        switch_port_name: str
        switch_name: str | None = None
        ecu_port_name: str
    }

    class ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

    class ECUPortToXConnection {
        type: str
        id: str
        ecu_port_name: str
    }

    class SwitchPort {
        name: str
        silicon_port_no: int
        default_vlan_id: int
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        ptp_config: PTPConfig | None = None
        ingress_streams: list[Stream] | None = []
        traffic_classes: list[TrafficClass] | None = []
        macsec_config: MACsecConfig | None = None
    }

    class ControllerInterfaceToXConnection {
        type: str
        id: str
        iface_name: str
        controller_name: str | None = None
    }

    class InternalConnectionUnion {
        root: ECUPortToSwitchPort | ECUPortToControllerInterface | SwitchPortToControllerInterface | SwitchPortToHostControllerInterface | SwitchPortToSwitchPort | ControllerInterfaceToControllerInterface
    }

    class InternalConnection {
        type: str
        id: str
    }

    class Category {
        <<Enumeration>>
        VALUE_RANGE: int = 1
        REQUIRED: int = 2
        CONSISTENCY: int = 3
        UNIQUENESS: int = 4
        REFERENCE: int = 5
        FORMAT: int = 6
        COMPATIBILITY: int = 7
        STRUCTURAL: int = 8
        LIFECYCLE: int = 9
    }

    class SwitchPortToControllerInterface {
        type: Literal['switch_port_to_controller_interface'] = 'switch_port_to_controller_interface'
        id: str
        iface_name: str
        controller_name: str | None = None
        switch_port_name: str
        switch_name: str | None = None
    }

    class ControllerInterfaceToControllerInterface {
        type: Literal['controller_interface_to_controller_interface'] = 'controller_interface_to_controller_interface'
        id: str
        iface_name: str
        controller_name: str | None = None
        iface2_name: str
        controller2_name: str | None = None
    }

    class FLYNCBaseModel {
    }

    class InternalTopology {
        connections: list[InternalConnectionUnion] = list
    }

    class RootModel {
        root: RootModelRootType
    }

    class SwitchPortToHostControllerInterface {
        type: Literal['switch_port_to_host_controller_interface'] = 'switch_port_to_host_controller_interface'
        id: str
        switch_port_name: str
        switch_name: str | None = None
        host_controller_interface_name: str
    }

    class ECUPortToControllerInterface {
        type: Literal['ecu_port_to_controller_interface'] = 'ecu_port_to_controller_interface'
        id: str
        iface_name: str
        controller_name: str | None = None
        ecu_port_name: str
    }

    RootModel ..> RootModelRootType
    Controller ..> Switch
    Controller ..> AppBindings
    Controller ..> ControllerTopology
    Controller ..> CANInterface
    Controller ..> StateMembershipRef
    Controller ..> EthernetInterface
    Controller ..> LINSlaveInterface
    Controller ..> ComputeNode
    Controller ..> LINMasterInterface
    Controller ..> EmbeddedMetadata
    EthernetInterface ..> EthernetInterfaceConfig
    EthernetInterface ..> SocketContainer
    ECUPort ..> RMII
    ECUPort ..> XFI
    ECUPort ..> MII
    ECUPort ..> BASET
    ECUPort ..> RGMII
    ECUPort ..> BASET1S
    ECUPort ..> SGMII
    ECUPort ..> BASET1
    Switch ..> SwitchConfig
    Switch ..> Controller
    SwitchPort ..> RMII
    SwitchPort ..> XFI
    SwitchPort ..> MII
    SwitchPort ..> PTPConfig
    SwitchPort ..> MACsecConfig
    SwitchPort ..> TrafficClass
    SwitchPort ..> RGMII
    SwitchPort ..> Stream
    SwitchPort ..> SGMII
    InternalConnectionUnion ..> ECUPortToSwitchPort
    InternalConnectionUnion ..> SwitchPortToControllerInterface
    InternalConnectionUnion ..> SwitchPortToSwitchPort
    InternalConnectionUnion ..> SwitchPortToHostControllerInterface
    InternalConnectionUnion ..> ControllerInterfaceToControllerInterface
    InternalConnectionUnion ..> ECUPortToControllerInterface
    InternalTopology ..> InternalConnectionUnion


    
Expand for a YAML example - 📄 topology.flync.yaml

Note

This file contains all the different internal connections between entities of an ECU (ports, switch ports, controller interfaces, …) to resolve the internal topology of the component and run validation checks on the model. This is a mandatory file for the ECU configuration, since all ECUs present (at least) one ECU port and one Controller Interface.

connections:
  - type: ecu_port_to_switch_port
    id: conn1
    ecu_port: hpc1_p1
    switch_port: hpc_s1_p0
  - type: ecu_port_to_switch_port
    id: conn2
    ecu_port: hpc1_p2
    switch_port: hpc_s1_p4
  - type: ecu_port_to_switch_port
    id: conn3
    ecu_port: hpc1_p3
    switch_port: hpc_s1_p3
  - type: switch_port_to_controller_interface
    id: conn4
    switch_port: hpc_s1_p1
    controller_interface: hpc_c1_iface1
  - type: switch_port_to_controller_interface
    id: conn5
    switch_port: hpc_s1_p2
    controller_interface: hpc_c2_iface1
  - type: ecu_port_to_switch_port
    id: conn6
    ecu_port: hpc1_p5
    switch_port: hpc_s1_p6
  - type: switch_port_to_host_controller_interface
    id: conn7
    switch_port: hpc_s1_cpu_port
    host_controller_interface: hpc_switch1_host_iface1

Internal Connection

Note

The fields of a connection will be different, depending on the kind of connection.

Types of Internal Connections

Types of Internal Connections

type

1st Attribute

2nd Attribute

ecu_port_to_switch_port

ecu_port

switch_port

ecu_port_to_controller_interface

ecu_port

controller_interface

switch_port_to_controller_interface

switch_port

controller_interface

switch_port_to_host_controller_interface

switch_port

host_controller_interface

switch_port_to_switch_port

switch_port_1

switch_port_2

controller_interface_to_controller_interface

controller_interface_1

controller_interface_2

class InternalTopology

Bases: FLYNCBaseModel

Parameters

connectionslist of InternalConnectionUnion

List of internal connections between ECU components. Defaults to an empty list.

class InternalConnectionUnion

Bases: RootModel

Union type representing a connection between two internal ECU components.

This model wraps a union of different internal connection types and uses the type field as a discriminator to determine which specific connection type is present.

Possible types

ECUPortToSwitchPort

Connection from an ECU port to a switch port.

ECUPortToControllerInterface

Connection from an ECU port to a controller interface.

SwitchPortToControllerInterface

Connection from a switch port to a controller interface.

SwitchPortToHostControllerInterface

On-die connection from a switch’s CPU port to an interface of that switch’s own host controller.

SwitchPortToSwitchPort

Connection between two switch ports on the same ECU.

ControllerInterfaceToControllerInterface

Connection between two controller interfaces.

class InternalConnection

Bases: FLYNCBaseModel

Represents a base internal connection between two ECU components.

Parameters

typestr

The type of the connection.

idstr

Unique identifier for the connection.

Private Attributes

_ecuECU

The ECU object to which this connection belongs. Managed internally.

class ECUPortToXConnection

Bases: InternalConnection

Base class for connections from an ECU port to another ECU component.

Parameters

ecu_port_namestr

Name of the ECU port (alias: ecu_port).

Private Attributes

_ecu_portECUPort

Internal reference to the actual ECU port object. Managed privately.

class SwitchPortToXConnection

Bases: InternalConnection

Base class for connections from an ECU switch port to another component.

Parameters

switch_port_namestr

Name of the ECU switch port (alias: switch_port).

switch_namestr, optional

Name of the parent switch that owns switch_port (alias: switch). Required only when the switch-port name alone is ambiguous within the ECU (i.e. more than one of the ECU’s switches defines a port with the same name). When omitted, the resolver scans all switches in the ECU and raises if the reference is ambiguous.

Private Attributes

_switch_portSwitchPort

Internal reference to the actual switch port object. Managed privately.

_switchSwitch

Internal reference to the parent switch of _switch_port. Managed privately.

class ECUPortToSwitchPort

Bases: ECUPortToXConnection, SwitchPortToXConnection

Represents a connection from an ECU port to a switch port.

Parameters

typeLiteral[“ecu_port_to_switch_port”]

Type of the connection. Defaults to "ecu_port_to_switch_port".

class ECUPortToControllerInterface

Bases: ECUPortToXConnection, ControllerInterfaceToXConnection

Represents a connection from an ECU port to a controller interface.

Parameters

typeLiteral[“ecu_port_to_controller_interface”]

Type of the connection. Defaults to "ecu_port_to_controller_interface".

iface_namestr

Name of the controller interface (alias: controller_interface).

controller_namestr, optional

Name of the parent controller that owns controller_interface (alias: controller). Required only when controller_interface alone is ambiguous within the ECU (i.e. more than one of the ECU’s controllers defines an interface with the same name).

Private Attributes

_ifaceControllerInterface

Internal reference to the actual ControllerInterface object. Managed privately.

_controllerController

Internal reference to the parent controller of _iface. Managed privately.

class SwitchPortToControllerInterface

Bases: SwitchPortToXConnection, ControllerInterfaceToXConnection

Represents a connection from a switch port to a controller interface.

Parameters

typeLiteral[“switch_port_to_controller_interface”]

Type of the connection. Defaults to "switch_port_to_controller_interface".

class SwitchPortToHostControllerInterface

Bases: SwitchPortToXConnection

Represents the on-die connection between a switch’s CPU port and an Ethernet interface of that same switch’s own host controller.

Unlike SwitchPortToControllerInterface, this connection models an internal, on-die link — the switch and its host controller sit on the same die/package, so there is no PHY, MII, or cabling involved. No MII/MACsec/gPTP/HTB compatibility checks are performed for this connection type. The referenced interface must belong to the CPU port’s own switch; it can never reference the host controller of a different switch.

Parameters

typeLiteral[“switch_port_to_host_controller_interface”]

Type of the connection. Defaults to "switch_port_to_host_controller_interface".

host_controller_interface_namestr

Name of the Ethernet interface on the switch’s own host controller (alias: host_controller_interface).

Private Attributes

_ifaceEthernetInterface

Internal reference to the resolved host-controller interface. Managed privately.

class SwitchPortToSwitchPort

Bases: SwitchPortToXConnection

Represents a connection between two switch ports on the same ECU.

Parameters

typeLiteral[“switch_to_switch_same_ecu”]

Type of the connection. Defaults to "switch_to_switch_same_ecu".

switch2_port_namestr

Name of the second switch port (alias: switch2_port).

switch2_namestr, optional

Name of the parent switch that owns switch2_port (alias: switch2). Required only when switch2_port alone is ambiguous within the ECU. Mirrors the role of switch for the first port; see SwitchPortToXConnection.

Private Attributes

_switch2_portSwitchPort

Internal reference to the second switch port object. Managed privately.

_switch2Switch

Internal reference to the parent switch of _switch2_port. Managed privately.

class ControllerInterfaceToControllerInterface

Bases: ControllerInterfaceToXConnection

Represents a direct connection between two controller interfaces in an ECU.

Parameters

typeLiteral[“controller_interface_to_controller_interface”]

Type of the connection. Defaults to "controller_interface_to_controller_interface".

iface_namestr

Name of the first controller interface (alias: controller_interface).

iface2_namestr

Name of the second controller interface (alias: controller_interface2).

controller2_namestr, optional

Name of the parent controller that owns the second interface (alias: controller2).

Private Attributes

_ifaceControllerInterface

Internal reference to the first controller interface. Managed privately.

_iface2ControllerInterface

Internal reference to the second controller interface. Managed privately.

_controller2Controller

Internal reference to the controller that owns the second interface. Managed privately.

MAC Multicast Endpoints

Expand for Schematic
        classDiagram

    class RootModel {
        root: RootModelRootType
    }

    class MACEndpointUnion {
        root: AVTPMulticastEndpoint
    }

    class AVTPMulticastEndpoint {
        name: str
        mac_address: MacAddress
        protocol: Literal['avtp'] | Literal['AVTP']
        ethertype: Literal[8944] = 8944
        vlan_id: int | None = None
        multicast_tx: list[MacAddress] | None = []
    }

    class MACMulticastEndpoints {
        endpoints: list[MACEndpointUnion] = list
    }

    class MACMulticastEndpoint {
        name: str
        mac_address: MacAddress
        protocol: str
        ethertype: int | None = None
        vlan_id: int | None = None
        multicast_tx: list[MacAddress] | None = []
    }

    class FLYNCBaseModel {
    }

    RootModel ..> RootModelRootType
    MACMulticastEndpoint ..> MacAddress
    AVTPMulticastEndpoint ..> MacAddress
    MACEndpointUnion ..> AVTPMulticastEndpoint
    MACMulticastEndpoints ..> MACEndpointUnion


    
Expand for a YAML example - 📄 mac_multicast_endpoints.flync.yaml

Note

This file contains defines Endpoints of the ECU for transmitted MAC multicast addresses.

endpoints:
- name: avb_endpoint
  protocol: AVTP
  mac_address: 00:11:03:01:01:01
  vlan_id: 10
  multicast_tx:
  - 91:E0:F0:00:00:AA
  - 91:E0:F0:00:00:BB
class MACMulticastEndpoints

Bases: FLYNCBaseModel

Represents a collection of multicast endpoints for an ECU.

Parameters

endpointsList[MACEndpointUnion]

List of multicast endpoints associated with the ECU.

class MACEndpointUnion

Bases: RootModel

Union type for MAC multicast endpoints, discriminated by the ‘ethertype’ field.

Possible types

class MACMulticastEndpoint

Bases: FLYNCBaseModel

Represents a multicast endpoint that is bound to a specific controller.

Parameters

namestr

Name of the multicast endpoint.

mac_addressMacAddress

MAC address of the controller that this endpoint is bound to.

protocolstr

Protocol that is expected on this endpoint.

ethertypeint, optional

EtherType that is expected on this endpoint (defaults to None). Must be between 0x0000 and 0xFFFF if provided.

vlan_idint, optional

VLAN ID that is expected on this endpoint (defaults to None). Must be between 0 and 4095 if provided.

multicast_txlist of MacAddress, optional

List of multicast addresses that this endpoint should transmit to (defaults to []). Each address must be a valid multicast MAC address.

class AVTPMulticastEndpoint

Bases: MACMulticastEndpoint

Represents an AVTP multicast endpoint that is bound to a specific controller. This is a specialized version of MACMulticastEndpoint with fixed EtherType and protocol values.

Parameters

ethertypeLiteral[0x22F0]

EtherType for AVTP, fixed to 0x22F0.

protocolLiteral[“avtp”] | Literal[“AVTP”]

Protocol for AVTP, fixed to “avtp” (case-insensitive).

Multicast Group Memberships

Hint

Multicast group memberships of an ECU are computed from several locations of a FLYNC Config. They are stored as a list in the field multicast_groups of an ECU. Mind that these multicast groups are not part of any YAML config, but are accessible fields in a FLYNC workspace.

Receiving Nodes

Receiving nodes are listed in the multicast group membership with the mode “rx”.

These entries are computed from:

Sending Nodes

Sender nodes are listed in the multicast group membership with the mode “tx”.

These entries are computed from:

  • IPv4 or IPv6 addresses in the field multicast_tx of a Socket,

  • MAC addresses in the field multicast_tx of a MACMulticastEndpoint,

  • IPv6 solicited-node multicast addresses per VLAN.

class MulticastGroupMembership

Bases: FLYNCBaseModel

Represents a multicast group membership for virtual controller interfaces.

Parameters

groupIPvAnyAddress or MacAddress

Multicast group address.

descriptionstr, optional

Description of the multicast group membership.

modeLiteral[“tx”] or Literal[“rx”], optional

Mode of multicast group membership.

vlanint, optional

VLAN ID associated with the multicast group membership. Use None for untagged.

src_ipIPvAnyAddress, optional

Source IP address. Only applicable for “tx” mode.

solicited_node_multicastbool, optional

Whether this is a solicited node multicast address (defaults to False).