Introduction to Ethernet

Before you start

Objectives: learn what is Ethernet and how it is designed, which media access method it is using, what are the differences when using a Hub or a Switch, what are collisions and jam signals, when is a back off algorithm used and how does a Frame look like.

Prerequisites: you should be aware of OSI model layers and different types of network topologies.

Key terms: device, topology, switch, ethernet, host, frame, message, logical, transmission, collision, access, data, media, physical, wire


History

In the early days of networking there were other standards besides Ethernet. Ethernet was never really what we would call the best standard, but it worked. Ethernet was easy to administer and it was cheap, it could be adapted and improved. Some other standards were faster at that time, but eventually the speed of Ethernet was improved, and with improvements has become the de facto standard for local area networks.

Architecture

The first things we need to understand is the topology that Ethernet uses. When talking about physical topology, Ethernet can use a bus topology or a star topology. In early days of networking Ethernet used only the bus topology, but that was eventually replaced with the star topology. Today we won’t see Ethernet with the bus topology anymore. When talking about logical topology there are several different situations. If we’re using a physical bus we have to have a logical bus topology. On a logical bus topology the signal goes to all computers on the bus. If we’re using a physical star topology there’s two logical topologies that might be used. One is the logical bus topology and other is a logical star topology. Logical bus topology means that we are using a Hub. Signal coming into the hub is regenerated back to all other devices on the network. If we are using a switch for connecting our network devices, then we are using a logical star topology. On a logical star topology a signal sent to one device is forwarded only to one particular device.

Medium and Devices

Ethernet supports copper (Unshielded Twisted Pair or UTP cables), and fiber optic. UTP with RJ-45 connectors is the most common transmission medium used for Ethernet. Fiber optic is most commonly used in high-speed applications such as servers or streaming media. Coaxial cables were used for older Ethernet implementations (often called thinnet or thicknet networks). Now, there’s a whole list of specifications that describe what kind of copper and what kind of fiber we can use, but for right now it is enough to remember that we can use either copper UTP or Fiber Optic cable.

Devices used on Ethernet networks include NICs with transceivers, Hubs, Switches and Routers.

Media Access

The media access is a set of rules that determine how devices identify when and if they can transmit. Ethernet uses a contention-based media access method called Carrier Sense Multiple Access Collision Detection (CSMA/CD). In our example we will look at each part of this media access method so that we can understand how devices can determine when it’s okay to transmit. We’ll work on a bus topology example.

Bus Topology

Image 215.1 – Bus Topology Example

In this case we’ll have Host A, B, C and D. Let’s say that host B has to send a message to computer C. The first thing host B will do is listen to the transmission media (carrier sense) to see if there’s already something being transmitted. Because all devices have equal access (multiple access) to the transmission media, a device with data to send first listens to the transmission medium to determine if it is free (carrier sense). Let’s say that nothing is going on on the wire, so host B sends its message to computer C.

Message Sent

Image 215.2 – Message Sent

Now, because we are using a physical bus topology, remember that when the message is sent to one host, it is also propagated to all other hosts on the network segment. That means that host A and D will also receive the message.

All Hosts Receive Message

Image 215.3 – Message Received by All Hosts

In this case computer C looks at the message, checks the destination address and sees that it is addressed for it, so it takes that message and processes it. Computers A and D receive the message, but they realize that it’s not addressed to them so they don’t do anything with it. But none the less, the message goes to all devices that are within that physical bus topology.

Let’s say that at the same time computer A has a message to send to computer C as well. It will go through the same process. First of all, it listens to the wire to find out whether the transmission medium is busy. Let’s say that in this case computer B and C are in the middle of a transmission. As we know that transmission will also come to computer A, and as it listens to the wire it can tell that there’s a signal on the wire. In that case host A will wait a random period of time and then it will try again. As host A waits, computer B finishes its transmission and the transmission medium becomes idle. When host A realizes that medium is free, it will transmit its message to computer C.

Collision

Let’s say that host A and host B have a message to send to host C at the same time. They’d go through the same process. They listen to the transmission medium, they determine that it’s free and they decide to transmit. In this case, both computers transmitted their messages at the same time. When this happens we get what’s called a collision. A collision is where two messages are sent at the same time from different hosts and they physically collide on the network. We actually get two different signals that overlap, so any host which receives that signal will see just a bunch of garbage. Because of that devices on the network must be able to detect collisions. Since this is a bus topology, all devices will sense that the collision has happened. The first thing that happens when a collision occurs is that the devices that were transmitting will transmit what’s called a jam signal. Jam signal is nothing more than a bunch of garbage. After the jam signal, the devices do what they call a back-off which means that they will wait for random amount of time before they start the process all over again. Now this back-off is a random amount of time. So ideally, if computer A and computer B are both jamming at the same time then one of them will back off a longer period than the other.

CSMA/CD media access method works on a bus topology. Either a physical bus with a logical bus, or a physical star with a logical bus (by using Hub). As the number of devices on the network increases, so does the number of collisions. With a very large number of devices the actual transmission speed and bandwidth of our network can slow way down. So the answer to this is to actually avoid collision detection, and this can be done with a Switch.

Switch

One of the unique things about a Switch is that it offers a guaranteed transmission path between any two devices. Let’s say that we use our hosts A, B, C, and D and connected them through a switch. When one device needs to send a message using a Switch, instead of the message being sent out to all the devices, with the switch the message goes directly to the destination device. In our case host B sends a message directly to the host C.

Switch

Image 215.4 – Connected Using Switch

Another unique thing about a switch is that it can typically simultaneously switch messages at the same time. So while we have a dedicated path between host B and host C, host A and host D can also establish a dedicated path for communications.

Crossing of Wires

Now, remember that when talking about twisted pair cables, we actually have a transmit wire and areceive wire. That means that the switch will use the signal on the transmit wire from one device, and cross it to the receive wire of the destination device. The destination device can also send data back trough its transmit wire, which will be crossed over inside the switch to the receive wire. This is important because in this kind of a configuration, with a switch in the middle and with the transmit and receive wires being swapped, collisions are completely eliminated. That way communication path is used only between two devices and it can never be used between any other two devices. So without collisions there’s no reason to have carrier sense. Devices, as soon as they are ready to transmit simply transmit, because they know there’s no reason to be detecting collisions with the collision detection mechanism. So when we’re using a switch we actually turn collision detection off, which also disables the carrier sense. When we’re using a switch, effectively the media access method goes away. It’s still there in the specifications, but the devices no longer need to worry about detecting and recovering from collisions. This means that as we add devices to this network with a switch, the number of collisions still stays at zero. So by using a switch we can have much larger subnet segments with more devices, and no collisions. When we use a switch, and when only single devices are connected to each switch port, we can use what is called full duplex communication. With full duplex the possibility of collisions is eliminated so devices can simply begin to transmit when they are ready. In some cases when full duplex is used we can even double our bandwidth.

Hub

When we use a Hub we’re actually using a logical bus topology. This means that all devices connected to the hub share the same transmission media segment. In this case we have what is called half duplex communication. With half duplex, devices share the medium and therefore, need to go through the carrier sense and collision detection processes.

Frame

A frame is a unit of data that is ready to be sent on the network medium. If we look at thepacket (network layer) that’s being transmitted from one device, we know that it will have the IP address of the destination device, IP address of the source device, as well as the data. Ethernet takes this packet and puts it in a Frame. The first part of the Frame is a series of zeros and ones that alternate. This is called the Preamble. The preamble denotes the start of a frame and everything that comes next is a Frame. This preamble ends in a 11 (one one). The 11 signals the end of the preamble and the start of the frame. Next in the frame we will have the MAC address of the destination device, followed by the MAC address of the source device. Ethernet devices are identified using the MAC address which is burned into the network interface card. Following the MAC addresses, we have the data. The data in the frame is really the packet that it received from the Network layer above it. So the data on the Frame level includes the IP addresses, as well as data that came from upper layers in the OSI model. The data portion of an Ethernet packet is actually a fixed size length and it can bebetween 64 and 1518 bytes. If the actual data is smaller than 64 bytes, it will be populated with a series of zeros and ones so that the minimum of 64 bytes is met. We call that added data a Padding. One reason this is important is because one way that devices detect a collision is that they detect a frame that is smaller than the minimum size. The last part of the frame is called a Cyclic Redundancy Check, or CRC. The CRC is a mathematical computation that’s performed on the frame information for the purpose of error detection. It is used to check if the Frame has been corrupted during transmission. It is also often referred to as Frame Check Sequence.

Frame

Image 215.5 – Frame

Remember

Topology used with Ethernet can be a physical bus with a logical bus, which is not seen any longer. It could be a physical star with a logical bus, and that’s when we’re using a hub. It can also be a physical star with a logical star topology, and that’s when we use a Switch. The media access method is carrier sense multiple access collision detection, or CSMA/CD. When we’re using a switch there are no collisions, so we can have full duplex communications. The Ethernet frame contains the MAC address of the destination and source devices, along with the data received from upper OSI layers, and the CRC, which is a mathematical computation that helps detect errors.