Ask Your Question
0

FTP from PLC to Robot with larger files fails

asked 2024-10-11 17:16:57 +0000

Casper gravatar image

So, I'm trying to send a file from a Beckhoff PLC to a Robot. I setup a FTP server on the Robot successfully. When sending a smaller file (<200-300Kb) to the robot using function blocks from Beckhoff it is not a problem and the capture on Wireshark looks normal. But, when I try to send larger files (>400 Kb) I get some weird behavior in the Wireshark capture. First of all, when sending the larger file, I get [TCP Window Full] and [TCP ZeroWindow] messages. After some more seconds the messages [TCP ZeroWindowProbe] and [TCP ZeroWindowProbeAck] are also showing up. This continues until almost at the end, after some time the PLC sends [FIN,ACK] to the robot. Then it connects again with [SYN] and i get [SYN,ACK] back from the robot. But, instead of waiting for the Robot to send a Transfer complete message it doesn't wait and tries to connect again. Some seconds after this connection is tried by the PLC, the FTP function block from Beckhoff gets an error and it closes the connection again ([FIN,ACK] to robot is sent). Then a couple seconds later the robot sends a transfer complete command and a [FIN,ACK] to the PLC and i can see the file is transmitted to the robot. But, now my function block on the PLC is at 99% progress and in error and i cannot continue in this process. After the [FIN,ACK] From the robot to the PLC, there is an [RST,ACK] from the PLC to the Robot. Can anyone tell me if i have interpreted the Wireshark capture correctly. And how to fix these issues?

edit retag flag offensive close merge delete

Comments

Have you verified your network connections?
ftp working with small files but failing with large ones used to be an issue if duplex no set properly.

Chuckc gravatar imageChuckc ( 2024-10-11 19:28:53 +0000 )edit

Can anyone tell me if i have interpreted the Wireshark capture correctly.

Without looking at the capture, it is quite impossible to determine is you interpreted it correctly. Can you share the pcap(ng) file of both a small and a large transfer?

Apart from that, it seems the FTP server on the Robot might be short on (memory) resources to handle larger files.

SYN-bit gravatar imageSYN-bit ( 2024-10-13 19:46:13 +0000 )edit

I would share the files, but I don't have enough points. If the Robot is short on memory resources, what could be a solution for this?

Casper gravatar imageCasper ( 2024-10-14 05:58:27 +0000 )edit

@SYN-bit, https://1drv.ms/f/c/074d6e7731219cc8/... This is the link to the captures. I'm thinking the robot is the issue here, but, check it out.

Casper gravatar imageCasper ( 2024-10-14 10:39:39 +0000 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2024-10-14 12:12:41 +0000

SYN-bit gravatar image

Thanks for providing pcap files @Casper, the pattern in them is very interesting. First of all, it is not a memory problem on the Robot. As you demonstrated with FTP from a CMD window (according to the file name), the whole file can be sent to the robot. In fact, the PLC is also capable of sending the whole file to the Robot, but while it is doing this some problems with the control connection arise.

The Robot takes some time to process the received data, you can see this by the shrinking receive window (tcp.window_size). This happens in both the CMD and the PLC uploads. But each FTP/TCP implementation is dealing with this differently. While the CMD is waiting for enough room to send a full MSS (1460) bytes, the PLC just fills up the last bit of the receive window (hence the Window-full/Zero-window expert info messages). All in all, the processing of the data by the robot takes ~17 seconds.

During the slow transfer, it seems the PLC control channel has reached a timeout on hearing back that the file transfer was complete and it tries to close the control channel and also tries to open a new control channel (which does not make much sense, as the data channel is bound to the first control channel).

I'm not familiar with PLC programming and/or Beckhoff function blocks. But I hope there are some settings that you can change. I would look for timeout settings in the FTP function block and increase the timeouts on the control channel to 30 seconds or even higher, depending of other large data transfers that might be needed between the PLC and the Robot.

I hope this makes sense, it would have been a bit easier if the FTP commands were not stripped away by the anonymization, as they might have "documented" what was happening a bit more I guess :-)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2024-10-11 17:16:57 +0000

Seen: 118 times

Last updated: Oct 14