Skip to content

3.2 Ethernet

1. Ethernet

Ethernet is a widely used networking technology that defines the standards for wired local area networks (LANs). It specifies how devices (computers, switches, routers, etc.) communicate over a shared or dedicated medium, using a system of frames to transmit data. Ethernet is governed by the IEEE 802.3 standard and is the most common method for connecting devices in LANs.

1.1 Key Features of Ethernet

  1. Wired Connectivity:
    • Ethernet uses physical cables (e.g., UTP, fiber optics) to connect devices.
  2. Speed:
    • Ethernet supports various speeds, from 10 Mbps (traditional Ethernet) to 100 Gbps (modern Ethernet) and beyond.
  3. Scalability:
    • Ethernet can be used in small home networks or large enterprise networks.
  4. Full-Duplex Communication:
    • Modern Ethernet supports full-duplex communication, allowing simultaneous sending and receiving of data.
  5. Collision Avoidance:
    • In modern switched networks, collisions are avoided due to dedicated links and full-duplex operation.
  1. Ethernet Cables:

    • UTP (Unshielded Twisted Pair): Commonly used in Ethernet networks (e.g., Cat5e, Cat6, Cat6a).
    • Fiber Optics: Used for high-speed and long-distance connections.
  2. Ethernet Standards:

    • Ethernet standards define speed, cable types, and maximum distances. Examples:
      • 10BASE-T: 10 Mbps over twisted-pair cables.
      • 100BASE-TX: 100 Mbps (Fast Ethernet).
      • 1000BASE-T: 1 Gbps (Gigabit Ethernet).
      • 10GBASE-T: 10 Gbps (10 Gigabit Ethernet).
  3. MAC Addresses:

    • Each Ethernet device has a unique MAC (Media Access Control) address, a 48-bit identifier used for communication at the data link layer.
  4. Switches and Hubs:

    • Switches: Modern Ethernet networks use switches to forward frames to the correct destination.
    • Hubs: Older Ethernet networks used hubs, which broadcast data to all devices, leading to collisions.
  5. Ethernet Frame:

    • The basic unit of data transmission in Ethernet is the frame, which encapsulates the data being sent.

1.3 Ethernet Frame Structure

An Ethernet frame consists of several fields that provide information about the data being transmitted. The structure of an Ethernet frame is as follows:

FieldSize (Bytes)Description
Preamble7A sequence of alternating 1s and 0s used for synchronization.
Start Frame Delimiter (SFD)1Marks the start of the frame (10101011).
Destination MAC Address6The MAC address of the device receiving the frame.
Source MAC Address6The MAC address of the device sending the frame.
EtherType/Length2Indicates the protocol type (e.g., IPv4, IPv6) or the length of the payload.
Payload/Data46–1500The actual data being transmitted (e.g., IP packet).
Pad(if needed)Padding to ensure the frame meets the minimum size requirement (64 bytes).
Frame Check Sequence (FCS)4A checksum for error detection (CRC-32).

1.4 Detailed Explanation of Ethernet Frame Fields

  1. Preamble:

    • A 7-byte pattern of alternating 1s and 0s (10101010…) used to synchronize the sender and receiver.
  2. Start Frame Delimiter (SFD):

    • A 1-byte field (10101011) that marks the beginning of the frame.
  3. Destination MAC Address:

    • A 6-byte field containing the MAC address of the intended recipient.
  4. Source MAC Address:

    • A 6-byte field containing the MAC address of the sender.
  5. EtherType/Length:

    • A 2-byte field that specifies the protocol type (e.g., IPv4, IPv6) or the length of the payload.
    • Common EtherType values:
      • 0x0800: IPv4
      • 0x0806: ARP
      • 0x86DD: IPv6
  6. Payload/Data:

    • The actual data being transmitted (e.g., an IP packet).
    • The minimum size is 46 bytes, and the maximum size is 1500 bytes (for standard Ethernet).
  7. Pad:

    • If the payload is less than 46 bytes, padding is added to meet the minimum frame size requirement (64 bytes, including headers and FCS).
  8. Frame Check Sequence (FCS):

    • A 4-byte checksum (CRC-32) used for error detection. The receiver calculates the checksum and compares it to the FCS to ensure the frame was not corrupted during transmission.

1.5 Minimum and Maximum Frame Sizes

  • Minimum Frame Size: 64 bytes (including headers and FCS).
    • Ensures that collisions can be detected in half-duplex networks.
  • Maximum Frame Size: 1518 bytes (including headers and FCS) for standard Ethernet.
    • Larger frames (up to 9000 bytes) are supported in Jumbo Frames, used in high-performance networks.

1.6 How Ethernet Frames Work

  1. Frame Creation:
    • The sending device encapsulates the data (e.g., an IP packet) into an Ethernet frame.
  2. Frame Transmission:
    • The frame is transmitted over the Ethernet cable to the destination device.
  3. Frame Reception:
    • The receiving device checks the FCS for errors and processes the frame if it is valid.
  4. Frame Forwarding:
    • In a switched network, the switch uses the destination MAC address to forward the frame to the correct port.

2. CSMA/CD on Full Duplex Swtiches?

In modern networking, switches use UTP (Unshielded Twisted Pair) cables, which support full-duplex communication. This allows data to be transmitted and received simultaneously on separate channels, eliminating the possibility of collisions. As a result, the need for CSMA/CD (Carrier Sense Multiple Access with Collision Detection) is no longer necessary in switched networks, as collisions cannot occur in full-duplex mode.

  1. UTP Cables and Full-Duplex Communication:

    • UTP cables (e.g., Cat5e, Cat6, Cat6a) are commonly used in modern networks.
    • These cables support full-duplex communication, meaning devices can send and receive data simultaneously on separate pairs of wires within the cable.
    • For example, in a typical Ethernet cable:
      • One pair is used for transmitting data.
      • Another pair is used for receiving data.
  2. Switches and Full-Duplex Mode:

    • Modern switches operate in full-duplex mode by default when connected to devices that also support full-duplex communication.
    • In full-duplex mode, each device has a dedicated channel for sending and receiving data, so there is no contention for the medium.
  3. Collisions and CSMA/CD:

    • In older half-duplex networks (e.g., using hubs), devices shared the same communication channel, leading to the possibility of collisions.
    • CSMA/CD was used to detect and handle collisions in such networks.
    • However, in full-duplex networks, collisions cannot occur because each device has its own dedicated transmit and receive channels.
  4. No Need for CSMA/CD in Modern Networks:

    • Since collisions are impossible in full-duplex mode, CSMA/CD is irrelevant in modern switched networks.
    • Modern Ethernet standards (e.g., Gigabit Ethernet, 10 Gigabit Ethernet) are designed for full-duplex operation and do not use CSMA/CD.

2.1 Why CSMA/CD is Obsolete in Modern Networks

  • Switches vs. Hubs:
    • Hubs operate in half-duplex mode and broadcast data to all connected devices, leading to collisions.
    • Switches operate in full-duplex mode and create dedicated communication paths between devices, eliminating collisions.
  • Full-Duplex Advantage:
    • Full-duplex communication doubles the effective bandwidth (e.g., 100 Mbps in each direction for Fast Ethernet).
    • It also improves network efficiency and reduces latency.

2.2 Key Points

  1. Full-Duplex Communication:

    • Allows simultaneous transmission and reception of data.
    • Eliminates the possibility of collisions.
  2. Switches:

    • Operate in full-duplex mode by default.
    • Provide dedicated communication paths between devices.
  3. CSMA/CD:

    • Was necessary in half-duplex networks (e.g., using hubs).
    • Is no longer needed in modern full-duplex switched networks.

2.3 What Happened to CSMA/CD?

  • CSMA/CD was a critical protocol in early Ethernet networks (e.g., 10BASE-T and 100BASE-TX) that used half-duplex communication and shared media (e.g., coaxial cables or hubs).
  • With the shift to switched networks and full-duplex communication, CSMA/CD became obsolete.
  • Modern Ethernet standards (e.g., IEEE 802.3) still include CSMA/CD for backward compatibility, but it is not used in full-duplex mode.

2.4 Key Differences Between Old and Modern Ethernet

FeatureOld Ethernet (Half-Duplex)Modern Ethernet (Full-Duplex)
DeviceHubsSwitches
Communication ModeHalf-Duplex (devices cannot send and receive simultaneously).Full-Duplex (devices can send and receive simultaneously).
CollisionsPossible (due to shared medium).Not possible (dedicated links).
Collision HandlingCSMA/CD required.CSMA/CD not needed.
BandwidthShared (e.g., 100 Mbps total for all devices).Dedicated (e.g., 100 Mbps per device in each direction).
EfficiencyLower (due to collisions and retransmissions).Higher (no collisions, no retransmissions).

2.5 Why Full-Duplex Ethernet is Better

  1. No Collisions:
    • Eliminates the need for collision detection and retransmissions, improving efficiency.
  2. Higher Throughput:
    • Full-duplex effectively doubles the bandwidth (e.g., 100 Mbps in each direction for Fast Ethernet).
  3. Lower Latency:
    • Data can be transmitted and received simultaneously, reducing delays.
  4. Scalability:
    • Supports high-speed Ethernet standards like Gigabit Ethernet and 10 Gigabit Ethernet.

2.6 Exceptions Where CSMA/CD Might Still Be Relevant

While modern Ethernet networks do not use CSMA/CD, there are a few scenarios where it might still be relevant:

  1. Legacy Networks:
    • Older networks using hubs or half-duplex communication may still rely on CSMA/CD.
  2. Mixed Environments:
    • If a modern network has legacy devices that operate in half-duplex mode, CSMA/CD may still be used for those devices.
  3. Wireless Networks:
    • Wireless networks (e.g., Wi-Fi) use a similar protocol called CSMA/CA (Collision Avoidance) because wireless communication is inherently half-duplex and prone to collisions.

2.7 Multiple PCs Sending Data at the Same time?

In a modern switched network, collisions will not occur even if multiple PCs send data to the same destination PC at the same time. This is because switches operate in full-duplex mode and use dedicated communication paths for each connected device. Here’s a detailed explanation of what happens in this scenario:

2.7.1 How Switches Handle Simultaneous Data Transmissions

  1. Dedicated Links:

    • Each device connected to a switch has a dedicated link to the switch. This means:
      • Data sent from one device to another does not interfere with data sent by other devices.
      • There is no shared medium, so collisions cannot occur.
  2. Switch Buffering:

    • Switches have internal buffers (memory) to temporarily store incoming data frames.
    • If multiple PCs send data to the same destination PC at the same time, the switch will:
      • Receive the frames from each sending PC.
      • Store the frames in its buffer.
      • Forward the frames to the destination PC one at a time in the order they were received (or based on priority, if configured).
  3. No Collisions:

    • Since each device has a dedicated link to the switch, there is no contention for the communication medium.
    • The switch ensures that data frames are forwarded without collisions.

2.7.2 Step-by-Step Process

  1. PC1, PC2, and PC3 simultaneously send data to PC4.
  2. The switch receives the data frames from PC1, PC2, and PC3 on their respective ports.
  3. The switch stores the frames in its internal buffer.
  4. The switch forwards the frames to PC4 one at a time:
    • It sends the frame from PC1 first, then PC2, and finally PC3 (or based on priority/queueing mechanisms).
  5. PC4 receives the frames sequentially and processes them.

2.7.3 Why Collisions Don’t Occur

  • Full-Duplex Communication:
    • Each device can send and receive data simultaneously on separate channels.
    • There is no shared medium, so collisions are impossible.
  • Switch Intelligence:
    • Switches use MAC address tables to forward frames only to the intended destination port.
    • They manage traffic efficiently using buffering and queuing mechanisms.

2.7.4 What Happens if the Switch Buffer is Full?

If the switch’s buffer becomes full due to excessive traffic, it may drop frames. This is not a collision but rather a result of congestion. To handle this:

  • Switches may use flow control mechanisms (e.g., IEEE 802.3x pause frames) to temporarily stop incoming traffic.
  • Network administrators can implement Quality of Service (QoS) to prioritize critical traffic.

2.7.5 Comparison with Hubs

In contrast, if multiple PCs were connected to a hub (which operates in half-duplex mode and uses a shared medium), simultaneous data transmissions would result in collisions. The hub would broadcast the data to all connected devices, causing collisions that require retransmissions (handled by CSMA/CD).

2.7.6 Key Points

  1. Switches Prevent Collisions:
    • Dedicated links and full-duplex communication eliminate collisions.
  2. Buffering and Queuing:
    • Switches temporarily store and forward frames to manage simultaneous transmissions.
  3. No Shared Medium:
    • Each device has its own communication path to the switch.

3. MAC Address

Play

MAC Address Overview

A MAC (Media Access Control) address is a unique identifier assigned to the network interface controller (NIC) of a device. It is used to identify devices on a local area network (LAN) at the data link layer (Layer 2) of the OSI model. MAC addresses are essential for communication within a LAN, as they enable devices to send data to the correct destination.

3.1 Key Features of MAC Addresses

  1. Uniqueness:
    • MAC addresses are globally unique, meaning no two devices should have the same MAC address.
  2. Hardware-Based:
    • MAC addresses are burned into the NIC (Network Interface Card) during manufacturing and are tied to the hardware.
  3. 48-Bit Address:
    • A MAC address is a 48-bit (6-byte) address, typically represented in hexadecimal format (e.g., 00:1A:2B:3C:4D:5E).
  4. Layer 2 Communication:
    • MAC addresses are used for communication at the data link layer (Layer 2) of the OSI model.

3.2 Structure of a MAC Address

A MAC address consists of two parts:

  1. OUI (Organizationally Unique Identifier):
    • The first 3 bytes (24 bits) of the MAC address identify the manufacturer or vendor of the NIC.
    • Example: 00:1A:2B might indicate a specific manufacturer.
  2. Device Identifier:
    • The last 3 bytes (24 bits) are assigned by the manufacturer to uniquely identify the device.
    • Example: 3C:4D:5E uniquely identifies the specific NIC.

3.3 MAC Address Format

  • MAC addresses are typically written in hexadecimal format, with each byte separated by a colon (:) or hyphen (-).
  • Example: 00:1A:2B:3C:4D:5E or 00-1A-2B-3C-4D-5E.

3.4 Important Things About MAC Addresses

  1. Unicast, Multicast, and Broadcast MAC Addresses:

    • Unicast MAC Address: Identifies a single device on the network.
      • Example: 00:1A:2B:3C:4D:5E.
    • Multicast MAC Address: Identifies a group of devices.
      • Example: 01:00:5E:XX:XX:XX (used for multicast traffic).
    • Broadcast MAC Address: Sends data to all devices on the network.
      • Example: FF:FF:FF:FF:FF:FF.
  2. MAC Address and ARP:

    • The ARP (Address Resolution Protocol) is used to map IP addresses to MAC addresses within a LAN.
    • When a device wants to communicate with another device, it uses ARP to find the MAC address associated with the destination IP address.
  3. MAC Address Table in Switches:

    • Switches use MAC address tables to forward frames to the correct port.
    • When a switch receives a frame, it looks up the destination MAC address in its table and forwards the frame to the appropriate port.
  4. MAC Address Filtering:

    • Some networks use MAC address filtering to allow or deny access to specific devices based on their MAC addresses.
  5. MAC Address Spoofing:

    • MAC addresses can be spoofed (changed temporarily) for privacy or security reasons, but this is generally discouraged in secure environments.
  6. MAC Address and VLANs:

    • In networks with VLANs (Virtual LANs), MAC addresses are used to identify devices within the same VLAN.
  7. MAC Address in Wireless Networks:

    • In Wi-Fi networks, MAC addresses are used to identify devices connected to the access point.

3.5 How MAC Addresses Are Used in Communication

  1. Frame Transmission:
    • When a device sends data, it encapsulates the data in an Ethernet frame with the source and destination MAC addresses.
  2. Switch Forwarding:
    • Switches use the destination MAC address to forward the frame to the correct device.
  3. ARP Resolution:
    • If the MAC address of the destination is unknown, the device sends an ARP request to resolve the IP address to a MAC address.

3.6 MAC Address vs. IP Address

FeatureMAC AddressIP Address
LayerData Link Layer (Layer 2).Network Layer (Layer 3).
PurposeIdentifies devices on a LAN.Identifies devices on a network (LAN or WAN).
Address Length48 bits (6 bytes).32 bits (IPv4) or 128 bits (IPv6).
UniquenessGlobally unique (hardware-based).Unique within a network (can change).
Example00:1A:2B:3C:4D:5E.192.168.1.10 (IPv4) or 2001:0db8::1 (IPv6).

3.7 MAC Address in Practice

  1. Finding Your MAC Address:
    • On Windows: Use the command ipconfig /all.
    • On Linux/macOS: Use the command ifconfig or ip link show.
  2. Changing a MAC Address:
    • MAC addresses can be spoofed (temporarily changed) using software tools, but this is not recommended in secure environments.