views:

347

answers:

5

I want to test a connection to a machine in my local intranet. I know the IP address.

What port number should I use? 555? BTW: I'm using .NET.

A: 

The port is generally of no consequence as long is it isn't in use by something else and also there is not network filtering happening for that port, I generally chose something random in the thousands like 32581

Quintin Robinson
+5  A: 

You can use any but avoid the 'well known' port numbers

More details on such ports here.

Learning
A: 

Anything above 1024 is good.

The reason for that is that all the ports below are reserved for specific protocols or future use.

pr0nin
A: 

If your goal is just to open a TCP connection to a Windows machine (XP/Vista/2003/2008), without having to stand up your own service, then you aren't going to break anything if you open up a connection (and then close it without sending a message) to port 445 (Windows-DS).

If you want to set up your own server, then follow the other recommendations about unused ports above 1024.

Craig Trader
+1  A: 

Ports below 1024 are considered privileged so shouldn't be used.

There are some ports above 1024 that are designated as "well known" ports, so you should probably steer away from them. Check the definitive IANA list for details.

And to be completely paranoid safe, grab a copy of the sysinternals tool Tcpview to check what ports are being used on your machine.

Andrew Edgecombe