openthread / ot-commissioner

OpenThread Commissioner, a Thread commissioner for joining new Thread devices and managing Thread networks.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
49 stars 36 forks source link

[udp-proxy] set local port to dedicated port number(:mm) for udp proxy transaction #279

Closed ZhangLe2016 closed 2 months ago

ZhangLe2016 commented 3 months ago

Currently, while the commissioner is transmitting udp_tx messages, the UDP source port is provided by the DtlsSession interface. This value is randomly generated. However, the CoAP layer on the border router side performs checks on the received udp_tx port to ensure that the destination UDP port used to outgoing messages matches the source port of the received messages. This leads to the commissioner's ACK messages not being processed, causing the BR side to repeatedly retransmit the same udp_rx message.

To resolve this issue, we use the default MM port as the only supported destination port for UDP_RX messages

ZhangLe2016 commented 2 months ago

Thanks @wgtdkp's reviewing and suggestions for the short term resolution of this problem. based on your comments, I have updated the PR.

jwhui commented 2 months ago

A more proper fix is probably let the Coap::Request carry the destination port along with it, but it will require larger change.

I agree with @wgtdkp 's comment here, but I'm fine with the short term fix.