Module 7: Encapsulation and the Ethernet Frame

Encapsulation in Networking

Encapsulation is the process of placing one message format inside another message format to facilitate proper delivery. To illustrate this concept, consider the analogy of a letter being placed inside an envelope for mailing. In networking, a computer message is encapsulated in a similar manner to ensure that it is delivered and processed correctly. When the message reaches its destination, the reverse process—called de-encapsulation—occurs. During de-encapsulation, the recipient removes the “letter” from the “envelope,” retrieving the original message.

For messages to travel over a computer network, they must adhere to specific format rules, which ensure they can be properly delivered and processed. These format rules govern how the message is structured, how the network identifies it, and how it is handled throughout the network.

Ethernet Frame Structure

The Ethernet protocol defines many aspects of network communication, such as frame format, frame size, timing, and encoding. Ethernet frames are the fundamental units of data transmission in Ethernet networks, and the structure of these frames is defined by Ethernet standards.

Each Ethernet frame contains several key components:

  • Destination and Source MAC Addresses: These addresses specify the source and destination devices on the network. The MAC address (Media Access Control address) is a unique identifier assigned to each network interface card (NIC), ensuring that the correct devices are identified and communicated with on the network.

  • Preamble: The preamble is used for sequencing and timing purposes. It helps synchronize the transmission of frames, ensuring that devices on the network can properly interpret incoming data.

  • Start of Frame Delimiter (SFD): The SFD marks the beginning of a frame, indicating that the data in the frame is ready for processing.

  • Frame Length/Type: This field specifies the length of the data portion of the frame or indicates the type of data being carried (e.g., IP data or other protocol types).

  • Frame Check Sequence (FCS): The FCS is used to detect errors in the transmission of the frame. It contains a checksum value, which is used by the recipient to verify whether the data has been transmitted correctly or whether any errors have occurred.

The Access Layer in Networking

The Access Layer refers to the part of the network where users gain access to shared resources, such as files, printers, and other hosts. It is the layer that connects individual devices (hosts) to the larger network. The access layer is comprised of networking devices like switches and hubs that enable devices to communicate with each other.

Within an Ethernet network, each device (or host) can connect directly to an access layer networking device via an Ethernet cable. The most common networking devices at this layer include:

  1. Ethernet Hubs: An Ethernet hub is a basic device that provides multiple ports to connect various hosts to the network. However, hubs have significant limitations. Only one message can be sent through the hub at a time, meaning that if two hosts send messages simultaneously, a collision occurs. This collision can cause delays and network congestion as the data must be retransmitted, which can slow down the entire network. Because of these issues, Ethernet hubs have largely been replaced by more efficient devices, such as Ethernet switches.

  2. Ethernet Switches: An Ethernet switch is an advanced device that operates at Layer 2 of the OSI model. When a host sends a message to another host connected to the same network, the switch processes the message by reading the MAC address of the source and destination. The switch contains a MAC address table, which stores the MAC addresses of all devices connected to its ports. This table allows the switch to identify the correct destination port for each incoming message.

    When a switch receives a message, it checks the destination MAC address in its MAC address table. If the address is found, the switch forwards the message to the corresponding port, creating a temporary circuit between the sending and receiving hosts. Ethernet switches significantly improve network performance by eliminating collisions, allowing for simultaneous sending and receiving of frames over the same Ethernet cable. This ability to manage traffic efficiently helps reduce network congestion and improves overall network speed.

Dynamic MAC Address Table

As hosts communicate with each other, the Ethernet switch dynamically updates its MAC address table. Whenever a host sends a message, the switch records the source MAC address and the corresponding port to which the device is connected. This dynamic learning process allows the switch to quickly learn the network topology and optimize the flow of data.

Whenever a new host joins the network or responds to a broadcast message, the switch updates its MAC address table to include the new device and its associated port. This continuous process ensures that the switch is always aware of the active devices on the network and can direct traffic efficiently.