Files
document-haness/docs/virtualization/final/assets/diagrams/packet-control-and-data-paths/packet-control-and-data-paths.svg
T

161 lines
13 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="680" height="1296" viewBox="0 0 680 1296" role="img" aria-labelledby="diagram-title diagram-description">
<title id="diagram-title">control/setup path 는 QEMU 를 지나고 data path 는 backend 에 따라 QEMU 를 지나기도 안 지나기도 한다</title>
<desc id="diagram-description">왼쪽에서 오른쪽으로 읽는다. 위쪽 줄이 control/setup path 다. virsh 에서 libvirt 와 QEMU 를 지나 virtio-net Device Model 에 닿고, 그 device model 이 virtual NIC 생성과 feature negotiation, virtqueue 설정, vhost-net backend 설정을 맡는다. 아래쪽 줄이 data path 다. Physical NIC 에서 Physical NIC Driver 와 Linux Bridge, TAP 까지 온다. 두 줄은 네 번째 열 다음에서 만난다. device model 은 점선으로 backend 둘을 설정하고, TAP 은 실선으로 그 둘 가운데 실제로 쓰는 쪽에 packet 을 넘긴다. vhost-net 을 쓰면 packet 은 Host Kernel 안에서 처리돼 QEMU 사용자 공간을 지나지 않고, QEMU virtio backend 를 쓰면 같은 packet 이 QEMU 사용자 공간을 지난다. 어느 쪽이든 virtqueue 에서 만나 Guest 로 올라간다. 이 Host 가 둘 중 어느 backend 를 쓰고 있는지는 그림이 말하지 않는다.</desc>
<metadata>{&quot;techviz&quot;:{&quot;spec_version&quot;:&quot;1.1&quot;,&quot;id&quot;:&quot;packet-control-and-data-paths&quot;,&quot;profile&quot;:&quot;component-flow&quot;},&quot;source_context&quot;:{&quot;document&quot;:&quot;docs/virtualization/final/document.md&quot;,&quot;document_sha256&quot;:&quot;181e2b3cc8a45bae81e7e8193d026937c4d586ae4495d3b2c323eb7e6abcfadd&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;125. 최종 기준 구조&quot;,&quot;line&quot;:5682}},&quot;evidence_policy&quot;:&quot;Each factual element cites source lines or is marked assumption.&quot;,&quot;diagram_only&quot;:true}</metadata>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 0 L 10 5 L 0 10 z" />
</marker>
<style>
:root { color-scheme: light; }
text { font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: #111827; }
.canvas { fill: #ffffff; }
.group-box { fill: #ffffff; stroke: #9ca3af; stroke-width: 1.4; stroke-dasharray: 7 5; }
.group-label-bg { fill: #ffffff; }
.group-label { font-size: 13px; font-weight: 650; fill: #374151; }
.edge { fill: none; stroke: #374151; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; marker-end: url(#arrow); }
.edge.style-dashed, .edge.semantic-dashed, .edge.assumption { stroke-dasharray: 7 5; }
.edge.style-dotted { stroke-dasharray: 2 5; }
.edge.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.edge.emphasis-muted { stroke: #9ca3af; }
.edge.emphasis-warning, .edge.kind-failure, .edge.kind-error { stroke: #dc2626; stroke-width: 2.2; }
.edge-label-bg { fill: #ffffff; }
.edge-label { font-size: 12px; font-weight: 560; text-anchor: middle; }
.node-shape { fill: #ffffff; stroke: #4b5563; stroke-width: 1.7; }
.node-shape.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.node-shape.emphasis-muted { stroke: #9ca3af; fill: #f9fafb; }
.node-shape.emphasis-warning { stroke: #d97706; stroke-width: 2; fill: #fffdf5; }
.node-shape.kind-database, .node-shape.kind-datastore, .node-shape.kind-storage { fill: #f8fafc; }
.node-shape.kind-queue, .node-shape.kind-event, .node-shape.kind-topic { fill: #fafafa; }
.node-shape.assumption { stroke-dasharray: 4 4; }
.storage-bottom, .controller-divider { fill: none; stroke: #4b5563; stroke-width: 1.4; }
.controller-led { fill: #4b5563; }
.actor-symbol { fill: none; stroke: #4b5563; stroke-width: 1.8; stroke-linecap: round; }
.actor-symbol.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
.node-label { font-size: 14px; font-weight: 650; text-anchor: middle; }
.node-role { font-size: 10px; letter-spacing: 0.04em; text-anchor: middle; fill: #6b7280; }
.node-detail-divider { stroke: #d1d5db; stroke-width: 1; }
.node-detail { font-size: 11px; fill: #374151; }
.assumption-badge { font-size: 9px; font-weight: 700; fill: #92400e; }
.failure-mark { stroke: #dc2626; stroke-width: 4; stroke-linecap: round; }
.lifeline { stroke: #9ca3af; stroke-width: 1.2; stroke-dasharray: 5 5; }
.timeline-axis { stroke: #374151; stroke-width: 1.8; marker-end: url(#arrow); }
.timeline-stem { stroke: #6b7280; stroke-width: 1.3; }
.timeline-marker { fill: #ffffff; stroke: #374151; stroke-width: 1.7; }
.timeline-marker.primary { fill: #2563eb; stroke: #2563eb; }
.timeline-marker.warning { fill: #dc2626; stroke: #dc2626; }
.timeline-label { font-size: 13px; font-weight: 650; text-anchor: middle; }
.timeline-detail { font-size: 11px; fill: #4b5563; text-anchor: middle; }
</style>
</defs>
<rect class="canvas" width="680" height="1296" />
<polyline class="edge kind-data style-solid emphasis-normal" points="375.5,461.0 375.5,526.8 387.5,526.8 387.5,592.5" data-evidence="5671-5671,5712-5714" />
<rect class="edge-label-bg" x="325.6" y="484.8" width="111.8" height="22" rx="3" />
<text class="edge-label" x="381.5" y="499.8">Ethernet Frame</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="375.5,291.0 375.5,339.0 375.5,339.0 375.5,387.0" data-evidence="5672-5672,5710-5712" />
<rect class="edge-label-bg" x="346.9" y="325.0" width="105.1" height="22" rx="3" />
<text class="edge-label" x="399.5" y="340.0">L2 forwarding</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="157.0,291.0 157.0,339.8 165.5,339.8 165.5,388.5" data-evidence="5663-5663,5691-5693" />
<rect class="edge-label-bg" x="68.5" y="297.8" width="185.5" height="22" rx="3" />
<text class="edge-label" x="161.2" y="312.8">NIC/network configuration</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="375.5,127.5 375.5,177.2 375.5,177.2 375.5,227.0" data-evidence="5671-5671,5708-5710" />
<rect class="edge-label-bg" x="343.6" y="163.2" width="111.8" height="22" rx="3" />
<text class="edge-label" x="399.5" y="178.2">Ethernet Frame</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="165.5,866.0 165.5,914.0 261.5,914.0 261.5,962.0" data-evidence="5729-5729,5742-5744" />
<rect class="edge-label-bg" x="174.3" y="872.0" width="78.3" height="22" rx="3" />
<text class="edge-label" x="213.5" y="887.0">Data Path</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="165.5,459.5 165.5,508.2 157.0,508.2 157.0,557.0" data-evidence="5666-5666,5693-5695" />
<rect class="edge-label-bg" x="112.0" y="466.2" width="98.4" height="22" rx="3" />
<text class="edge-label" x="161.2" y="481.2">QEMU process</text>
<polyline class="edge kind-control style-dashed emphasis-normal" points="148.0,699.0 148.0,747.0 156.5,747.0 156.5,795.0" data-evidence="5668-5668,5700-5700" />
<polyline class="edge kind-control style-dashed emphasis-normal" points="166.0,699.0 166.0,747.0 375.0,747.0 375.0,795.0" data-evidence="5700-5700,5716-5716" />
<rect class="edge-label-bg" x="194.5" y="705.0" width="152.0" height="22" rx="3" />
<text class="edge-label" x="270.5" y="720.0">vhost-net backend 설정</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="378.5,663.5 378.5,729.2 174.5,729.2 174.5,795.0" data-evidence="5729-5729,5740-5742" />
<polyline class="edge kind-data style-solid emphasis-normal" points="396.5,663.5 396.5,729.2 393.0,729.2 393.0,795.0" data-evidence="5703-5703,5714-5716" />
<rect class="edge-label-bg" x="345.6" y="687.2" width="98.4" height="22" rx="3" />
<text class="edge-label" x="394.8" y="702.2">vhost-net 사용</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="384.0,866.0 384.0,914.0 279.5,914.0 279.5,962.0" data-evidence="5703-5703,5716-5718" />
<rect class="edge-label-bg" x="292.6" y="872.0" width="78.3" height="22" rx="3" />
<text class="edge-label" x="331.8" y="887.0">Data Path</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="165.5,131.0 165.5,179.0 157.0,179.0 157.0,227.0" data-evidence="5662-5663,5684-5691" />
<rect class="edge-label-bg" x="102.0" y="137.0" width="118.5" height="22" rx="3" />
<text class="edge-label" x="161.2" y="152.0">Control / Setup</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="270.5,1033.0 270.5,1081.0 270.5,1081.0 270.5,1129.0" data-evidence="5664-5664,5718-5726" />
<rect class="edge-label-bg" x="198.4" y="1067.0" width="192.2" height="22" rx="3" />
<text class="edge-label" x="294.5" y="1082.0">virtio-net Frontend Driver</text>
<g id="node-virsh">
<rect class="node-shape kind-cli emphasis-normal role-actor" data-evidence="5662-5662,5687-5689" x="90.5" y="60.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="165.5" y="87.0">virsh</text>
<line class="node-detail-divider" x1="104.5" y1="108.0" x2="226.5" y2="108.0" />
<text class="node-detail" x="106.5" y="125.0">User</text>
</g>
<g id="node-physical-nic">
<rect class="node-shape kind-hardware emphasis-normal role-source" data-evidence="5706-5708" x="300.5" y="63.5" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="375.5" y="93.5">Physical NIC</text>
</g>
<g id="node-libvirt">
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="5663-5663,5691-5691" x="82.0" y="227.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="157.0" y="257.0">libvirt</text>
</g>
<g id="node-physical-nic-driver">
<rect class="node-shape kind-driver emphasis-normal role-service" data-evidence="5674-5674,5710-5710" x="292.0" y="227.0" width="167.0" height="64.0" rx="7" />
<text class="node-label" x="375.5" y="257.0">Physical NIC Driver</text>
</g>
<g id="node-qemu">
<rect class="node-shape kind-process emphasis-normal role-service" data-evidence="5666-5666,5693-5693" x="90.5" y="388.5" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="165.5" y="415.5">QEMU</text>
<line class="node-detail-divider" x1="104.5" y1="436.5" x2="226.5" y2="436.5" />
<text class="node-detail" x="106.5" y="453.5">Host Userspace</text>
</g>
<g id="node-linux-bridge">
<rect class="node-shape kind-network emphasis-normal role-service" data-evidence="5672-5673,5712-5712" x="300.5" y="387.0" width="150.0" height="74.0" rx="7" />
<text class="node-label" x="375.5" y="414.0">Linux Bridge /</text>
<text class="node-label" x="375.5" y="432.0">Routing / NAT</text>
</g>
<g id="node-virtio-net-device-model">
<rect class="node-shape kind-service emphasis-primary role-service" data-evidence="5666-5666,5695-5700" x="70.0" y="557.0" width="174.0" height="142.0" rx="7" />
<text class="node-label" x="157.0" y="585.0">virtio-net Device</text>
<text class="node-label" x="157.0" y="603.0">Model</text>
<line class="node-detail-divider" x1="84.0" y1="624.0" x2="230.0" y2="624.0" />
<text class="node-detail" x="86.0" y="641.0">virtual NIC 생성</text>
<text class="node-detail" x="86.0" y="657.0">feature negotiation</text>
<text class="node-detail" x="86.0" y="673.0">virtqueue 설정</text>
<text class="node-detail" x="86.0" y="689.0">vhost-net backend 설정</text>
</g>
<g id="node-tap">
<rect class="node-shape kind-network emphasis-normal role-service" data-evidence="5671-5671,5714-5714" x="304.0" y="592.5" width="167.0" height="71.0" rx="7" />
<text class="node-label" x="387.5" y="619.5">TAP</text>
<line class="node-detail-divider" x1="318.0" y1="640.5" x2="457.0" y2="640.5" />
<text class="node-detail" x="320.0" y="657.5">Host-side interface</text>
</g>
<g id="node-qemu-virtio-backend">
<rect class="node-shape kind-process emphasis-normal role-service" data-evidence="5668-5668,5742-5742" x="82.0" y="795.0" width="167.0" height="71.0" rx="7" />
<text class="node-label" x="165.5" y="822.0">QEMU virtio backend</text>
<line class="node-detail-divider" x1="96.0" y1="843.0" x2="235.0" y2="843.0" />
<text class="node-detail" x="98.0" y="860.0">QEMU Userspace</text>
</g>
<g id="node-vhost-net">
<rect class="node-shape kind-kernel emphasis-normal role-service" data-evidence="5669-5669,5716-5716" x="309.0" y="795.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="384.0" y="822.0">vhost-net</text>
<line class="node-detail-divider" x1="323.0" y1="843.0" x2="445.0" y2="843.0" />
<text class="node-detail" x="325.0" y="860.0">Host Kernel</text>
</g>
<g id="node-virtqueue">
<rect class="node-shape kind-queue emphasis-normal role-queue" data-evidence="5667-5667,5718-5718" x="195.5" y="962.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="270.5" y="989.0">virtqueue</text>
<line class="node-detail-divider" x1="209.5" y1="1010.0" x2="331.5" y2="1010.0" />
<text class="node-detail" x="211.5" y="1027.0">shared queue</text>
</g>
<g id="node-guest">
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="5664-5665,5720-5726" x="162.5" y="1129.0" width="216.0" height="122.0" rx="7" />
<text class="node-label" x="270.5" y="1156.0">Guest</text>
<line class="node-detail-divider" x1="176.5" y1="1177.0" x2="364.5" y2="1177.0" />
<text class="node-detail" x="178.5" y="1194.0">virtio-net Frontend Driver</text>
<text class="node-detail" x="178.5" y="1210.0">Guest TCP/IP Stack</text>
<text class="node-detail" x="178.5" y="1226.0">Socket</text>
<text class="node-detail" x="178.5" y="1242.0">Keycloak</text>
</g>
</svg>