Can't receive any data from an UDP socket until sending through it

We have 2 devices. One of them is powered by Legato (Sierra Wireless WP7502). Another one has a LTE module from a different vendor. We also has 2 USIM cards with public static IPv4 addresses (from 2 different mobile operators).
We’ve opened one UDP socket on each device to receive and transmit data asynchronously between these devices. The problem is that the Legato device don’t receive any data from the socket before the first packet is sent through the socket to the non-Legato device.
We’ve switched USIM cards - doesn’t help. The default rule of iptables’ INPUT is changed from DROP to ACCEPT - doesn’t help either. We don’t see any incoming data on the rmnet0 interface (“RX bytes” field of ifconfig command doesn’t change)
But when the very first UDP packet from this socket (on Legato device) is issued to the non-Legato device while the non-Legato device is flooding the Legato device’s socket with packets we start receiving all subsequent packets (even from another sources like our PC’s). So the vital part of the reception start on the Legato device is to send a packet from the socket and receive a RESPONSE through this socket (outgoing src_ip:src_port/dest_ip:dest_port should match dest_ip:dest_port/src_ip:src_port of the “response”). Sending packets from the socket to the addresses other than that could send a response doesn’t start the reception.

Does anyone have an idea how to start the reception without sending this first packet?

PS: We’re using DevStudio v5.3.1 for Windows with Legato for WP85/WP75 R16 SDK (Legato ver 18.6.1). The data session is started with le_data_Request().
PPS: I’m not sure if I’ve managed to explain my situation, thus clarifying questions are welcome!

how about typing the following in UART console to enable all the input port after boot up ?
iptables -I INPUT -j ACCEPT

This was exact what was done when I wrote that:
iptables -P INPUT ACCEPT

Can you write a simple udp server program and run in yocto linux?
This can isolate if problem related to legato framework.

You can also capture wireshark log to see the real traffic.

There’s a difference between -I and -P

Sounds like the -I might be what you need, however list out your rules and then you can see if your rule or default policy is inserted where you want it.

iptables -L INPUT

BR,
Chris

Sorry for late response. I was unexpectedly switched to another urgent task.
This week I get back to the WP7502. I already tried all your advices but they didn’t help.
I’ve written an udp server without the Legato framework. It behaves the same - doesn’t receive any data on the rmnet0 interface (I use “cm” command though to establish a connection and get the interface up).
When I connect the WP7502 via USB to my Windows PC I can see the “Mobile connection” on this Windows host machine. I can capture traffic with Wireshark on this interface (including the packets addressed to the particular port). At the same time I don’t see these packets when running ifconfig command on the Target device (powered by WP7502).
But sometimes strange thing happen and everything works just fine. The application receives the packets. I can reboot the Target device (power it off & on), and it still works. But by the end of the day it stops working. After next reboot it doesn’t receive data through the socket until the app on the Target send to it. Next reboots don’t help to fix this. I didn’t change the code of the app, just rebooted the Target trying to reproduce the problem. I don’t understand what exactly leads to the problem.
Sometimes I get unexpected disconnections (almost every connection session). le_mdc_GetDisconnectionReason() returns 45. Then the WP7502 automatically reconnects and works pretty fine. I can’t swear this is the reason of the problem but I think it’s important to note.

Seems your board is not stable, BTW, did you try iptables -I INPUT -j ACCEPT

1 Like

Hi,
Yes, I did:
iptables -P INPUT ACCEPT
iptables -I INPUT -j ACCEPT
iptables -I INPUT -p udp -m udp --dport <my_port> -j ACCEPT

I’ll try to do the same with a mangoh green board and report the results.

Hi @funfunfun,
do you have more results to share about this topic?

Best Regards

With MangOH Green Starter Kit it works pretty good. May be it needs to do more tests but I neither receive unexpected disconnections nor the problem with udp packets so far.

Seems like the problem is connected to a power supply on our board. I keep trying to solve the problem.

I think the problem could be marked as solved since it isn’t related to the Sierra Wireless’s component.

Especially I want to thank jyijyi for pointing out to our board’s design.