Rechnernetze / Kommunikationssysteme

GBN-Sequenzdiagramm

Dienstelemente eines bestätigten Dienstes

1
2
Request --> Indication
Confirm <-- Response 
sequenceDiagram participant AW1 participant FT1 participant SW1 participant Soc as Socket participant SW2 participant FT2 participant AW2 %% Kommentar Note over AW2: Start Server AW2->>+FT2: file.init Note over FT2: Wait for Start %% %% Start Note over AW1: Start Client AW1->>+FT1: file.req Note over FT1: Send Start FT1->>+SW1: data.req SW1->>Soc: udp.req Soc->>+SW2: udp.ind 0 SW2->>+FT2: data.ind (Start) FT2->>SW2: data.res (OK/!OK) Note over FT2: If !CRC -> Start Note over FT2: Wait for Data SW2->>-Soc: udp.req (ACK 0, N=3) Soc->>SW1: udp.ind (ACK 0) SW1->>-FT1: data.conf %% %% %% %% Data 1 Note over FT1: Send Data (N=3) FT1->>+SW1: data.req 1 SW1->>Soc: udp.req 1 SW1->>-FT1: data.conf FT1->>+SW1: data.req 2 %% Error %%Note over Soc: Packet lost %% Soc->>+SW2: udp.ind 1 SW2->>FT2: data.ind (Data 1) SW1->>Soc: udp.req 2 SW1->>-FT1: data.conf FT1->>+SW1: data.req 3 Soc->>SW2: udp.ind 2 SW2->>FT2: data.ind (Data 2) SW1->>Soc: udp.req 3 Soc->>SW2: udp.ind 3 SW2->>FT2: data.ind (Data 3) %% %%FT2-->>SW2: data.res Note over FT2: Write to Stream SW2->>Soc: udp.req (ACK 1) Soc->>SW1: udp.ind (ACK 1) SW1->>-FT1: data.conf FT1->>+SW1: data.req 4 SW2->>Soc: udp.req (ACK 2) Soc->>SW1: udp.ind (ACK 2) SW1->>-FT1: data.conf FT1->>+SW1: data.req 5 %% SW2->>Soc: udp.req (ACK 3) Soc->>SW1: udp.ind (ACK 3) SW1->>-FT1: data.conf FT1->>+SW1: data.req (last) %% SW1->>Soc: udp.req 4 %% %% Note over Soc: Packet lost %%Soc->>SW2: udp.ind 4 SW1->>Soc: udp.req 5 %%SW1->>-FT1: data.conf Soc->>SW2: udp.ind 5 SW2->>FT2: ignore SW1->>Soc: udp.req 6 %%SW1->>-FT1: data.conf %%FT1->>+SW1: data.req Soc->>SW2: udp.ind 6 SW2->>FT2: ignore %% Note over SW1: Timeout ACK 4 SW1->>Soc: udp.req 4 Soc->>SW2: udp.ind 4 SW2->>FT2: data.ind (Data 4) SW1->>Soc: udp.req 5 Soc->>SW2: udp.ind 5 SW2->>FT2: data.ind (Data 5) Note over FT2: Write to Stream SW1->>Soc: udp.req 6 Soc->>SW2: udp.ind 6 SW2->>FT2: data.ind (Data 6) %% SW2->>Soc: udp.req (ACK 4) Soc->>SW1: udp.ind (ACK 4) SW2->>Soc: udp.req (ACK 5) Soc->>SW1: udp.ind (ACK 5) %% FT2-->>SW2: file.res (CRC) FT2-->>SW2: data.req (CRC) SW2->>-Soc: udp.req (ACK 6 + CRC) Soc->>SW1: udp.ind (ACK 6 + CRC) %% SW1->>-FT1: data.conf (last) SW1->>FT1: data.ind (CRC) %% Note over FT2: If !CRC -> Start Note over FT2: Write to Stream Note over FT2: Ready %% FT2->>-AW2: file.ind %% %% Finish Note over FT1: Check CRC FT1->>-AW1: file.conf %% %% Note over AW1: Finish Note over FT2: Wait for Start

Sender – Zustandsdiagramm

stateDiagram %% Kommentar s1: Wait für HL-Data s2: Wait for ACK [*] --> s1 s1 --> s2: HL-send req | send packet s2 --> s2: Timeout | resend (>10 Cancel) s2 --> s2: wrong ACK s2 --> s1: ACK received note right of s1: Start or Data note right of s2: ACK for 0/1

Empfänger – Zustandsdiagramm

stateDiagram %% Kommentar s1: Wait for Start s2: Wait for Data [*] --> s1 s1 --> s2: receive Start | put to HL, send ACK 0 s2 --> s2: receive Data | put to HL, send ACK s2 --> s2: receive Data, wrong NR | send ACK s2 --> s1: Timeout (10s) note right of s2: ACK for 0/1

Mermaid-Demo

Mathe mit Mathjax

Some inline Latex: \(a^2 + b^2 = c^2\)

Display equation:

\[\int e^{-kx} \, dx = -\frac{1}{k} e^{-kx}\]

Letzte Änderung: 14. December 2022 17:52