⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node111.html

📁 相关搜索: ns2仿真结果分析 all-awk ns2 ns2 无限网络中awk文件 ... [2.tcl.rar] - 在ns2平台上实现对AODV协议的模拟
💻 HTML
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4patched version by:  Kenshi Muto, Debian Project.LaTeX2HTML 2002 (1.62),original version by:  Nikos Drakos, CBLU, University of Leeds* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from:  Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>10.5.4 Processing Responses at the Sender</TITLE><META NAME="description" CONTENT="10.5.4 Processing Responses at the Sender"><META NAME="keywords" CONTENT="everything"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="jLaTeX2HTML v2002 JA patch-1.4"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="everything.css" tppabs="http://www.isi.edu/nsnam/ns/doc/everything.css"><LINK REL="next" HREF="node112.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node112.html"><LINK REL="previous" HREF="node110.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node110.html"><LINK REL="up" HREF="node107.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node107.html"><LINK REL="next" HREF="node112.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node112.html"></HEAD><BODY ><!--Navigation Panel--><A NAME="tex2html3012"  HREF="node112.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node112.html"><IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="file:/usr/share/latex2html/icons/next.png"></A> <A NAME="tex2html3006"  HREF="node107.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node107.html"><IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="file:/usr/share/latex2html/icons/up.png"></A> <A NAME="tex2html3000"  HREF="node110.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node110.html"><IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="file:/usr/share/latex2html/icons/prev.png"></A> <A NAME="tex2html3008"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html"><IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="file:/usr/share/latex2html/icons/contents.png"></A> <A NAME="tex2html3010"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html"><IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="file:/usr/share/latex2html/icons/index.png"></A> <BR><B> Next:</B> <A NAME="tex2html3013"  HREF="node112.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node112.html">10.5.5 Implementing Timers</A><B> Up:</B> <A NAME="tex2html3007"  HREF="node107.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node107.html">10.5 Examples: Tcp, TCP</A><B> Previous:</B> <A NAME="tex2html3001"  HREF="node110.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node110.html">10.5.3 Processing Input at</A> &nbsp <B>  <A NAME="tex2html3009"  HREF="node1.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node1.html">Contents</A></B>  &nbsp <B>  <A NAME="tex2html3011"  HREF="node590.html" tppabs="http://www.isi.edu/nsnam/ns/doc/node590.html">Index</A></B> <BR><BR><!--End of Navigation Panel--><H2><A NAME="SECTION03754000000000000000"></A><A NAME="sec:tcpsimpleack"></A><BR>10.5.4 Processing Responses at the Sender</H2><P>Once the simple TCP's peer receives data and generates an ACK, thesender must (usually) process the ACK.In the <TT>TcpAgent</TT> agent, this is done as follows:<PRE>        /*         * main reception path - should only see acks, otherwise the         * network connections are misconfigured         */        void TcpAgent::recv(Packet *pkt, Handler*)        {                hdr_tcp *tcph = (hdr_tcp*)pkt-\&gt;access(off_tcp_);                hdr_ip* iph = (hdr_ip*)pkt-\&gt;access(off_ip_);                ...                if (((hdr_flags*)pkt-\&gt;access(off_flags_))-\&gt;ecn_)                        quench(1);                if (tcph-\&gt;seqno() \&gt; last_ack_) {                        newack(pkt);                        opencwnd();                } else if (tcph-\&gt;seqno() == last_ack_) {                        if (++dupacks_ == NUMDUPACKS) {                                \ldots                        }                }                Packet::free(pkt);                send(0, 0, maxburst_);       }</PRE>This routine is invoked when an ACK arrives at the sender.In this case, once the information in the ACK is processed (by <TT>newack</TT>)the packet is no longer needed and is returned to the packet memoryallocator.In addition, the receipt of the ACK indicates the possibility of sendingadditional data, so the []TcpSimpleAgent::send method isinvoked which attempts to send more data if the TCP window allows.<P><BR><HR><ADDRESS>2003-09-23</ADDRESS></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -