ION-DTN开启CFDP协议传输

CFDP英文简介如下:

cfdp (CCSDS File Delivery Protocol), another application-layer service that is not part of the DTN architecture but utilizes underlying DTN protocols. CFDP performs the segmentation, transmission, reception, reassembly, and delivery of files in a delay-tolerant manner. ION’s implementation of CFDP conforms to the “class 1” definition of the protocol in the CFDP standard, utilizing DTN (BP, nominally over LTP) as its “unitdata transport” layer.


也就是说CFDP是基于DTN协议栈的另一种应用层协议,主要用于文件传输。


那么如何在ION中开启该协议传输呢?

ION中给出了CFDP的一个测试demo,位于tests/cfdpv1文件夹下,可以看到包含两个节点,也就是点对点的互传,首先看节点1,包含很多rc文件和一些启动文件,如下图所示:




其中我们最关心的就是ionstart文件,因为都知道,DTN协议的开启都是利用ionstart脚本命令。

ionstart脚本如下;


# shell script to get node running
#!/bin/bash
ionadmin	node.ionrc
sleep 1
ionadmin	../global.ionrc
sleep 1
ionsecadmin	node.ionsecrc
sleep 1
owltsim		node.owltsim -v &
sleep 1
ltpadmin	node.ltprc
sleep 1
bpadmin		node.bprc
sleep 1
cfdpadmin	node.cfdprc

可以看出,CFDP协议的运行是基于LTP或者UDP进行传输的,因此首先要开启LTP传输。这个ionstart脚本可以直接运行,命令如下:

./ionstart


如果运行发现一些permission错误,就应该在命令前添加sudo


如此,脚本会运行各个rc文件,要注意的是,在第一个配置文件node.ionrc文件中:


1 1 node.ionconfig
s
m horizon +0


要利用node.ionconfig文件进行配置。

wmKey 66136
sdrName ion1
wmSize 1000000
configFlags 1
heapWords 1000000

该配置文件无法正常使用,size过小,应该改为以下配置:

wmSize 500000000
wmAddress 0
#configFlags = 14 means the ION data store is in a file (in /usr/ion)
#only, transactions are reversible, and object boundaries are enforced.
configFlags 1
heapWords 150000000
pathName /usr/ion

这样ionstart可正常运行。


将CFDP服务开启后,就应该输入控制CFDP传输文件的命令了,这里可以采用以下命令:

cfdptest cfdp_cmds


其中cfdptest是命令,后面跟的cfdp_cmds是命令脚本,该文件也在节点1的目录下,接下来详细解释该命令脚本:

z 2
d 2
f sourceFile
t receivedFile
a 10
&
z 10
d 2
f sourceFile
t receivedFile
a 10
|
z 18
q


z [<number of seconds to pause>]
The pause command. When cfdptest is running in interactive mode, this command causes the console input processing thread to pause the indicated number of seconds (defaulting to 1) before processing the next command. This is provided for use in test scripting.


z是暂停命令,后面的参数是时间,单位是秒。该命令是控制串口输入的命令,下个命令要在上个命令进程进行2s后才开始运行。


d <destination CFDP entity ID number>
The destination command. This command establishes the CFDP entity to which the next file transmission operation will be directed. CFDP entity numbers in ION are, by convention, the same as BP node numbers.

d命令是目的地节点。


f <source file path name>
The from command. This command identifies the file that will be transmitted when the next file transmission operation is commanded.


f很容易理解,是传输的源文件的路径名和文件名


t <destination file path name>
The to command. This command provides the name for the file that will be created at the receiving entity when the next file transmission operation is commanded.


t是传输过去的目的路径名,也很好理解。


a <latency in seconds>
The closure latency command. This command establishes the transaction closure latency for all subsequent file transmission operations. When it is set to zero, the file transmission is ‘‘open loop’’ and the CFDP transaction at the sending entity finishes when the EOF is sent. Otherwise, the receiving CFDP entity is being asked to send a ‘‘Finished’’ PDU back to the sending CFDP entity when the transaction finishes at the receiving entity. Normally the transaction finishes at the sending entity only when that Finished PDU is received. However, when closure latency seconds elapse following transmission of the EOF PDU prior to receipt of the Finished PDU, the transaction finishes immediately with a Check Timer fault.


a 关闭等待命令。这个命令是等待x秒后关闭这个进程,也就是cfdp传输,后面跟的参数就是x秒,如果设为0的话,那么会循环进行。


& The send command. This command initiates file transmission as configured by the most recent preceding d, f, t, and a commands.

发送命令。


| The get command. This command causes a request for file transmission to the local node, subject tothe parameters provided by the most recent preceding f, t, and a commands, to be sent to the entity identified by the most recent preceding d command.


I,获取结果的命令。



因此当利用cfdptest 对cfdp_cmds脚本文件进行解析并运行后,可以在目的主机的ion的cfdpv1的节点2目录下,生成接收到的文件。

Done.

转载于:https://www.cnblogs.com/sichenzhao/p/9320262.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值