Scenario: User on a PC wants to visit www.google.com.

We’ll analyze it layer by layer (OSI) and show the path the packet takes.

Step 1: Application Layer (Layer 7)

  • User opens a browser and types www.google.com.
  • The browser creates an HTTP or HTTPS request (Application Layer data).
  • The browser passes the request to Transport Layer.

Key Idea: At this stage, it’s just data the application wants to send.

Step 2: Transport Layer (Layer 4)

  • TCP (for HTTPS) wraps the data in segments.
  • Adds source port (your PC) and destination port (Google’s web server, port 443).
  • Sequence numbers and acknowledgment info are added for reliability.

Result: The data is now a TCP segment.

Step 3: Network Layer (Layer 3)

  • TCP segment is encapsulated into an IP packet.
  • Adds source IP (your PC, e.g., 192.168.1.10)
  • Adds destination IP (Google’s server IP, resolved via DNS).

DNS Lookup happens here first:

  1. Browser checks if IP for www.google.com is cached.
  2. If not, sends a DNS request (UDP packet) to DNS server.
  3. DNS server responds with Google’s IP.

Now your PC knows the IP to send the packet to.

Step 4: Data Link Layer (Layer 2)

  • IP packet is wrapped in a frame.
  • Adds source MAC address (your NIC)
  • Adds destination MAC address:
    • If destination is on the same subnet → MAC of destination device
    • If different subnet → MAC of default gateway (router)

Result: Packet is now a frame ready for transmission on Ethernet/Wi-Fi.

Step 5: Physical Layer (Layer 1)

  • Frame is converted into electrical signals or Wi-Fi signals.
  • Sent over cables or wireless to the switch.

Step 6: Switch (Layer 2)

  • Switch reads the destination MAC address.
  • Forwards the frame to the router port.
  • Switch does not care about IP, only MAC.

Step 7: Router (Layer 3)

  • Router reads the destination IP address.
  • Checks routing table to decide the best next hop toward Google’s server.
  • Re-encapsulates frame with new source/destination MAC for next hop.

Key Idea: Router moves the packet across networks (LAN → ISP → Internet).

Step 8: Internet / ISP Routing (Layer 3 + Layer 2)

  • Packet hops across multiple routers across the Internet.
  • Each router checks destination IP, forwards the packet accordingly.
  • At each hop: packet is encapsulated in a frame for the physical medium used.

Step 9: Destination Network / Google Data Center

  • Packet reaches Google’s router → internal network → Google web server.
  • Each device decapsulates frame to check the IP.
  • Server receives the TCP segment, reassembles application data.

Step 10: Application Layer on Google Server

  • Server processes HTTP request, prepares HTTP response (webpage).
  • Response follows the reverse path back to your PC.
  • TCP ensures all segments arrive reassembled correctly.

Step 11: Browser Receives Data

  • Browser gets HTML, CSS, JS files → renders page.
  • You see www.google.com loaded.

Simplified Layer Mapping

OSI Layer

Action in this flow

Devices Involved

1 – Physical

Electrical/Wi-Fi signals sent

NIC, cables, wireless

2 – Data Link

Frames created & MAC addressing

Switch, Router NIC

3 – Network

IP packet & routing

Router, Internet routers

4 – Transport

TCP/UDP segment, reliability

PC, Server

5-7 – Application

HTTP request/response

Browser, Google Server

Key Observations for Beginners

  1. Every packet travels layer by layer, being encapsulated/decapsulated.
  2. Switches deal with MAC addresses.
  3. Routers deal with IP addresses.
  4. DNS resolves names → IP before sending.
  5. TCP ensures reliable delivery; missing packets are resent.

 

6️⃣ Common Protocols

Protocol

Purpose

Port / Example

HTTP / HTTPS

Web browsing

80 / 443

DNS

Translate domain to IP

53

DHCP

Automatically assign IP

67/68

FTP / TFTP

File transfer

21 / 22

Ping / ICMP

Test connectivity

N/A

Note : Protocols are like languages devices use to communicate.

Different protocols for different jobs. 

 

7️⃣ Network Topologies (How Devices are Connected)

  • Star: All devices connect to a central switch → common in offices
  • Bus: Devices share a single cable → mostly outdated
  • Ring: Devices connected in a loop → rarely used today
  • Mesh: Every device connects to multiple devices → Internet backbone, redundancy

 

8️⃣ Basic Troubleshooting Mindset

Step-by-step thinking:

  1. Check physical connections → cables, power, Wi-Fi
  2. Check IP settings → correct IP, subnet, gateway
  3. Test connectivity → ping, traceroute
  4. Check network devices → switch, router, firewall
  5. Check services / applications → DNS, web servers

Note:

 Always work from simplest to complex. Don’t skip steps. This mirrors how real network engineers troubleshoot