Achievable logoAchievable logo
CCNA
Sign in
Sign up
Purchase
Textbook
Practice exams
Support
How it works
Exam catalog
Mountain with a flag at the peak
Textbook
Introduction
1. Introduction to networking
2. Administering Ethernet LANs
2.1 Wired network access
2.2 Hosts communicating on a Local Area Network
2.2.1 Hosts communicating on a Local Area Network (LAN)
2.2.2 Address Resolution Protocol (ARP) and Ethernet switching
2.3 Virtual LANs (VLANs)
2.4 Layer 2 link redundancy
2.5 Configuring Cisco Switches
3. IP connectivity
4. Network services
5. IPv6
6. Wireless networking
7. Network management and administering network devices
8. Network security fundamentals
9. Network automation and programmability
Wrapping up
Achievable logoAchievable logo
2.2.2 Address Resolution Protocol (ARP) and Ethernet switching
Achievable CCNA
2. Administering Ethernet LANs
2.2. Hosts communicating on a Local Area Network
Our CCNA course is currently in development and is a work-in-progress.

Address Resolution Protocol (ARP) and Ethernet switching

5 min read
Font
Discuss
Share
Feedback

There are three main functions of an Ethernet switch. Here, we’ll focus on the first two functions, both of which relate to forwarding Ethernet frames.

To see where the switch fits when two endpoints communicate, let’s walk through the scenario below.

(Image 033) Image Title - PC A and PC B connected to Switch-1

PC A would like to send pings to PC B. PC A is connected to Switch-1’s GigabitEthernet0/2 port and PC B is connected to Switch-1’s GigabitEthernet0/3.

PC A pings PC B

Assume you’ve opened a command prompt on PC A and verified that it has a valid IP address for the LAN. Assume PC B also has a valid IP address on the same LAN. You can now ping PC B by entering: “ping 192.168.1.3”

(This example assumes PC A and PC B have never communicated before this ping, and PC B has not sent any frames into the network yet.)

(Image 036) Image Title - Pinging PC B

Step 1: After you enter the “ping 192.168.1.3” command on PC A, PC A first determines whether the destination IP address (PC B) is on the same network. The operating system on PC A performs a Boolean operation called a “Logical AND.” It uses PC A’s own IP address and subnet mask, compares the result to PC B’s IP address, and decides whether they’re on the same network.

We’ll cover how to determine the range of IPs in a network when we discuss IPv4 addressing. For now, assume PC A and PC B are in the same IP network (LAN).

Step 2: Since PC A and PC B are on the same network, PC A must decide whether it needs to use its default gateway.

Does PC A need to use its default gateway in this case? Yes or no?

(spoiler)

No. Devices on a network only need to use their Default Gateway whenever they are sending packets to devices with destination IP Addresses outside of their own network.

Step 3: PC A now builds an Ethernet frame that will carry the ICMP (Ping) Echo Request, and it starts filling in the required Ethernet frame fields.

  • Devices on a LAN communicate using IP addresses and their associated MAC addresses. Every IP Address should have a MAC Address associated with it (and vice versa). A MAC address is the physical address “burned-in” to the NIC of an endpoint (or to a router interface on a router).
  • Ethernet switches forward Ethernet frames from switchport to switchport using the destination MAC address in the frame. This is the core of Layer 2 forwarding. Endpoints use both:
    • the Layer 3 IP address (to identify the destination logically), and
    • the Layer 2 MAC address (to deliver the frame on the local network).
  • Switches, however, only care about MAC addresses.

(Ethernet Frame Diagram - Ping Echo Request) (Description of an Ethernet Frame)

Step 4: In the diagram above, the Destination MAC Address field for the Ping Echo Request frame is empty. Since PC A has never communicated with PC B before (and PC B hasn’t sent any frames into the switch yet), PC A doesn’t know the MAC address associated with PC B’s IP address.

  • PC A tries to look up PC B’s MAC address in its Address Resolution Protocol (ARP) cache. The ARP cache is a database on hosts (which is another name for endpoints and routers on a network) that stores mappings of IP addresses to MAC addresses for other hosts on the LAN. Since PC A hasn’t talked to PC B before, PC A won’t have an entry for PC B yet.

(PC A’s ARP Table)

Step 5: PC A now realizes it can’t complete the Ethernet frame because it’s missing the destination MAC address. To send an Ethernet frame, a host must fill in all required fields. So PC A must DROP the incomplete Ethernet frame containing the Ping Echo Request.

  • To learn the MAC address for 192.168.1.3, PC A must send an Address Resolution Protocol (ARP) Request.
  • ARP is the protocol that lets hosts discover the MAC address associated with a known IP address. When the sender knows the destination IP address but not the destination MAC address associated with it, ARP resolves the missing MAC address so the sender can build a valid Ethernet frame.
  • Conceptually, the sender is asking: “I know your IP address - what MAC address should I use to reach you on this LAN?” The destination host responds with an ARP Reply that includes its MAC address.

(Image 037) Image title - Sender Host sending ARP Request to Destination Host

Step 6: At this point, PC A builds an Ethernet frame containing an ARP Request.

(Ethernet Frame containing PC A’s ARP Request)

Notice that all required fields in this frame are filled in, so PC A can transmit it. PC A sends it out its NIC to the switch, and the switch receives it.

Determining local vs. remote communication

  • Devices use Logical AND of IP address and subnet mask to determine if destination is on same network
  • Default gateway used only for destinations outside local network

Ethernet frame construction

  • Communication on LAN uses both IP addresses (Layer 3) and MAC addresses (Layer 2)
  • MAC address required to complete Ethernet frame for local delivery

Address Resolution Protocol (ARP)

  • ARP resolves unknown MAC address for a known IP address
  • ARP Request: broadcast frame (destination MAC FF:FF:FF:FF:FF:FF) sent to all hosts on LAN
  • ARP Reply: unicast frame sent directly to requester with responder’s MAC address

Switch functions: address learn and forward/filter

  • Address learn:
    • Switch records source MAC address and incoming port in MAC address table
  • Forward/filter:
    • For broadcast or unknown unicast: floods frame out all ports except incoming port
    • For known unicast: forwards frame only to port associated with destination MAC in MAC table

Unknown unicast frames

  • If destination MAC not in MAC table, switch floods frame like a broadcast
  • Used to discover silent hosts or after MAC table loss/expiration

Silent hosts

  • Devices that never send broadcasts or ARP Requests may remain unknown to switches
  • Handling unknown unicast frames is crucial for reaching these hosts

MAC address and ARP table maintenance

  • Switch resets MAC address aging timer upon seeing known MAC address again
  • Hosts reset ARP cache timer when receiving frames from known MAC addresses

ICMP ping process

  • ICMP Echo Request sent after ARP resolution completes
  • Echo Reply sent back to original sender upon receipt
  • Ping considered successful when Echo Reply is received

Windows ping utility behavior

  • Sends 4 consecutive pings by default
  • Reports loss percentage and round trip time (RTT)

Sign up for free to take 10 quiz questions on this topic

Previous
Next  | 2.3 Virtual LANs (VLANs)
All rights reserved ©2016 - 2026 Achievable, Inc.

Address Resolution Protocol (ARP) and Ethernet switching

There are three main functions of an Ethernet switch. Here, we’ll focus on the first two functions, both of which relate to forwarding Ethernet frames.

To see where the switch fits when two endpoints communicate, let’s walk through the scenario below.

(Image 033) Image Title - PC A and PC B connected to Switch-1

PC A would like to send pings to PC B. PC A is connected to Switch-1’s GigabitEthernet0/2 port and PC B is connected to Switch-1’s GigabitEthernet0/3.

PC A pings PC B

Assume you’ve opened a command prompt on PC A and verified that it has a valid IP address for the LAN. Assume PC B also has a valid IP address on the same LAN. You can now ping PC B by entering: “ping 192.168.1.3”

(This example assumes PC A and PC B have never communicated before this ping, and PC B has not sent any frames into the network yet.)

(Image 036) Image Title - Pinging PC B

Step 1: After you enter the “ping 192.168.1.3” command on PC A, PC A first determines whether the destination IP address (PC B) is on the same network. The operating system on PC A performs a Boolean operation called a “Logical AND.” It uses PC A’s own IP address and subnet mask, compares the result to PC B’s IP address, and decides whether they’re on the same network.

We’ll cover how to determine the range of IPs in a network when we discuss IPv4 addressing. For now, assume PC A and PC B are in the same IP network (LAN).

Step 2: Since PC A and PC B are on the same network, PC A must decide whether it needs to use its default gateway.

Does PC A need to use its default gateway in this case? Yes or no?

(spoiler)

No. Devices on a network only need to use their Default Gateway whenever they are sending packets to devices with destination IP Addresses outside of their own network.

Step 3: PC A now builds an Ethernet frame that will carry the ICMP (Ping) Echo Request, and it starts filling in the required Ethernet frame fields.

  • Devices on a LAN communicate using IP addresses and their associated MAC addresses. Every IP Address should have a MAC Address associated with it (and vice versa). A MAC address is the physical address “burned-in” to the NIC of an endpoint (or to a router interface on a router).
  • Ethernet switches forward Ethernet frames from switchport to switchport using the destination MAC address in the frame. This is the core of Layer 2 forwarding. Endpoints use both:
    • the Layer 3 IP address (to identify the destination logically), and
    • the Layer 2 MAC address (to deliver the frame on the local network).
  • Switches, however, only care about MAC addresses.

(Ethernet Frame Diagram - Ping Echo Request) (Description of an Ethernet Frame)

Step 4: In the diagram above, the Destination MAC Address field for the Ping Echo Request frame is empty. Since PC A has never communicated with PC B before (and PC B hasn’t sent any frames into the switch yet), PC A doesn’t know the MAC address associated with PC B’s IP address.

  • PC A tries to look up PC B’s MAC address in its Address Resolution Protocol (ARP) cache. The ARP cache is a database on hosts (which is another name for endpoints and routers on a network) that stores mappings of IP addresses to MAC addresses for other hosts on the LAN. Since PC A hasn’t talked to PC B before, PC A won’t have an entry for PC B yet.

(PC A’s ARP Table)

Step 5: PC A now realizes it can’t complete the Ethernet frame because it’s missing the destination MAC address. To send an Ethernet frame, a host must fill in all required fields. So PC A must DROP the incomplete Ethernet frame containing the Ping Echo Request.

  • To learn the MAC address for 192.168.1.3, PC A must send an Address Resolution Protocol (ARP) Request.
  • ARP is the protocol that lets hosts discover the MAC address associated with a known IP address. When the sender knows the destination IP address but not the destination MAC address associated with it, ARP resolves the missing MAC address so the sender can build a valid Ethernet frame.
  • Conceptually, the sender is asking: “I know your IP address - what MAC address should I use to reach you on this LAN?” The destination host responds with an ARP Reply that includes its MAC address.

(Image 037) Image title - Sender Host sending ARP Request to Destination Host

Step 6: At this point, PC A builds an Ethernet frame containing an ARP Request.

(Ethernet Frame containing PC A’s ARP Request)

Notice that all required fields in this frame are filled in, so PC A can transmit it. PC A sends it out its NIC to the switch, and the switch receives it.

Key points

Determining local vs. remote communication

  • Devices use Logical AND of IP address and subnet mask to determine if destination is on same network
  • Default gateway used only for destinations outside local network

Ethernet frame construction

  • Communication on LAN uses both IP addresses (Layer 3) and MAC addresses (Layer 2)
  • MAC address required to complete Ethernet frame for local delivery

Address Resolution Protocol (ARP)

  • ARP resolves unknown MAC address for a known IP address
  • ARP Request: broadcast frame (destination MAC FF:FF:FF:FF:FF:FF) sent to all hosts on LAN
  • ARP Reply: unicast frame sent directly to requester with responder’s MAC address

Switch functions: address learn and forward/filter

  • Address learn:
    • Switch records source MAC address and incoming port in MAC address table
  • Forward/filter:
    • For broadcast or unknown unicast: floods frame out all ports except incoming port
    • For known unicast: forwards frame only to port associated with destination MAC in MAC table

Unknown unicast frames

  • If destination MAC not in MAC table, switch floods frame like a broadcast
  • Used to discover silent hosts or after MAC table loss/expiration

Silent hosts

  • Devices that never send broadcasts or ARP Requests may remain unknown to switches
  • Handling unknown unicast frames is crucial for reaching these hosts

MAC address and ARP table maintenance

  • Switch resets MAC address aging timer upon seeing known MAC address again
  • Hosts reset ARP cache timer when receiving frames from known MAC addresses

ICMP ping process

  • ICMP Echo Request sent after ARP resolution completes
  • Echo Reply sent back to original sender upon receipt
  • Ping considered successful when Echo Reply is received

Windows ping utility behavior

  • Sends 4 consecutive pings by default
  • Reports loss percentage and round trip time (RTT)

More from Hosts communicating on a Local Area Network

  • Hosts communicating on a Local Area Network (LAN)