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

📄 srm.tex

📁 柯老师网站上找到的
💻 TEX
📖 第 1 页 / 共 4 页
字号:
\subsection{Adaptive Timers}Agents using adaptive timer mechanismsmodify their request and repair parameters under three conditions(1) every time a new loss object is created;(2) when sending a message; and(3) when they receive a duplicate, if their relative distance to the loss    is less than that of the agent that sends the duplicate.All three changes require extensions to the agent and the loss objects.The \clsref{Agent/SRM/Adaptive}{../ns-2/srm-adaptive.tcl}uses \clsref{SRM/request/Adaptive}{../ns-2/srm-adaptive.tcl} and\clsref{SRM/repair/Adaptive}{../ns-2/srm-adaptive.tcl}as the request and repair functions respectively.In addition, the last item requires extending the packet headers,to advertise their distances to the loss.The corresponding compiled class for the agent is the\clsref{ASRMAgent}{../ns-2/srm.h}.\paragraph{Recompute for Each New Loss Object}Each time a new request object is created,\fcnref{SRM/request/Adaptive::set-params}{../ns-2/srm-adaptive.tcl}{%        SRM/request/Adaptive::set-params}invokes \code{$agent_ recompute-request-params}.The agent method\fcnref{\fcn[]{recompute-request-params}}{../ns-2/srm-adaptive.tcl}{%        Agent/SRM/Adaptive::recompute-request-params}.uses the statistics about duplicates and delayto modify \c1 and \c2 for the current and future requests.Similarly,\fcnref{SRM/request/Adaptive::set-params}{../ns-2/srm-adaptive.tcl}{%        SRM/request/Adaptive::set-params}for a new repair objectinvokes \code{$agent_ recompute-repair-params}.The agent method\fcnref{\fcn[]{recompute-repair-params}}{../ns-2/srm-adaptive.tcl}{%        Agent/SRM/Adaptive::recompute-repair-params}.uses the statistics objects to modify \d1 and \d2for the current and future repairs.\paragraph{Sending a Message}If a loss object \fcnref{sends a request}{../ns-2/srm-adaptive.tcl}{%        SRM/request/Adaptive::send-request}in its first \code{round_},then the agent, in the instance procedure\fcnref{\proc[]{sending-request}}{../ns-2/srm-adaptive.tcl}{%        Agent/SRM/Adaptive::sending-request},will lower \c1,and set its instance variable \code{closest_(requestor)} to 1.Similarly,a loss object that\fcnref{sends a repair}{../ns-2/srm-adaptive.tcl}{%        SRM/repair/Adaptive::send-repair}in its first \code{round_}will invoke the agent's instance procedure,\fcnref{\proc[]{sending-repair}}{../ns-2/srm-adaptive.tcl}{%        Agent/SRM/Adaptive::sending-repair},to lower \d1 and set \code{closest_(repairor)} to 1.\paragraph{Advertising the Distance}Each agent must add additional information to each request/repairthat it sends out.The base \clsref{SRMAgent}{../ns-2/srm.cc}invokes the virtual method\fcnref{\fcn[]{addExtendedHeaders}}{../ns-2/srm.h}{%        SRMAgent::addExtendedHeaders}for each SRM packet that it sends out.The method is invoked after adding the SRM packet headers, andbefore the packet is transmitted.The adaptive SRM agent overloads \fcnref{\fcn[]{addExtendedHeaders}}{../ns-2/srm.h}{%        ASRMAgent::addExtendedHeaders}to specify its distances in the additional headers.When sending a request, that agent unequivocally knows theidentity of the sender.As an example, the definition of\fcn[]{addExtendedHeaders} for the adaptive SRM agent is:\begin{program}        void addExtendedHeaders(Packet* p) \{                SRMinfo* sp;                hdr_srm*  sh = (hdr_srm*) p->access(off_srm_);                hdr_asrm* seh = (hdr_asrm*) p->access(off_asrm_);                switch (sh->type()) \{                case SRM_RQST:                        sp = get_state(sh->sender());                        seh->distance() = sp->distance_;                        break;                \ldots                \}        \}\end{program}Similarly, the method\fcnref{\fcn[]{parseExtendedHeaders}}{../ns-2/srm.h}{%        ASRMAgent::parseExtendedHeaders}is invoked every time an SRM packet is received.It sets the agent member variable \code{pdistance_}to the distance advertised by the peer that sent the message.The member variable is bound to an instance variable of the same name,so that the peer distance can be accessedby the appropriate instance procedures.The corresponding \fcn[]{parseExtendedHeaders} method for theAdaptive SRM agent is simply:\begin{program}        void parseExtendedHeaders(Packet* p) \{                hdr_asrm* seh = (hdr_asrm*) p->access(off_asrm_);                pdistance_ = seh->distance();        \}\end{program}Finally, the adaptive SRM agent's extended headers are defined as\structref{hdr\_asrm}{../ns-2/srm.h}.The header declaration is identical to declaring other packet headers in \ns.% xref external documentation here.Unlike most other packet headers, these are not automatically available in the packet.The\fcnref{interpreted constructor}{../ns-2/srm-adaptive.tcl}{%        Agent/SRM/Adaptive::init}for the first adaptive agentwill add the header to the packet format.For example, the start of the constructor for the\code{Agent/SRM/Adaptive} agent is:\begin{program}        Agent/SRM/Adaptive set done_ 0        Agent/SRM/Adaptive instproc init args \{            if ![$class set done_] \{                set pm [[Simulator instance] set packetManager_]                TclObject set off_asrm_ [$pm allochdr aSRM]                $class set done_ 1            \}            eval $self next $args            \ldots        \}\end{program}\section{SRM objects}\label{srmobjects}SRM objects are a subclass of agent objects that implement the SRMreliable multicast transport protocol. They inherit all of the genericagent functionalities. The methods for this object is described in thenext section \ref{sec:srmcommand}. Configuration parameters for this objectare:\begin{description}\item[packetSize\_] The data packet size that will be used for repairmessages. The default value is 1024. \item[requestFunction\_] The algorithm used to produce a retransmissionrequest, e.g., setting request timers. The default value is SRM/request.Other possible request functions are SRM/request/Adaptive, used by theAdaptive SRM code. \item[repairFunction\_]The algorithm used to produce a repair, e.g., compute repair timers. Thedefault value is SRM/repair. Other possible request functions areSRM/repair/Adaptive, used by the Adaptive SRM code. \item[sessionFunction\_]The algorithm used to generate session messages. Default is SRM/session \item[sessionDelay\_]The basic interval of session messages. Slight random variation is addedto this interval to avoid global synchronization of session messages. Usermay want to adjust this variable according to their specific simulation.Default value is 1.0. \item[C1\_, C2\_]The parameters which control the request timer. Refer to [8] for detail.The default value is C1\_ = C2\_ = 2.0. \item[D1\_, D2\_]The parameters which control the repair timer. Refer to [8] for detail.The default value is D1\_ = D2\_ = 1.0. \item[requestBackoffLimit\_]The maximum number of exponential backoffs. Default value is 5. \end{description}State Variables are:\begin{description}\item[stats\_]An array containing multiple statistics needed by adaptive SRM agent.Including: duplicate requests and repairs in current request/repairperiod, average number of duplicate requests and repairs, request andrepair delay in current request/repair period, average request and repairdelay. \end{description}\textsc{SRM/Adaptive Objects}SRM/Adaptive objects are a subclass of the SRM objects that implement theadaptive SRM reliable multicast transport protocol. They inherit all ofthe SRM object functionalities. State Variables are: \\(Refer to the SRM paper by Sally et al [Fall, K., Floyd, S., andHenderson, T., Ns Simulator Tests for Reno FullTCP. URLftp://ftp.ee.lbl.gov/papers/fulltcp.ps. July 1997.] for more detail.)\begin{description}\item[pdistance\_]This variable is used to pass the distance estimate provided by the remoteagent in a request or repair message. \item[D1\_, D2\_]The same as that in SRM agents, except that they are initialized tolog10(group size) when generating the first repair. \item[MinC1\_, MaxC1\_, MinC2\_, MaxC2\_]The minimum/maximum values of C1\_ and C2\_. Default initial values aredefined in [8]. These values define the dynamic range of C1\_ and C2\_. \item[MinD1\_, MaxD1\_, MinD2\_, MaxD2\_]The minimum/maximum values of D1\_ and D2\_. Default initial values aredefined in [8]. These values define the dynamic range of D1\_ and D2\_. \item[AveDups]Higher bound for average duplicates. \item[AveDelay]Higher bound for average delay. \item[eps AveDups] -dups determines the lower bound of the number ofduplicates, when we should adjust parameters to decrease delay. \end{description}\section{Commands at a glance}\label{sec:srmcommand}The following is a list of commands to create/manipulate srm agents insimulations:\begin{flushleft}\code{set srm0 [new Agent/SRM]}\\This creates an instance of the SRM agent. In addition to the base class,two extensions of the srm agent have been implemented. They areAgent/SRM/Fixed and Agent/SRM/Adaptive. See section \ref{sec:extensions}for details about these extensions.\code{ns_ attach-agent <node> <srm-agent>}\\This attaches the srm agent instance to the given <node>.\begin{program}set grp [Node allocaddr]$srm set dst_ $grp\end{program}This assigns the srm agent to a multicast group represented by the mcastaddress <grp>.Configuration parameters for srm agent may be set as follows:\\\begin{program}$srm set fid_ <flow-id>$srm set tg_ <traffic-generator-instance>.. etc\end{program}For all possible parameters and their default values please lookup \ns/tcl/mcast/srm.tcland \ns/tcl/mcast/srm-adaptive.tcl.\begin{program}set exp [new Application/Traffic/Exponential]$exp attach-agent $srm\end{program}This command attaches a traffic generator (an exponential one in this example),to the srm agent.\code{$srm start; $exp start}\\These commands start the srm agent and traffic generator. Note that the srmagent and traffic generator have to be started separately. Alternatively, thetraffic generator may be started through the agent as follows:\\\code{$srm start-source}.See \ns/tcl/ex/srm.tcl for a simple example of setting up a SRM agent.\end{flushleft}\endinput### Local Variables:### mode: latex### comment-column: 60### backup-by-copying-when-linked: t### file-precious-flag: nil### End:

⌨️ 快捷键说明

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