﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-    Update 牌...@ Blog-随笔分类-网络编程</title><link>http://www.cppblog.com/Lee7/category/7089.html</link><description>  当华美的叶片落尽，生命的脉络才历历可见。 －－ 聂鲁达    
</description><language>zh-cn</language><lastBuildDate>Tue, 14 Oct 2008 08:27:05 GMT</lastBuildDate><pubDate>Tue, 14 Oct 2008 08:27:05 GMT</pubDate><ttl>60</ttl><item><title> 用协议分析工具学习TCP/IP</title><link>http://www.cppblog.com/Lee7/archive/2008/10/13/63887.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 13 Oct 2008 06:26:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/10/13/63887.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/63887.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/10/13/63887.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/63887.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/63887.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 一、前言 目前，网络的速度发展非常快，学习网络的人也越来越多，稍有网络常识的人都知道TCP/IP协议是网络的基础，是Internet的语言，可以说没有TCP/IP协议就没有互联网的今天。目前号称搞网的人非常多，许多人就是从一把夹线钳，一个测线器联网开始接触网络的，如果只是联网玩玩，知道几个Ping之类的命令就行了，如果想在网络上有更多的发展不管是黑道还是红道，必须要把TCP/IP协议搞的非常明白。...&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2008/10/13/63887.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/63887.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-10-13 14:26 <a href="http://www.cppblog.com/Lee7/archive/2008/10/13/63887.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ADO之Command对象全解[转]</title><link>http://www.cppblog.com/Lee7/archive/2008/06/10/52809.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Tue, 10 Jun 2008 14:54:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/06/10/52809.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/52809.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/06/10/52809.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/52809.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/52809.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 使用 Command 对象查询数据库并返回 Recordset 对象中的记录，以便执行大量操作或处理数据库结构。取决于提供者的功能，某些 Command 集合、方法或属性被引用时可能会产生错误。&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2008/06/10/52809.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/52809.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-06-10 22:54 <a href="http://www.cppblog.com/Lee7/archive/2008/06/10/52809.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ARP协议详解及如何编程实现ARP攻击[转]</title><link>http://www.cppblog.com/Lee7/archive/2008/05/23/50835.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Fri, 23 May 2008 02:35:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/05/23/50835.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/50835.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/05/23/50835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/50835.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/50835.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 我们都知道以太网设备比如网卡都有自己全球唯一的MAC地址，它们是以MAC地址来传输以太网数据包的，但是它们却识别不了我们IP包中的IP地址，所以我们在以太网中进行IP通信的时候就需要一个协议来建立IP地址与MAC地址的对应关系，以使IP数据包能发到一个确定的地方去。这就是ARP(Address Resolution Protocol，地址解析协议)。&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2008/05/23/50835.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/50835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-05-23 10:35 <a href="http://www.cppblog.com/Lee7/archive/2008/05/23/50835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>TCP/IP 协议的结构与运行原理[图]</title><link>http://www.cppblog.com/Lee7/archive/2008/05/19/50449.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 19 May 2008 15:18:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/05/19/50449.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/50449.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/05/19/50449.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/50449.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/50449.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要:       TCP/IP模型很成功，其设计已经经得起多年的磨练。无奈，TCP/IP协议族是很繁杂的一个模型，为了全面理解它，宜采取先全局后局部的庖丁解牛式。本文从应用的角度试着去理解TCP/IP的全貌，配合例子加以讲解。<br>&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2008/05/19/50449.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/50449.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-05-19 23:18 <a href="http://www.cppblog.com/Lee7/archive/2008/05/19/50449.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>TCP头结构 </title><link>http://www.cppblog.com/Lee7/archive/2008/05/19/50448.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 19 May 2008 15:09:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/05/19/50448.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/50448.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/05/19/50448.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/50448.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/50448.html</trackback:ping><description><![CDATA[TCP头结构 <br>
<div class=t_msgfont id=message1341362>TCP头结构 <br>&nbsp; &nbsp;TCP协议头最少20个字节，包括以下的区域（由于翻译不禁相同，文章中给出相应的英文单词）： <br>&nbsp; &nbsp;TCP源端口(Source Port)：16位的源端口其中包含初始化通信的端口。源端口和源IP地址的作用是标示报问的返回地址。 <br>&nbsp; &nbsp;TCP目的端口(Destination port)：16位的目的端口域定义传输的目的。这个端口指明报文接收计算机上的应用程序地址接口。 <br>&nbsp; &nbsp;TCP序列号（序列码,Sequence　Number）：32位的序列号由接收端计算机使用，重新分段的报文成最初形式。当SYN出现，序列码实际上是初始序列码（ISN），而第一个数据字节是ISN+1。这个序列号（序列码）是可以补偿传输中的不一致。 <br>&nbsp; &nbsp;TCP应答号(Acknowledgment&nbsp; &nbsp;Number)：32位的序列号由接收端计算机使用，重组分段的报文成最初形式。，如果设置了ACK控制位，这个值表示一个准备接收的包的序列码。 <br>&nbsp; &nbsp;数据偏移量(HLEN)：4位包括TCP头大小，指示何处数据开始。 <br>&nbsp; &nbsp;保留(Reserved)：6位值域，这些位必须是0。为了将来定义新的用途所保留。 <br>&nbsp; &nbsp;标志(Code Bits)：6位标志域。表示为：紧急标志、有意义的应答标志、推、重置连接标志、同步序列号标志、完成发送数据标志。按照顺序排列是：URG、ACK、PSH、RST、SYN、FIN。 <br>&nbsp; &nbsp;窗口(Window)：16位，用来表示想收到的每个TCP数据段的大小。 <br>&nbsp; &nbsp;校验位(Checksum)：16位TCP头。源机器基于数据内容计算一个数值，收信息机要与源机器数值 结果完全一样，从而证明数据的有效性。 <br>&nbsp; &nbsp;优先指针（紧急,Urgent&nbsp;&nbsp;Pointer）：16位，指向后面是优先数据的字节，在URG标志设置了时才有效。如果URG标志没有被设置，紧急域作为填充。加快处理标示为紧急的数据段。 <br>&nbsp; &nbsp;选项(Option)：长度不定，但长度必须以字节。如果 没有 选项就表示这个一字节的域等于0。 <br>&nbsp; &nbsp;填充：不定长，填充的内容必须为0，它是为了数学目的而存在。目的是确保空间的可预测性。保证包头的结合和数据的开始处偏移量能够被32整除，一般额外的零以保证TCP头是32位的整数倍。<br>＜附图是用SNIFFER抓的一个包头结构＞ <br><br>&nbsp; &nbsp; &nbsp; &nbsp; 00 50 07 45 9b d6 43&nbsp; &nbsp; &nbsp; &nbsp; 3c 47 fd 37 50 50 18 <br>&nbsp; &nbsp; &nbsp; &nbsp; ff 1f 05 a5 00 00 48 &nbsp; &nbsp; &nbsp; &nbsp; 54 54 50 2f 31 2e 31 <br>&nbsp; &nbsp; &nbsp; &nbsp; 20 32 30 30 20 4f 4b &nbsp; &nbsp; &nbsp; &nbsp; 0d 0a 53 65 72 76 65<br>&nbsp; &nbsp; &nbsp; &nbsp; 72 3a 20 4d 69 63 72 &nbsp; &nbsp; &nbsp; &nbsp; 6f 73 6f 66 74 2d 49 <br>&nbsp; &nbsp; &nbsp; &nbsp; 49 53 2f 35 2e 30 0d &nbsp; &nbsp; &nbsp; &nbsp; 0a 44 61 74 65 3a 20 <br>&nbsp; &nbsp; &nbsp; &nbsp; 57 65 64 2c 20 31 32 &nbsp; &nbsp; &nbsp; &nbsp; 20 4e 6f 76 20 32 30 <br>&nbsp; &nbsp; &nbsp; &nbsp; 30 33 20 30 33 3a 33 &nbsp; &nbsp; &nbsp; &nbsp; 37 3a 35 35 20 47 4d <br>&nbsp; &nbsp; &nbsp; &nbsp; 54 0d 0a 43 6f 6e 6e &nbsp; &nbsp; &nbsp; &nbsp; 65 63 74 69 6f 6e 3a <br>&nbsp; &nbsp; &nbsp; &nbsp; 20 63 6c 6f 73 65 0d &nbsp; &nbsp; &nbsp; &nbsp; 0a 48 54 54 50 2f 31 <br>&nbsp; &nbsp; &nbsp; &nbsp; 2e 31 20 32 30 30 20 &nbsp; &nbsp; &nbsp; &nbsp; 4f 4b 0d 0a 53 65 72 <br>&nbsp; &nbsp; &nbsp; &nbsp; 76 65 72 3a 20 4d 69 &nbsp; &nbsp; &nbsp; &nbsp; 63 72 6f 73 6f 66 74 <br>&nbsp; &nbsp; &nbsp; &nbsp; 2d 49 49 53 2f 35 2e &nbsp; &nbsp; &nbsp; &nbsp; 30 0d 0a 50 72 61 67 <br>&nbsp; &nbsp; &nbsp; &nbsp; 6d 61 3a 20 6e 6f 2d &nbsp; &nbsp; &nbsp; &nbsp; 63 61 63 68 65 0d 0a <br>&nbsp; &nbsp; &nbsp; &nbsp; 43 6f 6e 74 65 6e 74 &nbsp; &nbsp; &nbsp; &nbsp; 2d 74 79 70 65 3a 20 <br>&nbsp; &nbsp; &nbsp; &nbsp; 74 65 78 74 2f 70 6c &nbsp; &nbsp; &nbsp; &nbsp; 61 69 6e 3b 63 68 61 <br>&nbsp; &nbsp; &nbsp; &nbsp; 72 73 65 74 3d 67 62 &nbsp; &nbsp; &nbsp; &nbsp; 32 33 31 32 0d 0a 0d <br>&nbsp; &nbsp; &nbsp; &nbsp; 0a<br><br>解析：<br>源端口：00　50　　　　目的端口：07　45　　序列号：9b d6 43　3c <br>应答号：47 fd 37 50　&nbsp;&nbsp;数据偏移量：50　　　保留：<br>标志位：18　　　　　　　窗口：ff　1f&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp; 校验位：05 a5<br>优先指针：00　00　　　　选项：　　　　　　　填充：（余下的205字节为TCP数据）<br><br>&nbsp; &nbsp;&nbsp; &nbsp;标志控制功能 URG：紧急标志 <br>&nbsp; &nbsp;&nbsp; &nbsp;紧急(The urgent pointer) 标志有效。紧急标志置位， <br>&nbsp; &nbsp; ACK：确认标志 确认编号(Acknowledgement&nbsp;&nbsp;Number)栏有效。大多数情况下该标志位是置位的。TCP报头内的确认编号栏内包含的确认编号(w+1，Figure：1)为下一个预期的序列编号，同时提示远端系统已经成功接收所有数据。 <br>　　PSH：推标志 <br>&nbsp; &nbsp;&nbsp; &nbsp;该标志置位时，接收端不将该数据进行队列处理，而是尽可能快将数据转由应用处理。在处理 telnet 或 rlogin 等交互模式的连接时，该标志总是置位的。 <br>&nbsp; &nbsp; RST：复位标志 复位标志有效。用于复位相应的TCP连接。 <br>&nbsp; &nbsp; SYN：同步标志 同步序列编号(Synchronize Sequence Numbers)栏有效。该标志仅在三次握手建立TCP连接时有效。它提示TCP连接的服务端检查序列编号，该序列编号为TCP连接初始端(一般是客户端)的初始序列编号。在这里，可以把TCP序列编号看作是一个范围从0到4，294，967，295的32位计数器。通过TCP连接交换的数据中每一个字节都经过序列编号。在TCP报头中的序列编号栏包括了TCP分段中第一个字节的序列编号。 <br>　　FIN：结束标志 <br>&nbsp;&nbsp;　　带有该标志置位的数据包用来结束一个TCP回话，但对应端口仍处于开放状态，准备接收后续数据。服务端处于监听状态，客户端用于建立连接请求的数据包(IP packet)按照TCP/IP协议堆栈组合成为TCP处理的分段(segment)。 <br>&nbsp; &nbsp; 分析报头信息： TCP层接收到相应的TCP和IP报头，将这些信息存储到内存中。 <br>&nbsp; &nbsp; 检查TCP校验和(checksum)：标准的校验和位于分段之中(Figure：2)。如果检验失败，不返回确认，该分段丢弃，并等待客户端进行重传。 <br>　　查找协议控制块(PCB{})：TCP查找与该连接相关联的协议控制块。如果没有找到，TCP将该分段丢弃并返回RST。(这就是TCP处理没有端口监听情况下的机制) <br>&nbsp; &nbsp;&nbsp; &nbsp; 如果该协议控制块存在，但状态为关闭，服务端不调用connect()或listen()。该分段丢弃，但不返回RST。客户端会尝试重新建立连接请求。 <br>　　建立新的socket：当处于监听状态的socket收到该分段时，会建立一个子socket，同时还有socket{}，tcpcb{}和pub{}建立。这时如果有错误发生，会通过标志位来拆除相应的socket和释放内存，TCP连接失败。如果缓存队列处于填满状态，TCP认为有错误发生，所有的后续连接请求会被拒绝。这里可以看出SYN Flood攻击是如何起作用的。 <br>&nbsp; &nbsp;&nbsp;&nbsp;丢弃：如果该分段中的标志为RST或ACK，或者没有SYN标志，则该分段丢弃。并释放相应的内存。 <br>&nbsp; &nbsp;&nbsp;&nbsp;发送序列变量 <br>&nbsp; &nbsp;&nbsp; &nbsp; SND.UNA ： 发送未确认 <br>&nbsp; &nbsp;&nbsp; &nbsp; SND.NXT ： 发送下一个 <br>&nbsp; &nbsp;&nbsp; &nbsp; SND.WND ： 发送窗口 <br>&nbsp; &nbsp;&nbsp; &nbsp; SND.UP ： 发送优先指针 <br>&nbsp; &nbsp;&nbsp; &nbsp; SND.WL1 ： 用于最后窗口更新的段序列号 <br>&nbsp; &nbsp;&nbsp; &nbsp; SND.WL2 ： 用于最后窗口更新的段确认号 <br>&nbsp; &nbsp;&nbsp; &nbsp; ISS ： 初始发送序列号 <br>　&nbsp; &nbsp;接收序列号 <br>&nbsp; &nbsp;&nbsp; &nbsp; RCV.NXT ： 接收下一个 <br>&nbsp; &nbsp;&nbsp; &nbsp; RCV.WND ： 接收下一个 <br>&nbsp; &nbsp;&nbsp; &nbsp; RCV.UP ： 接收优先指针 <br>&nbsp; &nbsp;&nbsp; &nbsp; IRS ： 初始接收序列号 <br>&nbsp; &nbsp;&nbsp;&nbsp;当前段变量 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.SEQ ： 段序列号 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.ACK ： 段确认标记 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.LEN ： 段长 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.WND ： 段窗口 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.UP ： 段紧急指针 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.PRC ： 段优先级 <br>&nbsp; &nbsp;&nbsp;&nbsp;CLOSED表示没有连接，各个状态的意义如下： <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;LISTEN ： 监听来自远方TCP端口的连接请求。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SYN-SENT ： 在发送连接请求后等待匹配的连接请求。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SYN-RECEIVED ： 在收到和发送一个连接请求后等待对连接请求的确认。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ESTABLISHED ： 代表一个打开的连接，数据可以传送给用户。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;FIN-WAIT-1 ： 等待远程TCP的连接中断请求，或先前的连接中断请求的确认。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;FIN-WAIT-2 ： 从远程TCP等待连接中断请求。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;CLOSE-WAIT ： 等待从本地用户发来的连接中断请求。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;CLOSING ： 等待远程TCP对连接中断的确认。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;LAST-ACK ： 等待原来发向远程TCP的连接中断请求的确认。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;TIME-WAIT ： 等待足够的时间以确保远程TCP接收到连接中断请求的确认。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;CLOSED ： 没有任何连接状态。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;TCP连接过程是状态的转换，促使发生状态转换的是用户调用：OPEN，SEND，RECEIVE，CLOSE，ABORT和STATUS。传送过来的数据段，特别那些包括以下标记的数据段SYN，ACK，RST和FIN。还有超时，上面所说的都会时TCP状态发生变化。 <br>　&nbsp;&nbsp;序列号：请注意，我们在TCP连接中发送的字节都有一个序列号。因为编了号，所以可以确认它们的收到。对序列号的确认是累积性的。TCP必须进行的序列号比较操作种类包括以下几种： <br>　&nbsp; &nbsp;&nbsp;&nbsp;①决定一些发送了的但未确认的序列号。 <br>&nbsp;&nbsp;　&nbsp; &nbsp;②决定所有的序列号都已经收到了。 <br>&nbsp; &nbsp;&nbsp; &nbsp; ③决定下一个段中应该包括的序列号。 <br>&nbsp; &nbsp;&nbsp;&nbsp;对于发送的数据TCP要接收确认，确认时必须进行的： <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SND.UNA = 最老的确认了的序列号。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SND.NXT = 下一个要发送的序列号。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.ACK = 接收TCP的确认，接收TCP期待的下一个序列号。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.SEQ = 一个数据段的第一个序列号。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.LEN = 数据段中包括的字节数。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.SEQ+SEG.LEN-1 = 数据段的最后一个序列号。 <br>&nbsp; &nbsp;&nbsp;&nbsp;如果一个数据段的序列号小于等于确认号的值，那么整个数据段就被确认了。而在接收数据时下面的比较操作是必须的： <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;RCV.NXT = 期待的序列号和接收窗口的最低沿。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;RCV.NXT+RCV.WND：1 = 最后一个序列号和接收窗口的最高沿。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.SEQ = 接收到的第一个序列号。 <br>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;SEG.SEQ+SEG.LEN：1 = 接收到的最后一个序列号</div>
<br>
<img src ="http://www.cppblog.com/Lee7/aggbug/50448.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-05-19 23:09 <a href="http://www.cppblog.com/Lee7/archive/2008/05/19/50448.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>让你真正了解局域网技术概述[转]</title><link>http://www.cppblog.com/Lee7/archive/2008/05/19/50431.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Mon, 19 May 2008 13:27:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/05/19/50431.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/50431.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/05/19/50431.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/50431.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/50431.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要:     很多人将局域网（Local Area Network，LAN）和以太网（Ethernet）混为一谈，这个误解大概是因为和其他局域网技术比较起来，以太网技术使用得是如此普遍、发展得是如此地迅速，以至于人们将"以太网"当作了"局域网"的代名词。<br>　　<br>　　本节将讨论"局域网"和"以太网"二者之间的关系以及相关的一些基础知识。<br>&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2008/05/19/50431.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/50431.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-05-19 21:27 <a href="http://www.cppblog.com/Lee7/archive/2008/05/19/50431.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>实例ＩＰ　ＵＤＰ头结构</title><link>http://www.cppblog.com/Lee7/archive/2008/05/16/50052.html</link><dc:creator>isabc</dc:creator><author>isabc</author><pubDate>Fri, 16 May 2008 08:13:00 GMT</pubDate><guid>http://www.cppblog.com/Lee7/archive/2008/05/16/50052.html</guid><wfw:comment>http://www.cppblog.com/Lee7/comments/50052.html</wfw:comment><comments>http://www.cppblog.com/Lee7/archive/2008/05/16/50052.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cppblog.com/Lee7/comments/commentRss/50052.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/Lee7/services/trackbacks/50052.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 写在前面：<br>         一些关于Ethernet、IP 和UDP协议各分析过于抽象，下面这段数据使我通过WinpCap库捕捉到的数据，集合一些资料(协议资料转载我的BLOG中，可以搜索和查阅)分析我捕捉数据的正确性，同时实例分析这些协议！日后还将实例化分析Ethernet、IP 和TCP协议。&nbsp;&nbsp;<a href='http://www.cppblog.com/Lee7/archive/2008/05/16/50052.html'>阅读全文</a><img src ="http://www.cppblog.com/Lee7/aggbug/50052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/Lee7/" target="_blank">isabc</a> 2008-05-16 16:13 <a href="http://www.cppblog.com/Lee7/archive/2008/05/16/50052.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>