Site hosted by Angelfire.com: Build your free website today!
Chapter 22: Connecting to the Internet

PreviousChapterContentsGlossaryNext

Testing Your Connection

After dialing up a network connection, you can use the Windows Ipconfig command to find out the IP address of your computer. The Ping program can test whether packets of information can make the round trip from your computer, out over the Internet to another computer, and back to your computer. You can use the Tracert program to trace the route packets take to get from your computer to another computer, and you can use the Netstat program to find out to which computers your computer is talking.

Some of these commands are usually run from the Command Prompt window. Open a Command Prompt window by choosing Start | All Programs | Accessories | Command Prompt.

Displaying Your IP Address

Your computer can have more than one IP address at the same time: each network connection can have a separate IP address. For example, your computer can have the address 204.135.25.67 on the Internet (via a dial-up, cable, DSL account, assigned by your ISP) and the address 192.168.0 on your LAN (see Chapter 27 for how IP addresses are assigned on the LAN.

There are three easy ways to display the IP address of your Internet connection:

[figure]
Figure 22-9: Displaying the IP address of your Internet dial-up connection

Windows IP Configuration

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.0.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

PPP adapter Shoreham.net:

Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 208.144.253.8
Subnet Mask . . . . . . . . . . . : 255.255.255.255
Default Gateway . . . . . . . . . : 208.144.253.8

The IP address of your Internet connection is likely to change each time you connect to your ISP, because most ISPs assign IP addresses dynamically.

Testing Communication with Another Computer by Using Ping

Sending a small text packet on a round-trip is called pinging, and you can use Windows' built-in Ping program to send one. (Imagine that your computer sends the message "ping" and the other computer replies "pong.") To run Ping, open a Command Prompt window by choosing Start | All Programs | Accessories | Command Prompt and type the Ping command, as follows:

ping system

Replace system with either the numeric IP address or the host name of the computer you want to ping. Choose any Internet host computer that you're sure is online, such as your ISP's mail server. Then press ENTER.

tip To see a listing of all the command-line options for the Ping program, type ping /? at the DOS prompt.

For example, you can ping the Yahoo! Web server (a Web search engine and directory) by typing

ping www.yahoo.com

Ping sends out four test packets (pings) and reports how long the packets take to get to the Internet Gurus computer and back to yours, like this:

Pinging net.gurus.com [208.31.42.79] with 32 bytes of data:

Reply from 208.31.42.79: bytes=32 time=204ms TTL=248
Reply from 208.31.42.79: bytes=32 time=220ms TTL=248
Reply from 208.31.42.79: bytes=32 time=200ms TTL=248
Reply from 208.31.42.79: bytes=32 time=210ms TTL=248

Ping statistics for 208.31.42.79:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 200ms, Maximum = 220ms, Average = 208ms

For each packet, you see both how long the round-trip takes in milliseconds and summary information about all four packets' trips. If ping doesn't receive the response it is waiting for within a time limit, you see an error message.

Ping has a number of options, which are listed in Table 22-2. Ping has other arcane options, not listed here.

tip First try Ping with a numeric IP address (for example, 216.32.74.50 for a Yahoo! Web server, or 208.31.42.79 for our Web server), to see whether packets get out to the Internet and back. Then try Ping with a host name, to see whether you successfully contact your DNS to convert the name into an IP address. If the first test works and the second doesn't (failing with an "Unable to resolve target system name" error), your connection isn't set up properly to contact a DNS.

Option Description
-a Reports numeric addresses rather than host names.
-f Specifies that packets contain a Do Not Fragment flag, so packets aren't fragmented en route. (Useful to test very slow dial-up connections.)
-i ttl Specifies the Time To Live for the packets (how many times the packet can be passed from one computer to another while in transit on the network).
-n n Specifies to send n pings. (The default is four.)
-r n Specifies the outgoing and returning packets should record the first n hosts on the route they take, using the Return Route field; n is a number from 1 to 9.
-t Specifies to continue pinging until you interrupt it. (Otherwise, it pings four times.)
-w n Specifies a time-out of n milliseconds for each packet.
Table 2: Options for the Ping Program

Tracing Packets over the Internet

Packets of information don't usually go directly from one computer to another computer over the Internet. Instead, they are involved in a huge game of "whisper-down-the-lane," in which packets are passed from computer to computer until they reach their destination. If your data seems to be moving slowly, you can use the Tracert (short for trace route) program to follow your packets across the Internet, from your computer to an Internet host you frequently use. The technique Tracert uses doesn't always work, so it's quite possible running Tracert to a remote computer can fail, even though the computer is working and accessible.

To run Tracert, open a Command Prompt window by choosing Start | All Programs | Accessories | Command Prompt. Then type the Tracert command:

tracert system

Replace system with either the numeric IP address or the Internet name of the computer to which you want to trace the route. Then press ENTER.

tip To see a listing of all the command-line options for the Tracert program, type tracert at the DOS prompt, with no address.

For example, you can trace the route of packets from your computer to the Internet Gurus Web directory at net.gurus.com by typing

tracert net.gurus.com

You see a listing like this:

Tracing route to net.gurus.com [208.31.42.79]
over a maximum of 30 hops:

1 * * * Request timed out.
2 148 ms 149 ms 139 ms rtr.shoreham.net [208.144.253.1]
3 149 ms 149 ms 149 ms shoreham253.greenmountainaccess.net [208.144.253.253]
4 149 ms 139 ms 149 ms richmond-1.greenmountainaccess.net [208.144.252.13]
5 190 ms 179 ms 189 ms sl-gw20-nyc-6-1-0-TS8.sprintlink.net [160.81.215.241]
6 216 ms 189 ms 229 ms sl-finlak-7-0.sprintlink.net [160.81.228.18]
7 220 ms 199 ms 219 ms 208.31.47.5
8 229 ms 199 ms 209 ms net.gurus.com [208.31.42.79]

Trace complete.

The listing shows the route the packets took from your computer to the specified host (sometimes Tracert reports a different host name from the one you specified, which means the host has more than one name). For each hop (stage of the route), Tracert sends out three packets and reports the time each packet took to reach that far. It also reports the name and numeric IP address of the host.

Table 22-3 shows the options you can use with the Tracert program (type them before the host name or address). A few other arcane options are not listed here.

Option Description
-d Specifies not to resolve addresses to host names, so the resulting list of hosts consists only of numeric IP addresses
-h n Specifies a maximum number of n hops to trace before giving up
-w n Specifies that the program wait n milliseconds for each reply before giving up
Table 3: Options for the Tracert Program

Displaying Internet Connections Using Netstat

Netstat is a network diagnostic program you can use for any TCP/IP connection--Internet connections or LANs. You can run Netstat to see which computers your computer is connected to over the Internet--not the ISP to which you dial in, but other Internet hosts to or from which you are transferring information.

To run Netstat, open a Command Prompt window by choosing Start | All Programs | Accessories | Command Prompt. Then type the following:

netstat

When you press ENTER, you see a listing of the Internet connections currently running, like this:

Active Connections

Proto Local Address Foreign Address State
TCP inspiron7000:4683 ftp1.us.dell.com:ftp ESTABLISHED
TCP inspiron7000:4684 wx.iecc.com:pop3 SYN_SENT
TCP inspiron7000:4687 pop.vip.sc5.yahoo.com:pop3 TIME_WAIT
TCP inspiron7000:4689 smtp.america.net:smtp ESTABLISHED
TCP inspiron7000:4690 books.iecc.com:http SYN_SENT
TCP inspiron7000:4431 msgr-ns9.msgr.hotmail.com:1863 ESTABLISHED

This listing shows that the computer is connected to other computers for receiving Web pages (the 80 or http at the end of the address signifies the port commonly used for Web page retrieval), for file transfer (ftp), for sending mail (smtp), for receiving mail (pop3), and for instant messaging.

tip To see a listing of all the command-line options for the Netstat program, type netstat /h at the DOS prompt.

PreviousChapterContentsGlossaryNext