Based on the Linux Master 2 exam syllabusReport an error
hosts is where you write down the answers, resolv.conf is where you write down whom to ask. OSI 7 layers TCP/IP Device Unit
─────────────────────────────────────────────────────────────────
7 Application HTTP·FTP·SMTP·DNS ┐
6 Presentation Encryption·compression ├─ Application Gateway Data
5 Session Connection mgmt ┘
4 Transport TCP · UDP · ports ── Transport Gateway Segment
3 Network IP · ICMP · ARP ── Internet Router Packet
2 Data Link MAC · Ethernet ┐
1 Physical Cable·signal ┘─ Network Access Switch/Hub Frame/Bit
Ports 21 FTP · 22 SSH · 23 TELNET · 25 SMTP · 53 DNS
80 HTTP · 110 POP3 · 143 IMAP · 443 HTTPS
Switching Circuit switching (PSTN, dedicated path) ↔ Packet switching (PSDN, cut into pieces)
Packet switching = Datagram (connectionless) + Virtual circuit (connection-oriented)
Access CSMA/CD wired · CSMA/CA wireless · Token passing (Token Ring·FDDI)
WAN X.25 → Frame Relay → ATM (fixed 53-byte cell)
FDDI fiber dual-ring token passing · DQDB MAN (802.6)
IEEE 802.3 Ethernet · 802.5 Token Ring · 802.6 DQDB · 802.11 Wireless LAN
Addr A 1~126 · B 128~191 · C 192~223 · D 224~239 (multicast)
Private 10.x · 172.16~31.x · 192.168.x · Loopback 127.0.0.1
Hosts = (256 − mask) − 2| Mask | /Notation | Block | Hosts |
|---|---|---|---|
| 255.255.255.0 | /24 | 256 | 254 |
| 255.255.255.128 | /25 | 128 | 126 |
| 255.255.255.192 | /26 | 64 | 62 |
| 255.255.255.224 | /27 | 32 | 30 |
| 255.255.255.240 | /28 | 16 | 14 |
| 255.255.255.248 | /29 | 8 | 6 |
| 255.255.255.252 | /30 | 4 | 2 |
256 − last value of the mask = block size
block size − 2 = number of usable hosts
256 ÷ block size = number of subnetsKeep the IP fixed at 192.168.1.130 and change only the mask. You can see at a glance that the longer the mask, the narrower the network the address belongs to.
| Mask | Block | Network address | Broadcast address | Host range | Count |
|---|---|---|---|---|---|
| /25 | 128 | .128 | .255 | .129 ~ .254 | 126 |
| /26 | 64 | .128 | .191 | .129 ~ .190 | 62 |
| /27 | 32 | .128 | .159 | .129 ~ .158 | 30 |
| /28 | 16 | .128 | .143 | .129 ~ .142 | 14 |
| /29 | 8 | .128 | .135 | .129 ~ .134 | 6 |
| /30 | 4 | .128 | .131 | .129 ~ .130 | 2 |
/30 has exactly 2 hosts. It is the smallest subnet, used for a segment that links two devices one-to-one.| Two addresses | Mask | Boundary | Verdict |
|---|---|---|---|
| 192.168.1.60 and 192.168.1.70 | /25 (block 128) | Both within 0 ~ 127 | Same subnet — direct communication |
| 192.168.1.60 and 192.168.1.70 | /26 (block 64) | 60 is in 0 ~ 63, 70 is in 64 ~ 127 | Different subnets — a router is needed |
| 192.168.1.100 and 192.168.1.126 | /27 (block 32) | Both within 96 ~ 127 | Same subnet |
| 192.168.1.126 and 192.168.1.127 | /27 (block 32) | 127 is the broadcast address of that block | 127 cannot be assigned to a host |
/26 the boundary at 64 separates them.This is what happens when you type www.example.com into a browser on a computer whose IP is 192.168.0.10/24 and whose default gateway is 192.168.0.1.
1 Name → IP Check /etc/hosts; if it is not there, ask the DNS server (port 53) in /etc/resolv.conf
→ receive 93.184.216.34 (Day 4)
2 Inside or outside? My network is 192.168.0.0 ~ 192.168.0.255. 93.x is outside
→ send it to the default gateway 192.168.0.1 (Days 3·4)
3 IP → MAC Find the gateway's MAC with ARP (Day 1)
4 Encapsulation Send it out as a [ MAC | IP | TCP | data ] frame (Day 1)
5 Path selection Routers look at the IP and pass the packet to the next hop (Day 2, packet switching)
6 Connect and request TCP 3-way handshake, then an HTTP request to port 80 (Day 1)| If this step breaks | Symptom you see | What to check |
|---|---|---|
| 1 | It works by IP but not by name | /etc/resolv.conf, nslookup |
| 2 | Hosts on the same network work but the outside does not | The default line of ip route |
| 3 | You cannot even reach the device right next to you | Cable, arp -n, IP and mask |
| 6 | ping works but only that one service does not | Whether the other side's port is open — netstat -tulpn |
| Command | What it shows | Layer · address it touches |
|---|---|---|
ethtool | Link status, speed | Layer 1 |
arp · ip neigh | IP ↔ MAC table | Layer 2 — MAC |
ifconfig · ip addr | Interface IP and MAC | Layers 2·3 |
route · ip route | Routing table, default gateway | Layer 3 — IP |
ping · traceroute | Reachability, path | Layer 3 — ICMP |
netstat · ss | Open ports, connections | Layer 4 — port |
nslookup · dig · host | Name ↔ IP | Layer 7 — DNS |
| Item | A | B | Distinguishing criterion |
|---|---|---|---|
| OSI vs TCP/IP | 7 layers, theory | 4 layers, practice | Purpose |
| Switch vs router | Layer 2, MAC | Layer 3, IP | Address it looks at |
| MAC vs IP | Hardware, fixed | Configured, changeable | Where it is engraved |
| TCP vs UDP | Reliable, connection-oriented | Fast, connectionless | What it prioritizes |
| Circuit vs packet switching | PSTN, dedicated | PSDN, split up | Path occupancy |
| Datagram vs virtual circuit | Connectionless | Connection-oriented, order kept | Whether the path is fixed |
| CSMA/CD vs CA | Wired, detection | Wireless, avoidance | Medium |
| X.25 vs Frame Relay | More error checking, slow | Trimmed down, fast | Assumes good line quality |
| Class A vs C | 1~126 | 192~223 | First octet |
/etc/hosts vs resolv.conf | Name↔IP answers | DNS servers to ask | What gets written |
ifconfig vs ip | Old net-tools | Current iproute2 | Generation |
ping vs traceroute | Can I reach it? | Where does it get blocked? | What it tells you |
/etc/hosts" → It goes in /etc/resolv.conf.| Look-alikes | One line to tell them apart |
|---|---|
| ISO / OSI | ISO is the organization, OSI is the 7-layer model that organization made |
| IEEE / IETF | IEEE sets the 802 (LAN) standards, IETF produces RFCs (Internet protocols) |
| IANA / ICANN | Both manage addresses and names. IANA does the hands-on number assignment, ICANN oversees |
| PSTN / PSDN | T is telephone (circuit switching), D is data (packet switching) |
| ARP / RARP | IP → MAC / MAC → IP |
| FDDI / DQDB | Dual ring (fiber) / dual bus (MAN) |
| Token Ring / FDDI | Both use token passing. 802.5 / fiber dual ring |
| Hub / Switch | Floods to everyone (Layer 1) / looks at the MAC and sends only to that port (Layer 2) |
| Network address / Broadcast address | All host bits 0 / all host bits 1 |
netstat -r / netstat -i | Routing table / interface statistics |
ip addr / ip link | Handles addresses / turns devices on and off |
| Number | Confusing pair | How to tell them apart |
|---|---|---|
| 48 | 48 data bytes of an ATM cell / 48-bit MAC address | Different units — bytes vs bits |
| 53 | 53-byte ATM cell / DNS port 53 | The same number by coincidence |
| 64 / 62 | Address count / host count of /26 | Whether you subtracted 2 |
| 126 | Last first octet of Class A / host count of /25 | Range vs count |
| 127 | Loopback range | The value missing between A and B |
| 802.3 / 802.5 / 802.11 | Ethernet / Token Ring / wireless LAN | 3 is wired CSMA/CD, 11 is wireless CSMA/CA |
| Value | What it is |
|---|---|
| 7 / 4 | Number of OSI layers / number of TCP/IP layers |
| 53 bytes | ATM cell size |
| 62 | Host count of /26 (255.255.255.192) |
| 32 / 128 bits | IPv4 / IPv6 address length |
| 48 bits | MAC address length |
| 127.0.0.1 | Loopback |
| 0~1023 | Well-known port range |
| 22 / 23 / 25 / 53 / 80 / 110 | SSH / TELNET / SMTP / DNS / HTTP / POP3 |
Next week is Internet services. It covers the web, mail, DNS, remote access, and file sharing. 20 of the 32 Linux Usage questions come from this area, so it carries the greatest weight.
Click a choice to reveal the answer and explanation.
Question 1
In the OSI 7 layers, which layer does a switch operate at?
Question 2
Which medium access control method is used in wireless LANs?
Question 3
Which of the following is the loopback address that points to the host itself?
Question 4
When the subnet mask 255.255.255.224 is applied to a Class C network, how many usable hosts does one subnet have?
Question 5
What is the default port number of SMTP, which is used to send mail?
Question 6
Which of the following is not in a private IP address range?