Preparing for a Trip: How to Make Your Car (Data) Street Legal


Preparing for a Trip: How to Make Your Car (Data) "Street Legal"

Before you can drive a car onto a DOT-built, government-owned road, you need to have a registered street-legal car. Street legal simply means that the car meets the government's standards for what kinds of cars are allowed on the road. For instance, you can't use a car that goes 230 miles per hour around a racetrack on public roads. Likewise, you can't drive around in a truck with a 40-foot tall trailer behind it because you would almost certainly hit road signs, power lines, and bridges as you tried to pass under them.

Similarly, LANs require that the data sent across the wires in a LAN conform to some rules as well, which you can think of as making the data street legal, or LAN legal. Like most rules in the networking world, one or more standards define the rules. This book will focus on the world's most popular LAN standardEthernet.

Ethernet consists of a set of standards and protocols for LAN communication, as defined by the IEEE. For instance, Ethernet standards define how a network interface card (NIC) should encode binary 0s and 1s on a wire by varying the voltage, as discussed in Chapter 4, "How to Build a Local (Network) Roadway." Ethernet standards specify many more details as well, some of which you'll see in this chapter.

LAN-Legal Data: An Ethernet Frame

Before a NIC can send data over a LAN, all the details covered in Chapter 4 must be complete. The LAN must have the proper cabling installed. The NICs must know the electrical encoding scheme used to signal a 0 or a 1. At that point, the computer could ask the NIC to send data, and electrically, the bits could be sent over the LAN.

However, computers can't simply send end user data over the LAN. Before a PC can send the end user data over a LAN, the PC must encapsulate the end user data inside an Ethernet frame. Encapsulation refers to the process of taking the data and putting it inside the Ethernet header and trailer.

Encapsulation is similar in concept to putting a letter in an envelope before sending the letter through the postal service. The postal service requires that letters meet certain requirements, and the envelope must have a properly formatted address. The postal service even defines what a properly formatted address looks like. Similarly, Ethernet standards define the headers and trailers so that a NIC can correctly encapsulate the data.

The resulting bunch of bits created by the encapsulation process, including the Ethernet header and trailer, is called an Ethernet frame. Figure 5-1 shows an Ethernet frame, created by encapsulating the data in a header and trailer, for frames sent to Larry from Bob.

Figure 5-1. Ethernet Frame Sent from Bob to Larry


The laws created by government typically do not allow you to ride your bicycle on a superhighway. Likewise, Ethernet does not allow you to send the end user data over the LAN. You must put the data in the proper vehiclenamely, an Ethernet frame. After you put the data into a frame, you can send it across the LAN.

The Ethernet header and trailer are simply additional bytes of data that are used by the computers, NICs, and networking devices to make the Ethernet work smoothly. For instance, the first 8 bytes in an Ethernet header are called the preamble. The preamble contains alternating 1s and 0s so that the NICs receiving the data know that a new frame is being sent across the LAN.

The word frame happens to be a particularly important term. Back in Chapter 3, "Building a Network: It All Starts with a Plan," you read about networking standards and how the terms from the OSI model describe networking standards and protocols today. The term "frame" refers to the headers and trailers defined by any Layer 2 standard, as well as the data inside the frame. The term "Ethernet frame" refers to a frame created for use on an Ethernet, conforming to Ethernet protocol specifications.

As you will read in later chapters, protocols that match other OSI layers also have headers, and the networking world uses names besides "frame" to refer to those headers and data.

Throughout this chapter, I will cover more details about what is inside the Ethernet frame header and trailer. To move forward, just think of an Ethernet frame as the car that can actually be sent over the LAN, with the end user data being the equivalent of whomever or whatever is in the car.

Driving Where I Want and When I Want Is Pretty Cool

In real life, it's obvious why you can't just drive anywhere you want, any time you wantyou'll have a wreck. Or worse yet, someone else's blatant disregard for the law might cause you to be in a wreck!

Interesting, when you use Ethernet hubs, even if you obey the rules, wrecks (called collisions in Ethernet lingo) occur. A collision occurs when two or more frames are sent over a single twisted pair at the same point in time. The result is that none of the frames is intelligible. However, it's better to avoid the collisions if possible. So, Ethernet defines some rules of the roadrules that say when you can use the LAN and when you can'tand what to do if you have a wreck.

Why Wrecks (Collisions) Happen on Ethernet

Even if you obey all the laws of the land, you can still have a wreck. Likewise, even when all devices follow Ethernet rules, wrecks or collisions can happen. To understand why, focus on these two key facts:

  • When two or more electrical signals travel over the same pair, both electrical signals are distorted and become a single signal. The receiving device cannot interpret the signal as 0s and 1s.

  • A hub repeats received electrical signals out all other physical ports on the hub, except the one in which the signal was received, even if other electrical signals are already being repeated.

Knowing those two facts, consider what happens in Figure 5-2, when both Bob and Archie send an Ethernet frame to Larry at the same time.

Figure 5-2. Collision Between Bob's and Archie's Frames


The hub blindly repeats each of the frames sent by Bob and Archie out all other ports, including the one connected to Larry. Although both Bob and Archie wanted to send data to Larry, Larry can't understand either frame because the hub is trying to send both electrical signals over the cable to Larry at the same time.

How to Avoid Most Wrecks

Ethernet standards define a basic algorithm that helps reduce collisions, as well as defining what to do when collisions occur. The algorithm is called the carrier sense multiple access collision detect (CSMA/CD) algorithm. Boy, there's a fun trivia question for your next party, huh?

The name CSMA/CD is not as important as the ideas behind it. First, the algorithm starts with this simple concept:

Listen before sending, and wait until you are not receiving a frame before you try to send your frame.

The concept is pretty simple. Imagine that you are connected to a hub, and you are currently receiving a frame. What would happen if you sent a frame at that time? Well, you would cause a collision. So why not just wait a moment? Well, that's exactly what the algorithm calls for. Figure 5-3 shows the basic logic, with Bob waiting on Larry to finish sending his frame before sending his own frame.

Figure 5-3. Collision Avoidance by Listening Before Sending


What to Do When a Wreck Happens

Even when you're using CSMA/CD, collisions can still occur. Why? Well, consider this same example, but unbeknownst to Bob, Archie was also waiting for Larry to finish sending his frame before sending a frame. So, Larry's frame has finished, and the LAN is silent. Figure 5-4 shows both Bob's and Archie's logic.

Figure 5-4. An Imminent and Unavoidable Collision


Ethernet standards state that when no one is sending anything, the LAN is silentin other words, there is no electricity flowing over the wires. Both Bob and Archie realize that Larry is finished when they stop receiving an electrical signal. So, they both try to send their frames at roughly the same time, because they both realize at roughly the same time that the LAN is silent. And as was shown in Figure 5-2, when Bob and Archie both send at the same time, a collision occurs.

The hub will repeat both frames out to Larry, so Larry will know about the collision. However, the hub won't forward Bob's frame back to Bob or Archie's frame back to Archie, so both Bob and Archie will only be receiving one frame. With the logic discussed so far, Bob and Archie won't know there's a collision! To make sure Bob and Archie know when a collision happens, when a NIC transmits a frame, the NIC also connects what it sends to its own receive pair, right on the card. This bit of hardware is called a loopback circuit, and it simply means that the NIC receives its own frame as well.

By using loopback, when Bob sends a frame, he receives the same electrical signal that he sends. When Archie sends a frame at the same time, the hub forwards Archie's frame to Boband now Bob knows there is a collision.

So, what do you do when the collision occurs? CSMA/CD suggests the following:

  • The senders of the collided frames send a jamming signal to make sure everyone knows a collision has occurred.

  • The senders of the collided frames independently pick a random timer value.

  • Each sender waits until his own random timer has expired and then tries to send his frames again.

The jamming signal is an electrical signal that Ethernet standards specify to let everyone know "Hey, a collision has occurred, so let's clean it up." Next, by having both Bob and Archie wait before trying to send again, but with each of them choosing his own random number for the timer, Bob and Archie should not try to send again at the same time.

So far in this chapter, you have learned that computers send Ethernet frameswhich include the Ethernet header, trailer, and end user dataover an Ethernet LAN. You have also learned how CSMA/CD regulates when the LAN is used, much like traffic laws dictate when a road is used. So, enough of this discussion of how to get data across the LAN. Now, let's think about what happens when the frame actually gets to the destination.




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