Ethernet is a good choice for the physical data-transport mechanism in local area networks (LANs) for the following reasons:
Ethernet is proven technology (it has been in use since the early 1980s).
Ethernet provides good data-transfer rates: typically 10 million bits per second (10 Mbps), although there is now 100-Mbps Ethernet and Gigabit Ethernet (1,000 Mbps).
Ethernet runs on many different media from copper to fiber to wireless media.
Ethernet hardware is relatively low-cost (PC Ethernet cards cost about $20).
Typically, Linux effectively supports affordable hardware, and Ethernet is no exception. This appendix describes the physical setup of an Ethernet LAN and summarizes the Ethernet cards Linux supports.
Ethernet is a standard way to move packets of data between two or more computers connected to a single cable. (Larger networks are constructed by connecting multiple Ethernet segments with gateways.) Because a single wire is used, a protocol has to be used for sending and receiving data, because only one data packet can exist on the cable at any time. An Ethernet LAN uses a data-transmission protocol known as Carrier Sense Multiple Access/Collision Detection (CSMA/CD) to ensure that multiple computers can share the single transmission cable. Ethernet controllers embedded in the computers follow the CSMA/CD protocol to transmit and receive Ethernet packets.
The idea behind the CSMA/CD protocol is similar to the way in which you have a conversation at a party. You listen for a pause (carrier sense) and talk when no one else is speaking. If you and another person begin talking at the same time, both of you realize the problem (collision detection) and pause for a moment, then one of you starts speaking again. As you know from experience, everything works out.
In an Ethernet LAN, each Ethernet controller checks the cable for signals-that's the carrier-sense part. If the signal level is low, a controller sends its packets on the cable; the packet contains information about the sender and the intended recipient. All Ethernet controllers on the LAN listen to the signal, and the recipient receives the packet. If two controllers send out a packet simultaneously, the signal level in the cable rises above a threshold, and the controllers know a collision has occurred (two packets have been sent out at the same time). Both controllers wait for a random amount of time before sending their packets again.
Ethernet was invented in the early 1970s at the Xerox Palo Alto Research Center (PARC) by Robert M. Metcalfe. In the 1980s, Ethernet was standardized by the cooperative effort of three companies: Digital Equipment Corporation (DEC), Intel, and Xerox. Using the first initials of the company names, that Ethernet standard became known as the DIX standard. Later, the DIX standard was included in the 802-series standards developed by the Institute of Electrical and Electronics Engineers (IEEE). The final Ethernet specification is formally known as IEEE 802.3 CSMA/CD, but people continue to call it Ethernet.
Ethernet sends data in packets (also known as frames) with a standard format that consists of the following sequence of components:
6-byte destination address
6-byte source address
2-byte length of the data field
46- to 1,500-byte data field
4-byte frame-check sequence (used for error checking)
You don't need to know much about the innards of Ethernet packets except to note the 6-byte source and destination addresses. Each Ethernet controller has a unique 6-byte (48-bit) address. At the physical level, packets must be addressed with these 6-byte addresses.
In an Ethernet LAN, two Ethernet controllers can communicate only if they know each other's 6-byte physical Ethernet address. You may wonder how IP addresses are mapped to physical addresses. This problem is solved by the Address Resolution Protocol (ARP), which specifies how to obtain the physical address that corresponds to an IP address. Essentially, when a packet has to be sent to an IP address, the TCP/IP protocol uses ARP to find the physical address of the destination.
When the packet is meant for an IP address outside your network, that packet is sent to the gateway that has a physical presence on your network. Therefore, that gateway can respond to an ARP request for a physical address.
The original Ethernet standard used a thick coaxial cable, nearly half an inch in diameter. That wiring is called thickwire or thick Ethernet, although the IEEE 802.3 standard calls it 10Base5. That designation means several things: The data-transmission rate is 10 megabits per second (10 Mbps); the transmission is baseband (which simply means that the cable's signal-carrying capacity is devoted to transmitting Ethernet packets only); and the total length of the cable can be no more than 500 meters. Thickwire was expensive, and the cable was rather unwieldy.
Nowadays, two other forms of Ethernet cabling are more popular. The first alternative to thick Ethernet cable is thinwire, or 10Base2, which uses a thin, flexible coaxial cable. A thinwire Ethernet segment can be, at most, 185 meters long. The other, more recent, alternative is Ethernet over unshielded twisted-pair cable (UTP), known as 10BaseT.
To set up a 10BaseT Ethernet, you need an Ethernet hub-a hardware box with RJ-45 jacks. You build the network by running twisted-pair wires (usually, Category 5, or Cat5, cables) from each PC's Ethernet card to this hub. You can get a 4-port 10BaseT hub for about $50 U.S. Figure D-1 shows a typical small 10BaseT Ethernet LAN that you might set up at a small office or your home.