The OSI model is a “seven-story building” of communication
The OSI reference model splits how communication works into seven layers by role. Pulling out just the layers most related to devices gives this:
| Layer | Role | Main devices |
|---|---|---|
| Layer 4: Transport | Delivery rules (TCP, UDP, port numbers) | Firewall |
| Layer 3: Network | Directions to faraway places (IP addresses) | Router, L3 switch |
| Layer 2: Data link | Hand-offs within the same network (MAC addresses) | L2 switch |
| Layer 1: Physical | Electrical and light signals | Repeater hub, ONU, cables |
The higher the layer a device works at, the closer to the data’s contents it looks, and the smarter its decisions — at the cost of heavier processing.
Switches deliver by MAC address
A MAC address is a number assigned at the factory to a LAN port or Wi-Fi chip (e.g. 00:1A:2B:3C:4D:5E). A switch remembers each arriving frame’s “sender MAC address” and “which port it came in on,” building a MAC address table. From then on, it looks up the destination MAC address in the table and sends only to that port.
Old repeater hubs copied every incoming signal to all ports as is. The more devices you connected, the more the network clogged with data that had nothing to do with them.
Routers choose the route by IP address
A MAC address works only within the same network. When data goes to a different network — say, from the office LAN out to the internet — the router looks at the destination IP address and picks the next hop from its routing table (a table of routes for each destination).
Compared to a parcel delivery, the IP address is the final address written on the package, and the MAC address is the courier carrying it on the current leg. The courier (MAC address) changes every time it passes a router, but the address (IP address) stays the same all the way.
A home router is “all-in-one”
A single home Wi-Fi router contains a router, a switch (the LAN ports on the back), a wireless access point and a simple firewall. Two more things are also at work:
- DHCP: automatically hands out IP addresses to the phones and PCs you connect
- NAPT (IP masquerade): swaps the private IP addresses inside your home (192.168.…) for the line’s single global IP address, so any number of devices can go online at the same time
In companies and data centers, these jobs are split among dedicated devices — or L3 switches, which add router functions to a switch — so they can handle the number of devices and the speed.
Troubleshoot from the bottom layer up. If the port light is off, it’s Layer 1; if the other device isn’t in the switch’s MAC address table, Layer 2; if ping fails, Layer 3; if ping works but the web doesn’t, Layer 4 or above. Thinking in layers tells you what to check next.
What’s in a data-center rack?
In a data center, the equipment above sits in order from the top in a shelf about 2 m tall called a “rack.” Heavy UPS units and storage go near the bottom.
| Device | Role |
|---|---|
| Line entry (ONU) | Where the carrier’s fiber line comes in. Converts the light signal into the LAN’s electrical signal. In a data center, the carrier’s termination equipment does this job. |
| Patch panel | A relay point for cables. Gathers the cabling so connections are easy to change. |
| Router | Connects to the internet and other sites, and decides where data goes (its route). |
| Firewall | The gatekeeper that stops suspicious traffic from outside. Its rule table decides what’s allowed or blocked. |
| Switch | Connects the servers in the rack to each other and to the router, and hands out data. |
| Servers | Computers that run apps, websites and virtual machines. Lots of thin 1U and 2U boxes are stacked up. |
| Storage | A box that stores data on many disks. With RAID, data can be restored even if a disk breaks. |
| UPS | During a power outage, keeps supplying power from batteries until the generator starts. It’s heavy, so it goes at the very bottom. |
| PDU | A power strip for racks. It feeds power to every device. |
Practice questions
Four-choice questions in the style of Japan’s Fundamental Information Technology Engineer Examination. Tap below to see the answer.
Q1Which device, within a LAN, looks at the destination MAC address of received data and forwards it only to the port where that device is connected?
- ARepeater hub
- BL2 switch
- CRouter
- DONU
Show the answer and explanation
Answer: BAn L2 switch decides the outgoing port from the MAC address. A repeater hub sends the same signal to all ports, and a router chooses routes by IP address.
Q2In the OSI reference model, which layer does a router mainly work at?
- APhysical layer
- BData link layer
- CNetwork layer
- DApplication layer
Show the answer and explanation
Answer: CA router looks at IP addresses and chooses the route to another network. IP is a network-layer (Layer 3) mechanism.
Q3Which function lets a home router convert the private IP addresses of several devices in the home into one global IP address to connect to the internet?
- ADHCP
- BDNS
- CNAPT
- DVPN
Show the answer and explanation
Answer: CNAPT lets several devices share one global IP address by rewriting port numbers as well as IP addresses. DHCP hands out IP addresses automatically, and DNS maps names to IP addresses.
- Devices differ by “which layer’s information they look at.” Switch = MAC, router = IP
- MAC is the courier for the current leg; IP is the final address
- A home router is all-in-one: router, switch, AP, DHCP and NAPT