NS2 Agents课件.ppt

  1. 1、本文档共20页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
set udp0 [new Agent/UDP] This creates an instance of the UDP agent. $ns_ attach-agent node agent This is a common command used to attach any agent to a given node. $ns_ connect src-agent dst-agent This command sets up an end-to-end connection between two agents (at the transport layer). $udp set packetSize_ pktsize $udp set dst_addr_ address $udp set dst_port_ portnum $udp set class_ class-type $udp set ttl_ time-to-live ..... etc The above are different parameter values that may be set as shown above for udp agents. The default values can be found in ns/tcl/lib/ns-default.tcl. UDP agents are implemented in udp.{cc, h} Although real UDP packets do not contain sequence numbers or timestamps, this sequence number does not incur any simulated overhead, and can be useful for tracele analysis or for simulating UDP-based applications. This OTcl instvar is bound to the C++ agent variable size_ . Applications can access UDP agents via the sendmsg () function in C++, or via the send or sendmsg methods in OTcl, as The following is a simple example of how a UDP agent may be used in a program. In the example, the CBR trafc generator is started at time 1.0, at which time the generator begins to periodically call the UDP agent sendmsg () function. set ns [new Simulator] set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 5Mb 2ms DropTail This section describes the operation of the TCP agents in ns. There are two major types of TCP agents: one-way agents and a two-way agent. One-way agents are further subdivided into a set of TCP senders (which obey different congestion and error control techniques) and receivers (.sinks.). The two-way agent is symmetric in the sense that it represents both a sender and receiver. It is still under development. The les described in this section are too numerous to enumerate here. Basically it covers most les matching the regular expression ~ns/tcp*.{cc, h}. It performs congestion control and round-trip-time estimation in a way similar

文档评论(0)

liuxiaoyu98 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档