5002 would/could be a raw TCP (stream)
connection to a rotary group. So
for example if you had async TTY lines in
rotary group 2, you could connect to
them via port 5002. This should be disabled
by default, and enabled with the command
"transport input telnet" under the line(s).
I don't know what port 1024 would be.