7
layers in the OSI model
2^n - 2
formula for usable hosts from n host bits
62
usable hosts in a /26 subnet
3
private IPv4 ranges defined in RFC 1918

Reach 50,000+ security professionals

Sponsor a newsletter slot and put your brand in front of CISOs, engineers, and IT decision-makers.

Summarize with:

The OSI model, TCP versus UDP and IPv4 subnetting underpin a large share of Network+ questions and many networking scenarios on Security+. This cheat sheet gives the seven layers with their data units and devices, a TCP and UDP comparison, a CIDR table with masks and host counts, the private and special address ranges, and a worked subnetting example. The address ranges follow RFC 1918 and RFC 3927. These are our own study summaries of standard facts, not CompTIA's lists. The official CompTIA objectives document remains the authority for what is tested.

How to Use This Cheat Sheet

Network+ and the networking-heavy parts of Security+ lean on the OSI model, TCP versus UDP and IPv4 subnetting. These are our own study summaries of standard facts, not CompTIA's lists. The official CompTIA objectives document remains the authority for what is tested.

The OSI Model

A common mnemonic from layer 7 down to 1 is All People Seem To Need Data Processing, and from layer 1 up it is Please Do Not Throw Sausage Pizza Away.

LayerNamePDUExamplesDevices and notes
7ApplicationDataHTTP, HTTPS, DNS, SMTP, SSH, FTPWhat the user's software talks to
6PresentationDataEncoding, compression and encryption (TLS is often placed here, though it does not map cleanly to one OSI layer)Translates and formats data
5SessionDataSession setup and teardown, RPCManages conversations between applications
4TransportSegment (TCP) or datagram (UDP)TCP, UDP, portsEnd-to-end delivery, port numbers, stateful firewalls
3NetworkPacketIP, ICMP, routingRouters, layer 3 switches, IP addresses
2Data LinkFrameEthernet, Wi-Fi, MAC addresses, VLANsSwitches, bridges, access points
1PhysicalBitsCopper, fiber, radio signalsCables, hubs, repeaters, network interface hardware
Free daily briefing

Briefings like this, every morning before 9am.

Threat intel, active CVEs, and campaign alerts, distilled for practitioners. 50,000+ subscribers. No noise.

TCP Versus UDP

FeatureTCPUDP
ConnectionConnection-oriented, three-way handshake (SYN, SYN-ACK, ACK)Connectionless
ReliabilityAcknowledgments, retransmission and orderingNone built in
Speed and overheadSlower, more overheadFaster, less overhead
Typical usesWeb, email, file transfer, remote shellDNS queries, DHCP, streaming, VoIP, NTP

IPv4 Subnetting Quick Reference

To find the number of hosts, use 2 to the power of the host bits minus 2. A /26 leaves 6 host bits, so 2 to the 6th is 64 addresses and 62 usable hosts, because the first address is the network and the last is the broadcast.

CIDRSubnet maskTotal addressesUsable hostsBlock size (last octet)
/8255.0.0.016,777,21616,777,214Not applicable
/16255.255.0.065,53665,534Not applicable
/24255.255.255.0256254256
/25255.255.255.128128126128
/26255.255.255.192646264
/27255.255.255.224323032
/28255.255.255.240161416
/29255.255.255.248868
/30255.255.255.252424

A /31 is used for point-to-point links where both addresses are usable, and a /32 identifies a single host.

Worked Example

Question: what is the network, broadcast address and usable range for 192.168.10.77/26?

Block size

A /26 has a block size of 64 in the last octet, so the blocks start at 0, 64, 128 and 192.

Network address

77 falls in the 64 to 127 block, so the network address is 192.168.10.64.

Broadcast address

The last address in the block is 192.168.10.127.

Usable hosts

192.168.10.65 through 192.168.10.126, which is 62 hosts.

Special IPv4 and IPv6 Ranges

RangeMeaning
10.0.0.0/8Private (RFC 1918)
172.16.0.0/12 (172.16.0.0 to 172.31.255.255)Private (RFC 1918)
192.168.0.0/16Private (RFC 1918)
169.254.0.0/16Link-local, also called APIPA, assigned when DHCP fails (RFC 3927)
127.0.0.0/8Loopback, for example 127.0.0.1
224.0.0.0/4Multicast

IPv6 uses 128-bit addresses written in hexadecimal.

IPv6 prefixMeaning
::1Loopback
fe80::/10Link-local
fc00::/7Unique local (private-style) addresses
2000::/3Global unicast
ff00::/8Multicast

Address Classes

Classful addressing is largely historical but still appears in questions: Class A starts at 1 to 126, Class B at 128 to 191, Class C at 192 to 223, Class D (multicast) at 224 to 239, and 127 is reserved for loopback.

Where This Fits in Your Study

These topics map to Network+ objectives 1.1, 1.4 and 1.7. See our Network+ objectives explained for the full list, and our guide to which CompTIA certification to take first if you are deciding between Network+ and Security+. DD Academy covers both exams with flashcards and practice questions, free to start on iPhone and the web.

The bottom line

Learn the layers and what lives at each, remember the hosts formula and the block-size method, and practice subnetting until it is automatic. A few worked examples a day for a week will make most subnet questions routine.

Frequently asked questions

What are the seven layers of the OSI model?

From top to bottom: Application, Presentation, Session, Transport, Network, Data Link and Physical. They are often numbered 7 down to 1. Each layer has its own protocols, data units and devices.

At which OSI layer do routers and switches operate?

Routers operate at layer 3, the Network layer, using IP addresses. Standard switches operate at layer 2, the Data Link layer, using MAC addresses, while layer 3 switches also route.

How do I calculate usable hosts in a subnet?

Use 2 to the power of the host bits minus 2. The two addresses removed are the network address and the broadcast address. For example, a /26 has 6 host bits, so 64 minus 2 gives 62 usable hosts.

What are the private IPv4 ranges?

RFC 1918 defines 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. Addresses in these ranges are not routed on the public internet.

What is an APIPA address?

An address in 169.254.0.0/16 that a host assigns itself when it cannot get one from DHCP. It is defined in RFC 3927 as the IPv4 link-local range and allows only local communication.

What is the difference between TCP and UDP?

TCP is connection-oriented and reliable, using a three-way handshake, acknowledgments and retransmission. UDP is connectionless and faster with less overhead, and is used for DNS queries, streaming and similar traffic.

What is the PDU at each layer?

Layer 1 uses bits, layer 2 frames, layer 3 packets, and layer 4 segments for TCP or datagrams for UDP. Layers 5 through 7 are generally called data.

Sources & references

  1. RFC 1918: Address Allocation for Private Internets
  2. RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses
  3. IANA Service Name and Transport Protocol Port Number Registry
  4. CompTIA Network+ (N10-009) certification page
Summarize with:

Free resources

25
Free download

Critical CVE Reference Card 2025–2026

25 actively exploited vulnerabilities with CVSS scores, exploit status, and patch availability. Print it, pin it, share it with your SOC team.

No spam. Unsubscribe anytime.

Free download

Ransomware Incident Response Playbook

Step-by-step 24-hour IR checklist covering detection, containment, eradication, and recovery. Built for SOC teams, IR leads, and CISOs.

No spam. Unsubscribe anytime.

Follow Decryption Digest

Daily briefings + Google Top Stories in one step.

Enter your email and we'll subscribe you to the daily briefing and add Decryption Digest to your Google Search feed at the same time.

Free. Unsubscribe anytime. Google popup confirms the Top Stories add.

Eric Bang
Author

Founder & Cybersecurity Evangelist, Decryption Digest

Cybersecurity professional with expertise in threat intelligence, vulnerability research, and enterprise security. Covers zero-days, ransomware, and nation-state operations for 50,000+ security professionals every morning.

DD Academy

Studying for Network+?

DD Academy has Network+ N10-009 flashcards and practice questions, with an AI tutor that explains every answer. Free to start on iPhone and the web.

Daily Briefing

Get briefings like this every morning

Actionable threat intelligence for working practitioners. Free. No spam. Trusted by 50,000+ SOC analysts, CISOs, and security engineers.

Unsubscribe anytime.

Study for Security+ and six more exams with a daily plan.

Download on the App Store