IP Addressing Complete Guide
IP Addressing Complete Guide
COMPUTER NETWORKING
IP Addressing — A Complete Textbook Guide
Every device on the internet requires a unique identifier so that other devices can find and
communicate with it. This identifier is the IP address — the cornerstone of all networking.
Understanding IP addressing deeply is essential for any computing career and is heavily tested in the
JU PMSCS/PMIT admission exam.
IPv4 uses 32-bit addresses (~4.3 billion total). IPv6 uses 128-bit addresses (virtually
KEY FACT
unlimited). IPv4 is dotted decimal; IPv6 is colon-separated hexadecimal.
IP: [Link] | Mask: /24 ([Link]) -> Network: 192.168.1.x (first 24 bits) |
EXAMPLE
Host: .100 (last 8 bits). All 192.168.1.x devices are on the same subnet.
The original IPv4 addressing scheme used classful addressing — fixed classes (A-E) based on the first
octet value, each with a default subnet mask.
Class First Octet Address Range Default Mask Host Bits Purpose
/16 =
B 128-191 [Link] – [Link]
[Link]
16 bits Med org
/24 =
C 192-223 [Link] – [Link]
[Link]
8 bits Small LAN
Loopback — refers to the local device; tests the local IP stack without sending data on
[Link]
the network
[Link] Default route / unspecified address — used in routing tables as a catch-all route
255.255.255. Limited broadcast — sent to all hosts on the local network segment only
255
[Link]/ APIPA range — auto-assigned when DHCP fails (Windows only, link-local only)
16
The subnet mask defines the boundary between the network and host portions of an IP address. It is
one of the most important and most tested concepts in IP networking.
Usable
CIDR Subnet Mask Host Bits Block Size
Hosts
/24 [Link] 8 254 256
/25 [Link] 7 126 128
/26 [Link] 6 62 64
/27 [Link] 5 30 32
/28 [Link] 4 14 16
/29 [Link] 3 6 8
/30 [Link] 2 2 4
1 (host
/32 [Link] 0 1
route)
/16 [Link] 16 65,534 65,536
/8 [Link] 24 16,777,214 16.7M
Usable Hosts = 2^(host bits) - 2 | Subnets = 2^(borrowed bits) | Block Size = 256 -
FORMULA
mask interesting octet
Subnetting is one of the most heavily tested skills in networking exams. Master these five steps and
you can solve any subnetting problem.
STEP For N subnets: borrow s bits where 2^s >= N. For H hosts: keep
Borrow bits h bits where 2^h-2 >= H
2
STEP
Calculate block size Block size = 256 - (interesting octet of new mask)
3
STEP
List subnets Starting at 0, increment by block size: 0, BS, 2xBS, 3xBS...
4
IP: [Link] | Mask: /26 ([Link]) -> Find subnet, broadcast, host
GIVEN
range
VLSM A WAN link needs only 2 hosts -> use /30. A LAN with 100 users -> use /25. Both
ADVANTAG carved from the same parent block, no waste.
E
NAT (Network Address Translation) allows devices with private IPs to reach the public internet. It was
designed as a temporary IPv4 address conservation measure but remains universally used.
Static One private IP to one Used for servers needing a permanent public address (web, mail
NAT fixed public IP servers)
IPv4's ~4.3 billion addresses are essentially exhausted. IPv6 with 128-bit addresses provides a virtually
unlimited supply and adds modern features like built-in security and stateless auto-configuration.
Abbreviation rules:
7. Leading zeros in each group can be dropped: 0DB8 -> DB8, 0042 -> 42
8. One consecutive sequence of all-zero groups can be replaced with :: (only once per address)
Unique Local FC00::/7 Like RFC 1918 private; not globally routable
DHCP server responds with DHCPOFFER: proposed IP, mask, gateway, DNS, lease
OFFER
time
REQUEST Client broadcasts DHCPREQUEST to accept the offer (also informs other servers)
ACKNOWLE Server sends DHCPACK confirming the lease. Client configures its interface.
DGE
Correct answers are highlighted in the last column. These question styles are common in JU
PMSCS/PMIT admission tests.
An
# Question A B C D
s
1 How many bits are in an IPv4 address? 16 32 64 128 B
7 Class B addresses have first octet range: 1-126 128-191 192-223 224-239 B
1 255.255.255. 255.255.255.
Default subnet mask for Class A is: [Link] [Link]
0 255
A
1
1 255.255.255.
Default subnet mask for Class B is: [Link] [Link]
0
[Link] B
2
1 255.255.255. 255.255.255.
Default subnet mask for Class C is: [Link] [Link]
0 128
C
3
1
Class A provides how many default host bits? 8 16 24 32 C
4
1 Loopback Default
The address [Link] is used for: Broadcast Multicast
testing gateway
C
6
24 network
2 24 subnet bits = 24 available
What does /24 mean in CIDR notation? 24 host bits
bits 255.255.255. subnets
C
0
0
2
CIDR notation for [Link] is: /22 /23 /24 /25 C
1
2
CIDR notation for [Link] is: /8 /16 /24 /32 B
2
2
CIDR notation for [Link] is: /8 /16 /24 /4 A
3
3
How many usable hosts does /29 provide? 2 4 6 14 C
0
3
How many usable hosts does /28 provide? 14 16 30 62 A
1
3
How many usable hosts does /27 provide? 14 30 62 126 B
2
3
How many usable hosts does /26 provide? 30 62 64 126 B
3
3
How many usable hosts does /25 provide? 62 126 128 254 B
4
3
Formula for number of subnets created is: 2^s 2^s - 2 2^s - 1 2^(s+1) A
6
Network/
3 Broadcast Gateway
The first address of a subnet is the: Host address
address
Subnet
address
C
7 address
Second and
3 Which two addresses CANNOT be assigned First and First and
last second
Last two second-to- A
9 to hosts? last
4
Block size for mask [Link] is: 32 64 128 192 B
0
4
Block size for mask [Link] is: 16 32 64 128 B
1
4
Block size for mask [Link] is: 8 16 32 64 B
2
4
Block size for mask [Link] is: 4 6 8 16 C
3
4 How is block size calculated from a subnet 256 + mask 256 - mask mask value - 512 - mask
value value 256 value
B
4 mask?
4 [Link]
Broadcast address for [Link]/26 is: [Link] [Link] [Link]
7
B
5
4
Broadcast address for [Link]/27 is: [Link] [Link] [Link] [Link] B
6
5 Network Limited
[Link] represents:
address broadcast
Loopback Multicast B
0
Default
5
[Link] represents: Broadcast Loopback route or Multicast C
1 unspecified
5 [Link]/1 [Link]/1
APIPA address range is: [Link]/8 [Link]/12
6 6
D
2
Many private
IPs share
5 One-to-one Static IP Dynamic
PAT allows:
IP mapping
one public
assignment routing
B
5 IP using
ports
Colon-
5 Dotted Dotted separated
IPv6 is written in:
decimal hexadecimal hexadecimal
Binary C
8
groups
6
IPv6 loopback address is: 0::0 ::1 FF02::1 FE80::1 B
0
6
IPv6 link-local addresses begin with: FF00::/8 2001::/32 FE80::/10 FC00::/7 C
1
6
IPv6 multicast addresses begin with: FE80::/10 FC00::/7 FF00::/8 2000::/3 C
2
IPv4
6 Faster Better Simpler
Primary reason IPv6 was developed:
routing
address
encryption configuration
B
3 exhaustion
zeros
4 addresses
compressed
Variable Variable
Variable
6 Length Virtual LAN Length
VLSM stands for:
Subnet
Layer Subnet
Subnet Mask Subnet
A
6 Method
Mask Method
Different-
sized
Requires
6 Uses more IP Simplifies subnets
Advantage of VLSM:
addresses routing tables avoid
classful C
7 routing
address
waste
Classless Classful
Classless Configurable
6 Inter- Internet
CIDR stands for:
Domain Domain
Internet Data IP Domain A
8 Routing Routing
Routing Routing
Combine
networks
6 Create more Increase Reduce host
Supernetting is used to:
subnets
into a
security addresses
B
9 summary
route
The router
interface IP
The nearest The
7 used to The first valid
A default gateway is: DNS server
reach
broadcast
host address
B
1 IP address
external
networks
7 Domain
ARP maps a known ___ to an unknown ___. MAC to IP IP to MAC Port to IP
name to IP
B
3
7 Domain
DNS resolves: MAC to IP IP to MAC
name to IP
IP to port C
4
7
Which class is [Link]? Class A Class B Class C Class D B
5
7
Which class is [Link]? Class A Class B Class C Class D C
6
7
Which class is [Link]? Class A Class B Class C Class D A
7
7
Which class is [Link]? Class A Class B Class C Class D D
8
8
Bits borrowed for 6 subnets from /24: 2 3 4 5 B
1
8 [Link]
Network address for [Link]/26 is: [Link] [Link] [Link]
8
C
2
8
[Link]/24 has how many usable hosts? 252 253 254 256 C
4
8 [Link] [Link]
Broadcast of [Link]/8 is:
54 55
[Link] [Link] B
5
8
/30 subnet has how many usable hosts? 1 2 4 6 B
6
Exactly one
8 Entire Class C
/32 means: No hosts host — a
internet network
B
7 host route
8
Which is a valid private IP? [Link] [Link] [Link] [Link] C
8
8
Which is NOT a valid IPv4 address? [Link] [Link] [Link] [Link] B
9
9
[Link] is which type of address? Unicast Broadcast Anycast Multicast D
0
Identify
Route
network and
9 packets
Purpose of a subnet mask is to: Encrypt data host Assign IPs
between
B
2 portions of
networks
an IP
9
Borrowing 3 bits creates how many subnets? 6 8 16 32 B
4
DHCP fails
IPv6
9 DHCP — APIPA Manual IP is
[Link] is assigned when:
succeeds assigns the
transition
set
B
5 occurs
address
9 Ethernet
IPv6 tunneling encapsulates IPv6 packets in: UDP IPv4 packets MPLS
frames only
B
6
9
DHCP DORA — what does 'O' stand for? Open Offer Order Acknowledge B
7
9
DHCP uses which transport protocol? TCP ICMP UDP SCTP C
8
1
[Link]/29 — which is a valid host [Link] [Link] [Link]
0 [Link]
3 6 1
C
address?
0
Q7: How do you calculate the number of usable hosts per subnet?
Ans: Hosts = 2^h - 2, where h = number of host bits in the mask. Subtract 2 for the network address
(first) and broadcast address (last). Example: /26 has 6 host bits = 2^6 - 2 = 62 usable hosts.
Ans: Block size = 256 - (value of the 'interesting octet' in the mask). The interesting octet is the one
that is neither 0 nor 255. Example: mask [Link] -> block size = 256 - 192 = 64. Subnets
start at: 0, 64, 128, 192.
Q9: What is the difference between a network address and a broadcast address?
Ans: Network address = first address of a subnet (all host bits = 0). Used to identify the subnet itself,
not assignable to hosts. Broadcast address = last address of a subnet (all host bits = 1). Used to send
data to all hosts on the subnet, also not assignable. Every subnet has exactly one of each.
Q13: What is the difference between Static NAT, Dynamic NAT, and PAT?
Ans: Static NAT: one private IP <-> one fixed public IP (for servers). Dynamic NAT: private IPs map to
a pool of public IPs on demand (still 1-to-1). PAT (Overloading): many private IPs share one public IP,
differentiated by unique port numbers. PAT is the most common type used in home/office routers.
Ans: Supernetting combines multiple contiguous networks into one summary route, reducing routing
table size. Example: [Link]/24, [Link]/24, [Link]/24, [Link]/24 summarize to
[Link]/22. Used extensively in large networks and ISP routing.
Q18: What is the difference between unicast, multicast, broadcast, and anycast?
Ans: Unicast: one sender -> one receiver. Broadcast: one sender -> all hosts on a segment
([Link]). Multicast: one sender -> selected group of receivers (Class D: 224-239.x.x.x).
Anycast: one sender -> nearest member of a group (IPv6 and CDN use this). IPv6 has no broadcast.
Q19: How do you find subnet, broadcast, and valid host range for a given IP/mask?
Ans: 1) Block size = 256 - mask interesting octet. 2) Subnet = largest multiple of block size <= host
value in that octet. 3) Broadcast = next subnet - 1. 4) Hosts = subnet+1 to broadcast-1. Example:
[Link]/26 -> block=64, subnet=64, broadcast=127, hosts=65-126.
Ans: /32 = host route, represents exactly one IP address. Used for loopback interfaces or to define
specific host routes. /0 = default route ([Link]/0) — matches all IP addresses, used as a catch-all
route pointing to the internet gateway when no specific match exists.
Q28: What is the difference between RIPv1 and RIPv2 regarding IP addressing?
Ans: RIPv1 is classful — no subnet mask in updates, assumes default class mask, no VLSM/CIDR
support. RIPv2 is classless — includes subnet mask in updates, supports VLSM, CIDR, discontiguous
networks, authentication, and multicast updates ([Link]).
CLASS A: 1-126 (/8) | B: 128-191 (/16) | C: 192-223 (/24) | D: 224-239 Multicast | E: 240-255
RANGES Reserved
KEY Hosts = 2^h - 2 | Subnets = 2^s | Block Size = 256 - mask_value | Broadcast =
FORMULAS next_subnet - 1
CIDR /24=254 | /25=126 | /26=62 | /27=30 | /28=14 | /29=6 | /30=2 | /32=1 host route
CHEATSHE
ET