<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki.riguz.com/index.php?action=history&amp;feed=atom&amp;title=TCP_Packet_Example</id>
	<title>TCP Packet Example - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.riguz.com/index.php?action=history&amp;feed=atom&amp;title=TCP_Packet_Example"/>
	<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;action=history"/>
	<updated>2026-06-02T21:25:05Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=3437&amp;oldid=prev</id>
		<title>Riguz：​Riguz moved page Blog:TCP(2)：TCP报文实例 to TCP Packet Example without leaving a redirect</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=3437&amp;oldid=prev"/>
		<updated>2023-12-06T01:56:02Z</updated>

		<summary type="html">&lt;p&gt;Riguz moved page &lt;a href=&quot;/index.php?title=Blog:TCP(2)%EF%BC%9ATCP%E6%8A%A5%E6%96%87%E5%AE%9E%E4%BE%8B&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Blog:TCP(2)：TCP报文实例（页面不存在）&quot;&gt;Blog:TCP(2)：TCP报文实例&lt;/a&gt; to &lt;a href=&quot;/TCP_Packet_Example&quot; title=&quot;TCP Packet Example&quot;&gt;TCP Packet Example&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2023年12月6日 (三) 01:56的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;zh-Hans-CN&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;（没有差异）&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wiki_db:diff:1.41:old-3436:rev-3437 --&gt;
&lt;/table&gt;</summary>
		<author><name>Riguz</name></author>
	</entry>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=3436&amp;oldid=prev</id>
		<title>2023年12月6日 (三) 01:55 Riguz</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=3436&amp;oldid=prev"/>
		<updated>2023-12-06T01:55:30Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2023年12月6日 (三) 01:55的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l193&quot;&gt;第193行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第193行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Network]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Network]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Protocol]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:TCP/IP]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:RFC]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_db:diff:1.41:old-2481:rev-3436:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Riguz</name></author>
	</entry>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=2481&amp;oldid=prev</id>
		<title>Riguz：​/* 序列号与ACK */</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=2481&amp;oldid=prev"/>
		<updated>2021-07-12T13:28:31Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;序列号与ACK&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年7月12日 (一) 13:28的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l192&quot;&gt;第192行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第192行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# (Client) ACK, Seq=3261314642, ACK=1175996047=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# (Client) ACK, Seq=3261314642, ACK=1175996047=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Web&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Network&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_db:diff:1.41:old-2480:rev-2481:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Riguz</name></author>
	</entry>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=2480&amp;oldid=prev</id>
		<title>2021年4月30日 (五) 07:55 Riguz</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=2480&amp;oldid=prev"/>
		<updated>2021-04-30T07:55:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年4月30日 (五) 07:55的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l182&quot;&gt;第182行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第182行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= 序列号与ACK=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;= 序列号与ACK=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1. &lt;/del&gt;(Client) SYN, Seq=3261314628&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Client) SYN, Seq=3261314628&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Server) SYN/ACK, Seq=1175996045, ACK=3261314629=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Server) SYN/ACK, Seq=1175996045, ACK=3261314629=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Client) ACK, Seq=3261314629, ACK=1175996046=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Client) ACK, Seq=3261314629, ACK=1175996046=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Client) PSH/ACK, Seq=3261314629, ACK=1175996046, Data(12bytes)=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Client) PSH/ACK, Seq=3261314629, ACK=1175996046, Data(12bytes)=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Server) ACK, Seq=1175996046, ACK=3261314641=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Server) ACK, Seq=1175996046, ACK=3261314641=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Client) FIN/ACK, Seq=3261314641, ACK=1175996046=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Client) FIN/ACK, Seq=3261314641, ACK=1175996046=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Server) ACK, Seq=1175996046, ACK=3261314642=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Server) ACK, Seq=1175996046, ACK=3261314642=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Server) FIN, ACK, Seq=1175996046, ACK=3261314642=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Server) FIN, ACK, Seq=1175996046, ACK=3261314642=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=. &lt;/del&gt;(Client) ACK, Seq=3261314642, ACK=1175996047=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;# &lt;/ins&gt;(Client) ACK, Seq=3261314642, ACK=1175996047=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Web]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key wiki_db:diff:1.41:old-2479:rev-2480:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>Riguz</name></author>
	</entry>
	<entry>
		<id>https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=2479&amp;oldid=prev</id>
		<title>imported&gt;Riguz：​TCP每个报文都有一个序列号，这个序列号在初始的时候是随机生成的（而不是直接使用0或者1），那么这样做的原因究竟是为什么？</title>
		<link rel="alternate" type="text/html" href="https://wiki.riguz.com/index.php?title=TCP_Packet_Example&amp;diff=2479&amp;oldid=prev"/>
		<updated>2020-09-14T00:00:00Z</updated>

		<summary type="html">&lt;p&gt;TCP每个报文都有一个序列号，这个序列号在初始的时候是随机生成的（而不是直接使用0或者1），那么这样做的原因究竟是为什么？&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
TCP每个报文都有一个序列号，这个序列号在初始的时候是随机生成的（而不是直接使用0或者1），那么这样做的原因究竟是为什么？&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= TCP 实例=&lt;br /&gt;
使用[https://www.wireshark.org/ Wireshark]和[https://sourceforge.net/projects/sockettest/ SocketTest]在本地进行数据发送和接收，可以抓取到TCP报文。首先使用SocketTest在本地(127.0.0.1)的10240端口上启动一个Socket服务器，然后使用它的客户端功能连接这个端口，并在Wireshark中监听本地回环网卡(localhost)，即可抓取到对应的数据包。&lt;br /&gt;
&lt;br /&gt;
== 三次握手==&lt;br /&gt;
&lt;br /&gt;
[[File:Wireshark-lo-1.png|600px|3-way Handshake]]&lt;br /&gt;
&lt;br /&gt;
可以看出，是一个标准的三次握手的过程，握手完成之后，服务端给客户端发送了一个Window Update。&lt;br /&gt;
&lt;br /&gt;
=== 1:客户端发送SYN===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Frame 13: 68 bytes on wire (544 bits), 68 bytes captured (544 bits) on interface lo0, id 0&lt;br /&gt;
Null/Loopback&lt;br /&gt;
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1&lt;br /&gt;
Transmission Control Protocol, Src Port: 64255, Dst Port: 10240, Seq: 0, Len: 0&lt;br /&gt;
    Source Port: 64255&lt;br /&gt;
    Destination Port: 10240&lt;br /&gt;
    [Stream index: 0]&lt;br /&gt;
    [TCP Segment Len: 0]&lt;br /&gt;
    Sequence number: 0    (relative sequence number)&lt;br /&gt;
    Sequence number (raw): 3261314628&lt;br /&gt;
    [Next sequence number: 1    (relative sequence number)]&lt;br /&gt;
    Acknowledgment number: 0&lt;br /&gt;
    Acknowledgment number (raw): 0&lt;br /&gt;
    1011 .... = Header Length: 44 bytes (11)&lt;br /&gt;
    Flags: 0x002 (SYN)&lt;br /&gt;
    Window size value: 65535&lt;br /&gt;
    [Calculated window size: 65535]&lt;br /&gt;
    Checksum: 0xfe34 [unverified]&lt;br /&gt;
    [Checksum Status: Unverified]&lt;br /&gt;
    Urgent pointer: 0&lt;br /&gt;
    Options: (24 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), Timestamps, SACK permitted, End of Option List (EOL)&lt;br /&gt;
        TCP Option - Maximum segment size: 16344 bytes&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Window scale: 6 (multiply by 64)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Timestamps: TSval 740812626, TSecr 0&lt;br /&gt;
        TCP Option - SACK permitted&lt;br /&gt;
        TCP Option - End of Option List (EOL)&lt;br /&gt;
    [Timestamps]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2:服务端回复SYN/ACK===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Frame 14: 68 bytes on wire (544 bits), 68 bytes captured (544 bits) on interface lo0, id 0&lt;br /&gt;
Null/Loopback&lt;br /&gt;
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1&lt;br /&gt;
Transmission Control Protocol, Src Port: 10240, Dst Port: 64255, Seq: 0, Ack: 1, Len: 0&lt;br /&gt;
    Source Port: 10240&lt;br /&gt;
    Destination Port: 64255&lt;br /&gt;
    [Stream index: 0]&lt;br /&gt;
    [TCP Segment Len: 0]&lt;br /&gt;
    Sequence number: 0    (relative sequence number)&lt;br /&gt;
    Sequence number (raw): 1175996045&lt;br /&gt;
    [Next sequence number: 1    (relative sequence number)]&lt;br /&gt;
    Acknowledgment number: 1    (relative ack number)&lt;br /&gt;
    Acknowledgment number (raw): 3261314629&lt;br /&gt;
    1011 .... = Header Length: 44 bytes (11)&lt;br /&gt;
    Flags: 0x012 (SYN, ACK)&lt;br /&gt;
    Window size value: 65535&lt;br /&gt;
    [Calculated window size: 65535]&lt;br /&gt;
    Checksum: 0xfe34 [unverified]&lt;br /&gt;
    [Checksum Status: Unverified]&lt;br /&gt;
    Urgent pointer: 0&lt;br /&gt;
    Options: (24 bytes), Maximum segment size, No-Operation (NOP), Window scale, No-Operation (NOP), No-Operation (NOP), Timestamps, SACK permitted, End of Option List (EOL)&lt;br /&gt;
        TCP Option - Maximum segment size: 16344 bytes&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Window scale: 6 (multiply by 64)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Timestamps: TSval 740812626, TSecr 740812626&lt;br /&gt;
        TCP Option - SACK permitted&lt;br /&gt;
        TCP Option - End of Option List (EOL)&lt;br /&gt;
    [SEQ/ACK analysis]&lt;br /&gt;
    [Timestamps]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 3:客户端回复ACK===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Frame 15: 56 bytes on wire (448 bits), 56 bytes captured (448 bits) on interface lo0, id 0&lt;br /&gt;
Null/Loopback&lt;br /&gt;
Internet Protocol Version 4, Src: 127.0.0.1, Dst: 127.0.0.1&lt;br /&gt;
Transmission Control Protocol, Src Port: 64255, Dst Port: 10240, Seq: 1, Ack: 1, Len: 0&lt;br /&gt;
    Source Port: 64255&lt;br /&gt;
    Destination Port: 10240&lt;br /&gt;
    [Stream index: 0]&lt;br /&gt;
    [TCP Segment Len: 0]&lt;br /&gt;
    Sequence number: 1    (relative sequence number)&lt;br /&gt;
    Sequence number (raw): 3261314629&lt;br /&gt;
    [Next sequence number: 1    (relative sequence number)]&lt;br /&gt;
    Acknowledgment number: 1    (relative ack number)&lt;br /&gt;
    Acknowledgment number (raw): 1175996046&lt;br /&gt;
    1000 .... = Header Length: 32 bytes (8)&lt;br /&gt;
    Flags: 0x010 (ACK)&lt;br /&gt;
    Window size value: 6379&lt;br /&gt;
    [Calculated window size: 408256]&lt;br /&gt;
    [Window size scaling factor: 64]&lt;br /&gt;
    Checksum: 0xfe28 [unverified]&lt;br /&gt;
    [Checksum Status: Unverified]&lt;br /&gt;
    Urgent pointer: 0&lt;br /&gt;
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Timestamps: TSval 740812626, TSecr 740812626&lt;br /&gt;
    [SEQ/ACK analysis]&lt;br /&gt;
    [Timestamps]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 数据发送==&lt;br /&gt;
通过像服务器发送一个&amp;quot;helloworld&amp;quot;来查看数据是如何发送的：&lt;br /&gt;
&lt;br /&gt;
=== 1:客户端发送PSH/ACK===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Transmission Control Protocol, Src Port: 64255, Dst Port: 10240, Seq: 1, Ack: 1, Len: 12&lt;br /&gt;
    Source Port: 64255&lt;br /&gt;
    Destination Port: 10240&lt;br /&gt;
    [Stream index: 0]&lt;br /&gt;
    [TCP Segment Len: 12]&lt;br /&gt;
    Sequence number: 1    (relative sequence number)&lt;br /&gt;
    Sequence number (raw): 3261314629&lt;br /&gt;
    [Next sequence number: 13    (relative sequence number)]&lt;br /&gt;
    Acknowledgment number: 1    (relative ack number)&lt;br /&gt;
    Acknowledgment number (raw): 1175996046&lt;br /&gt;
    1000 .... = Header Length: 32 bytes (8)&lt;br /&gt;
    Flags: 0x018 (PSH, ACK)&lt;br /&gt;
    Window size value: 6379&lt;br /&gt;
    [Calculated window size: 6379]&lt;br /&gt;
    [Window size scaling factor: -1 (unknown)]&lt;br /&gt;
    Checksum: 0xfe34 [unverified]&lt;br /&gt;
    [Checksum Status: Unverified]&lt;br /&gt;
    Urgent pointer: 0&lt;br /&gt;
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Timestamps: TSval 742069804, TSecr 740812626&lt;br /&gt;
    [SEQ/ACK analysis]&lt;br /&gt;
    [Timestamps]&lt;br /&gt;
    TCP payload (12 bytes)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2:服务端回复ACK===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Transmission Control Protocol, Src Port: 10240, Dst Port: 64255, Seq: 1, Ack: 13, Len: 0&lt;br /&gt;
    Source Port: 10240&lt;br /&gt;
    Destination Port: 64255&lt;br /&gt;
    [Stream index: 0]&lt;br /&gt;
    [TCP Segment Len: 0]&lt;br /&gt;
    Sequence number: 1    (relative sequence number)&lt;br /&gt;
    Sequence number (raw): 1175996046&lt;br /&gt;
    [Next sequence number: 1    (relative sequence number)]&lt;br /&gt;
    Acknowledgment number: 13    (relative ack number)&lt;br /&gt;
    Acknowledgment number (raw): 3261314641&lt;br /&gt;
    1000 .... = Header Length: 32 bytes (8)&lt;br /&gt;
    Flags: 0x010 (ACK)&lt;br /&gt;
    Window size value: 6379&lt;br /&gt;
    [Calculated window size: 6379]&lt;br /&gt;
    [Window size scaling factor: -1 (unknown)]&lt;br /&gt;
    Checksum: 0xfe28 [unverified]&lt;br /&gt;
    [Checksum Status: Unverified]&lt;br /&gt;
    Urgent pointer: 0&lt;br /&gt;
    Options: (12 bytes), No-Operation (NOP), No-Operation (NOP), Timestamps&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - No-Operation (NOP)&lt;br /&gt;
        TCP Option - Timestamps: TSval 742069804, TSecr 742069804&lt;br /&gt;
    [SEQ/ACK analysis]&lt;br /&gt;
        [This is an ACK to the segment in frame: 13]&lt;br /&gt;
        [The RTT to ACK the segment was: 0.000040000 seconds]&lt;br /&gt;
    [Timestamps]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= 序列号与ACK=&lt;br /&gt;
&lt;br /&gt;
1. (Client) SYN, Seq=3261314628&lt;br /&gt;
=. (Server) SYN/ACK, Seq=1175996045, ACK=3261314629=&lt;br /&gt;
=. (Client) ACK, Seq=3261314629, ACK=1175996046=&lt;br /&gt;
=. (Client) PSH/ACK, Seq=3261314629, ACK=1175996046, Data(12bytes)=&lt;br /&gt;
=. (Server) ACK, Seq=1175996046, ACK=3261314641=&lt;br /&gt;
=. (Client) FIN/ACK, Seq=3261314641, ACK=1175996046=&lt;br /&gt;
=. (Server) ACK, Seq=1175996046, ACK=3261314642=&lt;br /&gt;
=. (Server) FIN, ACK, Seq=1175996046, ACK=3261314642=&lt;br /&gt;
=. (Client) ACK, Seq=3261314642, ACK=1175996047=&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</summary>
		<author><name>imported&gt;Riguz</name></author>
	</entry>
</feed>