nRF9160 ping event with AWS IoT

How does the device catch incoming ping events?


The device uses AWS IoT library, so it can't open a raw socket.

It looks like the ping events closed inside the modem binary.

So, this code does not run.

/opt/nordic/ncs/v2.0.2/zephyr/subsys/net/ip/icmpv4.c

Are there any ping event APIs? or sniffing raw packets?

nRF9160
mfw_nrf9160_1.3.2
nRF Connect SDK v.2.0.2

---------------------------------------
Update 2023-10-13

I use a diagram to explain what I want to achieve and what is actually difficult to achieve.




  • Hi,

     

    Thank you for the detailed description.

    I was able to reproduce this scenario locally, and I'm awaiting response from R&D to look deeper into what the behavior is in this specific case.

     

    I will update you as soon as I have new information, usually after approx. 2 business days.

     

    Kind regards,

    Håkon

  • Hello,

     

    Thank you so much for your patience.

     

    When opening a SOCK_RAW type socket, there's restrictions that apply. Mainly, you have two options:

    * Open the SOCK_RAW on a dedicated PDN

    or:

    * Keep all other sockets closed while the raw socket (SOCK_RAW type) is open.

     

    My apologies that these undocumented restrictions apply to this type of socket.

     

    Kind regards,

    Håkon

  • Thank you for your consideration.
    Having seen your post, this is my understanding:

    • Ping events from the server are typically processed within the modem firmware, and the application side cannot catch these events.
    • Ping events from the server can be captured by opening a raw socket. However, it is not possible to simultaneously capture events with AWS IoT and pings from the server.
  • Hi,

     

    ksksue said:
    Ping events from the server are typically processed within the modem firmware, and the application side cannot catch these events.

    Application can handle ICMP only if opening a SOCK_RAW type socket.

    ksksue said:
    Ping events from the server can be captured by opening a raw socket. However, it is not possible to simultaneously capture events with AWS IoT and pings from the server.

    Yes, this is correct. A SOCK_RAW type socket cannot operate simultaneously as other sockets on one specific PDN.

     

    Kind regards,

    Håkon

Related