A Local Area Network is a network contained within a relatively small area. LANs use L2 layer frames.
26 bytes 🔥
HEADER
Preamble
: used for syncronization and preparing the device to receive the rest of the data in the frameSFD
(Start Frame Delimiter)Destination
: L2 address to which the frame is being sentSource
: L2 address of the device that sent the frameType
(or Length): indicates the L3 protocol used in the encapsulated packet
(almsot always IPv4 or IPv6)TRAILER
FCS
(Frame Check Sequence): used by the receiving device to detect any errors that may have occurred in transmissionPreamble + SFD
are usually not considered as part of the ethernet headerMAC address
MAC
= Media Access Control1500 or less
in this field indicates the LENGTH of the encapsulated packet in bytes1536 or less
in this field indicates the TYPE
of the encapsulated packet (usually IPv4 or IPv6), and the length is determined via other methods2048
in decimal34525
in decimal2054
in decimalCRC
: “Cyclic Redundancy Check”ARP Request
ARP Reply
ARP Request
is a broadcast
ethernet frame (it is sent to all hosts in the network)ARP Reply
is a unicast
ethernet frametype static
: default entriestype dynamic
: learned via ARParp -a
to view the ARP table and show all ARP entries
show arp
to view the ARP table and show all ARP entries
ICMP Echo Request
ICMP Echo Reply
ping <ip_address>
In the above example the first of the 5 requests sent failed because of ARP.
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>
We will have PC1
send data to PC2
in the same LAN where the Switch has an empty MAC Address Table
PC1
sends an ethernet frame for PC2
SW1
learns PC1
Mac Address and associates it to the F0/1 interface (Dynamically learned MAC Address)
SW1
doesn’t know which device has the PC2
MAC address, so it will FLOOD
the frame
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
unicast frame
: frame destined for a single targetunknown unicast frame
: frame for which the switch doesn’t have an entry in its MAC Address Table. In this case the frame is FLOODED
(forwarded to all of its interfaces except the one it received the packet on)known unicast frame
: frame for which destination is already “known” in the switches MAC Address Table. In this case the frame is FORWARDED
to the specified destination.PC1
will send data to PC3
and PC3
will reply to PC1
where the Switch has an empty MAC Address Table
PC1
sends an ethernet frame for PC3
SW1
saves PC1
MAC Address and associates it to its F0/1
interface
SW1
FLOODS
the frame and PC2
drops the package
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
PC3
replies to PC1
SW2
saves PC3
MAC Address and associates it to its F0/1
interface
Since SW2
already associated PC1
MAC Address to the F0/3
interface it will FORWARD
the frame to SW1
SW1
already associated PC1
Mac Address to F0/1
interface so it will FORWARD
the frame to PC1
directly
PC1
wants to send data to PC3
where:
PC1
doesn’t know PC3
MAC AddressPC1
knows PC3
IP addressBecause PC1
doesn’t know PC3
MAC address, it will send an ARP Request with its IP
SW1
adds PC1
to its MAC Address table and FLOODS
the request
PC2
ignores the request because Destination IP doesn’t match
SW2
adds PC1
to its MAC Address table and FLOODS
the request
PC2
ignores the request because Destination IP doesn’t match and PC3
processes it
PC3
sends the ARP Reply
SW2
adds PC3
to its MAC Address table and FORWARDS
the request
SW1
adds PC3
to its MAC Address table and FORWARDS
the request
PC1
receives the ARP reply and will add PC3
MAC Address to its ARP table