flync_4_ecu

ECU Config

Expand for Schematic
        classDiagram

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

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

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

    class Switch {
        name: str
        tcam_rules: list[TCAMRule] | None = []
        ports: list[SwitchPort]
        vlans: list[VLANEntry]
        host_controller: ControllerInterface | None = None
        meta: EmbeddedMetadata
    }

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

    class ControllerInterface {
        name: str
        mac_address: MacAddress
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        virtual_interfaces: list[VirtualControllerInterface]
        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
    }

    class Controller {
        name: str
        meta: EmbeddedMetadata
        interfaces: list[ControllerInterface]
    }

    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 UniqueName {
        name: str
    }

    class ECU {
        name: str
        ports: list[ECUPort] = list
        controllers: list[Controller]
        switches: list[Switch] | None = list
        topology: InternalTopology
        ecu_metadata: ECUMetadata
        sockets: list[SocketContainer] | None = list
    }

    class SocketContainer {
        vlan_name: str
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

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

    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
    }

    Controller ..> EmbeddedMetadata
    Controller ..> ControllerInterface
    ControllerInterface ..> MacAddress
    ControllerInterface ..> XFI
    ControllerInterface ..> Stream
    ControllerInterface ..> HTBInstance
    ControllerInterface ..> MACsecConfig
    ControllerInterface ..> VirtualControllerInterface
    ControllerInterface ..> TrafficClass
    ControllerInterface ..> Firewall
    ControllerInterface ..> PTPConfig
    ControllerInterface ..> SGMII
    ControllerInterface ..> RMII
    ControllerInterface ..> MII
    ControllerInterface ..> RGMII
    InternalTopology ..> InternalConnectionUnion
    ECUPort ..> XFI
    ECUPort ..> BASET1S
    ECUPort ..> MII
    ECUPort ..> BASET1
    ECUPort ..> BASET
    ECUPort ..> RMII
    ECUPort ..> SGMII
    ECUPort ..> RGMII
    SocketContainer ..> SocketUDP
    SocketContainer ..> SocketTCP
    Switch ..> VLANEntry
    Switch ..> SwitchPort
    Switch ..> EmbeddedMetadata
    Switch ..> TCAMRule
    Switch ..> ControllerInterface
    SwitchPort ..> XFI
    SwitchPort ..> Stream
    SwitchPort ..> MII
    SwitchPort ..> MACsecConfig
    SwitchPort ..> TrafficClass
    SwitchPort ..> PTPConfig
    SwitchPort ..> RMII
    SwitchPort ..> SGMII
    SwitchPort ..> RGMII
    ECUMetadata ..> BaseVersion
    ECUMetadata ..> SoftwareBaseMetadata
    ECUMetadata ..> HardwareBaseMetadata
    ECU ..> ECUMetadata
    ECU ..> ECUPort
    ECU ..> SocketContainer
    ECU ..> Switch
    ECU ..> InternalTopology
    ECU ..> Controller


    
class ECU

Bases: UniqueName

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

Parameters

namestr

Name of the ECU.

portslist of ECUPort

List of physical ECU ports. At least one port must be provided.

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.

socketslist of SocketContainer, optional

Socket containers within the ECU. If not provided, the ECU has no socket deployments configured.

topologyInternalTopology

Internal topology defining the connectivity between ECU components.

ecu_metadataECUMetadata

Metadata information describing the ECU.

ECU Ports Config

Expand for Schematic
        classDiagram

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

    class BASET1S {
        mode: Literal['base_t1s'] = 'base_t1s'
        speed: Literal[10] = 10
        duplex: Literal['half'] = 'half'
        role: Literal['master', 'slave']
        autonegotiation: bool = False
    }

    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 BASET {
        mode: Literal['base_t'] = 'base_t'
        speed: Literal[100, 1000]
        duplex: Literal['full'] = 'full'
        autonegotiation: bool = False
    }

    class NamedDictInstances {
        name: str
    }

    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 ECUPort {
        name: str
        mdi_config: BASET1 | BASET1S | BASET = BASET1
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
    }

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

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

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


    
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: eth_ecu_p1
    mdi_config:
      mode: base_t1
      speed: 1000
      duplex: full
      role: slave
      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: NamedDictInstances

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

Expand for Schematic
        classDiagram

    class NamedListInstances {
        name: str
    }

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

    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 HTBInstance {
        root_id: str
        default_class: int | None = None
        child_classes: list[ChildClass]
    }

    class ControllerInterface {
        name: str
        mac_address: MacAddress
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        virtual_interfaces: list[VirtualControllerInterface]
        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
    }

    class Controller {
        name: str
        meta: EmbeddedMetadata
        interfaces: list[ControllerInterface]
    }

    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 MII {
        type: Literal['MII'] = 'MII'
        speed: Literal[10, 100] | None = 100
        mode: Literal['mac', 'phy']
    }

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

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

    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 IPv4AddressEndpoint {
        address: IPv4Address
        ipv4netmask: IPv4Address
        sockets: list[SocketTCP | SocketUDP] | None = list
    }

    class MACsecConfig {
        vlan_bypass: list[int]
        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
        cipher_preference: list[IntegrityWithoutConfidentiality | IntegrityWithConfidentiality] = <lambda>
    }

    class NamedDictInstances {
        name: str
    }

    class VirtualControllerInterface {
        name: str
        vlanid: int
        addresses: list[IPv6AddressEndpoint | IPv4AddressEndpoint]
        multicast: list[IPvAnyAddress | MacAddress] | 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
    }

    class FLYNCBaseModel {
    }

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

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

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

    IPv4AddressEndpoint ..> SocketUDP
    IPv4AddressEndpoint ..> SocketTCP
    IPv4AddressEndpoint ..> IPv4Address
    IPv6AddressEndpoint ..> SocketUDP
    IPv6AddressEndpoint ..> IPv6Address
    IPv6AddressEndpoint ..> SocketTCP
    EmbeddedMetadata ..> BaseVersion
    EmbeddedMetadata ..> SoftwareBaseMetadata
    EmbeddedMetadata ..> HardwareBaseMetadata
    Firewall ..> FirewallRule
    MACsecConfig ..> IntegrityWithoutConfidentiality
    MACsecConfig ..> IntegrityWithConfidentiality
    HTBInstance ..> ChildClass
    PTPConfig ..> PTPPort
    Stream ..> DoubleRateThreeColorMarker
    Stream ..> ATSInstance
    Stream ..> FrameFilter
    Stream ..> SingleRateThreeColorMarker
    Stream ..> SingleRateTwoColorMarker
    TrafficClass ..> ATSShaper
    TrafficClass ..> CBSShaper
    VirtualControllerInterface ..> MacAddress
    VirtualControllerInterface ..> IPv4AddressEndpoint
    VirtualControllerInterface ..> IPv6AddressEndpoint
    VirtualControllerInterface ..> IPvAnyAddress
    ControllerInterface ..> MacAddress
    ControllerInterface ..> XFI
    ControllerInterface ..> Stream
    ControllerInterface ..> HTBInstance
    ControllerInterface ..> MACsecConfig
    ControllerInterface ..> VirtualControllerInterface
    ControllerInterface ..> TrafficClass
    ControllerInterface ..> Firewall
    ControllerInterface ..> PTPConfig
    ControllerInterface ..> SGMII
    ControllerInterface ..> RMII
    ControllerInterface ..> MII
    ControllerInterface ..> RGMII
    Controller ..> EmbeddedMetadata
    Controller ..> ControllerInterface


    
Expand for a YAML example - 📁 controllers/

Note

This directory contains the configuration files that describe each one of the host controllers of the device. Each controller shall have its own YAML file. This is a mandatory dir for the ECU configuration, since all ECUs need to define (at least) one controller.

meta:
  author: Dev
  compatible_flync_version: 
    version_schema: semver
    version: 0.9.0
  target_system: flync_os

name: eth_ecu_controller1
interfaces:
  - name: eth_ecu_c1_iface1
    mac_address: 00:11:22:33:44:55
    mii_config:
      type: sgmii
      speed: 1000
      mode: mac
    virtual_interfaces:
      - name: eth_ecu_c1_i1_viface1
        vlanid: 40
        addresses: 
          - address: 10.0.40.7
            ipv4netmask: 255.255.255.0
        multicast:
          - 224.0.0.23
    ptp_config:
      cmlds_linkport_enabled: false
      ptp_ports:
        - domain_id: 0
          src_port_identity: 0
          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
    htb: 
      root_id: "1:"
      default_class: 12
      child_classes: 
        - classid: 11
          rate: 5
          ceil: 10
          filter:
            - prio: 1
              vlanid: 40
              dst_ipv4:
                address: 10.0.40.0
                ipv4netmask: 255.255.255.0
              protocol: tcp
        - classid: 12
          rate: 5
          ceil: 10
          filter:
            - prio: 2
              vlanid: 40
              dst_ipv4:
                address: 10.0.40.0
                ipv4netmask: 255.255.255.0
              protocol: udp
          child_classes: 
    macsec_config: 
      vlan_bypass: []
      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 Controller

Bases: NamedListInstances[Controller]

Represents a controller device that contains multiple interfaces.

Parameters

metaEmbeddedMetadata

Metadata describing the embedded controller.

typeLiteral[“Controller”]

Indicates the type of the device. Default is “Controller”.

namestr

Name of the controller.

interfaceslist of ControllerInterface

Physical interfaces of the controller.

Private Attributes

_type:

The type of the object generated. Set to Controller.

class ControllerInterface

Bases: NamedDictInstances

Represents a physical controller interface including virtual interfaces and optional PTP configuration.

Parameters

namestr

Interface name.

mac_addressMacAddress

MAC address in standard notation.

mii_configMII or RMII or SGMII or RGMII, optional

Media-independent interface configuration.

virtual_interfaceslist of VirtualControllerInterface

Virtual interfaces configured on top of the physical controller interface.

ptp_configPTPConfig, optional

Precision Time Protocol configuration.

macsec_configMACsecConfig, optional

MACsec configuration.

firewallFirewall, optional

Firewall configuration for the interface.

htbHTBInstance, optional

Hierarchical Token Bucket (HTB) 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 queues.

Private Attributes

_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 controller_interface.

class VirtualControllerInterface

Bases: FLYNCBaseModel

Represents a virtual interface on a controller.

Parameters

namestr

Name of the virtual interface.

vlanidint

VLAN identifier in the range 0-4095.

addresseslist of IPv4AddressEndpoint or IPv6AddressEndpoint

Assigned IPv4 and IPv6 address endpoints.

multicastlist of IPv4Address or IPv6Address or str, optional

Allowed multicast addresses.

Switch Config

Expand for Schematic
        classDiagram

    class MulticastGroup {
        address: IPvAnyAddress | MacAddress
        ports: list[str]
    }

    class NamedListInstances {
        name: str
    }

    class BASET1S {
        mode: Literal['base_t1s'] = 'base_t1s'
        speed: Literal[10] = 10
        duplex: Literal['half'] = 'half'
        role: Literal['master', 'slave']
        autonegotiation: bool = False
    }

    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 RemoveVLAN {
        type: Literal['remove_vlan'] = 'remove_vlan'
        ports: list[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 ControllerInterface {
        name: str
        mac_address: MacAddress
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        virtual_interfaces: list[VirtualControllerInterface]
        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
    }

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

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

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

    class Switch {
        name: str
        tcam_rules: list[TCAMRule] | None = []
        ports: list[SwitchPort]
        vlans: list[VLANEntry]
        host_controller: ControllerInterface | None = None
        meta: EmbeddedMetadata
    }

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

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

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

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

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

    class FrameFilter {
        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 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 TCAMRule {
        name: str
        id: int
        match_filter: FrameFilter
        match_ports: list[str]
        action: list[Drop | Mirror | VLANOverwrite | ForceEgress | RemoveVLAN]
    }

    class MACsecConfig {
        vlan_bypass: list[int]
        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
        cipher_preference: list[IntegrityWithoutConfidentiality | IntegrityWithConfidentiality] = <lambda>
    }

    class NamedDictInstances {
        name: str
    }

    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 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 Mirror {
        type: Literal['mirror'] = 'mirror'
        ports: list[str]
    }

    class FLYNCBaseModel {
    }

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

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

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

    ControllerInterface ..> MacAddress
    ControllerInterface ..> XFI
    ControllerInterface ..> Stream
    ControllerInterface ..> HTBInstance
    ControllerInterface ..> MACsecConfig
    ControllerInterface ..> VirtualControllerInterface
    ControllerInterface ..> TrafficClass
    ControllerInterface ..> Firewall
    ControllerInterface ..> PTPConfig
    ControllerInterface ..> SGMII
    ControllerInterface ..> RMII
    ControllerInterface ..> MII
    ControllerInterface ..> RGMII
    EmbeddedMetadata ..> BaseVersion
    EmbeddedMetadata ..> SoftwareBaseMetadata
    EmbeddedMetadata ..> HardwareBaseMetadata
    MACsecConfig ..> IntegrityWithoutConfidentiality
    MACsecConfig ..> IntegrityWithConfidentiality
    FrameFilter ..> IPv4AddressEntry
    FrameFilter ..> MACAddressEntry
    FrameFilter ..> IPv6Address
    FrameFilter ..> ValueRange
    FrameFilter ..> IPv6AddressEntry
    FrameFilter ..> IPv4Address
    PTPConfig ..> PTPPort
    Stream ..> DoubleRateThreeColorMarker
    Stream ..> ATSInstance
    Stream ..> FrameFilter
    Stream ..> SingleRateThreeColorMarker
    Stream ..> SingleRateTwoColorMarker
    TrafficClass ..> ATSShaper
    TrafficClass ..> CBSShaper
    SwitchPort ..> XFI
    SwitchPort ..> Stream
    SwitchPort ..> MII
    SwitchPort ..> MACsecConfig
    SwitchPort ..> TrafficClass
    SwitchPort ..> PTPConfig
    SwitchPort ..> RMII
    SwitchPort ..> SGMII
    SwitchPort ..> RGMII
    MulticastGroup ..> MacAddress
    MulticastGroup ..> IPvAnyAddress
    VLANEntry ..> MulticastGroup
    TCAMRule ..> ForceEgress
    TCAMRule ..> Mirror
    TCAMRule ..> FrameFilter
    TCAMRule ..> RemoveVLAN
    TCAMRule ..> VLANOverwrite
    TCAMRule ..> Drop
    Switch ..> VLANEntry
    Switch ..> SwitchPort
    Switch ..> EmbeddedMetadata
    Switch ..> TCAMRule
    Switch ..> ControllerInterface


    
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.9.0
  target_system: flync_os
name: hpc_switch1  
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: []
    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: []
      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: []
      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: []
      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: []
      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 


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

- name: VLAN40
  id: 40
  default_priority: 0
  ports:
    - hpc_s1_p2
    - hpc_s1_p3
    - hpc_s1_p4

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


host_controller:
  name: hpc_sw_host_iface
  mac_address: 00:11:22:33:44:56
  virtual_interfaces:
    - name: hpc_sw_host_viface
      vlanid: 50
      addresses:
        - address: 10.0.50.101
          ipv4netmask: 255.255.255.0    
      multicast: []  

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.

class Switch

Bases: NamedListInstances

Represents an automotive Ethernet network switch configuration.

Parameters

metaEmbeddedMetadata

Metadata associated with the switch, such as vendor-specific or implementation-specific attributes.

namestr

Name of the switch.

portslist of SwitchPort

List of external (connected to ECU ports) or internal (connected to internal ECU interfaces) switch ports.

vlanslist of VLANEntry

List of VLAN entries configured on the switch.

host_controllerControllerInterface, optional

Switch host controller configuration, if the switch is managed by an internal controller.

tcam_ruleslist of TCAMRule, optional

List of TCAM rules configured on the switch. These rules define packet-matching conditions and associated actions applied to ingress or egress traffic.

class SwitchPort

Bases: NamedDictInstances

Represents a Switch Port and its configuration.

Parameters

namestr

Name of the Switch Port.

silicon_port_noint

Silicon hardware port number (vendor-specific).

default_vlan_idint

VLAN ID to be added to an untagged frame ingressing on the port.

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 (0-4095).

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.

class MulticastGroup

Bases: FLYNCBaseModel

Represents a multicast group configuration.

This class defines a multicast group by associating a multicast destination address with a set of switch ports that participate in the group.

Parameters

addressIPv4Address or IPv6Address or MacAddress

The multicast address. Must be a valid MAC or IP multicast address.

portslist of str

A list of switch port names that are part of the multicast group.

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.

idStrictInt

Unique TCAM rule ID.

match_filterFrameFilter

Packet-matching filter used to decide whether the rule applies.

match_portslist of str

Ports to which the rule is bound.

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.

class Drop

Bases: FLYNCBaseModel

Action that discards traffic on the selected egress ports.

Parameters

typeLiteral[“drop”]

Discriminator used by Pydantic.

portslist of str

Egress ports where the drop action should be applied.

class Mirror

Bases: FLYNCBaseModel

Action that mirrors incoming traffic to additional egress ports.

Parameters

typeLiteral[“mirror”]

Discriminator used by Pydantic.

portslist of str

Egress ports that will receive the mirrored traffic.

class ForceEgress

Bases: FLYNCBaseModel

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

Egress ports to which the messages are force-forwarded.

class VLANOverwrite

Bases: FLYNCBaseModel

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

Egress ports at which the overwriting should take place.

class RemoveVLAN

Bases: FLYNCBaseModel

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

Parameters

typeLiteral[“remove_vlan”]

Discriminator used by Pydantic.

portslist of str

Egress ports where the VLAN tag will be removed.

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".

autonegotiationbool

Indicates whether autonegotiation is enabled.

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

Indicates whether autonegotiation is enabled.

class BASET1S

Bases: FLYNCBaseModel

Represents a BASE-T1S Ethernet interface configuration.

Parameters

modeLiteral[“base_t1s”]

Interface mode. Defaults to "base_t1s".

speedint

Supported link speed in megabits per second. Defaults to 10.

duplexLiteral[“half”]

Duplex mode. Defaults to "half".

roleLiteral[“master”, “slave”]

Role of the PHY, either master or slave.

autonegotiationbool

Indicates whether autonegotiation is enabled.

Media-Independent Interfaces

class MII

Bases: FLYNCBaseModel

Represents a Media Independent Interface (MII) configuration.

Parameters

typeLiteral[“mii”]

Interface type. Defaults to "mii".

speedint

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

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

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

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

Supported link speed in megabits per second. Valid values are 10, 100, 1000, or 2500. Defaults to 1000 Mbps.

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

Supported link speed in megabits per second. Valid values are 10, 100, or 1000. Defaults to 1000 Mbps.

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 SwitchPortToXConnection {
        type: str
        id: str
        switch_port_name: str
    }

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

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

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

    class ControllerInterface {
        name: str
        mac_address: MacAddress
        mii_config: MII | RMII | SGMII | RGMII | XFI | None = None
        virtual_interfaces: list[VirtualControllerInterface]
        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
    }

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

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

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

    class SwitchPortToSwitchPort {
        type: Literal['switch_to_switch_same_ecu'] = 'switch_to_switch_same_ecu'
        id: str
        switch_port_name: str
        switch2_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 FLYNCBaseModel {
    }

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

    class InternalConnection {
        type: str
        id: str
    }

    class RootModel {
        root: RootModelRootType
    }

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

    RootModel ..> RootModelRootType
    ControllerInterface ..> MacAddress
    ControllerInterface ..> XFI
    ControllerInterface ..> Stream
    ControllerInterface ..> HTBInstance
    ControllerInterface ..> MACsecConfig
    ControllerInterface ..> VirtualControllerInterface
    ControllerInterface ..> TrafficClass
    ControllerInterface ..> Firewall
    ControllerInterface ..> PTPConfig
    ControllerInterface ..> SGMII
    ControllerInterface ..> RMII
    ControllerInterface ..> MII
    ControllerInterface ..> RGMII
    ECUPort ..> XFI
    ECUPort ..> BASET1S
    ECUPort ..> MII
    ECUPort ..> BASET1
    ECUPort ..> BASET
    ECUPort ..> RMII
    ECUPort ..> SGMII
    ECUPort ..> RGMII
    SwitchPort ..> XFI
    SwitchPort ..> Stream
    SwitchPort ..> MII
    SwitchPort ..> MACsecConfig
    SwitchPort ..> TrafficClass
    SwitchPort ..> PTPConfig
    SwitchPort ..> RMII
    SwitchPort ..> SGMII
    SwitchPort ..> RGMII
    InternalConnectionUnion ..> SwitchPortToSwitchPort
    InternalConnectionUnion ..> SwitchPortToControllerInterface
    InternalConnectionUnion ..> ECUPortToSwitchPort
    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_controller_interface
    id: conn1
    ecu_port: eth_ecu_p1
    controller_interface: eth_ecu_c1_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_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.

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.

component1_namestr, optional

Name of the first component in the connection.

component2_namestr, optional

Name of the second component in 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).

Private Attributes

_switch_portSwitchPort

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

class ECUPortToSwitchPort

Bases: ECUPortToXConnection

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".

switch_port_namestr

Name of the switch port (alias: switch_port).

Private Attributes

_switch_portSwitchPort

Internal reference to the actual SwitchPort object. Managed privately.

class ECUPortToControllerInterface

Bases: ECUPortToXConnection

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).

Private Attributes

_ifaceControllerInterface

Internal reference to the actual ControllerInterface object. Managed privately.

class SwitchPortToControllerInterface

Bases: SwitchPortToXConnection

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".

iface_namestr

Name of the controller interface (alias: controller_interface).

Private Attributes

_ifaceControllerInterface

Internal reference to the actual ControllerInterface object. 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).

Private Attributes

_switch2_portSwitchPort

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

class ControllerInterfaceToControllerInterface

Bases: InternalConnection

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_interface1).

iface2_namestr

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

Private Attributes

_ifaceControllerInterface

Internal reference to the first controller interface. Managed privately.

_iface2ControllerInterface

Internal reference to the second controller interface. Managed privately.

Socket Config

Expand for Schematic
        classDiagram

    class IPv4AddressEntry {
        address: IPv4Address
        ipv4netmask: IPv4Address
    }

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

    class SocketTCP {
        name: str
        endpoint_address: IPv4Address | IPv6Address
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        protocol: Literal['tcp'] = 'tcp'
        tcp_profile: int
    }

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

    class SOMEIPServiceProvider {
        deployment_type: Literal['someip_provider'] = 'someip_provider'
        service: int
        major_version: int = 0
        instance_id: int
        find_service_multicast: MulticastEndpoint | None = None
        someip_sd_timings_profile: str
    }

    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 SOMEIPServiceConsumer {
        deployment_type: Literal['someip_consumer'] = 'someip_consumer'
        service: int
        major_version: int = 0
        instance_id: int
        find_service_multicast: MulticastEndpoint | None = None
        someip_sd_timings_profile: str
        consumed_eventgroups: list[str] | None = None
    }

    class DeploymentUnion {
        root: SOMEIPServiceConsumer | SOMEIPServiceProvider | SOMEIPSDDeployment
    }

    class SocketUDP {
        name: str
        endpoint_address: IPv4Address | IPv6Address
        port_no: int
        deployments: list[DeploymentUnion] | None = list
        protocol: Literal['udp'] = 'udp'
        udp_options: UDPOption | None = udp_cork=False
    }

    class FLYNCBaseModel {
    }

    class UDPOption {
        udp_cork: bool | None = False
    }

    class IPv6AddressEntry {
        address: IPv6Address
        ipv6prefix: int
    }

    class Socket {
        name: str
        endpoint_address: IPv4Address | IPv6Address
        port_no: int
        deployments: list[DeploymentUnion] | None = list
    }

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

    class RootModel {
        root: RootModelRootType
    }

    class DictInstances {
    }

    RootModel ..> RootModelRootType
    IPv4AddressEntry ..> IPv4Address
    IPv6AddressEntry ..> IPv6Address
    SOMEIPSDDeployment ..> MulticastSDEndpoint
    SOMEIPServiceConsumer ..> MulticastEndpoint
    SOMEIPServiceProvider ..> MulticastEndpoint
    IPv4AddressEndpoint ..> SocketUDP
    IPv4AddressEndpoint ..> SocketTCP
    IPv4AddressEndpoint ..> IPv4Address
    IPv6AddressEndpoint ..> SocketUDP
    IPv6AddressEndpoint ..> IPv6Address
    IPv6AddressEndpoint ..> SocketTCP
    DeploymentUnion ..> SOMEIPSDDeployment
    DeploymentUnion ..> SOMEIPServiceProvider
    DeploymentUnion ..> SOMEIPServiceConsumer
    Socket ..> DeploymentUnion
    Socket ..> IPv6Address
    Socket ..> IPv4Address
    SocketTCP ..> DeploymentUnion
    SocketTCP ..> IPv6Address
    SocketTCP ..> IPv4Address
    SocketUDP ..> UDPOption
    SocketUDP ..> DeploymentUnion
    SocketUDP ..> IPv6Address
    SocketUDP ..> IPv4Address


    
Expand for a YAML example - 📁 sockets/

Note

This directory contains files that define a group of sockets per VLAN. 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_name: eth_ecu_c1_i1_viface1

sockets:
  - name: sd_multicast_socket
    endpoint_address: 10.0.40.7
    port_no: 30490
    protocol: udp
    deployments:
      - deployment_type: someip_sd
        multicast:
          ip_address: 224.244.224.245
          port: 30490
          ip_ttl: 1
  - name: someip_udp_socket_1
    endpoint_address: 10.0.40.7
    port_no: 30500
    protocol: udp
    deployments:
      - deployment_type: someip_provider
        service: 0x101
        instance_id: 1
        major_version: 1
        someip_sd_timings_profile: server_default
  - name: someip_tcp_socket_1
    endpoint_address: 10.0.40.7
    port_no: 30502
    protocol: tcp
    tcp_profile: 1
    deployments:
      - deployment_type: someip_provider
        service: 0x101
        instance_id: 2
        major_version: 1
        someip_sd_timings_profile: server_default
class SocketContainer

Bases: FLYNCBaseModel

Represents a socket container for the ecu.

Parameters

vlan_namestr

Name of the virtual interface.

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.

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.

Options

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

Note

This file contains a list of TCP profiles that describes a bunch of TCP options that can be set in a socket. These profiles can be imported in a TCP socket.

vlan_name: eth_ecu_c1_i1_viface1

sockets:
  - name: sd_multicast_socket
    endpoint_address: 10.0.40.7
    port_no: 30490
    protocol: udp
    deployments:
      - deployment_type: someip_sd
        multicast:
          ip_address: 224.244.224.245
          port: 30490
          ip_ttl: 1
  - name: someip_udp_socket_1
    endpoint_address: 10.0.40.7
    port_no: 30500
    protocol: udp
    deployments:
      - deployment_type: someip_provider
        service: 0x101
        instance_id: 1
        major_version: 1
        someip_sd_timings_profile: server_default
  - name: someip_tcp_socket_1
    endpoint_address: 10.0.40.7
    port_no: 30502
    protocol: tcp
    tcp_profile: 1
    deployments:
      - deployment_type: someip_provider
        service: 0x101
        instance_id: 2
        major_version: 1
        someip_sd_timings_profile: server_default
class TCPOption

Bases: DictInstances

TCP options that can be enabled for a connection.

Parameters

tcp_profile_idint

Unique identifier of the TCP profile.

naglestrict_bool

Enable or disable Nagle algorithm.

keepalive_enabledbool

Enable or disable the TCP keep-alive option.

keepidleint

Seconds the connection must stay idle before the first keep-alive probe is sent.

keepcountint

Maximum number of keep-alive probes that may be sent before the connection is dropped.

keepintvlint

Seconds between successive keep-alive probes.

user_timeoutint

Maximum time in seconds that unacknowledged data may remain before the connection is closed.

congestion_avoidancestr

Congestion-avoidance algorithm to use (e.g., Reno, cubic, or bbr).

tcp_maxsegint

Maximum segment size for outgoing TCP packets.

tcp_quickackbool

Enable or disable the “quick-ack” feature.

tcp_syncntint

Number of SYN retransmissions TCP may perform before aborting the connection attempt.

class UDPOption

Bases: FLYNCBaseModel

UDP options that can be enabled for a connection.

Parameters

udp_corkbool

Enables buffering of UDP messages before they are sent.

Endpoints

class IPv4AddressEndpoint

Bases: IPv4AddressEntry

Represents an IPv4 address endpoint for a network interface.

Parameters

socketslist of SocketTCP or SocketUDP

TCP and UDP sockets that are part of this IPv4 address endpoint.

class IPv6AddressEndpoint

Bases: IPv6AddressEntry

Represents an IPv6 address endpoint for a network interface.

Parameters

socketslist of SocketTCP or SocketUDP

TCP and UDP sockets that are part of this IPv6 address endpoint.

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