DEENESPTFRRUARHIKOZHNL
AUTOSAR_CP_SWS_TcpIp FIG-1cf9b3a19614db86 865 × 911 px 1 Release(s)

Figure 7.2: Ctrl state machine of the TcpIp

SHA-256 Inhalts-Fingerabdruck: 1cf9b3a19614db860aeebc5857b469dd1df2e5b3c89fe2db459abcd08260136a
✦ KI-generierte Bildanalyse & technische Beschreibung Modell: gemini-3.8-flash (via agy) · Rezept figure-description@2 · erstellt am 2026-10-07

1. Diagrammtyp & Architektur-Kontext

  • Klassifikation: UML-Zustandsdiagramm (State Machine Diagram / Zustandsautomat gemäß OMG-UML- bzw. AUTOSAR-BSW-UML-Profil).
  • Funktionale Einordnung: AUTOSAR Classic Platform (R25-11), Schicht: Communication Services / Communication HW Abstraction. Spezifikation: AUTOSAR_CP_SWS_TcpIp (Schnittstellen zu EthSM, SoAd).
  • Technischer Zweck: Modellierung des controller-individuellen Betriebs- und Verbindungszustands (Controller State Machine, TcpIp_StateType) eines virtuellen/physikalischen Ethernet-Controllers innerhalb des TCP/IP-Stacks. Steuert den Lebenszyklus von IP-Adressierungsmechanismen (statisch, DHCP, Auto-IP), Socket-Ressourcen und Sende-/Empfangspfaden in Abhängigkeit von den Netzwerkanforderungen des Ethernet State Managers (EthSM).

2. Komponenten, Entitäten & Schnittstellen

  • Zustände (TcpIp_StateType):
    • TCPIP_STATE_OFFLINE: Stack-Controller ist inaktiv/dekonfiguriert, keine Kommunikation, Ressourcen sind freigegeben.
    • TCPIP_STATE_STARTUP: IP-Zuweisungsprozess läuft; Controller bereitet Netzwerkressourcen vor.
    • TCPIP_STATE_ONLINE: Vollständiger Kommunikationsbetrieb aktiv; IP-Adresse ist zugewiesen und gebunden.
    • TCPIP_STATE_ONHOLD: Kommunikation ist temporär suspendiert; IP-Bindung bleibt reserviert.
    • TCPIP_STATE_SHUTDOWN: Asynchrone Teardown-Phase; Schließen von Verbindungen, Pufferbereinigung und Ressourcenfreigabe.
    • Initial: Start-Pseudozustand nach System-Reset.
  • Entry-Aktionen:
    • Jeder Hauptzustand besitzt die standardisierte Eintrittsaktion: entry / EthSM_TcpIpModeIndication(<TARGET_STATE>) zur asynchronen Bestätigung des erreichten Betriebszustands an den EthSM.
  • API-Trigger & Steuerschnittstellen:
    • TcpIp_Init(): Initialisierungsaufruf durch BSW Mode Management / EcuM.
    • TcpIp_RequestComMode(CtrlIdx, State): Steuer-API, aufgerufen durch den EthSM zur Modusumschaltung (ONLINE, OFFLINE, ONHOLD).
  • Upstream-Benachrichtigungen (<Up>_LocalIpAddrAssignmentChg):
    • Konfigurierbare Callback-Schnittstelle an übergeordnete Module (primär SoAd), signalisiert den Status der IP-Adressbindung:
      • TCPIP_IPADDR_STATE_ASSIGNED (IP verfügbar)
      • TCPIP_IPADDR_STATE_ONHOLD (IP geparkt)
      • TCPIP_IPADDR_STATE_UNASSIGNED (IP entzogen/freigegeben)

3. Dynamisches Verhalten & Sequenzablauf

[Initial]
   │  TcpIp_Init()
   ▼
[TCPIP_STATE_OFFLINE] ──TcpIp_RequestComMode(ONLINE) / enable IP assignment──► [TCPIP_STATE_STARTUP]
   ▲                                                                                  │
   │                                           [Ip is assigned] /                     │
   │                                           Up_LocalIpAddrAssignmentChg(ASSIGNED)  │
   │                                                                                  ▼
   │  [ressources are released] ◄───────────────────────────────────────────── [TCPIP_STATE_ONLINE]
   │              ▲                                                               │     ▲
   │              │                                TcpIp_RequestComMode(ONHOLD)   │     │  TcpIp_RequestComMode(ONLINE)
   │     [TCPIP_STATE_SHUTDOWN]                    deactivate communication       │     │  reactivate communication
   │              ▲                                                               ▼     │  AssignmentChg(ASSIGNED)
   │              └──── TcpIp_RequestComMode(OFFLINE) ───────────────────────── [TCPIP_STATE_ONHOLD]
  1. Initialisierung:
    • Initial → TCPIP_STATE_OFFLINE: Getriggert durch TcpIp_Init(). Löst EthSM_TcpIpModeIndication(TCPIP_STATE_OFFLINE) aus.
  2. Startup & Adressauflösung (Online-Pfad):
    • TCPIP_STATE_OFFLINE → TCPIP_STATE_STARTUP:
      • Trigger: TcpIp_RequestComMode(TCPIP_STATE_ONLINE).
      • Aktion: /enable IP assignment. Startet Adressvergabe (z. B. DHCP-Request, IPv6 SLAAC, ARP-Probe).
    • TCPIP_STATE_STARTUP → TCPIP_STATE_ONLINE:
      • Guard: [Ip is assigned].
      • Aktion: Callback <Up>_LocalIpAddrAssignmentChg(..., TCPIP_IPADDR_STATE_ASSIGNED).
    • Abbruch vor Zuweisung: TCPIP_STATE_STARTUP → TCPIP_STATE_OFFLINE via TcpIp_RequestComMode(TCPIP_STATE_OFFLINE) mit Aktion /abort IP assignment.
  3. Pausierungsbetrieb (ONHOLD):
    • TCPIP_STATE_ONLINE → TCPIP_STATE_ONHOLD:
      • Trigger: TcpIp_RequestComMode(TCPIP_STATE_ONHOLD).
      • Aktionen: <Up>_LocalIpAddrAssignmentChg(..., TCPIP_IPADDR_STATE_ONHOLD) und Kommunikationsdeaktivierung im Modul.
    • TCPIP_STATE_ONHOLD → TCPIP_STATE_ONLINE:
      • Trigger: TcpIp_RequestComMode(TCPIP_STATE_ONLINE).
      • Aktionen: Kommunikation reaktivieren, <Up>_LocalIpAddrAssignmentChg(..., TCPIP_IPADDR_STATE_ASSIGNED).
    • Lokaler Loop-Trigger: [Ip priority reassignment] verbleibt intern in ONLINE bzw. ONHOLD (dynamischer Wechsel prioritärer Adresszuweisungen).
  4. Asynchroner Shutdown & Ressourcenfreigabe:
    • Sowohl von TCPIP_STATE_ONLINE als auch TCPIP_STATE_ONHOLD führt TcpIp_RequestComMode(TCPIP_STATE_OFFLINE) nach TCPIP_STATE_SHUTDOWN.
    • Aktionen: <Up>_LocalIpAddrAssignmentChg(..., TCPIP_IPADDR_STATE_UNASSIGNED), Kommunikation stoppen, interne Ressourcenfreigabe anfordern (request releasing the resources).
    • TCPIP_STATE_SHUTDOWN → TCPIP_STATE_OFFLINE: Guard [ressources are released]. Erst wenn alle Verbindungen abgebaut und Puffer frei sind, erfolgt der Wechsel nach OFFLINE.
  5. Preemptiver Neustart während Shutdown (Fast Recovery):
    • TCPIP_STATE_SHUTDOWN → TCPIP_STATE_STARTUP bei vorzeitigem TcpIp_RequestComMode(TCPIP_STATE_ONLINE):
      • Aktionen: Sofortige Zwangsrücknahme der Ressourcen (immediately release the resources).
      • Unterdrückung der Benachrichtigung an EthSM beim Passieren von OFFLINE (do not inform EthSM upon entering state TCPIP_STATE_OFFLINE).
      • Zuweisung neuer Ressourcen starten und direkt nach TCPIP_STATE_STARTUP übergehen.

4. Normative Relevanz & Entwickler-Hinweise

  • Asynchrone Entkopplung (Request vs. Indication): TcpIp_RequestComMode() ist rein anfordernd und kehrt unmittelbar zurück. Der Stack darf den Statuswechsel niemals synchron blockieren. Integratoren müssen sicherstellen, dass übergeordnete Module (EthSM) erst auf den Moduswechsel reagieren, wenn EthSM_TcpIpModeIndication() empfangen wurde.
  • Ressourcenbereinigung gemäß SWS_TcpIp_00410 / SRS_Eth_00187: Im Zustand TCPIP_STATE_SHUTDOWN müssen alle offenen Socket-Deskriptoren, TCP-Verbindungen (FIN/RST-Handling) und PDU-Sendepuffer (LSduR_TcpIpTransmit) deterministisch freigegeben werden. PDU-Zustände fallen auf PDU_AVAILABLE zurück.
  • Upper-Layer-Vertrag (SoAd / Socket-Nutzer): Sendeanfragen dürfen nur bei TCPIP_STATE_ONLINE bzw. aktivem IP-Zustand ASSIGNED verarbeitet werden. Im Zustand TCPIP_IPADDR_STATE_ONHOLD bleiben Socket-Tabellen bestehen, der Datenverkehr auf Link- und IP-Ebene wird jedoch stummgeschaltet.
  • Preemption-Sonderlogik: Treiber- und Stack-Implementierer müssen die Sequenz SHUTDOWN -> STARTUP absichern: Werden Re-Init-Requests während eines laufenden Shutdowns empfangen, muss der Hardware-/Stack-Pufferabbruch beschleunigt erzwungen werden, ohne dass EthSM ein fälschliches Zwischen-OFFLINE signalisiert bekommt.

Zugeordnete Anforderungen

Diese Angaben zeigt der Versions-Explorer.

Erkannte Spezifikationsbelege & Anforderungen auf dieser Seite

Aus dem Dokument extrahierter Text & Kontext

Beschriftungen im Schaubild:

Initial | TCPIP_STATE_STARTUP | entry / EthSM_TcpIpModeIndication(TCPIP_STATE_STARTUP) | TCPIP_STATE_OFFLINE | entry / EthSM_TcpIpModeIndication(TCPIP_STATE_OFFLINE) | TCPIP_STATE_SHUTDOWN | entry / EthSM_TcpIpModeIndication(TCPIP_STATE_SHUTDOWN) | TCPIP_STATE_ONLINE | entry / EthSM_TcpIpModeIndication(TCPIP_STATE_ONLINE) | TCPIP_STATE_ONHOLD | entry / EthSM_TcpIpModeIndication(TCPIP_STATE_ONHOLD) | TcpIp_RequestComMode(TCPIP_STATE_ONHOLD) | /Up_LocalIpAddrAssignmentChg (TCPIP_IPADDR_STATE_ONHOLD) deactivate the communication within TcpIp module | [Ip priority reassignment] | TcpIp_RequestComMode(TCPIP_STATE_OFFLINE) /Up_LocalIpAddrAssignmentChg(TCPIP_IPADDR_STATE_UNASSIGNED) | deactivate the communication within the TcpIp module | request releasing the resources | [ressources are released] | TcpIp_RequestComMode (TCPIP_STATE_ONLINE) /reactivate the communication within | the TcpIp module Up_LocalIpAddrAssignmentChg (TCPIP_IPADDR_STATE_ASSIGNED) | TcpIp_RequestComMode (TCPIP_STATE_ONLINE) | /enable IP assignment | TcpIp_RequestComMode (TCPIP_STATE_OFFLINE) /Up_LocalIpAddrAssignmentChg (TCPIP_IPADDR_STATE_UNASSIGNED) | request releasing the resources | TcpIp_Init() | [Ip priority reassignment] | [Ip is assigned] /Up_LocalIpAddrAssignmentChg (TCPIP_IPADDR_STATE_ASSIGNED) | TcpIp_RequestComMode(TCPIP_STATE_ONLINE) | /immediately release the resources do not inform EthSM upon entering state TCPIP_STATE_OFFLINE | start assigning the resources after TCPIP_STATE_OFFLINE was | entered and proceed to TCPIP_STATE_STARTUP | TcpIp_RequestComMode (TCPIP_STATE_OFFLINE) | /abort IP assignment

Begleitender Spezifikationstext:

Specification of TCP/IP Stack AUTOSAR CP R25-11 [SWS_TcpIp_00410] Aborting transmission request Status: DRAFT Upstream requirements: SRS_Eth_00187 ⌈If the TcpIp module requested to transmit data and the LSduR_TcpIpTransmit() returned E_NOT_OK, then the TcpIp module shall release all PDU resources and set the state of the affected PDU back to PDU_AVAILABLE.⌋ 7.8.2 TCP/IP Stack state handling The internal states are shown in Figure 7.2. Details are described in the following requirements. An overview of the internal states is described in [SWS_TCPIP_00073]. Initial TCPIP_STATE_STARTUP entry / EthSM_TcpIpModeIndication(TCPIP_STATE_STARTUP) TCPIP_STATE_OFFLINE entry / EthSM_TcpIpModeIndication(TCPIP_STATE_OFFLINE) TCPIP_STATE_SHUTDOWN entry / EthSM_TcpIpModeIndication(TCPIP_STATE_SHUTDOWN) TCPIP_STATE_ONLINE entry / EthSM_TcpIpModeIndication(TCPIP_STATE_ONLINE) TCPIP_STATE_ONHOLD entry / EthSM_TcpIpModeIndication(TCPIP_STATE_ONHOLD) TcpIp_RequestComMode(TCPIP_STATE_ONHOLD) /Up_LocalIpAddrAssignmentChg (TCPIP_IPADDR_STATE_ONHOLD) deactivate the communication within TcpIp module [Ip priority reassignment] TcpIp_RequestComMode(TCPIP_STATE_OFFLINE) /Up_LocalIpAddrAssignmentChg(TCPIP_IPADDR_STATE_UNASSIGNED) deactivate the communication within the TcpIp module request releasing the resources [ressources are released] TcpIp_RequestComMode (TCPIP_STATE_ONLINE) /reactivate the communication within the TcpIp module Up_LocalIpAddrAssignmentChg (TCPIP_IPADDR_STATE_ASSIGNED) TcpIp_RequestCom

Vorkommen in AUTOSAR-Releases (1)

Release Dokument Seite Nr. Bildunterschrift im Dokument
R25-11 AUTOSAR_CP_SWS_TcpIp S. 60 7.2 Figure 7.2: Ctrl state machine of the TcpIp