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="2249" height="390" viewBox="0 0 2249 390" 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;8c4ecc64c8cea9a4450ed7131fdd9cb2048dc092b66cd969f6346ed77887c210&quot;,&quot;anchor&quot;:{&quot;kind&quot;:&quot;heading&quot;,&quot;value&quot;:&quot;125. 최종 기준 구조&quot;,&quot;line&quot;:5695}},&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="2249" height="390" />
<polyline class="edge kind-data style-solid emphasis-normal" points="857.0,274.0 938.8,274.0 938.8,309.5 1020.5,309.5" data-evidence="5684-5684,5725-5727" />
<rect class="edge-label-bg" x="906.9" y="277.8" width="111.8" height="22" rx="3" />
<text class="edge-label" x="962.8" y="292.8">Ethernet Frame</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="547.0,270.5 627.0,270.5 627.0,274.0 707.0,274.0" data-evidence="5685-5685,5723-5725" />
<rect class="edge-label-bg" x="598.5" y="258.2" width="105.1" height="22" rx="3" />
<text class="edge-label" x="651.0" y="273.2">L2 forwarding</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="538.5,134.5 622.8,134.5 622.8,129.5 707.0,129.5" data-evidence="5676-5676,5704-5706" />
<rect class="edge-label-bg" x="604.2" y="118.0" width="85.0" height="22" rx="3" />
<text class="edge-label" x="646.8" y="133.0">NIC config</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="220.0,274.0 300.0,274.0 300.0,270.5 380.0,270.5" data-evidence="5684-5684,5721-5723" />
<rect class="edge-label-bg" x="268.1" y="258.2" width="111.8" height="22" rx="3" />
<text class="edge-label" x="324.0" y="273.2">Ethernet Frame</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="1518.0,131.0 1598.0,131.0 1598.0,193.5 1678.0,193.5" data-evidence="5742-5742,5755-5757" />
<rect class="edge-label-bg" x="1582.8" y="148.2" width="78.3" height="22" rx="3" />
<text class="edge-label" x="1622.0" y="163.2">Data Path</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="857.0,129.5 937.0,129.5 937.0,131.0 1017.0,131.0" data-evidence="5679-5679,5706-5708" />
<rect class="edge-label-bg" x="911.8" y="116.2" width="98.4" height="22" rx="3" />
<text class="edge-label" x="961.0" y="131.2">QEMU process</text>
<polyline class="edge kind-control style-dashed emphasis-normal" points="1191.0,122.0 1271.0,122.0 1271.0,122.0 1351.0,122.0" data-evidence="5681-5681,5713-5713" />
<polyline class="edge kind-control style-dashed emphasis-normal" points="1191.0,140.0 1275.2,140.0 1275.2,265.0 1359.5,265.0" data-evidence="5713-5713,5729-5729" />
<rect class="edge-label-bg" x="1223.2" y="188.5" width="152.0" height="22" rx="3" />
<text class="edge-label" x="1299.2" y="203.5">vhost-net backend 설정</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="1187.5,300.5 1269.2,300.5 1269.2,140.0 1351.0,140.0" data-evidence="5742-5742,5753-5755" />
<polyline class="edge kind-data style-solid emphasis-normal" points="1187.5,318.5 1273.5,318.5 1273.5,283.0 1359.5,283.0" data-evidence="5716-5716,5727-5729" />
<rect class="edge-label-bg" x="1248.3" y="286.8" width="98.4" height="22" rx="3" />
<text class="edge-label" x="1297.5" y="301.8">vhost-net 사용</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="1509.5,274.0 1593.8,274.0 1593.8,211.5 1678.0,211.5" data-evidence="5716-5716,5729-5731" />
<rect class="edge-label-bg" x="1578.6" y="228.8" width="78.3" height="22" rx="3" />
<text class="edge-label" x="1617.8" y="243.8">Data Path</text>
<polyline class="edge kind-control style-solid emphasis-normal" points="220.0,134.5 304.2,134.5 304.2,134.5 388.5,134.5" data-evidence="5675-5676,5697-5704" />
<rect class="edge-label-bg" x="245.0" y="92.5" width="118.5" height="22" rx="3" />
<text class="edge-label" x="304.2" y="107.5">Control / Setup</text>
<polyline class="edge kind-data style-solid emphasis-normal" points="1828.0,202.5 1908.0,202.5 1908.0,202.5 1988.0,202.5" data-evidence="5677-5677,5731-5739" />
<rect class="edge-label-bg" x="1872.2" y="160.5" width="71.6" height="22" rx="3" />
<text class="edge-label" x="1908.0" y="175.5">frontend</text>
<g id="node-virsh">
<rect class="node-shape kind-cli emphasis-normal role-actor" data-evidence="5675-5675,5700-5702" x="70.0" y="99.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="145.0" y="126.0">virsh</text>
<line class="node-detail-divider" x1="84.0" y1="147.0" x2="206.0" y2="147.0" />
<text class="node-detail" x="86.0" y="164.0">User</text>
</g>
<g id="node-physical-nic">
<rect class="node-shape kind-hardware emphasis-normal role-source" data-evidence="5719-5721" x="70.0" y="242.0" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="145.0" y="272.0">Physical NIC</text>
</g>
<g id="node-libvirt">
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="5676-5676,5704-5704" x="388.5" y="102.5" width="150.0" height="64.0" rx="7" />
<text class="node-label" x="463.5" y="132.5">libvirt</text>
</g>
<g id="node-physical-nic-driver">
<rect class="node-shape kind-driver emphasis-normal role-service" data-evidence="5687-5687,5723-5723" x="380.0" y="238.5" width="167.0" height="64.0" rx="7" />
<text class="node-label" x="463.5" y="268.5">Physical NIC Driver</text>
</g>
<g id="node-qemu">
<rect class="node-shape kind-process emphasis-normal role-service" data-evidence="5679-5679,5706-5706" x="707.0" y="94.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="782.0" y="121.0">QEMU</text>
<line class="node-detail-divider" x1="721.0" y1="142.0" x2="843.0" y2="142.0" />
<text class="node-detail" x="723.0" y="159.0">Host Userspace</text>
</g>
<g id="node-linux-bridge">
<rect class="node-shape kind-network emphasis-normal role-service" data-evidence="5685-5686,5725-5725" x="707.0" y="237.0" width="150.0" height="74.0" rx="7" />
<text class="node-label" x="782.0" y="264.0">Linux Bridge /</text>
<text class="node-label" x="782.0" y="282.0">Routing / NAT</text>
</g>
<g id="node-virtio-net-device-model">
<rect class="node-shape kind-service emphasis-primary role-service" data-evidence="5679-5679,5708-5713" x="1017.0" y="60.0" width="174.0" height="142.0" rx="7" />
<text class="node-label" x="1104.0" y="88.0">virtio-net Device</text>
<text class="node-label" x="1104.0" y="106.0">Model</text>
<line class="node-detail-divider" x1="1031.0" y1="127.0" x2="1177.0" y2="127.0" />
<text class="node-detail" x="1033.0" y="144.0">virtual NIC 생성</text>
<text class="node-detail" x="1033.0" y="160.0">feature negotiation</text>
<text class="node-detail" x="1033.0" y="176.0">virtqueue 설정</text>
<text class="node-detail" x="1033.0" y="192.0">vhost-net backend 설정</text>
</g>
<g id="node-tap">
<rect class="node-shape kind-network emphasis-normal role-service" data-evidence="5684-5684,5727-5727" x="1020.5" y="274.0" width="167.0" height="71.0" rx="7" />
<text class="node-label" x="1104.0" y="301.0">TAP</text>
<line class="node-detail-divider" x1="1034.5" y1="322.0" x2="1173.5" y2="322.0" />
<text class="node-detail" x="1036.5" y="339.0">Host-side interface</text>
</g>
<g id="node-qemu-virtio-backend">
<rect class="node-shape kind-process emphasis-normal role-service" data-evidence="5681-5681,5755-5755" x="1351.0" y="95.5" width="167.0" height="71.0" rx="7" />
<text class="node-label" x="1434.5" y="122.5">QEMU virtio backend</text>
<line class="node-detail-divider" x1="1365.0" y1="143.5" x2="1504.0" y2="143.5" />
<text class="node-detail" x="1367.0" y="160.5">QEMU Userspace</text>
</g>
<g id="node-vhost-net">
<rect class="node-shape kind-kernel emphasis-normal role-service" data-evidence="5682-5682,5729-5729" x="1359.5" y="238.5" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="1434.5" y="265.5">vhost-net</text>
<line class="node-detail-divider" x1="1373.5" y1="286.5" x2="1495.5" y2="286.5" />
<text class="node-detail" x="1375.5" y="303.5">Host Kernel</text>
</g>
<g id="node-virtqueue">
<rect class="node-shape kind-queue emphasis-normal role-queue" data-evidence="5680-5680,5731-5731" x="1678.0" y="167.0" width="150.0" height="71.0" rx="7" />
<text class="node-label" x="1753.0" y="194.0">virtqueue</text>
<line class="node-detail-divider" x1="1692.0" y1="215.0" x2="1814.0" y2="215.0" />
<text class="node-detail" x="1694.0" y="232.0">shared queue</text>
</g>
<g id="node-guest">
<rect class="node-shape kind-service emphasis-normal role-sink" data-evidence="5677-5678,5733-5739" x="1988.0" y="141.5" width="216.0" height="122.0" rx="7" />
<text class="node-label" x="2096.0" y="168.5">Guest</text>
<line class="node-detail-divider" x1="2002.0" y1="189.5" x2="2190.0" y2="189.5" />
<text class="node-detail" x="2004.0" y="206.5">virtio-net Frontend Driver</text>
<text class="node-detail" x="2004.0" y="222.5">Guest TCP/IP Stack</text>
<text class="node-detail" x="2004.0" y="238.5">Socket</text>
<text class="node-detail" x="2004.0" y="254.5">Keycloak</text>
</g>
</svg>