Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

port 0.0.0.0

Status
Not open for further replies.

baozhi

Programmer
Mar 30, 2006
3
US
When my application server connect to our sql server, I use port explorer to monitor the port activity. I noticed my app connect to db server in two different ways:
1. 0.0.0.0:2825 192.100.10.100:2003
2. 192.100.10.20:2927 192.100.10.100:2003

where 192.100.10.100 is the sql server and 192.100.10.20 is my app server.

My question is why my app trying to use a port on 0.0.0.0 to connect to db server. I thought 0.0.0.0 is just a listening port. Is this caused by some flaw in my program?

Please help!
 
First of all 0.0.0.0 is not a port. The port is the part after the : in your case 2825

Now 0.0.0.0 means every ip address.

When you have a server (lets say sql) you can set it up to listen to a particular ip address(interface) of the system lets say (192.168.1.100) or have it listening on every interface (every ip -> 0.0.0.0 which means 192.168.1.100 and 10.0.0.1 and 64.34.54.190 and any other) your system might have.

Are these (app server and sql server) on the same machine or on a different one?

Now if you have something going out from 0.0.0.0 (if you are looking at the right thing) then there is definitely something wrong.

Be sure you are looking on the right report because this doesn't make any sense.
I read "Every interface I have is conneted to 192.100.10.100 on port 2003 from port 2825".
So is either you program (or whatever it is) or the port explorer monitor.


``The wise man doesn't give the right answers,
he poses the right questions.''
TIMTOWTDI
 
Thanks for the reply.

I use TCP/IP for two purposes in my application.
1. HTTPS connection to our providers.
for this type of connection, all the initial connection
to our provider start from 0.0.0.0:portNum.
e.g: CONNECT TCP 0.0.0.0:2266 to 12.xxx.xx.xxx:443
where 12.xxx.xx.xxx:443 is our provider ip. then all the
following https connection activity on this connection
(SEND, RECEIVE) are done on my local port (2266) but with
my server ip address (192.100.10.20:2266), finally,
after I am done with that connection, close it.
My question is: why it starts connection from 0.0.0.0, but using it from my local ip? I am using simple java httprulconnection.

2. Database Connection via sql jdbc driver (v2.2):
The connection I try to make - from 0.0.0.0:2825 to sql
server 192.100.10.100:2003 (NOT on the same box) always
failed. At the same time, my app failed on using
0.0.0.0:0 to connection to our web server asp page.

However, all other Database connection I successfully
made are connected from my local ip (192.100.10.20).

My questions is: why my application uses my local ip for several hours without any problem, then all of sudden, it decide to use 0.0.0.0 to connect to sql server. does this sound like I am running out of port on my local ip interface, then trying to grab one from 0.0.0.0?

any idea?
 
I think you may have the function of ports confused with the function of an IP address. When your host machine makes a request to the server, the transport layer will create a session between the two machines and a port number is assigned to the host and another port number is assigned to the server (2825, 2927, and 2003.) Now the port numbers are not used for communications between the two machines; the host uses its’ port number so that its’ transport layer can communicate to its’ Application, Presentation, and Session layers. The server has a port number to do the same thing locally.

If memmory serves me correctly there are 2^16 number of ports that can be used. Your port numbers are fine; you’re not running out of port.

However, the IP address of 0.0.0.0 is curious. This number is needed to properly route the data. I’m not sure what is going on here but if the host and server are on the same LAN, in other words not going across a router, then the field may be getting set to 0.0.0.0 because the communication is happening at layer 2 (MAC Address) and no layer 3 (IP Address)communication is taking place.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top