Graphviz TCP Packet Header diagram doesn't render

+1 vote
asked Mar 11 in Question / help by eduardomozart (500 points)
Hello,

I'm attempting to reproduce the following diagram on PlantUML online: https://stackoverflow.com/a/74016975/1031340

But I'm unable to, it doesn't work on PlantUML Online (https://plantuml.com/plantuml) into PNG/SVG formats and no useful info is shown to troubleshoot the problem.

1 Answer

+1 vote
answered Mar 11 by dickmaley (4,120 points)

Rather than replicate the chart shown in Stevens TCPIP reference let me capture the essence of his message.

Attempt 1

image

@startuml

title TCP/IP Data Encapsulation

participant "Application Layer" as App
participant "Transport Layer (TCP/UDP)" as Transport
participant "Internet Layer (IP)" as Internet
participant "Network Access Layer" as Network

App -> Transport : Data
Transport -> Transport : Add TCP/UDP Header (Segment/Datagram)
Transport -> Internet : Pass Segment/Datagram
Internet -> Internet : Add IP Header (Packet)
Internet -> Network : Pass Packet
Network -> Network : Add Frame Header & Trailer (Frame)
Network -> "Physical Medium" : Transmit Bits

@enduml

Attempt 2

image

@startuml
title TCP/IP Data Encapsulation

package "Application Layer" {
  [Application Data]
}

package "Transport Layer" {
  [Segment]
  [Application Data] --> [Segment] : Encapsulation
}

package "Internet Layer" {
  [Packet]
  [Segment] --> [Packet] : Encapsulation
}

package "Network Access Layer" {
  [Frame]
  [Packet] --> [Frame] : Encapsulation
}

[Frame] --> "Physical Medium" : Transmission

@enduml

Attempt 3

image

@startuml
skinparam monochrome true
skinparam shadowing false

rectangle "Application Data" as AppData
rectangle "TCP Header" as TCPHeader
rectangle "IP Header" as IPHeader
rectangle "Ethernet Header" as EthernetHeader
rectangle "Ethernet Trailer (FCS)" as EthernetTrailer

AppData --> TCPHeader : Encapsulation
TCPHeader --> IPHeader : Encapsulation
IPHeader --> EthernetHeader : Encapsulation
EthernetHeader --> EthernetTrailer : Encapsulation

note right of AppData
    Application Layer Data
    e.g., HTTP, FTP, etc.
end note

note right of TCPHeader
    TCP Segment
    - Source Port
    - Destination Port
    - Sequence Number
    - Acknowledgement Number
    - Flags (SYN, ACK, FIN, etc.)
    - Checksum
    - ...
end note

note right of IPHeader
    IP Datagram
    - Source IP Address
    - Destination IP Address
    - Protocol (TCP)
    - Time-to-Live (TTL)
    - ...
end note

note right of EthernetHeader
    Ethernet Frame
    - Destination MAC Address
    - Source MAC Address
    - EtherType (IP)
end note

note right of EthernetTrailer
    Frame Check Sequence (FCS)
    - Error Detection
end note

rectangle "Data Link Layer (Ethernet)" as DataLink {
    rectangle "Physical Layer (Cable)" as Physical
    EthernetHeader -- Physical
    EthernetTrailer -- Physical
    IPHeader -- Physical
}

rectangle "Network Layer (IP)" as Network {
    IPHeader -- DataLink
    TCPHeader -- DataLink
}

rectangle "Transport Layer (TCP)" as Transport {
    TCPHeader -- Network
    AppData -- Network
}

rectangle "Application Layer" as Application {
    AppData -- Transport
}

@enduml

...