Hosts communicating on a Local Area Network (LAN)
In earlier chapters, you learned that to access an Ethernet LAN, you first connect to an Ethernet switch using either:
- A UTP cable (Cat 5, Cat 5e, or Cat 6)
- A fiber-optic cable (if your device supports it)
What is the function of an Ethernet switch?
An Ethernet switch forwards (switches) Ethernet frames between endpoints within the LAN.
What is a LAN?
A group of devices connected to each other (typically by Ethernet) within a relatively small geographic area, using an Ethernet switch or multiple interconnected Ethernet switches.
Knowing how endpoints connect to a LAN is only the start. As a Network Administrator and CCNA candidate, you also need to understand how data moves between devices inside the LAN. That understanding matters most when you’re troubleshooting problems that prevent endpoints from communicating.
At which layer of the TCP/IP (or OSI) model are Ethernet frames and switches categorized?
Layer 2, the Data Link Layer.
Now let’s look at how endpoints communicate through an Ethernet switch using a simple example.
(Image 033)
PC A and PC B connected to Switch-1
In the diagram, PC A and PC B are both connected to Switch-1. Most endpoint operating systems include a tool called ping. You use ping to test whether you can communicate bi-directionally with another device.
A few important points about ping:
- You can ping a device on the same LAN.
- You can also ping a device on a different LAN.
- Ping can cross multiple network boundaries because the messages can be routed.
- Ping can act like a “heartbeat” to check whether a device is still reachable.
If ping fails, the destination might be:
- Powered off
- Disconnected from the network
- Blocked by something between the two devices
Ping uses a protocol called Internet Control Message Protocol (ICMP). ICMP is part of the TCP/IP stack on common operating systems, including PCs, laptops, routers, and switches.
Here’s the basic ping exchange:
- PC A sends an ICMP Echo Request (a “ping request”) to PC B.
- When PC B receives and processes it, ICMP on PC B sends an ICMP Echo Reply back to PC A.
From PC A’s perspective, the ping is successful only if PC A receives the ICMP Echo Reply from PC B.
Ping also uses a timer. PC A waits a certain amount of time for the reply. If the timer expires before the reply arrives, the ping times out, and the attempt is considered a failure.
Next, let’s confirm that PC A is configured correctly to participate in this LAN.
Verifying IP parameters on PC A
Assume we’re working on PC A, which is running Microsoft Windows. We’ll open the Command Prompt, which is a command-line interface (CLI) that lets you view network settings and test connectivity (including using ping).
(Image 034)
PC A Command Prompt
If you enter the command ipconfig, Windows displays the PC’s network configuration and the current state of its network connectivity.
(Image 035)
ipconfig on PC A
In the output, two fields are especially important:
- IPv4 Address: the IP address configured on PC A
- Default Gateway: the router that devices on this LAN use to reach destinations outside the LAN
Devices on the same LAN can communicate without using the default gateway. But if a device needs to send traffic to an IP address outside the LAN, it must send that traffic to the default gateway, which routes it toward the remote network.
Verifying IP parameters using Linux
On a Linux operating system, you can verify IP and MAC parameters using the ifconfig command.
(Image 035b)
ifconfig on a Linux computer
Verifying IP parameters on Mac OS
On Mac OS, you can verify IP and MAC parameters using the ipconfig command, similar to Windows.
The ipconfig getsummary command also displays the default gateway and additional information.
Conclusion
Now that you know how to test whether two endpoints on a LAN can communicate, the next step is understanding how those messages travel from PC A to PC B.
In the diagram, an Ethernet switch sits between the two endpoints. For a switch to forward and deliver frames, it first needs to learn which switch port each endpoint is connected to. Then it uses specific mechanisms to forward a frame from the sender’s port to the destination’s port.
That leads to an important question: what if the destination endpoint hasn’t communicated on the network yet - how does the switch know which port it’s on?
We’ll answer that in the next chapter, where we explore how switches forward Ethernet frames from switchport to switchport.