Stopping at the Destination: What Happens When Someone Comes to See You


When using an Ethernet with a hub, everyone gets a copy of every framethat's just a side effect of the fact that the hub repeats incoming frames out all other ports on the hub. You might recall that a hub does this to allow each computer's NIC to have a single cable connecting it to the hub, while still being able to communicate with all other devices on the LAN.

In the second half of this chapter, I'll explain Ethernet from the perspective of the computer receiving the frame, and along the way, I'll talk a little more about what's inside the header and trailer of an Ethernet frame.

Are They Coming to Our House or the Neighbor's House?

In an Ethernet LAN with a hub, a computer receives a lot of Ethernet frames, but only some of them contain data that is meant for that computer. For instance, Larry might need to send data to Bob, but because of the hub's behavior, both Archie and Bob get a copy of the frame.

Now, consider the case when Larry wants to send data to Bob. Both Bob and Archie receive the frame, but Archie should simply ignore the frame, and Bob should examine the data and process it. But how do Archie and Bob know? Well, before Larry sends the frame, he puts Bob's Ethernet address into a field in the Ethernet header called the destination address field. By putting Bob's Ethernet address in the destination address field of the header, Bob can use the logic shown in Figure 5-5.

Figure 5-5. How Bob Decides the Frame Was Sent to Him


The logic is simple. Each NIC has a unique Ethernet address, which is put onto the NIC by the NIC manufacturer. The sender just puts the correct Ethernet address in the header, so when another NIC receives the frame, it can decide whether to process the frame or ignore it.

The Ethernet header includes both a source address field and a destination address field. For instance, Larry included his own Ethernet address in the source address field of the frame in Figure 5-5. Of course, Larry put Bob's Ethernet address into the destination address field.

Ethernet standards specify that addresses be 48 bits long (6 bytes). You can write down Ethernet addresses as binary numbers, but writing down 48 binary 0s and 1s can be a pain in the neck. The creators of Ethernet could have decided to record Ethernet addresses as decimal numbers, but as it turns out, converting between decimal and binary isn't that easy to do. However, there's a better way to represent binary numbers by using fewer digits: hexadecimal (hex). Hex is an alternative numbering system, similar to decimal and binary. With decimal, you have 10 numerals (0, 1, 2, and so on, through 9). With hexadecimal, the numerals are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. Essentially, A represents decimal 10, B represents decimal 11, and so on, with F representing decimal 15.

Hex can be used easily to represent binary numbers. In fact, a single hex digit can represent four binary digits. For instance, Table 5-1 shows each combination of a 4-digit binary number and its hex equivalent.

Table 5-1. Binary Numbers and Their Hex Equivalents

Four-Digit Binary Number

Hex Number

0000

0

0001

1

0010

2

0011

3

0100

4

0101

5

0110

6

0111

7

1000

8

1001

9

1010

A

1011

B

1100

C

1101

D

1110

E

1111

F


Although there's a lot more to hex, you don't really have to understand how hex numbering works to appreciate why it is used for Ethernet addresses. Instead of writing down Ethernet addresses as 48-digit binary numbers, you can write them as 12-digit hex numbers because each hex digit represents 4 binary digits. For instance, if the first 4 binary digits of an Ethernet address were 0010, then the first hex digit would be a 2. If the next 4 binary digits were 1010, the next hex digit would be A, and so on.

When you see a hex number, just know that each hex digit represents four binary digits. For example, when you're using gear from Cisco Systems, the device will list Ethernet addresses in the following format:

15CD.3412.5BDA

0200.2222.2222

Note that the numbers have 12 hex digits, so they each represent a 48-bit binary number.

Who Is It, Honey?

If someone drives up your street and stops in the driveway, you're probably curious about whom it is. Likewise, when someone sends you data over a LAN, you might want to know who sent the data.

With Ethernet, the Ethernet header includes a source address field in addition to the destination address field. The source address identifies the Ethernet address of the NIC that sent the frame. Figure 5-6 shows an example, listing the addresses for all three PC's NICs, as well as the basic logic used.

Figure 5-6. Ethernet Source and Destination Addresses


Before sending a frame, Larry adds the Ethernet header and trailer to the data. He puts his own Ethernet address in the source address field of the header and the destination's Ethernet address (Bob again in this case) in the destination address field. After Larry assembles the frame, he can use CSMA/CD logic to determine when he can send the frame.

Also note that Figure 5-6 shows the typical style in which to show a frame, with the header on the left and the trailer on the right. When sending the frame, a NIC sends the bits starting with the header and ending with the trailer, regardless of how it happens to be drawn in a figure.

I Don't Understand a Thing You're Saying

So, someone drives up to your house and parks in your driveway. (Why do we park in driveways, and drive on parkways, anyway?) The person comes up to the door, rings the bell, and you answer it. The stranger smiles and confidently says, "Jwl! Sfk oewp fkas lal. Wwjj. KK45i!!!" Of course, this makes no sense to you, so you ask the visitor to repeat himself, after which he says, "Hi, I'm Archie. If you're Bob, you just won our grand prize of $1 billion." "Oh my! Yes, I am Bob. Please come in."

With Ethernet, a similar process occurs for recognizing that a received frame makes no sense. When the receiving NIC interprets the incoming electrical signal as meaning some string of binary 0s and 1s, the receiver might misinterpret the meaning. That can happen because the electrical signal has changed as it passed over the wire, affected by resistance in the wire, EMI, collisions, and other factors. Simply put, the sender might send a 1 and the receiver might think it was a 0, or vice versa.

To recognize the error, Ethernet uses a field in the Ethernet trailer called the frame check sequence (FCS) field. The FCS field holds a 4-byte number that allows the receiver to notice that the frame that it received actually had bit errors in it.

To check for errors, the receiver must rely on the value of the FCS field as set by the sender. The sender runs a mathematical formula, with the input being the contents of the Ethernet frame to be sent, up to the Ethernet trailer. The sender places the results of the formula into the trailer FCS field. Upon receipt of the frame, the receiver applies the same formula to the same part of the Ethernet frame (everything up to the trailer). If the result of the formula as calculated by the receiving NIC is the same as the value in the transmitted FCS, then no errors occurred. If the values do not match, then an error has occurred. Figure 5-7 outlines the process.

Figure 5-7. How the FCS Field Is Used


The details of how FCS fields work might be interesting, but the reaction of the receiver of the frame is more important. Ethernet standards specify that the receiver should simply discard frames that have errors. End of story. The receiver does not request that the frame be re-sent, and the sender does not know that the frame was in error. This simple process is called error detection.

A related concept, error recovery, refers to the process whereby the receiver requests that the sender retransmit the frames that did not pass the FCS check. For example, the Transmission Control Protocol (TCP), as explained in Chapter 3, performs error recovery, but Ethernet does not.

In a way, Ethernet and TCP complement each other. Ethernet defines how to deliver data across the LAN, plus how to perform error detection, with an end result of discarding errored frames. If error recovery is needed, TCP will recognize that some of the data is missing and perform error recovery.

Now you know the basics of how Ethernet works, but you haven't heard much about the standards behind all these concepts. The next section covers some of these standards.




Computer Networking first-step
Computer Networking First-Step
ISBN: 1587201011
EAN: 2147483647
Year: 2004
Pages: 173
Authors: Wendell Odom

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net