Ravindra BagaleCourses & study guides

Chapter 1: Networking Fundamentals

1.2 IP address — what and why

An IP (Internet Protocol) address is a logical number that uniquely identifies a device (host) on a network — like the postal address of a house. Routers use it to deliver packets to the correct destination.

  • IPv4 example: 192.168.1.10 (32 bits)
  • IPv6 example: 2406:da1a:8e8:e801::10 (128 bits)

Analogy

Think of an apartment complex. The IP address is the building address (e.g. Shivaji Nagar, Pune). The port is the flat number inside the building. The postman (router) delivers to the building; the watchman (operating system) sends the letter to the right flat (application). And just like the pin code (e.g. 411005) tells India Post which area a letter belongs to, the network part of an IP address tells routers which network the packet belongs to, while the host part identifies the exact machine.

Lakshat theva — this is only an analogy. The literal mechanism is: every packet carries a destination IP in its IP header; each router compares that IP with its routing table (longest matching prefix wins) and forwards the packet to the next hop. When the packet reaches the destination host, the OS reads the destination port in the TCP/UDP header and hands the data to the process listening on that port.