ION-DTN RC配置文件分析

来源:互联网 发布:必胜时时彩软件 编辑:程序博客网 时间:2024/06/05 00:44
在安装好ion环境后,要开启ION应用程序并通过DTN协议栈传输数据,最重要的就是通过ionstart命令配置rc文件来配置应用程序的环境,

一般而言,ionstart开启rc文件的命令如下:

ionstart -I host1.rc
其中host1.rc就是rc文件名,要注意的是,在终端输入ionstart命令,当前路径必须是rc文件所在路径。

接下来具体分析rc文件的组成:

首先给出一份rc文件:

在分析之前,要知道一点:以单个“#”开头的行表示注释以方便了解相应配置所起的作用,而以两个“##”开头的行即表示此行为注释号,同时也起到识别不同管理进程的作用,如ionadmin, ionsecadmin, ltpadmin, bpadmin, ipnadmin。

host1.rc

## begin ionadmin# ionrc configuration file for host3 in a 3node ltp test.#This uses ltp as the convergence layer.#command: % ionadmin host3.ionrc#This command should be run FIRST.##Soochow University, April 2012# Initialization command (command 3).#Set this node to be node 3 (as in ipn:3).#Use sdr configuration of “ionconfig” file.1 1 ionconfig# start ion nodes# Add some contacts.#They will start at +0 seconds from now, ending +86400 seconds from now.#They will connect node 1 to node 2, and connect node 2 to node 3.#They will transmit 125000 bytes/second.#Note that contacts are unidirectional, so order matters.a contact +0 +86400 1 2 125000a contact +0 +86400 2 1 125000# Add some ranges. These are the physical distance between nodes.#They will start at +0 seconds from now, ending +86400 seconds from now.#They will connect node 1 to node 2, and connect node 2 to node 3.#We will assume every range is one second. Data on the link is expected to take 1 second#to reach the other end (One Way Light Time).#Note that ranges cover both directions, so you only need define one range for any#combination of nodes.a range +0 +86400 1 2 1# set this node to consume and produce a mean of 1000000 bytes/second.m production 1000000m consumption 1000000m horizon +0## end ionadmin## begin ionsecadmin1e 1## end ionsecadmin## begin ltpadmin# ltprc configuration file for host1 in a 3node ltp test.#Command: % ltpadmin host3.ltprc#This command should be run AFTER ionadmin and BEFORE bpadmin.##Soochow University, April 2012##A warning: the ltp configuration is not ideal in this case.#please consult manual pages and other documentation for a better description.# Initialization command (command 1).# Establishes the LTP retransmission window.# (Prohibiting LTP from seizing all available storage).#A maximum of 5 sessions. A session is assumed to be around one second of#transmission. This value should be estimated at the sum of maximum round-trip#times(in seconds) for all "spans." Suggest throwing 20% higher number of sessions#to account for extra- long sessions which contain an actual retransmission. Set a total#LTP memory space usage limit of 1200000 as the sum of the memory space usage of#all spans (more or less the number of bytes in transit on all links for their duration).1 5 1200000# Add a span. (a connection)#Identify the span as engine number 2. That is the ipn node number of the node on#the other end of this span. Use 5 as the maximum number of export sessions.#Use 120000 as the maximum size of an export block. This more or less limits the#maximum size of a bundle in the system. The next two items are the maximum#number of import sessions and the maximum size of an imported block.#Since this is connect, we just copy the export numbers here.#1400 is the maximum segment size- more or less, the amount of data that can be#held in a single frame of the underlying protocol. In this case, UDP packets are#the frame, and we will give a conservative limit.#Limit the aggregation size to 120000 bytes, and set a time limit on aggregation to 1#second. Use the command 'udplso 10.0.0.4:1113' to implement the link itself.#In this case, we use udp to connect to host2 (10.0.0.4 is host2's ipaddr) using port 1113#(defined by IANA as the default UDP port for Licklider Transmission Protocol).#The single quote is important, don't use double quotes.a span 2 5 120000 5 120000 1400 120000 1 'udplso 10.0.0.4:1113'# Start command.#This command actually runs the link service output commands#(defined above, in the "a span" commands).#Also starts the link service INPUT task 'udplsi 10.0.0.5:1113' to#listen locally on UDP port 1113 for incoming LTP traffic.s 'udplsi 10.0.0.3:1113'm screening nw 1## end ltpadmin## begin bpadmin# bprc configuration file for host3 in a 3node ltp test.#Command: % bpadmin host3.bprc#This command should be run AFTER ionadmin and ltpadmin and#BEFORE ipnadmin or dtnadmin.##Soochow University, April 2012# Initialization command (command 1).1# Add an EID scheme.#The scheme's name is ipn.#This scheme's forwarding engine is handled by the program 'ipnfw.'#This scheme's administration program (acting as the custodian daemon) is 'ipnadminep.'a scheme ipn 'ipnfw' 'ipnadminep'# Add endpoints.#Establish endpoints ipn:3.1 and ipn:3.2 on the local node.#The behavior for receiving a bundle when there is no application currently accepting#bundles, is to queue them 'q', as opposed to immediately and silently discarding#them (use 'x' instead of 'q' to discard).#Note that the custodian endpoint ipn:3.0 is automatically generated.a endpoint ipn:1.0 qa endpoint ipn:1.1 qa endpoint ipn:1.2 q# Add a protocol.#Add the protocol named ltp.#Estimate transmission capacity assuming 1400 bytes of each frame (in this case, udp#on ethernet) for payload, and 100 bytes for overhead.a protocol ltp 1400 100# Add an induct. (listen)#Add an induct to accept bundles using the ltp protocol.#The duct's name is 3 (this is for future changing/deletion of the induct).#The induct itself is implemented by the 'ltpcli' command.a induct ltp 1 ltpcli# Add an outduct. (send to host2)#Add an outduct to send bundles using the ltp protocol.#The duct's name is 2(this is for future changing/deletion of the outduct).#The outduct itself is implemented by the 'ltpclo' command.a outduct ltp 2 ltpclo#Start bundle protocol engine, also running all of the induct, outduct, and#administration programs defined aboves#w 1## end bpadmin## begin ipnadmin# ipnrc configuration file for host3 in a 3node ltp test.#Essentially, this is the IPN scheme's routing table.#Command: % ipnadmin host1.ipnrc#This command should be run AFTER bpadmin (likely to be run last).##Soochow University, April 2012# Add an egress plan.#Bundles to be transmitted to element number 2 can be transmitted directly to host2#using ltp outduct identified as ‘2.’#See your bprc file or bpadmin for outducts/protocols you can use.a plan 2 ltp/2## end ipnadmin



接下来分段分析:

1 2 ionconfig
这行命令是选取ionconfig配置文件,该文件主要是指定了ion运行的内存空间,1代表是命令1 ,2代表是节点2,也就是如果你是为了节点1配置rc文件,那么这里应该改成1 1 ionconfig,要注意的是,这里ionconfig文件应该和rc文件在同一路径下。

# start ion nodes
该行命令无需多解释

a contact +0 +86400 1 2 125000a contact +0 +86400 2 1 125000
这两行命令是添加传输的时间和节点,传输将从0s开始,结束于86400s,将连接从节点1到节点2,传输速度是125000 bytes/second

a range +0 +86400 1 2 1
添加一些范围。 这些是节点之间的物理距离,连接节点1到节点2,我们假设这些节点之间的距离时间为1s,也就是说数据从节点1到节点2要花费1s时间,由于range包含了双向,因此只需要定义一个range即可。

m production 1000000m consumption 1000000m horizon +0
设置该节点消耗和生产的均值为1000000 bytes/second

1e 1
不多解释
a protocol ltp 1400 100

1 5 1200000
1表示命令1,5表示会话进程最大值为5,1200000(单位byte)表示LTP内存空间的使用上限,,也就是所有span的使用内存空间总和。

a span 2 5 120000 5 120000 1400 120000 1 'udplso 10.0.0.4:1113'

添加一个span也就是一个连接,2表示连接另一端的节点号码,5表示最大数目的输出会话进程,120000是最大的输出块尺寸,后面的5和120000表示输入的最大数目会话进程和最大块尺寸,这里设置和输出一样。1400是segment的尺寸,也就是1400byte数据在一个帧中,比如udp包,120000是限制聚合层大小,并设置聚合层时间为1s,命令'udplso 10.0.0.4:1113‘是设置连接本身性质,在这个rc文件中,利用udp连接host2(ip地址:10.0.0.4)端口1113。

s 'udplsi 10.0.0.3:1113'm screening nw 1
这里设置input task。用udp端口1113进行监听,本节点地址为10.0.0.3。

m screening n 此命令启用或禁用接收的LTP的筛选,n表示禁用。默认是禁用。

a scheme ipn 'ipnfw' 'ipnadminep'
不做解释

a endpoint ipn:1.0 qa endpoint ipn:1.1 qa endpoint ipn:1.2 q
添加终端节点,ipn:1.0 1表示本节点的number,0表示service number,servicenumber 类似于端口号之类的,每个number提供一个服务,q表示对于每一个接收到的bundle进行排队,而x表示立即丢弃这个bundle,也就是a endpoint ipn:1.0 q 改成a endpoint ipn:1.0 x,常用在loopback测试中。

a protocol ltp 1400 100
添加ltp协议,每个frame有1400bytes数据,100个字节的开销。

a induct ltp 1 ltpcli
添加监听induct,duct的名字为1

a outduct ltp 2 ltpclo
添加发送outduct,duct名字为2

s
开始bundle 协议,开启所有的induct和outduct。

a plan 2 ltp/2
添加输出计划,也就是bundle要传输到node number为2的节点,使用标识为“2”的ltp输出。


以上就是对rc文件的分析,可以说正确的配置好rc文件那么ion就成功了一半,那么rc文件中,有几个需要注意的地方,

比如bp的启动命令

s,很多情况下由于并不显眼,可能会漏写该命令,会直接导致bp层运行失败。本人就曾经因为漏了s命令,调了一天的bug。

还有就是ltp协议的两个主要参数,block和session。也就是这条命令:a span 1 5 120000 5 120000 1400 120000 1 'udplso 10.0.0.3:1113'

Block 的尺寸决定着一次会话最多可以传输多少数据(以字节为单位)。会话的量(或数目)决定着同时最多可以进行多少个会话。Block 的实际尺寸与信道的速率( Channel rate )决定了传输 Block 所需的时间。





0 0