quick ping question

no!all!no!all! Member Posts: 245 ■■■□□□□□□□
I've got a lab setup in packet tracer with some vlans and I can ping other PC's in their respective vlans just fine. But I realized I'm not using any layer 3 devices. I thought ICMP worked at layer 3? I guess I'm asking how does ping work if I'm only have layer 2 devices set up?confused.png
A+, N+, S+, CCNA:RS, CCNA:Sec

"In high society TCP is more welcome than UDP. At least it knows a proper handshake" - Ben Franklin

2019 Goals: CCNP:RS & relocate to St. Pete, FL!

Comments

  • BerkshireHerdBerkshireHerd Member Posts: 185
    If you are pinging from vlan x to another vlan x on the same network then you do not need a layer 3 device. if you wanted to ping vlan y from vlan x then you would need layer 3 to move you to the different network. You can think of a vlan as a separate broadcast domain or network, even if all vlans are on the same switch.

    Someone please correct me if I am wrong.

    Thanks
    Identity & Access Manager // B.A - Marshall University 2005
  • theodoxatheodoxa Member Posts: 1,340 ■■■■□□□□□□
    Are you using extended ping on a switch or pinging from a host connected to an access port? Are you able to ping devices in a different VLAN? You should not be able to. If you are only pinging devices in the same VLAN, then it will work. Even Layer 2 switches support SOME Layer 3-7 functions, such as a Management IP, PING, Traceroute, HTTP, HTTPS, SSH, Telnet, etc...Basically, the same stuff you would have on a PC. Just no routing.
    R&S: CCENT CCNA CCNP CCIE [ ]
    Security: CCNA [ ]
    Virtualization: VCA-DCV [ ]
  • Vask3nVask3n Member Posts: 517
    Like BerkshireHerd and theodoxa already mentioned, the reason why you are able to ping with only layer 2 devices is because you are pinging within the same VLAN.

    The logic would be something like this:

    You initiate a ping on one of the hosts to another host
    The host that initiates the ping performs a bitwise AND on the destination address and sees that it is on the same network
    Since the destination is on the same network, we don't need to go to the default gateway and can instead ARP for the destination MAC if it's not already in the ARP cache.
    The switch handles sending the traffic between the two hosts based on the destination MAC address.
    Working on MS-ISA at Western Governor's University
  • saraanandsaraanand Member Posts: 16 ■□□□□□□□□□
    This is one of my responses from somewhere else...ctrl-c/ctrl-v

    1. A PC checks its ARP cache to find the MAC address of the destination PC. Hence the frame is built accordingly, with source/destination MAC address and source/destination IP address. (you have provided the destination address when you type in the URL)

    2. If the ARP cache of PC does not list the MAC address, PC ARPs for the MAC address of the destination PC....remember here....PC1 has the IP address of the destination that it will use to ARP for its MAC
    .
    3. To get the MAC address, the switch will flood the frame it received from PC1....out all its ports, except the one it received from PC1.And then the intended recipient responds back acknowledging the ARP request by replying with its own MAC address information.

    Now the switch adds the MAC address of the returning frame to its MAC table. It already has the MAC address of PC1, for which this returning frame is destined, hence forwards it out the Ethernet port PC1 is attached to.
    If the destination is in a different subnet/network....

    1. PC1 will send an ARP request for the default gateway. The default gateway is the exit point for the LAN segment.

    2. Switch receives the frame and then the switch checks its MAC address table.

    3. Scenario 1 - Is the exit interface for the default gateway is listed in its MAC address table - -> yes .....switch will send the frame out that port to the default gateway

    Scenario 2 - If the exit interface is not listed in the MAC table of the switch, then the switch will flood that frame out all it ports except the incoming interface, and then the intended recipient (default gateway) responds back acknowledging the ARP request by replying with its own MAC address information.

    Now the switch adds the MAC address of the returning frame to its MAC table. It already has the MAC address of PC, for which this returning frame is destined, hence forwards it out the Ethernet port the PC is attached to, now the PC can build the entire frame as it has all the details required

    From there on the router will forward it out the interface that indicates connectivity towards the destination PC.

  • no!all!no!all! Member Posts: 245 ■■■□□□□□□□
    ahh, i see...very thorough responses from everyone! thank you!!
    A+, N+, S+, CCNA:RS, CCNA:Sec

    "In high society TCP is more welcome than UDP. At least it knows a proper handshake" - Ben Franklin

    2019 Goals: CCNP:RS & relocate to St. Pete, FL!
Sign In or Register to comment.