Hubs and Switches in Star Topologies
In this step, we will look at the role of a hub or a switch in a star network.
You will also learn more about how addresses and other fields are added to data that is sent, about the idea of encapsulation, and about how to build an Ethernet frame.
The Ethernet Hub
In the previous step you learned that bus topology was phased out in favour of star topology, which has a central connection point. Initially this was a hub. Each device connected to it using a dedicated UTP cable that linked into one of the hub’s ports.
On its way to the hub, a signal will have picked up some noise. As long as the noise does not cause the signal to cross a threshold level, the hub can recreate each bit, effectively removing the noise. This process is called regeneration. If there is too much noise, errors occur during regeneration: a binary 1 may be regenerated as a binary 0 or vice versa.
The hub has no understanding of what the signals mean. It just sees them as electrical signals to be regenerated and sent to all other connected devices.
Unlike the wireless Aloha network, devices in a wired network can detect whether another device is transmitting data.
Before sending data, a device first determines whether anyone else is transmitting by checking for a carrier signal on the wire. If the wire is clear, the device starts to send its data. If the device detects another transmission, it waits until the wire is clear before trying again. However, another device may have also sensed the wire was clear and also started to transmit. This would cause a collision, so all the data would be corrupted. To combat this, each device monitors the wire while it is sending its data. If a collision is detected, all devices stop transmitting and wait a random time before retrying. This system of Carrier Sense, where there is Multiple Access to the cable and a Collision Detection system, is known as CSMA/CD. This allows multiple devices to access the same connecting media.
To stop any one device hogging the wire by sending a large amount of data as one block, there is a rule that a device cannot send more that 1500 bytes of data in one go. Data larger than this must be split into smaller chunks that are sent separately — this is called fragmentation. Fragmentation gives the other devices a chance to slot in their transmissions in between, thus ensuring fair access to all devices.
Ethernet protocol, MAC addresses and frames
A set of conventions and rules that govern the communications between devices is called a protocol. The 1500 byte limit, the CSMA/CD rules, and the need to send destination and recipient addresses are all part of the Ethernet protocol.
The structure of the data sent via the physical media is called a frame. An Ethernet frame has five different sections, called fields, for the pieces of information necessary for transmission.
One field is for the data that is being transmitted.
Two fields contain the destination and source addresses, which are called MAC addresses (for ‘Media Access Control’). They are 48 bits long, and are usually referred to in hexadecimal notation, e.g. cd:f1:24:e4:89:a1.
The Type field is used to indicate what type of data the frame is carrying. You will learn more about this in a later step.
The Frame Check Sequence (FCS) is used to detect whether errors have occurred during transmission.
The actual process used to generate the FCS is called Cyclic Redundancy Check (CRC) and is a complex mathematical process beyond the scope of this course. However, it is similar in concept to a checksum: the sender adds the data values together as it sends, and appends this sum to the end of the data in the FCS. The receiver adds the data values together as they arrive and compares this sum to the appended one; a difference in the sums indicates an error. Try the class activity in the PDF attached to this step to see checksum in action.
The four non-data fields together ‘wrap around’ the data as the Ethernet Frame, in what is called encapsulation.
Note that there are different frames for different media types, such as point-to-point, fibre-optics, dial-up, ADSL, wireless, 3G/4G/5G, etc.
Unlike an Ethernet hub, a switch learns the address of each device connected to its ports by looking at the source addresses in the Ethernet frames it receives. It then builds a table, mapping each device to the port it is connected to, so that it can switch incoming frames to the correct device by looking at the destination address in the incoming frame. If the destination address is not in the switch’s table, the switch defaults to a hub behaviour and sends the frame out on all ports. Modern switches are capable of switching traffic between multiple ports simultaneously.
A network with a switch at the core and multiple devices connected in a star topology is called a Local Area Network, or LAN; the LAN may itself be connected to another network.
In the next section, you will take a quiz to review what you’ve learned about connections, hubs, switches, and Ethernet frames.
- What happens to an electrical signal when the interference is so bad that the noise takes the signal over the threshold?
- What happens when you plug a new device into a switch?
Share your ideas and answers in the comments section below.