up:: [[Computing MOC]]
tags:: #note/develop #on/computing/networking
# Ethernet Frames
A *frame* is the Protocol Data Unit (PDU) for Layer 2 of the [[OSI Model]]. They are handled by switches.
## Format
Frames are composed of the following contents:
- Header
- Destination MAC address (6 bytes)
- Source MAC address (6 bytes)
- Type/Length of the packet (2 bytes)
- Packet
- Trailer
- Frame Check Sequence (4 bytes)
In addition to the frame itself, a Preamble and a Start Frame Delimiter (SFD) are sent along with it.
### Frame Header
- Preamble and Start Frame Delimiter (SFD)
- Sent with each Ethernet frame, though not considered to be part of the frame
- Allows the receiving device to synchronize its receiver clock and prep to receive the incoming frame
- Preamble is 7 bytes; just a series of alternating 1s and 0s
- SFD (Start Frame Delimiter) is 1 byte; signals that the preamble is done
- Sequence is 10101011
- Belong to Layer 1
- Destination and source
- Destination is the destination MAC address
- Source is the source MAC address
- Type/Length
- 2 bytes
- Used to either indicate the type of the encapsulated packet (eg., an IPv4 packet vs an IPv6 packet) or to indicate the length of the encapsulated packet (in bytes)
- These days it's mostly used for indicating the type; using it for length is historical
- Value of 1500 (decimal) or less means it indicates the length of the encapsulated packet
- Value above 1536 (decimal) indicates the type of the encapsulated packet
- This field is called the EtherType field
- IPv4: 0x0800
- IPv6: 0x86DD
### Frame Trailer
- Only field is the Frame Check Sequence (FCS)
- 4 bytes
- Used to detect corrupt data in a frame
- Contains a checksum
- Algorithm used to generate and check checksum is Cyclic Redundancy Check
---
> [!createdat] Created at: [[2025-11-13]]