Lab: Host-to-Host Communication

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

DeviceInterfaceIP AddressSubnet MaskDefault Gateway
Host-ANIC192.168.1.10255.255.255.0192.168.1.1
Host-BNIC192.168.2.20255.255.255.0192.168.2.1
R1G0/0192.168.1.1255.255.255.0
R1G0/1192.168.2.1255.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

  1. Host-A checks:
    • Is 192.168.2.20 in my network?
  2. It calculates network ID.
  3. Networks are different.
  4. Host-A ARPs for default gateway (192.168.1.1).
  5. Router replies with its MAC.
  6. Host-A builds frame:
    • Destination MAC = Router
    • Source MAC = Host-A
    • IP addresses unchanged.
  7. Router:
    • Removes L2 header
    • Decrements TTL
    • Looks at routing table
    • ARPs for Host-B
    • Builds new frame with new MAC addresses.
  8. 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

  1. Host-A checks destination network.
  2. Network matches.
  3. Host-A ARPs directly for Host-B.
  4. Switch forwards frame.
  5. 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

FeatureSame NetworkDifferent Network
Router UsedNoYes
ARP ForTarget hostDefault gateway
TTL DecrementNoYes
MAC Changes at RouterNoYes
IP ChangesNoNo

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

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top