Latest

Basics of Ping Packets Processing: A Step-by-Step Guide

Basics of Ping Packets Processing: A Step-by-Step Guide

We assume that all devices have just been turned on, that the switch is a layer 2 switch, and that all PCs are fully setup. 

Ping connection
Fig 1.1- Ping request

Step 1: User1 pings remote User2. As two PCs are separated by a router, they must be on different networks (subnets). User1 determines that destination IP is on remote networks using ANDing method of bit calculating, so User1 will use its Default Gateway. 

Step 2: User1 looks in its ARP cache for default gateway IP address. If does not have it, it sends ARP request (hey, you with IP 192.168.1.1, what is your MAC?)

Step 3: NDNA_SW1 gets the frame; frame is ARP broadcast, so NDNA_SW1 processes the frame. Adds MAC source address and interface # it came in. 

Step 4: ARP is broadcast (all FFFF’s), NDNA_SW1 sends out the frame to all ports in the same VLAN except the receiving port. (Frame is not move to upper layers in OSI, instead Data link takes care of it)

Step 5: Broadcast ARP reaches your NDNA_R1. NDNA_R1 accepts frame since target IP address matches the receiving port's IP address.

Step 6: NDNA_R1 updates its ARP table with received information and replies to the request with the receiving port's MAC address. (I am 192.168.1.1, my MAC is 0a.11.2c.e3.4x.9a). Frame ARP replay now is going back to User1. 

Step 7: NDNA_SW1 has MAC of User1, but adds MAC of NDNA_R1 and sends frame ONLY to User1. User1 receives APR replay and puts info into his ARP cache. 

Step 8: Now User1 can continue whatever was trying to do in the first place. User1 takes MAC of default gateway stored in cache and builds packet with upper layer protocols 

Step 9: User1 sends packet to User2. Source IP is User1, Dst IP is User2, source MAC is User1, Dst. MAC is Router's Fa0/1. Switch receives packet and forwards out of port connected to NDNA_R1. It does not do anything special now.

Step 10: NDNA_R1 looks at MAC Dst. It is for him, processes the frame to look at IP Dst. IP Destination is directly connected, so it will process the packet (Routers know about directly connected networks; User2 is directly connected).  

Step 11: If NDNA_R1 does not have MAC address of User2 in his cache, it will send ARP broadcast on the interface connected to User2. NDNA_R1 waits for ARP replay from User2, not from NDNA_SW2, although ARP frame will pass through the NDNA_SW2 on the way to User2 and back. NDNA_Sw2 is doing same thing as NDNA_SW1 did: builds MAC table.

Step 12: With User2's MAC in cache, NDNA_R1 will process packet by adding User2's MAC address as dest. and his outgoing interface MAC as a source. The IPs in the packet are the same.NDNA_SW2 receives frame, adds MAC address (if not already in the table).   

Step 13: NDNA_SW2 and NDNA_SW1 will process frames if ports are access ports and are on the same VLAN. Assuming NDNA_R1 and User2 are on the same VLAN, NDNA_SW2 will forward frame to User2.  User2 receives frame, reads dest. MAC, strips Ethernet header and trailer, and looks at dest. IP. OK, it is for me and processes. Packet is an ICMP packet so the ICMP process processes it by sending Echo Replay message. 

Step 14: IP addresses are reversed. Source IP (User1) becomes destination; destination IP (User2) becomes source. Data link layer takes packet and encapsulates it with User2's MAC as source and MAC of default gateway on NDNA_R1 (destination IP is on different network). 

Step 15: Packet is on his way back to User1. The return path does not need ARP process so the return trip will be faster.

 Continue Reading...