【NS2仿真】RTP协议安装
来自: http://personales.upv.es/fboronat/Research/NS2_RTP/NS2_RTP_RTCP_module.htm
文件:http://pan.baidu.com/s/1slRAwn7
NEW NS-2 RTP/RTCP MODULE
INSTALLATION GUIDE
0. DOWNLOAD
Download the files of the new module. Download new RTP/RTCP NS-2 module
If you find this module useful for your work, please let us know. If you use the module to obtain results for publications, please reference the as follows:
Montagud, M. and Boronat, F. 2010. A new network simulator 2 (NS-2) module based on RTP/RTCP protocols to achieve multimedia group synchronization. In Proceedings of the 3rd international ICST Conference on Simulation Tools and Techniques (Torremolinos, Malaga, Spain, March 15 - 19, 2010). International Conference on Simulation Tools and Techniques for Commuications, Networks and Systems & Workshops. ICST (Institute for Computer Sciences Social-Informatics and Telecommunications Engineering), ICST, Brussels, Belgium, 1-8. DOI= http://dx.doi.org/10.4108/ICST.SIMUTOOLS2010.8686
1.
INTRODUCTION
In this document
the authors describe the necessary steps to include the new developed RTP/RTCP
module with the other built-in NS-2 modules,
without needing to replace the native implementation for these protocols.
We assume the reader has successfully installed a current NS-2.XX[1] version. This
code has been developed and tested with NS-2.33 and NS-2.34.
In the legacy code,
RTP
and RTCP protocols are implemented as the RTP Agent and
the RTCP Agent classes, respectively. These two classes
are implemented in the rtp.cc
(located in ~ns-2.XX/apps/rtp.cc) and rtcp.cc (located in ~ns-2.XX/tcp/rtcp.cc) files, as can
be appreciated in Figure 1. The RTP Agent holds
all the functionalities for sending and receiving data packets, whereas
the RTCP Agent is responsible for the
control reports transmission and reception. The RTP Session
class (implemented in ~ns-2.XX/common/session-rtp.cc) mainly deals
with feedback report building and participant’s information tables maintenance, through the received packets passed
by its agents. This class also defines the procedures for session initialization,
report interval calculation, associating new RTP sessions with nodes, managing
join and leave processes to multicast groups, stopping RTP flow transmissions,
liberating the session resources, etc. It is called by its binding Session/RTP OTcl class (implemented
in ~ns-2.XX/tcl/rtp/session-rtp.tcl). All the above
files use rtp.h(located in ~ns-2.XX/apps/rtp.h) as header file, and they are shown in pink boxes in Figure 1.
Figure 1. NS-2
Directory Structure
The native implementation
is quite generic. Many attributes specified in RFC 3550 are not included
or they are not implemented accurately: i) it
does not define all the RTCP packets, only RTCP Sender Reports (SR) packets
are included, but its format is not complete (it does not include payload
type, number of packets/octets sent fields, etc.); ii) since RTCP Receiver
Reports (RR) messages are not defined, neither QoS
metrics (jitter, network delay, Round Trip Time -RTT-, loss rate) monitoring
nor reporting are provided; iii) the same packet header data structure is
used for both RTP and RTCP packets construction; iv) the packet header fields
are specified using incorrect variables’ types and sizes; v) there is a
bug for multicast transmissions configuration; vi) the code does not support
multiple multicast streams on the same node; vii) the RTP Agent is only capable
of generating CBR (Constant Bit Rate) traffic, etc.
As simulations
rely on the accuracy of the proposed models,
and as the NS-2 native implementation
for RTP/RTCP standard protocols is incomplete and imprecise, authors decided
to develop a new module with a more complete and accurate implementation
for these protocols than the one in the NS-2 native code, following strictly
all the attributes specified in RFC 3550. The code includes
the following enhancements: i) definition of
all the types of RTCP packets with their exact format (Sender Report
or SR, Receiver Reports or RR, Source Description or SDES, Application-defined
or APP and BYE packets); ii) network-level metrics
(such as end-to-end delay, jitter, RTT, throughput and packet loss) monitoring,
processing and registering in simulation time; iii) capability of processing
any kind of application traffic pattern supported by NS-2; iv) support
for multiple multicast streams on the same node; and v) compatibility with
the legacy code.
2. INSTALLATION STEPS
In order to install
the new developed NS-2 module, users must follow the next instructions:
- Decompress (untar) the ‘rtp_gs_module.tar.gz’ file. After decompression,
a new folder ‘rtp_gs_module’ will
be created. It includes: - ‘rtp_gs’ folder, containing the C++
source code:
rtp_gs.h rtp_gs.cc
rtcp_gs.h rtcp_gs.cc session-rtp_gs.h session-rtp_gs.cc
- session-rtp.tcl file, including the TCL code.
In this file we have slightly modified the native TCL code in order
to correct a small bug that does not allow configuring
multicast scenarios. We have also included,
in the same file, the TCL code for the new developed module in order
to avoid adding another file (and/or directory). - rtp_scenario.tclfile, with an example
of a TCL script. It includes the necessary steps in order to configure
a new multicast simulation scenario with one RTP Source and three
RTP Receivers distributed over the network topology, using our new RTP/RTCP
module. - Move the ‘rtp_gs’ folder into ns-allinone-2.XX/ns-2.XX directory.
- Replace the
session-rtp.tcl file,
located in ns-allinone-2.XX/ns-2.XX/tcl/rtp/, with
the one provided in the ‘rtp_gs_module’
folder. - Define the
new specific packet types for the new developed protocols. The list of supported
packets by NS-2 is located inside ~ns-2.XX/common/packet.h
file. Thus, users must
modify this file including the new RTP/RTCP packets (using numeric
constants, which can vary depending on the NS-2 version) in packet_tenumeration
(located in this header file):
typedef unsigned int
packet_t;
static const packet_t
PT_TCP = 0;
static const packet_t
PT_UDP = 1;
...
static const packet_t
PT_RTCP = 14;
static const packet_t
PT_RTP = 15;
...
// insert new packet
types here
static
const packet_t PT_RTCP_GS = 61;
static
const packet_t PT_RTP_GS = 62;
// The numbers can
vary depending on the NS-2 version!!!
// This MUST be the
LAST one (61+2)
static packet_t PT_NTYPE
= 63;
In the same file,
users must provide a textual name for the new RTP/RTCP novel
packets identifying in order to distinguish them from the native packets
in the output trace files generated by the simulator. This is done by adding
the following lines inside p_info
C++ class constructor:
class
p_info {
public:
p_info()
{
initname()
}
...
static
void initName()
{
...
name_[PT_TCP]= "tcp";
name_[PT_UDP]= "udp";
...
name_[PT_RTCP]= "rtcp";
name_[PT_RTP]= "rtp";
...
name_[PT_RTCP_GS]= "rtcp_gs";
name_[PT_RTP_GS]= "rtp_gs";
...
}
}
Doing so, the new
RTP/RTCP packets will be able to be sent, received and processed by the
NS-2 simulation objects.
- Save changes.
- Add the following
lines to ‘ns-2.XX/tcl/lib/ns-default.tcl’ file just below the line ‘Agent/RTCP
set seqno_ 0’, in order to
set default values for the Otcl/C++ bound
variables:
Agent/RTCP set seqno_ 0
# New RTP/RTCP module:
default variables setting
Agent/RTP_gs
set seqno_ 0
Agent/RTP_gs set packetSize_ 1000
Agent/RTCP_gs set interval_ 500ms.
Agent/RTCP_gs set random_ 0
Session/RTP_gs set debug_ 0
Session/RTP_gs set cname_ 0
Session/RTP_gs set jitter_ 0
Session/RTP_gs set RTT_ 0
Session/RTP_gs set rx_recv_ 0
…
- Save changes.
- After that,
it is necessary to open the ‘Makefile.in’
file (located in ~ns-2.XX/directory)
and modify it in order to add the source files of the new RTP/RTCP
module. - Add to the
INCLUDES section this text: '-I./rtp_gs \'. It should look like:
INCLUDES = \
-I. @V_INCLUDE_X11@ \
-I. \
@V_INCLUDES@ \
-I./tcp -I./sctp -I./common -I./link -I./queue
-I./adc -I./apps -I./mac -I./mobile -I./trace \
-I./routing
-I./tools -I./classifier -I./mcast \
-I./diffusion3/lib/main
-I./diffusion3/lib \
-I./diffusion3/lib/nr
-I./diffusion3/ns \
-I./diffusion3/filter_core
-I./asim/ -I./qs \
-I./diffserv -I./satellite
-I./rtp_gs \
-I./wpan
- Go to the “OBJ.CC” section and
add the following line (before the line @V_STLOBJ@):
rtp_gs/rtp_gs.o
rtp_gs/rtcp_gs.o rtp_gs/session-rtp_gs.o
\
We can add it just
below the line:
common/session-rtp.o
apps/rtp.o tcp/rtcp.o
\
Users need to do
that because the source directories for the new RTP/RTCP code have been
collocated in a new directory (‘rtp_gs’).
- Save changes.
- Here, all
the necessary modifications have been finished. Open a terminal window, move
to ns-allinone-2.XX/ns-2.XX and run:
./configure
, in order to create a new ‘Makefile’ file.
- The last step
is to compile the code. Execute the following commands (users must
still be in ns-allinone-2.XX/ns-2.XX directory):
make
clean;make depend;make;
Once it is finished,
a new binary file named ‘ns’ in ns-allinone-2.XX/ns-2.XX/
directory will be available with the new RTP/RTCP functionality.
Authors recommend
the use of an IDE to work with NS-2. We personally use KDevelop.
For bugs reporting
email to: mamontor@posgrado.upv.es or fboronat@dcom.upv.es.
[1] XX refers to the current NS-2 version installed by the user.
【NS2仿真】RTP协议安装的更多相关文章
- NS2仿真:两个移动节点网络连接及协议性能分析
NS2仿真实验报告2 实验名称:两个移动节点网络连接及协议性能分析 实验日期:2015年3月9日~2015年3月14日 实验报告日期:2015年3月15日 一.实验环境(网络平台,操作系统,网络拓扑图 ...
- 网络拥塞控制与NS2仿真
准备工作: 1. 安装virtual box 虚拟机,并安装虚拟机增强功能,并配制共享文件夹. 共享文件夹自动挂载后的路径为/media/sf_xxx文件夹,xxx为所起的文件名. 解决virtual ...
- NS2仿真:使用NS仿真软件模拟简单网络模型
NS2仿真实验报告1 实验名称:使用NS仿真软件模拟简单网络模型 实验日期:2015年3月2日~2015年3月7日 实验报告日期:2015年3月8日 一.实验环境(网络平台,操作系统,网络拓扑图) 运 ...
- RTP协议学习大总结从原理到代码
from:http://wenku.baidu.com/view/aaad3d136edb6f1aff001fa5.html 一.流媒体概念 流媒体包含广义和狭义两种内涵:广义上的流媒体指的是使音频和 ...
- NS2仿真:公交车移动周期模型及性能分析
NS2仿真实验报告3 实验名称:公交车移动周期模型及性能分析 实验日期:2015年3月16日~2015年3月21日 实验报告日期:2015年3月22日 一.实验环境(网络平台,操作系统,网络拓扑图) ...
- Linux下几种RTP协议实现的比较和JRTPLIB编程讲解
流媒体指的是在网络中使用流技术传输的连续时基媒体,其特点是在播放前不需要下载整个文件,而是采用边下载边播放的方式,它是视频会议. IP电话等应用场合的技术基础.RTP是进行实时流媒体传输的标准协议和关 ...
- 自己动手写RTP服务器——关于RTP协议
转自:http://blog.csdn.net/baby313/article/details/7353605 本文会带领着你一步步动手实现一个简单的RTP传输服务器,旨在了解RTP流媒体传输协议以及 ...
- Rtp 协议实现网络广播台网络收音机
RTP协议介绍:http://www.360doc.com/content/11/1009/15/496343_154624612.shtml 本文中使用了 StreamCoders 的 RTP.ne ...
- RTP协议分析(转自:http://blog.csdn.net/bripengandre/article/details/2238818)
RTP协议分析 第1章. RTP概述 1.1. RTP是什么 RTP全名是Real-time Transport Protocol(实时传输协议).它是IETF提出的一个标准,对应的RFC文 ...
随机推荐
- atitit.条形码的原理与生成总结java Barcode4j barcode o5
atitit.条形码的原理与生成总结java Barcode4j barcode o5 条形码类库使用报告Barcode4j, ZXing 1 使用成果图片 1 条形码标准code 128和code ...
- CAS 实现单点登录 .NET MVC
单点登录 Single Sign On,简称为 SSO,是目前比较流行的企业业务整合的解决方案之一.SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统. 单点登录原理 ...
- Sql Server2005恢复备份数据库问题-Error:3154 3219
解决办法: 1.新建一个同名数据库New_HeasySchoolDB2.执行下面的sql语句: restore database New_HeasySchoolDB from disk = 'D:/N ...
- php对csv文件的读取,写入,输出下载操作
在实际工作中,很多时候需要把网站上的一些数据下载到CSV文件里,方便以后查看. 亦或者是用CSV进行一些批量的上传工作. 这个时候我们就需要对CSV进行读写操作. 1.CSV的读取操作 <?ph ...
- JQ中 trigger()和triggerHandler()区别
既然使用了trigger和triggerHandler,那么你应该了解了他们的差别了. trigger():在每一个匹配的元素上触发某类事件. triggerHandler():这个特别的方法将会触发 ...
- Cluster群集
Cluster群集一般来讲有四个功能1. 冗余功能,就是说在这个群集中的任何一台机器出现本机或网络故障时,整个网络仍不中断,对外的服务也不中断,网络有多个路线可以走,服务器也可以相互代替.2.负载均衡 ...
- java综合
java环境变量配置:http://jingyan.baidu.com/article/f96699bb8b38e0894e3c1bef.html 1.导入项目 当下载了包含Eclipse 项目的源代 ...
- 机器学习基石--学习笔记02--Hard Dual SVM
背景 上一篇文章总结了linear hard SVM,解法很直观,直接从SVM的定义出发,经过等价变换,转成QP问题求解.这一讲,从另一个角度描述hard SVM的解法,不那么直观,但是可以避免fea ...
- Scala 深入浅出实战经典 第68讲:Scala并发编程原生线程Actor、Cass Class下的消息传递和偏函数实战解析
王家林亲授<DT大数据梦工厂>大数据实战视频 Scala 深入浅出实战经典(1-87讲)完整视频.PPT.代码下载: 百度云盘:http://pan.baidu.com/s/1c0noOt ...
- 理解 python metaclass使用技巧与应用场景分析
理解python metaclass使用技巧与应用场景分析 参考: decorator与metaclass:http://jfine-python-classes.readthedocs. ...