Show Menu
Cheatography

Ethernet LAN Switching Part 1 Cheat Sheet (DRAFT) by

Brief Introduction to Ethernet Switching

This is a draft cheat sheet. It is a work in progress and is not finished yet.

What is a LAN

A LAN stands for local area network. These are devices that are confined to a limited area. For example, a SOHO, or an office department etc. A LAN in its basic form can just be two computers plugged together. However, in most enterprise or office’s, these LAN’s are created by something called a switch. End-hosts are typically plugged into switches. These end hosts could be PC’s or servers.

What is a Switch?

A switch is a Layer 2 device. (Based on OSI Model) Switches typically have a lot of ports on them, unlike routers which typically do not have many interfaces on them. This makes switches great to plug into end hosts.
The function of a switch is to forward traffic WITHIN LAN’s. A router on the other hand will forward traffic BETWEEN LAN’s.

Ethernet Switching

Ethernet Switching is when a switch forwards traffic to the correct end host within a LAN based upon MAC addresses.

Ethernet itself is a Layer 2 protocol in the OSI Model, also known as the Data Link Layer.
The PDU (Protocol Data Unit) at Layer 2 is known as a Frame. Thus Ethernet Frames are what are sent when sending traffic within LAN’s.

Ethernet Frames

The Minimum size for an Ethernet Frame is 64 Bytes. 1 Byte = 8 Bits, so 64 Bytes = 512.
An Ethernet Frame will include an Ethernet header, a packet (encap­sulated from Layer 3) and a trailer. This would make the minimum size if everything included to 64 bytes.
Minimum PAYLOAD size is 46. If <46 padding bytes are added to the frame to add upto 46. (Below explains why)
 

Ethernet Header: (Without 802.1Q)

The Ethernet Header is comprised of 4 main sections (There are optional ones, like VLAN 802.1q which isnt explained here). These are Preamble & SFD, Destin­ation & Source, Type, and CRC.
Preamble & SFD: The preamble is 7 bytes long. (56 bits) Its main purpose is to allow devices to sync their reciever clocks. The SFD is 1 byte long (8 bits) and is used to mark the end of the rest of the frame. The preamble & SFD are usually not considered part of the ethernet frame. So, without this, the ethernet payload is 64-18 (Preamble +SFD) = 46. So, if it is <46 padding is added.
Destin­ation & Source: These sections indicate the source & destin­ation of where the frame is headed too. Inside these it includes MAC addresses, which are 6 bytes in length. So it will be 6 bytes for both the Destin­ation & the Source. In ethernet frames destin­ation comes before source, because of something called ARP.
Type/L­ength: 2 Bytes in Length. (16 Bits) A value of 1500 or less indicates the length of the encaps­ulated packet. A value of 1536 or higher indicates the TYPE of encaps­ulated packet. For example IPv4 = 2048, IPv6 = 34,525.