Classful Addressing and IP Casting Explained: Classes, Ranges and Worked Examples
Learn a quick first-octet method for IPv4 classes, then solve a complete Class B example and trace four delivery modes on one network.
KnowledgeGate Team
Exam prep & CS education

Class and cast answer different IPv4 questions. Class describes how the historical address model divided network and host bits, while cast describes who should receive a packet. You can correctly identify 172 as Class B and still confuse a host address with a broadcast or multicast destination. The first octet identifies the historical class; its default mask yields the network and broadcast, while the destination and group membership determine delivery. Here, casting means network delivery, not programming-language type casting. See CS Fundamentals for Exams & Placements for the wider subject.
Classful addressing and casting answer different questions
In classful IPv4 addressing, leading bits place an address in Class A, B, C, D or E. For Classes A to C, the class historically fixed the network-host boundary and default mask. Casting instead describes the relationship between a sender and its receivers.
Keep this pair separate:
Address class: how the destination is categorised.
Casting mode: one receiver, every receiver in a scope, or members of a subscribed group.
A Class B address is not automatically a broadcast address. Class D is multicast group space, not a subnet with a default mask. Classful addressing is now a historical model used in textbooks and exam questions. In operational routing, an explicit prefix such as /20 controls the boundary. Use a class default only when a question says classful or gives no mask under that historical assumption.
Identify Classes A to E from the first octet
Class | Leading bits | First-octet range | Historical default | Meaning |
|---|---|---|---|---|
A |
|
|
| Unicast network space |
B |
|
|
| Unicast network space |
C |
|
|
| Unicast network space |
D |
|
| No A/B/C-style default | Multicast group addressing |
E |
|
| No A/B/C-style default | Reserved or special use |
Handle exceptions explicitly. 0/8 is special, not an ordinary Class A network. 127/8 is loopback. 255.255.255.255 is limited broadcast. That is why ordinary Class A first octets are remembered as 1-126, not 0-127.
A speed drill makes the boundaries easier to retain: 10.4.5.6 is A, 172.20.14.99 is B, 192.168.1.44 is C, 239.1.2.3 is D multicast, and 250.1.2.3 is E. At the edges, 191 is B; 192 and 223 are C; 224 and 239 are D; 240 is E.
Worked classful example: analyse 172.20.14.99
Assume no mask is supplied and the question requires classful addressing. Find the class, default mask, network and host parts, network address, directed broadcast, conventional host range, and usable-host capacity.
The first octet is 172, or 10101100 in binary. Its leading bits are 10, and 172 lies in 128-191, so this is Class B. The historical default is /16, or 255.255.0.0. Therefore:
Network part:
172.20Host part:
14.99Network address, after zeroing 16 host bits:
172.20.0.0Directed broadcast, after setting 16 host bits to one:
172.20.255.255Conventional usable range:
172.20.0.1to172.20.255.254Total addresses:
2^16 = 65,536Conventional usable hosts:
2^16 - 2 = 65,534
Host ID 14.99 is neither all zeros nor all ones, so 172.20.14.99 is usable under these assumptions. It is also inside private block 172.16.0.0/12, but private status and address class are separate properties. Private status does not change this exercise's historical Class B default. Continue with IP Addressing and Subnetting: Worked Example, Exam Angle for supplied prefixes and equal-size subnet design.

Unicast, broadcast and multicast recipients
Unicast sends to one addressed interface. IPv4 broadcast targets every interface in a defined broadcast scope. Multicast targets interfaces that joined a group, not every host. Class D destinations identify multicast groups. Classes A to C contain ordinary unicast space, with network and broadcast addresses determined by the relevant prefix.
255.255.255.255 is limited broadcast on the local link and a router does not forward it. Under the worked /16, 172.20.255.255 is the directed broadcast for 172.20.0.0/16. Textbook questions may ask you to calculate it, although real networks commonly restrict or disable directed-broadcast forwarding.
Misconception: Anycast has no dedicated A-to-E range. Multiple nodes use or advertise the same destination, and routing selects one reachable instance. Class E is not anycast.
Worked casting example on one /16 LAN
Sender A is 172.20.14.99/16. B is 172.20.20.10/16, C is 172.20.30.25/16, D is 172.20.40.50/16, and router R is 172.20.0.1/16. B and D joined multicast group 239.1.2.3; C and R did not.
Destination
172.20.20.10is unicast, delivered to B.Destination
255.255.255.255is limited broadcast across this local broadcast domain. R does not route it onward.Destination
172.20.255.255is the directed broadcast for172.20.0.0/16. Its textbook intent is delivery to all local hosts, subject to network policy.Destination
239.1.2.3is multicast. It is delivered up the stack at joined receivers B and D, not non-member C.
Inspect the destination, then the supplied prefix or membership. The source address does not decide the casting mode.

Traps that make a plausible answer wrong
The first octet is not enough when a prefix is supplied. Classfully, 192.168.10.255 is Class C and the directed broadcast for 192.168.10.0/24. With /20, the mask is 255.255.240.0. The third octet calculation is 10 AND 240 = 0, so the network is 192.168.0.0. Setting the 12 host bits to one gives 192.168.15.255. Therefore 192.168.10.255 is an ordinary host address under /20.
Avoid these other traps:
172.20.20.10is Class B-shaped and is unicast here.239.1.2.3is Class D and multicast. Class and cast answer different questions.Do not apply
2^h - 2to Class D or E. It belongs to a conventional A/B/C network-host split.Do not call
255.255.255.255an ordinary Class E host. It is the special limited-broadcast address.Do not assume every broadcast crosses routers or every multicast reaches all hosts. Scope, policy, membership, and the stated assumptions matter.
How exams test classful addressing and casting
The IIT Guwahati GATE 2026 CS syllabus lists IP addressing, IPv4 and CIDR notation under Computer Networks. It assigns no topic-level marks or frequency, so past papers supply the evidence for recurring question forms.
Likely exercise forms include identifying a class, recalling a default mask, finding network and broadcast addresses, recognising special ranges, classifying delivery, and checking whether .255 is broadcast under a supplied mask. Audit yourself with these:
201.45.16.200: Class C,/24, network201.45.16.0, broadcast201.45.16.255, host ID200.230.10.4.5: Class D multicast group, not a Class C host.192.168.10.255/20: network192.168.0.0, broadcast192.168.15.255, so the given address is not broadcast.
Use Subnetting MCQs: 12 Solved IP Addressing Questions to practise class boundaries, masks and host ranges under question pressure.
The short version and the next step
Remember A as 1-126 with /8, B as 128-191 with /16, C as 192-223 with /24, D as 224-239 multicast, and E as 240-255 reserved or special. Handle 127/8 and 255.255.255.255 explicitly. Unicast means one receiver, broadcast means everyone in scope, and multicast means joined group members.
For a 15-minute revision, recompute 172.20.14.99 into 172.20.0.0, 172.20.255.255, and 65,534 conventional usable hosts. Classify the four destinations from the LAN example, then explain aloud why 192.168.10.255/20 is not broadcast. For structured exam preparation, use GATE Guidance by Sanchit Sir. For a broader core-CS route, use Zero to Hero: Complete CS Course.
Keep learning
Classful IP Addressing and Casting MCQs: 12 Solved Questions with Explanations
Build a reliable classful IPv4 decision method, then apply it to 12 solved questions covering class recognition, network masks, representation and casting.
IP Addressing in Computer Networks: Classes, Subnetting, CIDR, and Worked Examples for GATE
Build IP addressing from its 32-bit foundation through classful ranges, subnetting, VLSM, CIDR aggregation, and longest prefix match with checked examples.
IP addressing and subnetting: a worked guide with the exam angle
IP addressing and subnetting explained: IPv4 structure, classful vs CIDR, subnet masks, a fully worked subnetting example with ranges and broadcast addresses.
Computer Networks Subnetting MCQs: 12 solved IP addressing questions (GATE, ISRO, state exams)
Subnetting and IP addressing MCQs solved: 12 previous-year GATE, ISRO and state-exam questions on address classes, masks, hosts per subnet, CIDR and VLSM.





