Objective
Same-network communication (Layer 2 only)
Different-network communication (Layer 3 + Layer 2)
When ARP is used
When the router is required
What changes and what stays constant
This is designed for beginners.
Devices
- 1 Router (R1)
- 1 Switch (SW1)
- 2 Hosts (Host-A and Host-B)
Physical Connections
- Host-A (link to) Switch
- Host-B (link to) Switch
- Router G0/0 (link to) Switch
- Router G0/1 (link to) Switch
No VLANs.
No trunking.
Just basic Ethernet.
IP Addressing
| Device | Interface | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|---|
| Host-A | NIC | 192.168.1.10 | 255.255.255.0 | 192.168.1.1 |
| Host-B | NIC | 192.168.2.20 | 255.255.255.0 | 192.168.2.1 |
| R1 | G0/0 | 192.168.1.1 | 255.255.255.0 | — |
| R1 | G0/1 | 192.168.2.1 | 255.255.255.0 | — |
You will use this same topology to test both scenarios.
* IPs are not configured on switches.
Configure the Router
On R1:
enable
configure terminal
interface g0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
interface g0/1
ip address 192.168.2.1 255.255.255.0
no shutdown
exit
end
Verify:
show ip interface brief
show ip route
You should see two connected routes:
C 192.168.1.0/24
C 192.168.2.0/24
Configure the Hosts
Host-A
IP: 192.168.1.10
Mask: 255.255.255.0
Gateway: 192.168.1.1
Host-B
IP: 192.168.2.20
Mask: 255.255.255.0
Gateway: 192.168.2.1
Test Different Network (Layer 3 Required)
From Host-A:
ping 192.168.2.20
It should work.
What Happens Internally
- Host-A checks:
- Is 192.168.2.20 in my network?
- It calculates network ID.
- Networks are different.
- Host-A ARPs for default gateway (192.168.1.1).
- Router replies with its MAC.
- Host-A builds frame:
- Destination MAC = Router
- Source MAC = Host-A
- IP addresses unchanged.
- Router:
- Removes L2 header
- Decrements TTL
- Looks at routing table
- ARPs for Host-B
- Builds new frame with new MAC addresses.
- Host-B receives packet.
Important:
- IP addresses stay the same.
- MAC addresses change at router.
- TTL decreases.
Convert to Same Network (Layer 2 Only)
Now change only Host-B:
Change Host-B:
IP: 192.168.1.20
Mask: 255.255.255.0
Gateway: (leave blank or 192.168.1.1)
Now both Hosts are in:
192.168.1.0/24
Test again from Host-A:
ping 192.168.1.20
What Happens Now
- Host-A checks destination network.
- Network matches.
- Host-A ARPs directly for Host-B.
- Switch forwards frame.
- Router is NOT involved.
Notice:
- Router G0/1 is unused.
- TTL does not decrement.
- No routing table lookup.
- No MAC rewrite at router.
Compare Both Results
| Feature | Same Network | Different Network |
|---|---|---|
| Router Used | No | Yes |
| ARP For | Target host | Default gateway |
| TTL Decrement | No | Yes |
| MAC Changes at Router | No | Yes |
| IP Changes | No | No |
Troubleshooting
Remove Host-A default gateway and try:
ping 192.168.2.20
It will fail.
Reason:
Host-A knows the network is remote but has no gateway to send traffic to.
Conclusion
Using a single topology, you observed both behaviors:
- Same subnet = pure Layer 2 delivery.
- Different subnet = Layer 3 decision + Layer 2 delivery to gateway.
Core principles reinforced:
- Layer 3 decides where traffic must go.
- Layer 2 decides how to reach the next hop.
- ARP resolves MAC addresses locally.
- Routers rewrite Layer 2 headers.
- IP addresses remain end-to-end.
- TTL decreases at each router.
This single topology clearly shows how host-to-host communication works at CCNA level without introducing VLAN complexity.
HOME | CCNA Study Hub | Blog
