<mxfile host="Electron" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/29.6.6 Chrome/144.0.7559.236 Electron/40.8.4 Safari/537.36" version="29.6.6">
  <diagram id="ntp-packet-diagram" name="NTP v4 Packet Format">
    <mxGraphModel dx="1064" dy="1030" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1400" pageHeight="800" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="title" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=20;fontStyle=1" value="NTP v4 / SNTP v4 报文格式 (标准 48 字节)" vertex="1">
          <mxGeometry height="40" width="600" x="175" y="60" as="geometry" />
        </mxCell>
        <mxCell id="header-bit-title" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" value="报文头部 (Word 0 - 第 0 至 31 位)" vertex="1">
          <mxGeometry height="30" width="300" x="100" y="100" as="geometry" />
        </mxCell>
        <mxCell id="ruler-0" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="0" vertex="1">
          <mxGeometry height="20" width="25" x="100" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-1" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="1" vertex="1">
          <mxGeometry height="20" width="25" x="125" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-2" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="2" vertex="1">
          <mxGeometry height="20" width="25" x="150" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-3" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="3" vertex="1">
          <mxGeometry height="20" width="25" x="175" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-4" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="4" vertex="1">
          <mxGeometry height="20" width="25" x="200" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-5" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="5" vertex="1">
          <mxGeometry height="20" width="25" x="225" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-6" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="6" vertex="1">
          <mxGeometry height="20" width="25" x="250" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-7" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="7" vertex="1">
          <mxGeometry height="20" width="25" x="275" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-8" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="8" vertex="1">
          <mxGeometry height="20" width="25" x="300" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-15" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="15" vertex="1">
          <mxGeometry height="20" width="50" x="460" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-16" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="16" vertex="1">
          <mxGeometry height="20" width="50" x="490" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-23" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="23" vertex="1">
          <mxGeometry height="20" width="50" x="660" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-24" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="24" vertex="1">
          <mxGeometry height="20" width="50" x="690" y="130" as="geometry" />
        </mxCell>
        <mxCell id="ruler-31" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=top;fontSize=10" value="31" vertex="1">
          <mxGeometry height="20" width="50" x="870" y="130" as="geometry" />
        </mxCell>
        <mxCell id="li-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#000000;align=center;verticalAlign=middle;fontStyle=1" value="LI" vertex="1">
          <mxGeometry height="40" width="50" x="100" y="150" as="geometry" />
        </mxCell>
        <mxCell id="vn-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#000000;align=center;verticalAlign=middle;fontStyle=1" value="VN" vertex="1">
          <mxGeometry height="40" width="75" x="150" y="150" as="geometry" />
        </mxCell>
        <mxCell id="mode-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#000000;align=center;verticalAlign=middle;fontStyle=1" value="Mode" vertex="1">
          <mxGeometry height="40" width="75" x="225" y="150" as="geometry" />
        </mxCell>
        <mxCell id="stratum-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#000000;align=center;verticalAlign=middle;fontStyle=1" value="Stratum&amp;nbsp;&lt;span style=&quot;font-size: 11px; font-weight: 400;&quot;&gt;8bit (1 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="40" width="200" x="300" y="150" as="geometry" />
        </mxCell>
        <mxCell id="poll-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#000000;align=center;verticalAlign=middle;fontStyle=1" value="Poll&amp;nbsp;&lt;span style=&quot;font-size: 11px; font-weight: 400;&quot;&gt;8bit (1 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="40" width="200" x="500" y="150" as="geometry" />
        </mxCell>
        <mxCell id="precision-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#000000;align=center;verticalAlign=middle;fontStyle=1" value="Precision&amp;nbsp;&lt;span style=&quot;font-size: 11px; font-weight: 400;&quot;&gt;8bit (1 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="40" width="200" x="700" y="150" as="geometry" />
        </mxCell>
        <mxCell id="timestamps-title" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=14;fontStyle=1" value="时间戳与其他字段 (Words 1-11)" vertex="1">
          <mxGeometry height="30" width="400" x="100" y="201" as="geometry" />
        </mxCell>
        <mxCell id="root-delay-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#000000;align=center;verticalAlign=middle" value="Root Delay &lt;span style=&quot;font-size: 11px;&quot;&gt;32bit (4 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="400" x="100" y="231" as="geometry" />
        </mxCell>
        <mxCell id="root-disp-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#000000;align=center;verticalAlign=middle" value="Root Dispersion&amp;nbsp;&lt;span style=&quot;font-size: 11px;&quot;&gt;32bit (4 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="400" x="100" y="271" as="geometry" />
        </mxCell>
        <mxCell id="ref-id-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#000000;align=center;verticalAlign=middle" value="Reference Identifier&amp;nbsp;&lt;span style=&quot;font-size: 11px;&quot;&gt;32bit (4 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="400" x="100" y="311" as="geometry" />
        </mxCell>
        <mxCell id="ref-ts-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#000000;align=center;verticalAlign=middle" value="Reference Timestamp&amp;nbsp;&lt;span style=&quot;font-size: 11px;&quot;&gt;64bit (8 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="800" x="100" y="361" as="geometry" />
        </mxCell>
        <mxCell id="orig-ts-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#000000;align=center;verticalAlign=middle" value="Originate Timestamp (T1)&amp;nbsp;&lt;span style=&quot;font-size: 11px;&quot;&gt;64bit (8 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="800" x="100" y="401" as="geometry" />
        </mxCell>
        <mxCell id="rx-ts-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#000000;align=center;verticalAlign=middle" value="Receive Timestamp (T2)&amp;nbsp;&lt;span style=&quot;font-size: 11px;&quot;&gt;64bit (8 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="800" x="100" y="441" as="geometry" />
        </mxCell>
        <mxCell id="tx-ts-box" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#000000;align=center;verticalAlign=middle" value="Transmit Timestamp (T3)&amp;nbsp;&lt;span style=&quot;font-size: 11px;&quot;&gt;64bit (8 字节)&lt;/span&gt;" vertex="1">
          <mxGeometry height="30" width="800" x="100" y="481" as="geometry" />
        </mxCell>
        <mxCell id="table-title" parent="1" style="text;html=1;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;fontStyle=1" value="核心字段定义表" vertex="1">
          <mxGeometry height="30" width="200" x="100" y="523" as="geometry" />
        </mxCell>
        <mxCell id="table-bg" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#666666;" value="" vertex="1">
          <mxGeometry height="130" width="800" x="100" y="563" as="geometry" />
        </mxCell>
        <mxCell id="th1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#6c8ebf;strokeColor=#ffffff;fontColor=#ffffff;align=center;verticalAlign=middle;fontStyle=1" value="字段名称" vertex="1">
          <mxGeometry height="30" width="180" x="100" y="563" as="geometry" />
        </mxCell>
        <mxCell id="th2" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#6c8ebf;strokeColor=#ffffff;fontColor=#ffffff;align=center;verticalAlign=middle;fontStyle=1" value="长度" vertex="1">
          <mxGeometry height="30" width="100" x="280" y="563" as="geometry" />
        </mxCell>
        <mxCell id="th3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#6c8ebf;strokeColor=#ffffff;fontColor=#ffffff;align=center;verticalAlign=middle;fontStyle=1" value="核心含义" vertex="1">
          <mxGeometry height="30" width="520" x="380" y="563" as="geometry" />
        </mxCell>
        <mxCell id="d1-1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#cccccc;align=left;verticalAlign=middle" value="LI&amp;nbsp;" vertex="1">
          <mxGeometry height="25" width="180" x="100" y="593" as="geometry" />
        </mxCell>
        <mxCell id="d1-2" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#cccccc;align=center;verticalAlign=middle" value="2 bit" vertex="1">
          <mxGeometry height="25" width="100" x="280" y="593" as="geometry" />
        </mxCell>
        <mxCell id="d1-3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#cccccc;align=left;verticalAlign=middle" value="闰秒警告(&lt;span style=&quot;background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));&quot;&gt;00 = 无警告，11 = 时钟未同步告警&lt;/span&gt;)" vertex="1">
          <mxGeometry height="25" width="520" x="380" y="593" as="geometry" />
        </mxCell>
        <mxCell id="d2-1" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=left;verticalAlign=middle" value="VN" vertex="1">
          <mxGeometry height="25" width="180" x="100" y="618" as="geometry" />
        </mxCell>
        <mxCell id="d2-2" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=center;verticalAlign=middle" value="3 bit" vertex="1">
          <mxGeometry height="25" width="100" x="280" y="618" as="geometry" />
        </mxCell>
        <mxCell id="d2-3" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=left;verticalAlign=middle" value="版本号(&lt;span style=&quot;background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));&quot;&gt;SNTPv4 对应值为 4&lt;/span&gt;)" vertex="1">
          <mxGeometry height="25" width="520" x="380" y="618" as="geometry" />
        </mxCell>
        <mxCell id="KUBt822XMcShu5GcSIXM-4" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=left;verticalAlign=middle" value="Mode" vertex="1">
          <mxGeometry height="25" width="180" x="100" y="643" as="geometry" />
        </mxCell>
        <mxCell id="KUBt822XMcShu5GcSIXM-5" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=center;verticalAlign=middle" value="3 bit" vertex="1">
          <mxGeometry height="25" width="100" x="280" y="643" as="geometry" />
        </mxCell>
        <mxCell id="KUBt822XMcShu5GcSIXM-6" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=left;verticalAlign=middle" value="模式 (&lt;span style=&quot;background-color: transparent; color: light-dark(rgb(0, 0, 0), rgb(255, 255, 255));&quot;&gt;3 = 客户端，4 = 服务器，5 = 广播 / 多播)&lt;/span&gt;" vertex="1">
          <mxGeometry height="25" width="520" x="380" y="643" as="geometry" />
        </mxCell>
        <mxCell id="KUBt822XMcShu5GcSIXM-7" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=left;verticalAlign=middle" value="Transmit Timestamp" vertex="1">
          <mxGeometry height="25" width="180" x="100" y="668" as="geometry" />
        </mxCell>
        <mxCell id="KUBt822XMcShu5GcSIXM-8" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=center;verticalAlign=middle" value="64 bit" vertex="1">
          <mxGeometry height="25" width="100" x="280" y="668" as="geometry" />
        </mxCell>
        <mxCell id="KUBt822XMcShu5GcSIXM-9" parent="1" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#ffffff;strokeColor=#cccccc;align=left;verticalAlign=middle" value="【T3】服务器离开时间戳 (计算偏移的核心)" vertex="1">
          <mxGeometry height="25" width="520" x="380" y="668" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
