Ethernet LAN Fundamentals: Cabling, Framing, and Switch Basics

Ethernet is the dominant technology connecting devices within local networks worldwide, and understanding its physical cabling, frame structure, and switching behavior is foundational to nearly every networking task. This comprehensive guide covers Ethernet cabling standards, the structure of an Ethernet frame, how switches learn and forward traffic using MAC addresses, and the essential commands for viewing and managing a Cisco switch.

Ethernet LANMAC Address SwitchingCisco Switch Commands

~5 دقیقه مطالعه · آخرین به‌روزرسانی ۱۸ شهریور ۱۴۰۵

Ethernet Cabling: Connecting the Physical Layer

Ethernet networks are physically connected using either copper twisted-pair cabling or fiber-optic cabling, each suited to different distances and speeds.

Common Ethernet cabling standards:
UTP (Unshielded Twisted Pair) - most common,
  Cat5e supports 1 Gbps up to 100 meters
  Cat6/6a supports 10 Gbps up to 100 meters (Cat6a)

Fiber Optic - used for longer distances and higher speeds
  Single-mode: long distances (kilometers), used for WAN links
  Multi-mode: shorter distances, common within data centers

Two cable wiring types matter for connecting devices correctly: a Straight-Through Cable connects dissimilar devices (a PC to a switch, or a switch to a router), while a Crossover Cable traditionally connected similar devices (switch to switch). Modern Ethernet ports largely eliminate this distinction through Auto-MDIX, a feature that automatically detects and adjusts for whichever cable type is plugged in.

The Structure of an Ethernet Frame

Data traveling across an Ethernet LAN is organized into Frames, the Layer 2 unit of data discussed earlier in this series regarding encapsulation.

Ethernet II frame structure:

| Preamble | Dest MAC | Src MAC | Type | Data | FCS |
| 8 bytes  | 6 bytes  | 6 bytes | 2B   | 46-1500B | 4B |

Preamble:    synchronizes the receiving device's clock
Dest MAC:    the physical address of the intended recipient
Src MAC:     the physical address of the sender
Type:        identifies the Layer 3 protocol carried inside
              (e.g., 0x0800 for IPv4)
Data:        the actual payload (an IP packet, typically)
FCS:         Frame Check Sequence, used to detect transmission errors

The MAC (Media Access Control) Address, a 48-bit identifier typically written as six pairs of hexadecimal digits, uniquely identifies each network interface at the hardware level. Unlike IP addresses, which are assigned based on network topology, MAC addresses are burned into the hardware by the manufacturer and remain fixed regardless of where the device connects.

How a Switch Learns and Forwards Traffic

A Cisco switch's core job is deciding which port to send an incoming frame out of, and it accomplishes this through a continuously updated MAC Address Table.

Switch forwarding logic:

1. Learn: when a frame arrives on a port, the switch
   records the source MAC address and the port it
   arrived on in its MAC address table

2. Forward/Flood: the switch checks the destination
   MAC address against its table
   - If found: forward the frame only out that specific port
   - If not found: flood the frame out every port
     except the one it arrived on

3. Filter: if the source and destination MAC are on
   the same port's segment, the switch does not
   forward the frame at all

This learning process happens automatically and continuously, without any configuration required, which is why a switch functions correctly the moment it is powered on and cabled — though verifying its learned state is a routine and essential troubleshooting step.

Viewing the MAC Address Table

Switch# show mac address-table

          Mac Address Table
-------------------------------------------

Vlan    Mac Address       Type        Ports
----    -----------       --------    -----
   1    0050.56aa.1122    DYNAMIC     Gi1/0/1
   1    0050.56bb.3344    DYNAMIC     Gi1/0/2

This output directly reflects the forwarding logic described above: it shows exactly which MAC address the switch has learned on which port, and is often the very first command run when troubleshooting why a device cannot communicate on the local network.

Full-Duplex Versus Half-Duplex Operation

Modern Ethernet operates in Full-Duplex mode, where a device can send and receive simultaneously on separate physical wire pairs, effectively eliminating collisions entirely. Older or misconfigured connections sometimes fall back to Half-Duplex, where a device can only send or receive at one time, requiring a collision-detection mechanism.

Checking and setting duplex/speed on an interface:

Switch(config)# interface gigabitethernet 1/0/1
Switch(config-if)# duplex full
Switch(config-if)# speed 1000

Switch# show interfaces gigabitethernet 1/0/1
GigabitEthernet1/0/1 is up, line protocol is up
  Full-duplex, 1000Mb/s, media type is 10/100/1000BaseTX

A Duplex Mismatch, where one end of a link is set to full-duplex and the other to half-duplex, is a classic and notoriously confusing networking problem: the link appears to work, but suffers from unexplained slowness and intermittent errors, since one side expects collision handling that the other side never performs.

Essential Cisco Switch Management Commands

Beyond understanding switching theory, day-to-day work requires fluency with the basic commands for navigating and inspecting a Cisco device.

Switch> enable
Switch# configure terminal
Switch(config)# hostname SW1
SW1(config)# interface vlan 1
SW1(config-if)# ip address 192.168.1.2 255.255.255.0
SW1(config-if)# no shutdown
SW1(config-if)# exit
SW1(config)# exit
SW1# copy running-config startup-config

SW1# show version
SW1# show interfaces status
SW1# show running-config

These commands illustrate the Cisco IOS command hierarchy: enable moves from user mode to privileged mode, configure terminal enters global configuration mode, and interface-specific commands like interface vlan 1 drop into a more specific configuration context. Saving the configuration with copy running-config startup-config is essential — changes made in the running configuration are lost on reboot unless explicitly saved to the startup configuration.

Why These Fundamentals Matter for Everything That Follows

Every more advanced Layer 2 topic covered later in this series — VLANs, Spanning Tree Protocol, and EtherChannel — builds directly on the MAC-address-based learning and forwarding behavior described in this article. Understanding exactly how a switch decides where to send a frame, and being fluent with the basic show commands used to verify that behavior, is the essential foundation for diagnosing the vast majority of real-world local network connectivity problems.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Systematic Network Troubleshooting: A Methodology Tying Everything Together

Every protocol and technology covered throughout this series is only useful if a problem involving it can actually be diagnosed and fixed efficiently under real-world pressure. This article presents a systematic troubleshooting methodology built around the OSI layers, walks through applying it to a realistic connectivity problem, and shows how the specific verification commands covered throughout this entire series fit into a structured diagnostic process.

ادامه

NETCONF, YANG, and Python: Programmatic Network Configuration at Scale

The REST APIs and JSON/YAML formats covered earlier in this series represent one approach to network automation, but NETCONF and YANG provide a more structured, standards-based alternative purpose-built for network device configuration. This article explains what distinguishes NETCONF from a simple REST API, covers how YANG models define exactly what configuration data looks like, and walks through using Python to programmatically interact with network devices.

ادامه

IPsec VPN Fundamentals: Securing Traffic Across Untrusted Networks

Connecting two sites across the public internet exposes traffic to interception unless it is properly encrypted, and IPsec provides the standard framework for building secure, authenticated tunnels between sites. This article explains the two-phase IKE negotiation process, covers the distinction between AH and ESP protocols, walks through configuring a basic site-to-site IPsec VPN, and covers essential verification commands.

ادامه

MPLS Fundamentals: Label Switching Explained

Traditional IP routing requires every router along a path to perform a full routing table lookup on every packet, but MPLS takes a fundamentally different approach by making that forwarding decision once and attaching a simple label that every subsequent router can use instead. This article explains the core label-switching concept, walks through how the Label Distribution Protocol builds the label forwarding tables that make this possible, and covers the practical benefits MPLS provides in real provider networks.

ادامه

BGP Route Reflectors and Confederations: Scaling iBGP Beyond Full Mesh

The iBGP full-mesh requirement, briefly mentioned earlier in this series, becomes a serious scaling problem as an autonomous system grows, requiring a number of sessions that increases quadratically with router count. This article explains exactly why full mesh does not scale, walks through how route reflectors solve this by relaxing BGP's normal route-propagation rules, and covers confederations as an alternative approach that divides a single AS into smaller sub-autonomous systems.

ادامه

OSPF Area Types Deep Dive: Stub, Totally Stubby, and NSSA

Multi-area OSPF, covered earlier in this series, already reduces database size by separating a network into areas, but OSPF offers further specialized area types that reduce routing table size even more aggressively by filtering out unnecessary external routes entirely. This article explains the LSA types that must be suppressed to create each specialized area type, walks through configuring stub, totally stubby, and not-so-stubby areas, and covers the specific trade-offs each design choice involves.

ادامه