Appendix C: Name Resolution Services

Previous Page Next Page

C.2.2 SERVICES

Just as hosts have names and IP addresses, most of the popular TCP/IP services also have names and port addresses. For example, the HTTP protocol used on web servers is most commonly found at port 80, while SMTP servers commonly listen on port 25.

Just as the HOSTS file provides a name-to-address lookup mechanism, so does the SERVICES file. This file is similar in format to the HOSTS file described above, although it varies from it considerably as well.

Whereas the HOSTS file used the first column the IP address, the SERVICES file uses the first column for the service name. Likewise, instead of using the second column for the name, the SERVICES file uses the second column for the port number and the transport protocol (either TCP or UDP). The third column of the SERVICES file is used for aliases, like the HOSTS file. In the NetWare 4.x server environment, the third column is used for aliases, and comments are defined through the use of "#" marks; anything after the "#" is considered to be a comment.

Each platform varies in it’s implementation, so refer to the documentation that came with your system to be sure of what’s acceptable or not.

Figure C.2 below shows what a sample SERVICES file might look like.

In this example, the application called "echo" runs as a server service, listening on port 7 through both TCP and UDP. "echo" is a small application that will echo back any characters fed to it. If you have a telnet client, you can connect to the "echo" port on a local server and then type in characters, which the server will echo back to the telnet client.

Port 9 on UDP and TCP is used by the discard application. As might be expected, the "discard" application does not echo back characters it receives; it simply drops them. The "discard" ports also have alias service names of "sink" and "null". Thus, you could open a telnet session to "sink" and you would get connected to the "discard" service.

Other services to note here are the SMTP and POP3 mail servers, and the HTTP server. All three services have comments, which are ignored by the local software. The POP3 server has an alias name of "POP" because some applications used that nomenclature instead of "POP3".

It is important to note that the services file is generally only used to make management information readable to humans, and is not generally used by application software. For example, there are not many e-mail clients which explicitly ask the TCP/IP stack to check for new mail on the "POP3" port. Typically most of them just ask for a connection to TCP port 110 on the destination host.

However, if you were attempting to debug the server, you might want to telnet to TCP port 110 on the server. Rather than try to memorize each of these service names, you would be better off simply opening a connection to the "pop3" server. Again, the services file is generally only used for human convenience, and is not referred to by applications at all.

Previous Page Next Page

Copyright 1997 Unoverica Corporation. All Rights Reserved page
Send comments to docs@unoverica.com