11.01.2013 Views

Workshop

Workshop

Workshop

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

printer 515 Line Printer Daemon (network printing for UNIX)<br />

socks 1080 Socks proxy server (Socks 4 and Socks 5)<br />

What if you don’t know the socket number of a client/server program that you’re using? Simple—stop the<br />

server program and then run netstat -an. Print it out or save it to a file:<br />

netstat -an > socklist.txt<br />

Then start the server program and run netstat -an again. Compare the two lists. The new socket<br />

number that shows up in the second list is the socket number (or numbers) for your client/server program.<br />

Connection-Oriented Versus Connectionless Sockets<br />

As we discussed in Hour 15, “Firewall and Proxy Server Basics,” for our purposes, there are two types of<br />

sockets: UDP and TCP. When a program sends out a UDP packet, it has no way of knowing that the<br />

packet got there because it’s connectionless, rather like a message in a bottle. For our troubleshooting<br />

purposes, we hate UDP. It’s a very irresponsible child. We like TCP best, because we can quickly tell<br />

whether a TCP socket is listening. Because a TCP socket is a connection-oriented socket, we can initiate<br />

a call on our own and see whether we get a busy signal or a connection.<br />

One way to check whether the socket is being established is to use the client program itself and then<br />

check the workstation’s socket list. For example, here’s how you can connect with an FTP service in one<br />

window and run netstat -an in another window:<br />

C:\WINDOWS>netstat -an | find “:21”<br />

TCP 192.168.10.5:1025 192.168.5.1:21 ESTABLISHED<br />

Here you have an ESTABLISHED connection, so no matter how much your FTP client is complaining,<br />

you do have a bona fide socket. In this case, you might want to look at client configuration if you’re<br />

experiencing problems.<br />

Another way to check whether a remote socket is listening is to telnet to that socket. For example, let’s<br />

perform a control experiment. You can run an FTP server on a PC and then use Telnet to go to it to see if<br />

it’s listening. Just so you don’t even go to the outside network, use your loopback address (the loopback<br />

address in TCP/IP is always 127.0.0.1). You can see the results just by typing this (see Figure 18.5):<br />

telnet 127.0.0.1 21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!