# Which port to open for a program to communicate with computer ?



## manishrathi (Apr 21, 2009)

How to find out which port number to open so that a program can communicate with my computer ?

How to find out whether to open TCP or UDP port ?

There are thousands of ports. Will the communication take place through port number which I open or do I need to know which port number to open for communication to take place ? 

If I need to know which port number to open for a particular program to communicate with my computer, how do I figure out on which port communication will take place ?

Thanks.


----------



## scottsee (Feb 28, 2007)

Applications are written to use specific ports, you shouldn't need to configure anything unless the listing machine is configured on a diffrent port. 

IANA.org is in charge of maintaining all the information about registered port numbers assigned to applications.

http://www.iana.org/assignments/port-numbers


----------



## manishrathi (Apr 21, 2009)

But sometimes a program is blocked by firewall. In this situation, we need to open a port to allow this program to communicate with computer. 

How do I know, which port to open for communication.

As answered in this post, if application is configured to use a specific port and if I open a different port, will program be able to communicate through the firewall ? 

I was reading about system security. In there, its stated that, I can allow a program through firewall. Now allowing a program thru firewall and opening a port are two different things.

When I look in the "windows firewall with advanced security" and create "New Rule", I see separate radio buttons for Program and Port. Program radio button allows a program thru firewall. What does Port radio button do ? If it allows a program thru that specific port then how do I know which port number to provide. If program is communicating thru specific port number and if I provide any arbitrary port number, will the program be able to communicate thru this arbitrarily provided port number ? If not, then how do I find out which port number to provide form a particular prohgram ?

thanks


----------



## scottsee (Feb 28, 2007)

If you look at the link I provided you, it will tell you the default port's most program uses over TCP and UDP. In the case where you open up a port that an application is not listening on, you'll get an ICMP type 3 code 3 error message: Destination un reachable, port unreachable. Both a client and the server must share the same port. 

I don't know anything about configuring Microsoft's firewall, Sorry.


----------

