ccna-notes

Ethernet LAN Switching

Table of contents

What is a LAN ?

A Local Area Network is a network contained within a relatively small area. LANs use L2 layer frames.

Ethernet Frame

A complete ethernet frame structure

Preamble + SFD are usually not considered part of the ethernet header

Preamble

SDF (Start Frame Delimiter)

Destination and Source

Type / Length

FCS (Frame Check Sequence)

MAC Address

ARP

ARP Table

Windows / MacOS / Linux

arp -a to view the ARP table and show all ARP entries

Cisco IOS

show arp to view the ARP table and show all ARP entries

Ping

In the above example the first of the 5 requests sent failed because of ARP.

MAC Address Table

To show the MAC Address table in CISCO devices use:

show mac address-table

To manually clear the MAC Address table in CISCO devices use:

clear mac address-table dynamic interface <interface name>

Examples

Example 1

We will have PC1 send data to PC2 in the same LAN where the Switch has an empty MAC Address Table

  1. PC1 sends an ethernet frame for PC2

  2. SW1 learns PC1 Mac Address and associates it to the F0/1 interface (Dynamically learned MAC Address)

  3. SW1 doesn’t know which device has the PC2 MAC address, so it will FLOOD the frame

  4. PC2 receives the packet to process it normally up the OSI stack and PC3 ignores the packet because the frame destination doesn’t match its own MAC address

Example 2

PC1 will send data to PC3 and PC3 will reply to PC1 where the Switch has an empty MAC Address Table

  1. PC1 sends an ethernet frame for PC3

  2. SW1 saves PC1 MAC Address and associates it to its F0/1 interface

  3. SW1 FLOODS the frame and PC2 drops the package

  4. SW2 saves PC1 MAC Address and associates it to its F0/3 interface, then FLOODS the frame and PC4 drops the package while PC3 processes it

  5. PC3 replies to PC1

  6. SW2 saves PC3 MAC Address and associates it to its F0/1 interface

  7. Since SW2 already associated PC1 MAC Address to the F0/3 interface it will FORWARD the frame to SW1

  8. SW1 already associated PC1 Mac Address to F0/1 interface so it will FORWARD the frame to PC1 directly

Example 3 🔥

PC1 wants to send data to PC3 where:

  1. Because PC1 doesn’t know PC3 MAC address, it will send an ARP Request with its IP

  2. SW1 adds PC1 to its MAC Address table and FLOODS the request

  3. PC2 ignores the request because Destination IP doesn’t match

  4. SW2 adds PC1 to its MAC Address table and FLOODS the request

  5. PC2 ignores the request because Destination IP doesn’t match and PC3 processes it

  6. PC3 sends the ARP Reply

  7. SW2 adds PC3 to its MAC Address table and FORWARDS the request

  8. SW1 adds PC3 to its MAC Address table and FORWARDS the request

  9. PC1 receives the ARP reply and will add PC3 MAC Address to its ARP table