Fundamentals 12 min read

Understanding the OSI 5‑Layer Model: How Computers Locate and Communicate with Each Other

This article explains, in plain language, how the five‑layer OSI model enables two distant computers to discover each other, establish a connection, and reliably exchange data by detailing the roles of the physical, data‑link, network, transport, and application layers.

Java Captain
Java Captain
Java Captain
Understanding the OSI 5‑Layer Model: How Computers Locate and Communicate with Each Other

Introduction

How can two computers that are far apart communicate, and how does a computer accurately locate another computer to send data? This article uses the OSI five‑layer model to explain the process in a concise way that anyone without a networking background can understand.

1. Physical Layer

The physical layer connects computers using media such as fiber, cable, or twisted pair, and transmits binary signals (0s and 1s) as electrical or optical pulses.

2. Data Link Layer

The data‑link layer adds structure to the raw bits by defining frames, which consist of a header and payload. Ethernet is the most common protocol at this layer, using 64‑1518‑byte frames with a fixed 18‑byte header.

Each network interface card (NIC) has a unique MAC address (48 bits) that identifies the device on the local network.

When a device needs to discover another device’s MAC address, it uses broadcast messages and the ARP (Address Resolution Protocol) to map IP addresses to MAC addresses.

3. Network Layer

The network layer introduces the concept of subnets and IP addressing. IPv4 addresses are 32‑bit numbers divided into a network part and a host part; the subnet mask (also 32 bits) indicates which bits belong to the network.

By performing a bitwise AND between an IP address and its subnet mask, devices can determine whether two hosts are on the same subnet. If they are, communication occurs directly; otherwise, packets are forwarded to a gateway.

IP addresses are resolved to human‑readable domain names via DNS servers.

4. Transport Layer

The transport layer adds ports to identify which application should receive the data. Common protocols are TCP (reliable) and UDP (unreliable). Default ports, such as 80 for HTTP, are often used.

5. Application Layer

The application layer is closest to the end user. It defines the format of the data being transferred (e.g., HTTP specifies the type of file being sent) so that receiving applications can correctly interpret and render the content.

Conclusion

The five‑layer OSI model provides a structured way to understand how data travels from one computer to another. For deeper study, the book "Computer Networking: A Top‑Down Approach" is recommended.

MAC addressOSI modelnetwork layersnetworking fundamentalsIP addressing
Java Captain
Written by

Java Captain

Focused on Java technologies: SSM, the Spring ecosystem, microservices, MySQL, MyCat, clustering, distributed systems, middleware, Linux, networking, multithreading; occasionally covers DevOps tools like Jenkins, Nexus, Docker, ELK; shares practical tech insights and is dedicated to full‑stack Java development.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.