How to get status of message transmission

My application communicates via UDP and all communication is initiated from the device. Before packet transmission, network registration status is checked (CEREG) and sendto() is called only if the modem is registered to the network (maybe it would be better to check PDN status with CGEV). This works, but if the modem is in PSM, then it isn't updating network status (except for periodic TAU, which is in my case much longer than the communication period). Therefore when the device wants to send data, it doesn't know, if the modem is really connected or not. It calls sendto(), which copies data to the modem, the modem wakes up and reports the network status. If the network is not available for some reason, then data are already in the modem's buffer and the modem will send them when the network is available again (I guess?). My questions are:

  • How long will the modem keep data to be sent in its buffer?
  • It is possible to get a number of bytes/packets waiting in the buffer?
  • It is possible to get confirmation, that the packet was successfully transmitted to the network?
  • It is possible to clear the buffer (cancel the transmission)?

Development setup:

  • NRF9160 SIBA B1A
  • mfw 1.3.7
  • ncs 2.9.1

Parents
  • While that will make it easier to implement a UDP based protocol, it may be also seen as "duplicate", because regardless if the modem has sent the message, it may not reach the destination.

    Therefore UDP based protocols use some ACK/timeout mechanisms to cover that. In my experience it's therefore only important to know, when to start the transmission timer. I use "registered + pdn context + rrc active" to start that timer. To make it a little more reliable on "wake up after PSM", it may be considered to add "for 2s" because in rare cases of some gone network registrations, you get "rrc active", while the registration is still from the last "rrc active" and then changes to "searching" short after.

    For CoAP/DTLS 1.2 CID that works pretty well. I don't use the current coap-client logic , I've implemented my own timeout/retransmission mechanism.

  • I have implemented ACK/timeout with retransmission in my protocol. And I agree, that those informations are not important from UDP point of view. But e.g. I can get buffer overflow, if packets are stuck in buffer for some reason.

Reply Children
Related