eclipse-threadx / netxduo

Eclipse ThreadX - NetXDuo is an advanced, industrial-grade TCP/IP network stack designed specifically for deeply embedded real-time and IoT applications
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/netx-duo/index.md
MIT License
230 stars 131 forks source link

Does netxduo have a function to send a IPv6 RA message #169

Closed prarthana-13 closed 1 year ago

prarthana-13 commented 1 year ago

Hi, Does the netxduo have or support a function to send a IPv6 RA message . If not how can we be able to send a RA message in response to RS message .

TiejunMS commented 1 year ago

Sending IPv6 RA is not supported by NetXDuo. To send RA message, you can use API nxd_ip_raw_packet_send() to construct RA header. To receive RS message, set a raw packet filter by nx_ip_raw_packet_filter_set() to hijack RA message.

shahab5 commented 1 year ago

HI @TiejunMS we see that DHCPv6 server https://github.com/azure-rtos/netxduo/blob/master/addons/dhcp/nxd_dhcpv6_server.c implementation is present in the NetxDuo, how does it work without the RA messages? Does the DHCPv6 implementation support Stateful DHCPv6? Please help to understand the implementation done for DHCPv6 Server in this file.

What I mean is that the connected node will trigger either DHCPv6 Stateless or Stateful method based on the flags in RA send by the DHCPv6 server, as NetxDuo doesn't sent RA, then what is the expectation from the connected node?

TiejunMS commented 1 year ago

@bo-ms , could you help with this question?

bo-ms commented 1 year ago

Hi @shahab5 DHCPv6 is stateful address autoconfiguration protocol for IPv6 (RFC3315), this protocol is a stateful counterpart to "IPv6 Stateless Adress Autoconfiguration (RA)" (RFC2462). Our DHCPv6 implementation supports stateful address autoconfiguration, DHCPv6 Client/Server uses Solicit, Advertise, Request, Confirm, etc to configure address and other information. If you want to use DHCPv6 in your network, you can refer to the sample https://github.com/azure-rtos/netxduo/blob/master/samples/demo_netxduo_dhcpv6.c

prarthana-13 commented 1 year ago

Hi @TiejunMS @bo-ms , we have two observations w.r.t RA message and ip configuration.

1.There is no RA message sent in response for RS image

  1. Even without RA message from server side, DHCPv6 handshake happens and an ip address is assigned. No RA

Please help understand this behaviour

bo-ms commented 1 year ago

Hi @prarthana-13 1. Your network (Router) may not support/enable IPv6 Stateless Address configuration. 2. DHCPv6 is completely independent feature, does not depend on RA/RS.

shahab5 commented 1 year ago

@bo-ms, please refer to this page https://www.networkacademy.io/ccna/ipv6/stateful-dhcpv6 It is described that A, O, and M flags of RA are required by the host to decide whether Stateless or Stateful DHCPv6 should be used.

The problem is with the NetX device when configured as a DHCPv6 server, we see the Third-party hosts are unable to configure the IP address, while they work fine with other DHCPv6 routers that send an RA in response to RS. FYI, NetX host and works fine with NetX server. We think not sending an RA is leading to IOP issues. Please help to mitigate this.

bo-ms commented 1 year ago

Hi @shahab5 Understood, router may combine/manage these features. But NetX just supports Stateful DHCPv6, as Tiejun suggested, you may implement the logic of processing RS and sending RA in your application. Thanks.

shahab5 commented 1 year ago

We will do that, thanks!

bo-ms commented 1 year ago

Closing