`

NS by Example 笔记(15)Multicasting Example

阅读更多

Multicasting Example

(Obsolete: work with ns-2.1b4a)

 

multicasting例子的模拟脚本和NAM中模拟的截图, 模拟脚本"ex-mcast.tcl".

 




 
Figure 33. The NAM screen capture of the multicasting simulation

 

 

# Polly Huang 8-7-98

set ns [new Simulator]
$ns multicast

set f [open out.tr w]
$ns trace-all $f
$ns namtrace-all [open out.nam w]

$ns color 1 red
# prune/graft packets
$ns color 30 purple
$ns color 31 green

set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

# Use automatic layout 
$ns duplex-link $n0 $n1 1.5Mb 10ms DropTail
$ns duplex-link $n1 $n2 1.5Mb 10ms DropTail
$ns duplex-link $n1 $n3 1.5Mb 10ms DropTail

$ns duplex-link-op $n0 $n1 orient right
$ns duplex-link-op $n1 $n2 orient right-up
$ns duplex-link-op $n1 $n3 orient right-down
$ns duplex-link-op $n0 $n1 queuePos 0.5

set mrthandle [$ns mrtproto DM {}]

set cbr0 [new Application/Traffic/CBR]
set udp0 [new Agent/UDP]
$cbr0 attach-agent $udp0
$ns attach-agent $n1 $udp0
$udp0 set dst_ 0x8001

set cbr1 [new Application/Traffic/CBR]
set udp1 [new Agent/UDP]
$cbr1 attach-agent $udp1
$udp1 set dst_ 0x8002
$udp1 set class_ 1
$ns attach-agent $n3 $udp1

set rcvr [new Agent/LossMonitor]
#$ns attach-agent $n3 $rcvr
$ns at 1.2 "$n2 join-group $rcvr 0x8002"
$ns at 1.25 "$n2 leave-group $rcvr 0x8002"
$ns at 1.3 "$n2 join-group $rcvr 0x8002"
$ns at 1.35 "$n2 join-group $rcvr 0x8001"

$ns at 1.0 "$cbr0 start"
$ns at 1.1 "$cbr1 start"

$ns at 2.0 "finish"

proc finish {} {
	global ns
	$ns flush-trace

	puts "running nam..."
	exec nam out.nam &
	exit 0
}

$ns run

 

  • 大小: 23.3 KB
分享到:
评论

相关推荐

    NS by example

    ### NS by Example: A Comprehensive Guide for Beginners #### Introduction NS (version 2) is an advanced and powerful network simulator developed at the University of California, Berkeley. It is ...

    mcast.rar_NS2 multicasting_mcast_mcast ns2_multicasting in ns2_v

    《NS2多播技术详解与实践教程》 在计算机网络领域,多播(Multicast)是一种高效的通信方式,尤其在实时流媒体、在线会议、分布式系统等场景中扮演着重要角色。NS2(Network Simulator 2)是一款广泛使用的网络...

    NS by examples.doc

    NS comes with a range of examples covering diverse network scenarios, like local area networks (LAN), multicasting, web server simulations, and Shortest Remaining Path (SRM) routing. These examples ...

    ns-2入门简介.ppt

    NS 也实现了 Multicasting 和一些应用于局域网模拟的在 MAC 层的协议。 NS-2 的优点是可以模拟复杂的网络环境,能够模拟各种网络协议,具有很强的扩展性和灵活性。用户可以通过 NS-2 来研究和模拟不同的网络环境,...

    NS2网络模拟简介以及MTE、LEACH、LEACH-C协议仿真

    NS2也实现了Multicasting和一些应用于局域网模拟的在MAC层的协议。 OTcl语言简介 OTcl是Tcl的面向对象扩展,在OTcl中加入了类的概念。对象是类的实例,它有自己的属性和自己的内部操作。对象具有继承、封装、多态性...

    Multicasting with the JGroups

    一个用户广播的开源组件,低层通讯广播的重要java开源项目。与mina不同。

    RTP.zip_.net rtp_multicasting _rtp multicasting

    在.NET框架中,RTP(Real-time Transport Protocol)是一种用于实时数据传输的协议,常用于音频、视频等多媒体通信。RTP多播是RTP的一种应用方式,它允许单个数据源向多个接收者发送数据,极大地提高了网络资源的...

    ns2网络模拟简易实用教程

    NS不仅模拟了路由队列的管理机制,如DropTail和RED(随机早期检测),还涵盖了Multicasting和局域网MAC层的一些协议。 #### NS-2的实现语言:C++与Otcl NS-2采用C++和Otcl两种编程语言实现。Otcl是在TCL基础上添加...

    Multicasting

    如何运行:在命令行中以详细信息形式输入“ java -jar Multicasting.jar”:-键入您的姓名。 -输入聊天成员组将要使用的ip地址。 事先在地址上与您的朋友达成协议。 必须高于224.0.0.0-输入一个商定的端口。 应该在...

    A Non-Replication Multicasting Scheme in Delay

    ### 延迟容忍网络中的非复制多播方案 #### 概述 本文提出了一种在延迟容忍网络(DTN)中实现非复制多播的方案。延迟容忍网络是一种特殊的无线移动网络,其中节点间的连接通常是间歇性的,并且缺乏持续的网络连通性...

    Addison.Wesley.TCP.IP.Illustrated.Volume.2.The.Implementation.chm

    Combining 500 illustrations with 15,000 lines of real, working code, TCP/IP Illustrated, Volume 2 uses a teach-by-example approach to help you master TCP/IP implementation. You will learn about such ...

    Research on performance of multicasting in optical packet switched networks

    Different multicasting schemes in optical packet switched networks are discussed, including the parallel mode, serial mode, and hybrid mode multicasting schemes. Simulated modeling technique is ...

    how to use the managed rtp api class in .net to creat your multicasting systems

    在.NET框架中,RTP(Real-time Transport Protocol)主要用于实时数据传输,如音频、视频流。本文将深入探讨如何利用.NET中的Managed RTP API类来构建多播系统,这对于开发多媒体应用,尤其是网络会议、在线教育等...

    Multicasting Master-Slave Net Filesystem-开源

    **多播主从网络文件系统(Multicasting Master-Slave Network File System)**是一种创新的分布式文件系统,它利用了多播技术来提高文件在本地网络中的分发效率。多播允许一个数据源同时向多个接收者发送信息,极大地...

    Experimental demonstration of EON node supporting reconfigurable optical superchannel multicasting

    In this paper, we propose and demonstrate an EON node structure supporting reconfigurable optical superchannel multicasting. The node structure incorporates a shared multicasting module, which ...

    Recursive pump-adding scheme for optical superchannel multicasting based on FWM

    Optical superchannel multicasting, whereby a superchannel is replicated simultaneously to multiple spectral locations in a single device, is potentially a promising functionality for future optical ...

    IP_Multicasting

    标题中的“IP_Multicasting”指的是IP组播技术,这是一种网络通信协议,允许单个数据源发送数据到多个接收者,而无需为每个接收者单独发送数据包。这种技术在视频会议、在线教育、实时流媒体等场景中非常有用,因为...

Global site tag (gtag.js) - Google Analytics