Physical and Logical Addresses
If you go to visit your next-door neighbor, you simply go out your door and walk down the street. You don't need to know your neighbor's street address because you know physically where the house is.
If you plan to drive to visit your uncle who has just moved into a new house across the country, though, you're going to need to know the state, city, street, and house number. You'll use the city and state information to decide what highways to travel, and you'll use the city and street address to hone in on the right house. After you've seen the house, you'll be able to drive around in the local neighborhood without referring back to the house address.
Networks operate in exactly the same way. The physical address of a computer on a LAN, fixed in the network interface card by the manufacturer, works like physical knowledge of where a house is. Messages sent on the same LAN segment, corresponding to a house's neighborhood, can get to a specific physical LAN address. If you want to send a message across the country or around the world, though, you need the equivalent of a country, state, city, and street address. In network terms, the address that you need is called a logical address. The key difference between physical addresses and logical addresses is that, although physical addresses are scattered randomly around the world, logical addresses follow a pattern determined by network administrators and stored in routing tables. Routing tables (used by routers) are the equivalent of street maps, guiding messages to their destination.
Current versions of TCP/IP represent logical network addresses to humans as a sequence of four decimal numbers, each ranging from 0 to 255. The four numbers are typically written with dots separating them; a typical TCP/IP address is 22.214.171.124.
Figure 1 shows how messages get from your computer to anywhere in the world using routers and the notion of a default route. Whenever your computer needs to send a TCP/IP message to a computer not part of your LAN, it instead sends it to the computer defined as the default TCP/IP route. That computer (or router) has the responsibility of forwarding the message on a communications link leading to the destination, using routing tables to identify the correct link. In practice, the message goes out by default from your LAN through a computer or router with a link to your Internet service provider (ISP). A router at the ISP looks in the Internet core routing tables, selects the ISPs Internet link most directly connected to the end destination of the message, and sends the message down that link. The forwarding process continues until the message finally arrives on the LAN hosting the destination computer.
Worldwide routing using default routes and routing tables
Take a look at how to explore the way the Internet sends messages through intermediate hops to get from one place to another halfway around the world. A standard TCP/IP utility called traceroute (tracert, under Windows) lets you discover the hops that a message takes in passing from the originating computer to the destination.
Assuming that you have a computer hooked to the Internet, open a Web browser and go to the address http://net.yahoo.com/cgi-bin/trace.sh, which is a service maintained by Yahoo!.
Enter the destination TCP/IP address (we'll use 126.96.36.199).
Click the Send button and wait for the results. The following listing shows the results that we received:
Following down from the top of the listing, you see that the first four lines were within Yahoo! itself. The times listed are how long a round trip from the originating computer to the listed point and back took; in lines 14, that was about 13 milliseconds.
At line 6, the messages have left Yahoo! proper and gone to the Exodus network (Exodus is a large Web-hosting company).
At line 11 the round-trip times have jumped to more than 37 milliseconds, suggesting that a long haul link is being used.
The messages eventually reach the InformIT site hosted at datareturn.net.
FROM net.yahoo.com TO 188.8.131.52. traceroute to 184.108.40.206 (220.127.116.11), 30 hops max, 40 byte packets 1 e-1.4700m-1.3400.yahoo.com (18.104.22.168) 1.556 ms 0.900 ms 1.148 ms 2 gw3-rtr (22.214.171.124) 0.663 ms 0.848 ms 0.640 ms 3 hssi1-0.gw4.sce.yahoo.com (126.96.36.199) 3.093 ms 2.898 ms 2.844 ms 4 peer-geo11.sce.yahoo.com (188.8.131.52) 2.797 ms 1.853 ms 1.672 ms 5 184.108.40.206 (220.127.116.11) 2.629 ms 2.595 ms 3.004 ms 6 dcr03-g7-0.sntc01.exodus.net (18.104.22.168) 1.907 ms 2.610 ms 1.851 ms 7 ibr02-g1-0.sntc01.exodus.net (22.214.171.124) 2.159 ms 2.790 ms 2.693 ms 8 sprint-sntc01.exodus.net (126.96.36.199) 4.199 ms 4.915 ms 3.961 ms 9 sl-bb21-sj-13-0.sprintlink.net (188.8.131.52) 5.762 ms 3.925 ms 4.327 ms 10 sl-bb21-ana-10-0.sprintlink.net (184.108.40.206) 14.805 ms 13.905 ms 13.461 ms 11 sl-bb20-fw-11-0.sprintlink.net (220.127.116.11) 37.252 ms 36.721 ms 37.167 ms 12 sl-exodus-8-0-0.sprintlink.net (18.104.22.168) 38.332 ms 38.252 ms 37.585 ms 13 sl-internapchi-14-0-0.sprintlink.net (22.214.171.124) 40.754 ms 41.057 ms 42.765 ms 14 border6.ge3-0-bbnet2.dal.pnap.net (126.96.36.199) 41.635 ms 40.038 ms 42.146 ms 15 datartn-5.border6.dal.pnap.net (188.8.131.52) 42.739 ms 41.483 ms 42.074 ms 16 port-64-1949700-dal16509b-drtn.devices.datareturn.net (184.108.40.206) 42.494 ms 42.603 ms 86.107 ms 17 port-64-1953828-zzt0prespect.devices.datareturn.net (220.127.116.11) 42.046 ms 41.785 ms 87.598 ms
After a message gets to the destination computer, the operating system has to deliver it to the proper software running on that computer, the software implementing the service requested by the sender. Network protocols implement the idea of ports, which are identifiers for different message receivers running on a machine. Just as a surface mailing address includes the person to whom the mail is sent along with the street address, a complete network address includes the port number along with the TCP/IP address. The World Wide Web operates using port 80, for example, so connecting to the InformIT Web server on the computer www.informit.com requires the complete address 64.29.208:80. The software that you use almost always takes care of providing the port numbers, but it's important to understand that network addresses are a three-step process: Logical addresses let the message travel to the destination LAN; physical addresses (derived from the logical address) get the message onto the destination computer; and port addresses get the message to the right software.