Choosing a UDP port

Hi,
I'm working on a remote controlled car.
I want to use UDP to send commands to the car.
Can I use any UDP port? Of the tutorials I've seen, port 4210 seems to be most common. I've also read that ports in the higher range of 40,000 to 50,000 should be safer?
Apologies for my ignorance.
Thanks.

You should avoid using ports below 1024. Though 80 is a reasonable choice especially if the car provides a web or REST interface. 443 is a reasonable choice if that interface is secure.

That's in the ephemeral range. Ports in that range are dynamically used by operating systems. Using a port in that range is likely to cause problems were you to include something like a DNS lookup.

Generally, I just go here then pick something not assigned that's easy to remember. I have a proclivity for prime numbers. 4210 seems like a good choice though it collides with the tutorials you're using.

I use ports 8080 to 8088. They seem to work well without interfering with preassigned ports like 80 (http) and 443 (https).

... or peek at /etc/services and pick one that's free. Or pick one, that's free on your system as this is only going to be used by you on your systems --> no need to bother with anything else. Also note that e.g. 80 is only used by tcp, but not udp, so you can use that anyway.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.