Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NCP support in ot-br-posix #2398

Open
11 of 17 tasks
Irving-cl opened this issue Jul 23, 2024 · 3 comments
Open
11 of 17 tasks

NCP support in ot-br-posix #2398

Irving-cl opened this issue Jul 23, 2024 · 3 comments
Assignees

Comments

@Irving-cl
Copy link
Contributor

Irving-cl commented Jul 23, 2024

Use this issue to track PRs and todo tasks to support NCP in ot-br-posix.

@Irving-cl Irving-cl self-assigned this Jul 23, 2024
@Vanperdung
Copy link

Hello @Irving-cl, I'm interested in this feature. Our product wants to support Matter over Thread on NCP arch. Hopefully, it will soon be completed.

@Irving-cl
Copy link
Contributor Author

Hi @Vanperdung, glad to hear that! However I cannot guarantee on the timeline. We will keep tracking the process on this issue.

@Irving-cl
Copy link
Contributor Author

Will start to submit the code for border routing. Since the code will be non-trivial, I will use this comment to give an abstraction of the implementation for reviewers to review more easily.

Implement NCP based version of otPlatInfraIf APIs

openthread/openthread#10638 has added an empty version of these APIs. The remaining work is to implement them.

  • otPlatInfraIfDiscoverNat64Prefix will not be implemented temporarily because NAT64 will be implemented later.
  • otPlatInfraIfHasAddress: we will sync the IPv6 addresses of the infra if on the host to NCP and save them on NCP. When calling this API, we will directly search in the replica on NCP.
  • otPlatInfraIfSendIcmp6Nd: We will send a spinel property from NCP to the host and let host send the ICMP6 ND message.

New spinel commands

  • SPINEL_PROP_INFRA_IF_SETUP (host -> NCP)
    • This is used to initialize the "InfraIf" on NCP. The host will send InfraIfIndex, isInfraIfRunning and InfraIfAddresses to the NCP. The handler on NCP will save the addresses, call otBorderRoutingInit and otBorderRoutingSetEnabled.
  • SPINEL_PROP_INFRA_IF_STATE (host -> NCP)
    • This is used to notify NCP the change of infra if state or addresses. The host will send isInfraIfRunning and InfraIfAddresses to the NCP whenever there is any changes.
  • SPINEL_PROP_INFRA_IF_RECV_ICMP6_ND (host -> NCP)
    • When the host received an ICMP6 ND message, it forwards this message to the NCP using this spinel prop. And NCP handler will simply call otPlatInfraIfRecvIcmp6Nd to let OT core to handle it.
  • SPINEL_PROP_INFRA_IF_SEND_ICMP6_ND (NCP -> host)
    • When otPlatInfraIfSendIcmp6Nd is called on NCP, NCP will send this spinel property to the host. The spinel frame contains the InfraIfIndex, destAddress, Icmp6NdPacket.

Host InfraIf module

Like the Netif module, we will add a new InfraIf module to interact with the infraIf on the platform.

  • Initialization: The NcpHost will initialize the InfraIf if BackboneInterface is passed when starting the executable. Then theInfraIf will send SPINEL_PROP_INFRA_IF_SETUP to the NCP. We will also provide an API to initialize/Update the Infra after the executable already started (for Android use case).
  • InfraIf state update: A netlink socket will be created to receive netlink message about the state change (ON/OFF state and addresses) of the InfraIf. Whenever receiving a message, the module will send SPINEL_PROP_INFRA_IF_STATE to the NCP to update the state.
  • Receive ICMP6 ND messages (RA, RS, NA): A Icmp6 socket will be created to receive these messages from the platform. Then the InfraIf module will send a SPINEL_PROP_INFRA_IF_RECV_ICMP6_ND to the NCP to forward these messages and let NCP handle them.
  • Send ICMP6 ND messages: The InfraIf module will provide a method SendIcmp6Nd which sends the message though the Icmp6 socket as well. The method SendIcmp6Nd will be called in NcpSpinel when it receives a spinel frame of SPINEL_PROP_INFRA_IF_SEND_ICMP6_ND.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants