16.2 Network Hardware and Layered Network Models (OSI and TCP/IP)
Key Takeaways
- A switch connects devices within a LAN and sends each frame only to the port of its destination MAC address; a hub, now obsolete, repeats every signal to all ports.
- A router connects different networks and forwards packets toward their destination IP address using a routing table; a home router usually also provides Wi-Fi, NAT, and a firewall.
- A modem converts between the digital signals of a home network and the signaling used on the provider's cable, DSL, or fiber line.
- The TCP/IP model has four layers (application, transport, internet, link); the OSI model has seven (application, presentation, session, transport, network, data link, physical).
- Sending data moves down the layers, each adding its own header (encapsulation): a message becomes a TCP segment, then an IP packet, then an Ethernet frame, then bits.
What this competency asks
ETS asks you to know components of networks:
- Identify network hardware devices and their functions.
- Describe possible abstraction models of networks.
Network hardware devices
| Device | Function | Uses addresses at |
|---|---|---|
| Network interface card (NIC) | Connects a device to a network (wired or wireless); has a MAC address | Link (hardware) |
| Hub (obsolete) | Repeats every incoming signal out of all ports; all devices share bandwidth and collisions | None; it just repeats signals |
| Switch | Connects devices within a LAN; learns which MAC address is on which port and forwards frames only where they need to go | MAC addresses |
| Wireless access point (WAP) | Connects Wi-Fi devices to the wired LAN | MAC addresses |
| Router | Connects different networks (for example, a school LAN to the Internet) and forwards packets toward their destination using routing tables | IP addresses |
| Modem | Modulates and demodulates: converts between the network's digital signals and the provider's line signaling (cable, DSL, fiber terminal) | — |
| Firewall | Filters traffic according to security rules (Section 16.6) | IP addresses, ports, and sometimes content |
| Repeater / range extender | Regenerates a signal to extend its distance | — |
A typical home router combines a router, a switch, a Wi-Fi access point, and a firewall, and it performs network address translation (NAT) so many devices share one public IP address (Section 16.4).
MAC vs. IP addresses: a MAC address (48 bits, written in hex, such as 00:1A:2B:3C:4D:5E) identifies a network interface on the local link. An IP address identifies a device's location on the internetwork and is used to route across networks. Your laptop keeps its MAC address everywhere, but it receives a different IP address on each network it joins.
Why layered models?
Networking is complicated, so it is divided into layers. Each layer provides services to the layer above it and uses the services of the layer below. This is abstraction (Section 4.1). A web browser does not care whether data travel over Wi-Fi or fiber, and Wi-Fi does not care whether it is carrying a video or an email. Layers can be improved independently: moving from copper to fiber required no change to HTTP.
The TCP/IP model (four layers)
| Layer | Job | Examples |
|---|---|---|
| Application | Network services for programs | HTTP, HTTPS, DNS, SMTP, FTP |
| Transport | End-to-end delivery between programs, using port numbers; reliability (TCP) or speed (UDP) | TCP, UDP |
| Internet | Addressing and routing packets across networks | IP (IPv4, IPv6) |
| Link (network access) | Moving frames across one physical network | Ethernet, Wi-Fi |
The OSI model (seven layers)
| # | Layer | Role | Corresponds to TCP/IP |
|---|---|---|---|
| 7 | Application | Services used by applications | Application |
| 6 | Presentation | Data formats, encryption, compression | Application |
| 5 | Session | Managing sessions between applications | Application |
| 4 | Transport | End-to-end reliability, ports, segmentation | Transport |
| 3 | Network | Logical addressing and routing (routers) | Internet |
| 2 | Data link | Frames, MAC addresses (switches) | Link |
| 1 | Physical | Bits as signals on cable or radio | Link |
The OSI model is a teaching and reference model. TCP/IP is what the Internet actually runs.
Where each device works
| Device | OSI layer | TCP/IP layer |
|---|---|---|
| Hub, repeater, cable | 1 Physical | Link |
| Switch, wireless access point, NIC | 2 Data link | Link |
| Router | 3 Network | Internet |
| Firewall | 3 and 4; some also inspect application data | Internet and transport, sometimes application |
A common mnemonic lists the OSI layers from 1 up to 7: Please Do Not Throw Sausage Pizza Away (physical, data link, network, transport, session, presentation, application).
Using the layers to troubleshoot
Technicians work up the layers, because a failure at a lower layer breaks everything above it.
| Symptom | Likely layer | What to check |
|---|---|---|
| No link light, or Wi-Fi shows no connection | Physical and link | Cable, port, wireless radio, access point |
| Connected, but the computer has only a self-assigned 169.254.x.x address | Internet (addressing) | The DHCP server that hands out IP addresses |
| Sites load by numeric IP address but not by name | Application (DNS) | DNS server settings (Section 16.4) |
| One website fails while others work | Application or the remote server | The site itself, not the local network |
Encapsulation
When data are sent, each layer adds its own header (and the link layer adds a trailer):
Application: [ message, e.g. an HTTP request ]
Transport: [ TCP header | message ] → segment
Internet: [ IP header | TCP header | message ] → packet
Link: [ Ethernet header | IP packet | FCS trailer ] → frame
Physical: 1 0 1 1 0 0 1 … → bits
- The TCP header holds source and destination ports, sequence numbers for reordering, and acknowledgment information.
- The IP header holds source and destination IP addresses and a time-to-live counter that stops packets from circling forever.
- The Ethernet frame holds MAC addresses in its header and a frame check sequence (CRC) in its trailer for detecting transmission errors.
At the receiver, each layer removes its own header (decapsulation) and passes the rest up.
Following one request through the devices
A student's laptop on school Wi-Fi requests a web page from a server on another network:
- The laptop sees that the server is not on its local network, so its NIC sends the packet in a Wi-Fi frame addressed to the MAC address of the default gateway, the school's router. In IPv4, the Address Resolution Protocol (ARP) finds the MAC address that goes with the router's IP address.
- The access point passes the frame onto the wired LAN, and the switch forwards it only out of the router's port.
- The router removes the frame, reads the destination IP address, checks its routing table, and decrements the time-to-live. At the school's edge, the router (or a firewall beside it) also applies security rules and uses NAT to replace the laptop's private source address with the school's public address. Then the packet goes into a new frame for the next link.
- The school's connection carries the packet to its Internet provider. Every router along the path repeats the forwarding part of step 3: it reads the destination IP address, decrements the time-to-live, and sends the packet on inside a new frame, with the IP addresses unchanged.
- The server's NIC accepts the final frame, and each layer removes its header until the request reaches the web server program.
The rule to remember: MAC addresses change at every hop, while the source and destination IP addresses stay the same from end to end, except where NAT rewrites a private address at the network's edge. A basic switch forwards by MAC address only. A router forwards by IP address.
Packet switching
The Internet uses packet switching. Data are split into packets that travel independently, possibly by different routes, and are reassembled at the destination. Links are shared efficiently, and traffic can route around failures. The traditional telephone network used circuit switching, which reserves a dedicated path for the whole call. That path is steady, but capacity is wasted during silences, and the call drops if the path breaks.
Twenty computers in a lab connect by cable to one device. When computer A sends data to computer B, the device forwards the frame only out of the port connected to B, based on B's MAC address. What is the device?
Which device forwards packets between a school's local network and the Internet, choosing where to send each packet based on its destination IP address?
In the TCP/IP model, which layer is responsible for addressing packets and routing them across interconnected networks?
As a web request travels down the TCP/IP layers on the sending computer, in what order are headers added?