nasa / SBN

38 stars 23 forks source link

Configuring SBN Filters #34

Closed mogar closed 4 years ago

mogar commented 4 years ago

I want to experiment with SBN to send files between two cFS nodes. I'd be using the CF app to actually send and receive the files, and SBN to route the packets from one node to the other using UDP (all on the same host). My plan is to use TO/CI to control each of the nodes during the test, so I want to configure the SBN filters to only pass messages from CF across the network.

I have some questions about how to do this:

  1. I'm assuming I'll have to use the sbn_f_remap filter along with the sbn_remap_tbl. The Table provided with the SBN app is empty, and it's not completely clear to me how it's supposed to be used. How is the ProcessorID field used in the table? If I want to forward all CF messages, can I just create a row for each CF message that maps it to itself?
  2. I plan to create CPU1 and CPU2 in the same cFS build. How do I give these different config files? I want to configure each to listen to a different port for SBN messages. I see how I could create multiple sbn_conf_tbls, but it looks like the table name is hard coded in the header files used to build the apps.

Thanks for any help you can give!

mogar commented 4 years ago

I think I've mostly figured this out by looking at the code in your test directory. Thanks for putting together such easy-to-follow tests!

In doing this, I did identify a couple of issues with the Remap Filter.

  1. In sbn_f_remap.c, function LoadRemap(), the RemapTbl itself is accessed before it's assigned. The assignment at line 85 (RemapTbl = TblPtr;) should go before the call to qsort to avoid a null pointer exception.

  2. In sbn_remap_tbl.c, the size of the table needs to come on line 7, after the default behavior value and before the table itself.

CDKnightNASA commented 4 years ago

I think I've mostly figured this out by looking at the code in your test directory. Thanks for putting together such easy-to-follow tests!

In doing this, I did identify a couple of issues with the Remap Filter.

  1. In sbn_f_remap.c, function LoadRemap(), the RemapTbl itself is accessed before it's assigned. The assignment at line 85 (RemapTbl = TblPtr;) should go before the call to qsort to avoid a null pointer exception.

Ah, good catch, thanks.

  1. In sbn_remap_tbl.c, the size of the table needs to come on line 7, after the default behavior value and before the table itself.

The RemapTblVal() function (which computes RemapTblCnt) is called as part of the CFE_TBL load functions which occurs prior to the call to LoadRemapTbl().

I'm simplifying the module and changing the interface (the Init() should return SBN_Status_t) and will have code tested and checked into git by COB today.

CDKnightNASA commented 4 years ago

I've committed changes to the remap module and a variety of other changes this morning, this should be clearer and work properly. I need to continue testing but my initial tests look good.