Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » questions about FBDK(UDP, multicast, sub/pub, buffering)
questions about FBDK [message #1841821] Mon, 31 May 2021 08:55 Go to next message
xin zhao is currently offline xin zhaoFriend
Messages: 15
Registered: March 2021
Junior Member
Hi, all

The software arch for our project is like this: OPC DA is handled in forte running on win 10 and everything else are in fortes on wsl 2. All the fortes are communicated by pub/sub which actually are talking with each other in FBDK/IP.

We met some problems in pub/sub so that I looked into the code for FBDK.


First logic I do not understand is why FBDK is buffering? You can look at the code of function deserializeDataPoint called in CFBDKASN1ComLayer::recvData. The actually result is that as long as the packet does not comply with the below logic:


if(0 < pa_nStreamSize && e_APPLICATION == (pa_pcBytes[0] & e_APPLICATION)) 


The packet will be buffered and concatenated with next packet and next packet and ..... So that the sub will never work again and the memory wil be eaten by forte quickly. You can repeat the problem by use

nc -u 225.0.0.1 61499 


And input texts, for example "123", the idea is to input some chars starting with ascii code fullfil

 code & 01000000  != 0 

Then the sub fb will not work any more. Also a little bit dangerous because if somebody multicast udp packet in the same channel as ours, quite likely the sub will not work anymore.


My thinking is that as the packet published is udp packet so that either we receive the whole packet or we receive nothing at all. Can we do not buffer any udp packet and any illegal packets will be dropped? Or is there the case that one udp packet cannot hold the whole information so that we need to split the packet into two or more? Please correct me as I may have incomplete information.

sencond problem I see is different from machine to machine. But the change of IP may cause the sub running on windows does not work any longer. Need some time to inestigate the root cause.


Regards
Tibalt











Re: questions about FBDK [message #1841881 is a reply to message #1841821] Wed, 02 June 2021 06:43 Go to previous messageGo to next message
xin zhao is currently offline xin zhaoFriend
Messages: 15
Registered: March 2021
Junior Member
It seems I need to raise this issue in the bug system so that somebody will verify the problem.
Re: questions about FBDK [message #1842023 is a reply to message #1841881] Mon, 07 June 2021 13:27 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

first of all thanks for the deep analysis and the bug report. Yes it is an issue. I think the base idea behind that code is that for TCP packets which is handled by the same code it is possible to have fragmented packets and it is an attempt to handle fragemented packets. However the underlying enocding in FBDK would not really allow to handle packet fragmentation very good. Therefore I really think it is a good idea to remove that code.
Previous Topic:enchance suggest
Next Topic:how to send msg by tcp? help pls
Goto Forum:
  


Current Time: Sat Apr 27 19:44:50 GMT 2024

Powered by FUDForum. Page generated in 0.03078 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top