Does Windows use the services file for determining TCP port number?

I was curious – is Windows still using the services file for determining which port to use when connecting with a specific protocol, or is it hardcoded in the OS?

I mean, if we type http://test.com/ into Start->Run dialog, will it check the standard IANA services file to check which TCP port to use or will it just assume it’s port 80?

Let’s find out!

I created a standard Windows XP Professional SP2 virtual machine. I downloaded Microsoft Network Monitor for capturing TCP/IP traffic.

I did a simple test, by Going to google.com with IE 7 to check if Network Monitor is working fine – it was:

Network Monitor screenshot

Then I edited the standard services file and added an extra dummy service with port number 77:

Services file

Then I tried accessing the newly created protocol, both by Start->Run and by typing it into IE’s address bar.

Run window showing new dummy protocol

Unfortunately, in both cases, there was no TCP traffic initiated.

Conclusion

Windows doesn’t use the standard services file when determining if it knows the protocol, and how to connect to it. This has been verified for Windows XP SP2, but I assume newer version would not switch to the “old” method.

Leave a Reply

Your email address will not be published. Required fields are marked *