ExamShortcut

Networking: Devices, Topologies & Protocols

🔒 Log in to track
high importance⚡ 12 shortcuts5 subtopics
All subtopics·Subtopic 4 of 5

IP addressing: IPv4 classes and IPv6

🔒 Log in to track
⏱ 4 min read🧩 6 question types🎯 16 practice Q
The idea in one minute

An IPv4 address has 32 bits, written as four numbers from 0 to 255. The first number decides the class. IPv6 has 128 bits, written in hexadecimal with colons. 127.0.0.1 is loopback, and 192.168.x.x is a private range.

01

IPv4, the 32-bit address

An IPv4 address has 32 bits. It is written as four numbers from 0 to 255 with dots, like 192.168.1.1. Each number is an octet (8 bits). The first octet decides the class.

ClassFirst octetDefault maskHosts per networkUse
A1 - 126255.0.0.0 (/8)1,67,77,214huge networks
B128 - 191255.255.0.0 (/16)65,534large organisations
C192 - 223255.255.255.0 (/24)254small networks
D224 - 239nonenonemulticasting
E240 - 255nonenoneexperimental or research

Tip: Anchor the ruler at 1, 128, 192, 224 and 240. Drop the given number between them.

02

Usable hosts

Two addresses in each network are reserved: the network address and the broadcast address.

Example: Class C has 256 addresses. Take away 2. That leaves 254 usable hosts.

03

Special addresses

  • 127.0.0.1 is loopback or localhost. A machine talks to itself. Pinging it tests your own TCP/IP stack.
  • 0.0.0.0 is the unspecified address.
  • 255.255.255.255 is the broadcast address.
  • Private ranges are not routed on the Internet: 10.0.0.0/8, 172.16.0.0 to 172.31.255.255, and 192.168.0.0/16.

Watch: 127 is not a Class A network. Class A ends at 126. Home routers use 192.168.x.x, which is private.

04

IPv6, the 128-bit address

IPv4 has about 4.3 billion addresses. That is too few for the connected world. IPv6 uses 128 bits. It is written as eight groups of hexadecimal digits with colons, for example 2001:0db8::7334. A double colon can shorten a run of zeros.

05

MAC and IP compared

MAC addressIP address
Typephysical, burnt into the NIClogical, assigned
Size48 bitsIPv4 32 bits, IPv6 128 bits
Changesneverchanges with the network
Used byswitches (layer 2)routers (layer 3)

DHCP gives IP addresses automatically. A static address is set by hand.

06

Worked class checks

Cover everything after the first dot. Look at the first octet only.

AddressFirst octetClass
10.0.0.510A
130.10.5.2130B
196.1.2.3196C
225.5.4.1225D (multicast)
245.0.0.1245E

Rule: 127.x.x.x is never a Class A host address. It is loopback.

07

Checking a private address

A private address starts with 10, or with 172 and a second number from 16 to 31, or with 192.168. A 172 address with second number 32 or more is public.

08

Question types you will see

Each type: how to recognise it, the method step by step, and one question to try.

Type 1very common4 practice Q

IP class identification

How to spot it:

An address is given (10.0.0.5, 130.10.5.2, 196.1.2.3, 225.5.4.1) and its class is asked, or the range of a class is asked.

Method
  1. Read only the first octet.

  2. 1-126 is A, 128-191 is B, 192-223 is C.

  3. 224-239 is D (multicast). 240-255 is E.

  4. Treat 127 as loopback, not Class A.

Why it works:

The first octet alone fixes the class.

Try this

The IP address 196.20.5.1 belongs to which class?

Show solution
  1. The first octet is 196.

  2. 196 lies between 192 and 223.

Answer

Class C

Type 2very common3 practice Q

Private ranges and loopback

How to spot it:

Which is a private IP address, what is 127.0.0.1, or which address is reserved for testing or localhost.

Method
  1. Private: 10.x.x.x, 172.16 to 172.31.x.x, 192.168.x.x.

  2. Home routers use 192.168.x.x.

  3. 127.0.0.1 is loopback (localhost).

  4. 169.254.x.x appears when automatic addressing fails (APIPA).

Why it works:

Private and loopback ranges are reserved and never routed on the Internet.

Try this

The address 127.0.0.1 is used for

Show solution
  1. 127 is the reserved loopback block.

  2. The computer talks to itself.

Answer

Loopback testing (localhost)

Type 3common3 practice Q

IPv4 vs IPv6 facts

How to spot it:

IPv4 has how many bits, IPv6 is written in what form, how many groups in an IPv6 address, or why IPv6 was needed.

Method
  1. IPv4: 32 bits, four decimal octets, about 4.3 billion addresses.

  2. IPv6: 128 bits, eight hexadecimal groups with colons.

  3. IPv6 was needed because IPv4 addresses ran out.

Why it works:

More bits mean a far larger address space.

Try this

An IPv6 address is how many bits long?

Show solution
  1. IPv6 has eight groups.

  2. Eight groups of 16 bits make 128 bits.

Answer

128 bits

Type 4common3 practice Q

MAC vs IP and usable-host counts

How to spot it:

Difference between MAC and IP, how many hosts a Class C network can have, or which address changes when you move networks.

Method
  1. MAC: 48-bit, physical, permanent.

  2. IP: logical, assigned, changes with the network.

  3. Class C: 256 - 2 = 254 usable hosts.

  4. Class B: 65,534. Class A: 1,67,77,214.

Why it works:

Two addresses in every network are reserved.

Try this

How many usable host addresses does a Class C network provide?

Show solution
  1. Class C has 256 addresses.

  2. Take away the network and broadcast addresses: 254.

Answer

254

Type 5occasional

Default masks and special addresses

How to spot it:

The default mask of a class, the broadcast address, or the unspecified address.

Method
  1. Class A: 255.0.0.0 (/8). Class B: 255.255.0.0 (/16).

  2. Class C: 255.255.255.0 (/24).

  3. 0.0.0.0 is unspecified.

  4. 255.255.255.255 is the broadcast address.

Why it works:

The mask shows how many leading bits name the network.

Try this

What is the default subnet mask of a Class B network?

Show solution
  1. Class B has a /16 prefix.

  2. Two full octets of 255.

Answer

255.255.0.0

Type 6occasional

DHCP and static addressing

How to spot it:

Which protocol assigns IP addresses automatically, or how static addressing differs from it.

Method
  1. DHCP gives IP addresses automatically.

  2. Static addressing sets them by hand.

  3. DHCP uses ports 67 and 68.

Why it works:

Automatic assignment saves manual setup.

Try this

Which protocol assigns IP addresses automatically to devices?

Show solution
  1. Automatic assignment is the job of DHCP.

  2. Its full form is Dynamic Host Configuration Protocol.

Answer

DHCP

09

Shortcuts that save time

⚡ Class ruler

Remember the cut-points 1, 128, 192, 224, 240. A starts at 1, B at 128, C at 192, D (multicast) at 224, E at 240. The number 127 is loopback, between A and B.

Example

What is the class of 172.16.0.1?

Show solution
  1. Read only the first octet: 172.

  2. 172 lies in 128 to 191.

Answer

Class B

⚡ Loopback is 127

127.0.0.1 is localhost. Pinging it tests your own TCP/IP stack, not the cable. Any question with 127.x wants loopback.

Example

Pinging 127.0.0.1 tests what?

Show solution
  1. 127.0.0.1 is the machine itself.

  2. It never leaves the computer.

Answer

The local machine's own TCP/IP setup

⚡ IPv4 vs IPv6 size

IPv4 is 32 bits in dotted decimal. IPv6 is 128 bits in colon-separated hexadecimal. If addresses are running out, IPv6 is the fix.

Example

How many bits does an IPv6 address have?

Show solution
  1. IPv4 has 32 bits.

  2. IPv6 has 128 bits.

Answer

128

10

Mistakes to avoid

Where most students lose marks on this subtopic.

Mistake 01

Calling 127.0.0.1 a Class A host address.

127 is reserved for loopback. Class A networks end at 126.

Mistake 02

Calling 192.168.1.1 a public address.

It is the classic private home-router address.

Mistake 03

Confusing the MAC address with the IP address.

MAC is 48-bit, physical and burnt in. IP is logical and assigned.

Mistake 04

Reading the whole address to find the class.

Only the first octet decides the class.

Mistake 05

Giving all 256 addresses of Class C as usable hosts.

Two are reserved, so 254 are usable.

11

Quick revision

Read this the night before the exam.

  • IPv4 has 32 bits in four octets from 0 to 255. IPv6 has 128 bits in hexadecimal with colons.

  • Classes by first octet: A 1-126, B 128-191, C 192-223, D 224-239, E 240-255.

  • 127.0.0.1 is loopback.

  • Private ranges: 10.x, 172.16 to 172.31.x, 192.168.x.

  • A Class C network has 254 usable hosts.

  • MAC is 48-bit and physical. IP is logical.

  • DHCP gives IP addresses automatically.

12

Practice: 16 questions

Sets of 10, mixed across the question types above. Every answer has a step-by-step explanation.

Topic test · 10 questions

Suggested time 5 min · wrong answers go to your mistake notebook automatically.