Based on the Linux Master 1 exam syllabusReport an error
| Layer | Name | Core responsibility | Data unit (PDU) | Typical devices / protocols |
|---|---|---|---|---|
| 7 | Application | Provides user services | Data | HTTP, FTP, SMTP, DNS |
| 6 | Presentation | Encoding, encryption, compression | Data | SSL/TLS, JPEG, ASCII |
| 5 | Session | Establishing, maintaining, and ending connections | Data | NetBIOS, RPC |
| 4 | Transport | End-to-end reliability, ports | Segment | TCP, UDP |
| 3 | Network | Logical addressing, routing | Packet | IP, ICMP, router |
| 2 | Data Link | Physical addressing, frames, error control | Frame | Ethernet, MAC, switch |
| 1 | Physical | Transmitting bits as electrical signals | Bit | Cable, hub, repeater |
Mnemonic: "All People Seem To Need Data Processing" (7→1: Application, Presentation, Session, Transport, Network, Data link, Physical). For 1→7, use "Please Do Not Throw Sausage Pizza Away". The exam has questions that ask about layer order.
Key distinction: pair each layer number with that layer's address and device. Layer 2 = MAC address / switch, Layer 3 = IP address / router, Layer 4 = port number / TCP and UDP. "Which layer is a MAC address?" → Layer 2. "Which layer is a router?" → Layer 3. This mapping is the root of the Day 4 device questions.
| TCP/IP layer | Corresponding OSI layers | Typical protocols |
|---|---|---|
| Application | 7, 6, 5 | HTTP, FTP, DNS, SMTP, SSH |
| Transport | 4 | TCP, UDP |
| Internet | 3 | IP, ICMP, ARP |
| Network Access | 2, 1 | Ethernet, ARP |
TCP/IP is the "practical model" that developed through real implementation on the US ARPANET in the 1970s, while OSI is the "theoretical model" standardized by ISO in 1984. The real Internet is dominated by TCP/IP, but the 7 layers are more precise as a language for analyzing problems, so both are used. The exam asks about the correspondence between the OSI 7 layers and the TCP/IP 4 layers.
| Item | TCP | UDP |
|---|---|---|
| Connection method | Connection-oriented (3-way handshake) | Connectionless |
| Reliability | Guaranteed (retransmission, ordering, flow control) | Not guaranteed |
| Speed | Relatively slow | Fast |
| Header size | 20 bytes | 8 bytes |
| Uses | Web, email, file transfer | DNS, streaming, VoIP |
TCP's 3-way handshake establishes a connection in 3 steps: SYN → SYN/ACK → ACK. Connection teardown is a 4-way exchange (two FIN/ACK pairs). UDP just sends with no such procedure — so it is fast but gives no delivery guarantee. Summarize it as "reliability = TCP, speed = UDP".
| Class | First octet range | Default subnet mask | Network/host bits | Use |
|---|---|---|---|---|
| A | 1 ~ 126 | 255.0.0.0 (/8) | 8 / 24 | Large |
| B | 128 ~ 191 | 255.255.0.0 (/16) | 16 / 16 | Medium |
| C | 192 ~ 223 | 255.255.255.0 (/24) | 24 / 8 | Small |
| D | 224 ~ 239 | None | — | Multicast |
| E | 240 ~ 255 | None | — | Research / reserved |
⚠️ Trap: first octet 127 (127.0.0.0/8) looks like it falls within the Class A range, but it is reserved for loopback and is not assigned to ordinary hosts. That is why the practical Class A range is written as 1-126.
127.0.0.1is the machine itself (localhost).
| Class | Private IP range |
|---|---|
| A | 10.0.0.0 ~ 10.255.255.255 (10.0.0.0/8) |
| B | 172.16.0.0 ~ 172.31.255.255 (172.16.0.0/12) |
| C | 192.168.0.0 ~ 192.168.255.255 (192.168.0.0/16) |
Key distinction: 169.254.x.x is not a private IP; it is an APIPA (link-local) address. It is an address a host assigns itself when it cannot find a DHCP server, so "the IP starts with 169.254 but the Internet doesn't work" = a sign that DHCP failed. This concept is used both in practice and on the exam.
# 255.255.255.0 in binary
11111111.11111111.11111111.00000000
# └─────── network (24 bits) ──────┘ └ host (8 bits) ┘/24 = 24 leading 1s in the mask = 255.255.255.0.| CIDR | Subnet mask | Last octet in binary | Block size |
|---|---|---|---|
| /24 | 255.255.255.0 | 00000000 | 256 |
| /25 | 255.255.255.128 | 10000000 | 128 |
| /26 | 255.255.255.192 | 11000000 | 64 |
| /27 | 255.255.255.224 | 11100000 | 32 |
| /28 | 255.255.255.240 | 11110000 | 16 |
| /29 | 255.255.255.248 | 11111000 | 8 |
| /30 | 255.255.255.252 | 11111100 | 4 |
A mask octet value is the result of filling that many 1s from the left. 128 = one 1, 192 = two, 224 = three, 240 = four, 248 = five, 252 = six. If you memorize the sequence "128 192 224 240 248 252 254 255", you can instantly convert any CIDR to a mask.
1) Usable hosts = 2^(host bits) − 2
# /24 → 8 host bits → 2^8 - 2 = 254 hosts
# /26 → 6 host bits → 2^6 - 2 = 62 hosts
# /30 → 2 host bits → 2^2 - 2 = 2 hosts (for router-to-router links)2) Finding the network and broadcast addresses (example: 192.168.1.0/26)
# The first subnet of 192.168.1.0/26
Network address : 192.168.1.0 (all host bits 0)
First usable address: 192.168.1.1
Last usable address : 192.168.1.62
Broadcast : 192.168.1.63 (all host bits 1)
# The next subnet is 192.168.1.64/26, then 192.168.1.128/26 ...Key distinction: the network address of the network an IP belongs to is "the largest multiple of the block size that is less than or equal to the IP". Example: 192.168.1.100/26 has block size 64 → among multiples of 64 (0, 64, 128, 192), the largest that is at most 100 is 64 → network address 192.168.1.64, broadcast 192.168.1.127. You need this calculation on the practical exam.
3) Try it yourself — verify with ipcalc
# ipcalc shows the subnet calculation automatically (install it if missing)
ipcalc 192.168.1.100/26
# Network: 192.168.1.64/26
# HostMin: 192.168.1.65
# HostMax: 192.168.1.126
# Broadcast: 192.168.1.127
# Hosts/Net: 62ipcalc, you can solve problems quickly and accurately in the exam room even without tools.⚠️ Trap: "/31" has only 1 host bit, so 2^1−2 = 0 and it normally cannot hold any hosts, but under RFC 3021 it is an exception on point-to-point links between routers, where both addresses are used. On the exam, the standard is questions that apply the −2 formula, such as "/30 holds 2 hosts, /29 holds 6".
Starting tomorrow (Day 2), ip addr, gateways, and routing all operate on top of the Layer 3 foundation we built today.
/24): notation that writes the number of 1s in the mask after a slash. /24 means 255.255.255.0.Click a choice to reveal the answer and explanation.
Question 1
Which of the OSI 7 layers determines the path of a packet (routing) based on its IP address?
Question 2
How many usable IP addresses (assignable to hosts) are there in the 192.168.10.0/26 network?
Question 3
What is the broadcast address of the network that the IP address 172.20.5.130/25 belongs to?
Question 4
Which of the following is NOT a private IP address?
Question 5
Which statement about TCP and UDP is correct?
Question 6
Which is the correct subnet mask for CIDR notation /28?
Question 7
A host's IP is automatically set to 169.254.12.34 and the Internet does not work. What is the most likely cause?