0% found this document useful (0 votes)
5 views22 pages

IP Addressing Complete Guide

This document serves as a comprehensive guide on IP addressing for the JU PMSCS/PMIT admission test, covering essential topics such as IPv4 and IPv6 structures, subnetting, NAT, and DHCP. It includes detailed explanations of IP address classes, subnet masks, variable length subnet masks (VLSM), and the transition from IPv4 to IPv6. Additionally, the guide features practice questions to aid in exam preparation.

Uploaded by

rezaul212002044
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views22 pages

IP Addressing Complete Guide

This document serves as a comprehensive guide on IP addressing for the JU PMSCS/PMIT admission test, covering essential topics such as IPv4 and IPv6 structures, subnetting, NAT, and DHCP. It includes detailed explanations of IP address classes, subnet masks, variable length subnet masks (VLSM), and the transition from IPv4 to IPv6. Additionally, the guide features practice questions to aid in exam preparation.

Uploaded by

rezaul212002044
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

COMPUTER NETWORKING
IP Addressing — A Complete Textbook Guide

Prepared for: JU PMSCS / PMIT Admission Test


IPv4 Classes | Subnetting | VLSM/CIDR | NAT/PAT | IPv6 | 100 MCQs | 30 Short Questions

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 1: Introduction to IP Addressing

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.

1.1 What is an IP Address?


An IP (Internet Protocol) address is a numerical label assigned to each device on a TCP/IP network. It
serves two main functions:
• Host/Network Interface Identification — uniquely identifies a device
• Location Addressing — provides a routable path for packet delivery

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.

1.2 IPv4 Address Structure


An IPv4 address is 32 bits organized into four 8-bit octets in dotted decimal notation. Each octet: 0-255.

Octet 1 Octet 2 Octet 3 Octet 4

192 168 1 100


8 bits 8 bits 8 bits 8 bits

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.

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 2: Classful IPv4 Addressing

The original IPv4 addressing scheme used classful addressing — fixed classes (A-E) based on the first
octet value, each with a default subnet mask.

2.1 The Five Address Classes

Class First Octet Address Range Default Mask Host Bits Purpose

A 1-126 [Link] – [Link] /8 = [Link] 24 bits Large org

/16 =
B 128-191 [Link] – [Link]
[Link]
16 bits Med org

/24 =
C 192-223 [Link] – [Link]
[Link]
8 bits Small LAN

D 224-239 [Link] – [Link] N/A N/A Multicast

E 240-255 [Link] – [Link] N/A N/A Research

2.2 Special IPv4 Addresses

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

2.3 Private IP Address Ranges (RFC 1918)

Class Address Range CIDR Block Total Addresses


A [Link] – [Link] [Link]/8 16,777,216
B [Link] – [Link] [Link]/12 1,048,576

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

C [Link] – [Link] [Link]/16 65,536

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 3: Subnet Masks & CIDR Notation

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.

3.1 CIDR Notation Reference Table

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

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 4: Subnetting — Step by Step

Subnetting is one of the most heavily tested skills in networking exams. Master these five steps and
you can solve any subnetting problem.

4.1 The 5-Step Method

STEP Subnets needed or hosts needed? This decides which direction


Determine requirement to subnet
1

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

STEP Network=subnet, First host=subnet+1, Last host=broadcast-1,


Find all values Broadcast=next subnet-1
5

4.2 Worked Example: [Link]/24 into 4 Subnets

GIVEN Network: [Link]/24 | Task: Create 4 equal subnets

1. Borrow 2 bits (2^2=4). New mask: /26 = [Link]


2. Block size = 256 - 192 = 64
3. Subnets: 0, 64, 128, 192

# Network Address First Host Last Host Broadcast


1 [Link]/26 [Link] [Link] [Link]
2 [Link]/26 [Link] [Link] [Link]
3 [Link]/26 [Link] [Link] [Link]
4 [Link]/26 [Link] [Link] [Link]

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

4.3 Worked Example: Finding Subnet for [Link]/26

IP: [Link] | Mask: /26 ([Link]) -> Find subnet, broadcast, host
GIVEN
range

4. Block size = 256 - 192 = 64


5. Subnet boundaries: 0, 64, 128, 192. Host .188 falls in the 128 subnet (128 <= 188 < 192)
6. Network: [Link] | Broadcast: [Link] | Hosts: .129 to .190

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 5: VLSM, CIDR & Supernetting

5.1 VLSM — Variable Length Subnet Mask


Traditional subnetting uses the same mask for all subnets, wasting addresses when sizes differ. VLSM
allows different-sized subnets within the same network block.

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

5.2 CIDR — Classless Inter-Domain Routing


CIDR (1993) eliminated classful boundaries, allowing any prefix /0 to /32. It enables route aggregation
to reduce routing table sizes and is supported by all modern protocols (OSPF, EIGRP, RIPv2, BGP).

5.3 Supernetting Example

Individual Networks Summary Route


[Link]/24 [Link]/24 [Link]/24 [Link]/22 (covers all 4 networks with one
[Link]/24 entry)

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 6: NAT & PAT

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.

6.1 Types of NAT

Static One private IP to one Used for servers needing a permanent public address (web, mail
NAT fixed public IP servers)

Private IPs mapped to a


Dynam When the pool is full, new connections are refused until one is
pool of public IPs on free
ic NAT
demand

PAT / Many private IPs share


Used in virtually all home routers and small/medium business
Overlo ONE public IP using networks
ading unique port numbers

6.2 How PAT Works

Private IP:Port Public IP:Port Connection

[Link]:1025 -> [Link]:5001 PC1 browsing Google

[Link]:3000 -> [Link]:5002 PC2 watching YouTube

[Link]:8080 -> [Link]:5003 PC3 on Facebook

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 7: IPv6 — Next Generation Addressing

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.

7.1 IPv6 Address Structure & Abbreviation


128 bits | 8 groups x 4 hex digits separated by colons. Full:
FORMAT
2001:0DB8:0000:0000:0000:FF00:0042:8329 | Abbreviated: 2001:DB8::FF00:42:8329

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)

7.2 IPv6 Address Types

Type Prefix Description


Global Unicast 2000::/3 Publicly routable IPv6 (equivalent to public IPv4)

Link-Local FE80::/10 Auto-configured; valid only on the local link

Loopback ::1/128 Equivalent to [Link] in IPv4

Multicast FF00::/8 Replaces IPv4 broadcast; sent to a group

Unique Local FC00::/7 Like RFC 1918 private; not globally routable

Unspecified :: (all zeros) Used before a device obtains an address

7.3 IPv4 vs IPv6 Comparison

Feature IPv4 IPv6


Address Size 32 bits 128 bits
Total Addresses ~4.3 billion ~340 undecillion
Notation Dotted decimal Colon-separated hex
Broadcast Yes No (uses multicast)
IPSec Optional Built-in
Auto-config DHCP required SLAAC available
Fragmentation By routers and hosts By source host only

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 8: DHCP, ARP, and DNS

8.1 DHCP — The DORA Process

DISCOVER Client broadcasts DHCPDISCOVER to find DHCP servers on the network

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

DHCP Server listens on UDP port 67 | Client uses UDP port 68


PORTS

8.2 ARP — Address Resolution Protocol


ARP bridges Layer 3 (IP) and Layer 2 (MAC). When a host needs to reach an IP on the same subnet
and doesn't know the MAC address:
9. Host broadcasts ARP Request: 'Who has IP [Link]? Tell [Link]'
10. Device with that IP sends unicast ARP Reply with its MAC address
11. Requesting host stores the IP->MAC mapping in its ARP cache for future use

8.3 DNS — Domain Name System


DNS translates domain names to IP addresses. Operates at Application layer, UDP/TCP port 53.
Hierarchical: Root -> TLD (.com, .org) -> Authoritative server -> returns IP address.
DNS [Link] -> DNS resolver queries root server -> .com TLD server ->
RESOLUTIO [Link] authoritative server -> returns [Link] -> browser connects
N

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 9: 100 Multiple Choice Questions

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

2 How many bits are in an IPv6 address? 32 64 128 256 C


Dotted
3 IPv4 addresses are written in which notation? Binary Hexadecimal
decimal
Octal C

An IPv4 address is divided into how many


4 2 3 4 8 C
octets?

Each octet of an IPv4 address can range


5 0 to 127 0 to 254 0 to 255 1 to 255 C
from:

Which class of IPv4 address begins with bit


6 Class B Class C Class A Class D C
pattern '0'?

7 Class B addresses have first octet range: 1-126 128-191 192-223 224-239 B

Class C addresses begin with which bit


8 0 10 110 1110 C
pattern?

9 Class D addresses are used for: Unicast Anycast Broadcast Multicast D


Research/
1
Class E addresses are reserved for: Private use Multicast experimenta Loopback C
0 l

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 Which class provides the most host


Class B Class C Class D Class A D
5 addresses per network?

1 Loopback Default
The address [Link] is used for: Broadcast Multicast
testing gateway
C
6

[Link]- [Link]- [Link]- [Link]-


1
Private Class A range is: [Link] 192.168.255. [Link] 169.254.255. C
7 55 255 55 255

[Link]- [Link]- [Link]- [Link]-


1
Private Class B range is: [Link] [Link] 192.168.255. 100.127.255. B
8 55 55 255 255

[Link]- [Link]- [Link]- [Link]-


1
Private Class C range is: [Link] [Link] 192.168.255. [Link] C
9 55 55 255 55

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

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

2 255.255.255. 255.255.255. 255.255.255. 255.255.255.


Subnet mask for /25 is:
192 128 224 240
B
4

2 255.255.255. 255.255.255. 255.255.255. 255.255.255.


Subnet mask for /26 is:
128 224 192 240
C
5

2 255.255.255. 255.255.255. 255.255.255. 255.255.255.


Subnet mask for /27 is:
192 240 224 248
C
6

2 255.255.255. 255.255.255. 255.255.255. 255.255.255.


Subnet mask for /28 is:
224 240 248 252
B
7

2 255.255.255. 255.255.255. 255.255.255. 255.255.255.


Subnet mask for /29 is:
224 240 248 252
C
8

2 255.255.255. 255.255.255. 255.255.255. 255.255.255.


Subnet mask for /30 is:
240 248 252 254
C
9

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 usable hosts per


2^n 2^n - 1 2^n - 2 2^(n-1) C
5 subnet is:

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

3 Default Broadcast Network


The last address of a subnet is the:
gateway address address
First host B
8

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

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

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

4 [Link] [Link] [Link] [Link]


Valid host range for [Link]/26 is:
-126 -127 -127 -126
A
7

4 How many /27 subnets can be made from a


4 6 8 16 C
8 /24?

4 How many /28 subnets can be made from a


8 12 16 32 C
9 /24?

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

Network Node Network


5 Network
NAT stands for: Address
Access Table
Address Allocation A
3 Translation Transfer Table

Protocol Port Packet Public


5
PAT stands for: Address Address Address Address B
4 Translation Translation Transfer Table

Many private
IPs share
5 One-to-one Static IP Dynamic
PAT allows:
IP mapping
one public
assignment routing
B
5 IP using
ports

5 Which NAT type maps one private IP to one Dynamic


NAT
PAT Static NAT Overloading C
6 fixed public IP?

5 Which NAT type uses a pool of public Dynamic


Static NAT PAT
NAT
NAT64 C
7 addresses?

Colon-
5 Dotted Dotted separated
IPv6 is written in:
decimal hexadecimal hexadecimal
Binary C
8
groups

5 How many groups does an IPv6 address


4 6 8 16 C
9 have?

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

6 In IPv6, '::' means: Error in One or more End of Separator B


address groups of all address between

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

zeros
4 addresses
compressed

6 Broadcast Multicast Unicast Anycast


IPv6 does NOT have:
addresses addresses addresses addresses
A
5

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

7 Which routing protocol does NOT support


OSPF EIGRP RIPv1 RIPv2 C
0 VLSM?

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 Which protocol dynamically assigns IP


ARP ICMP DHCP DNS C
2 addresses?

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

7 192.168.168. 192.168.168. 192.168.168. 192.168.168.


Valid host range for [Link]/26 is:
129-190 128-191 130-190 128-192
A
9

8 [Link] mask gives how many


14 30 62 126 B
0 hosts?

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 /29 mask in dotted decimal is: 255.255.255. 255.255.255. 255.255.255. 255.255.255. C


224 240 248 252

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

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

The mask is The


9 The 'interesting octet' in subnetting is the The address The network
ends
neither 0 nor
begins
broadcast is B
1 octet where: 255 found

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 RARP finds an IP when only the ___ is Domain MAC Default


Port number
name address gateway
C
3 known.

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

9 Which of the following is the subnet for host


[Link] [Link] [Link] [Link] C
9 [Link]/21?

1
[Link]/29 — which is a valid host [Link] [Link] [Link]
0 [Link]
3 6 1
C
address?
0

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Chapter 10: 30 Short Questions & Model Answers

Write clear, precise answers covering key points only.

Q1: What is an IP address and why is it important?


Ans: An IP (Internet Protocol) address is a unique numerical label assigned to each device on a
network. It serves two purposes: host identification and location addressing. Without IP addresses,
devices cannot find or communicate with each other on a network or the Internet.

Q2: Explain the structure of an IPv4 address.


Ans: IPv4 is 32 bits, written as four octets in dotted decimal notation, e.g., [Link]. Each octet
is 8 bits (0-255). It has two parts: the Network portion (identifies the network) and the Host portion
(identifies the device on that network), separated by the subnet mask.

Q3: What are the five classes of IPv4 addresses?


Ans: Class A: 1-126.x.x.x, /8, 16M+ hosts. Class B: 128-191.x.x.x, /16, ~65K hosts. Class C: 192-
223.x.x.x, /24, 254 hosts. Class D: 224-239.x.x.x, multicast. Class E: 240-255.x.x.x, research/reserved.

Q4: What is a subnet mask and what is its purpose?


Ans: A subnet mask is a 32-bit number with 1s for network bits and 0s for host bits. It divides an IP
address into network and host portions. Example: [Link] (/24) means first 24 bits = network,
last 8 bits = hosts. Routers use it to determine if a destination is local or needs forwarding.

Q5: Explain CIDR notation with an example.


Ans: CIDR (Classless Inter-Domain Routing) combines an address and prefix length with a slash.
Example: [Link]/24 means the first 24 bits are the network portion, equivalent to mask
[Link]. CIDR allows flexible, classless allocation and supports route summarization.

Q6: What is subnetting and why is it used?


Ans: Subnetting divides a large network into smaller subnets. Benefits: (1) Reduces broadcast domain
size and congestion. (2) Improves security by isolating segments. (3) Efficient use of IP space. (4)
Easier network management. Each subnet has its own network address and broadcast address.

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.

Q8: How do you calculate block size from a subnet mask?

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

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.

Q10: What are private IP address ranges (RFC 1918)?


Ans: RFC 1918 defines three private ranges: Class A: [Link]/8, Class B: [Link]/12 ([Link]-
[Link]), Class C: [Link]/16. These are not publicly routable and require NAT to access
the Internet. Used freely inside organizations.

Q11: What is the loopback address and what is it used for?


Ans: [Link] (IPv4) or ::1 (IPv6) refers to the local machine itself. Used to test if the TCP/IP stack is
working without sending data over a real network. Pinging [Link] confirms the local IP stack is
functional.

Q12: What is NAT and why is it needed?


Ans: NAT (Network Address Translation) translates private IP addresses to a public IP at the router
boundary. Needed because IPv4 has insufficient public addresses for all devices. NAT allows many
private-addressed devices to share one public IP. It also hides internal topology, adding security.

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.

Q14: What is IPv6 and how does it differ from IPv4?


Ans: IPv6 is the successor to IPv4. Key differences: 128-bit addresses (vs 32-bit), colon-separated
hex notation, no broadcast (uses multicast), built-in IPSec, SLAAC auto-configuration, simplified fixed-
length headers, and virtually unlimited address space (~340 undecillion addresses).

Q15: What is VLSM and what is its advantage?


Ans: VLSM (Variable Length Subnet Mask) allows subnets of different sizes within the same network.
Advantage: eliminates address waste. A /30 (2 hosts) for WAN links, a /25 (126 hosts) for large LANs
— all carved from the same address block. Requires classless routing protocols (OSPF, EIGRP,
RIPv2).

Q16: What is supernetting (route summarization)?

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

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.

Q17: What is APIPA and when is it used?


Ans: APIPA (Automatic Private IP Addressing) automatically assigns an address in [Link]/16
when a DHCP server is unreachable. Allows communication only with other APIPA-addressed hosts
on the same link. If you see 169.254.x.x on a machine, it means DHCP failed.

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.

Q20: What is the difference between classful and classless addressing?


Ans: Classful: fixed A/B/C classes with fixed default masks. No mask info in routing updates.
Protocols: RIPv1, IGRP. Classless (CIDR): any prefix length; mask info included in routing updates.
Supports VLSM and subnetting across class boundaries. Protocols: OSPF, EIGRP, RIPv2, BGP.

Q21: What is a default gateway?


Ans: The default gateway is the IP address of the router interface on the local subnet. When a device
needs to reach a host on a different network, it forwards the packet to the default gateway. The router
then uses its routing table to forward it toward the destination.

Q22: Explain DHCP and the DORA process.


Ans: DHCP automatically assigns IP, mask, gateway, and DNS to devices. DORA: (D)iscover - client
broadcasts to find DHCP servers. (O)ffer - server proposes an IP. (R)equest - client accepts the offer.
(A)cknowledge - server confirms the lease. DHCP uses UDP ports 67 (server) and 68 (client).

Q23: What is ARP and how does it work?


Ans: ARP (Address Resolution Protocol) resolves a known IP address to its MAC address. Process:
(1) Host broadcasts ARP Request: 'Who has IP x.x.x.x?' (2) Device with that IP sends unicast ARP
Reply with its MAC. (3) Requesting host caches the IP-to-MAC mapping. Used for local subnet
communication.

Q24: What is the significance of /32 and /0 prefix lengths?

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

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.

Q25: What is DNS and why is it important?


Ans: DNS (Domain Name System) translates domain names like [Link] to IP addresses.
Without DNS users would memorize IP addresses. Operates at Application layer, uses UDP/TCP port
53. Hierarchical: root servers -> TLD servers -> authoritative servers -> recursive resolvers.

Q26: What is the difference between a public and a private IP address?


Ans: Public IPs are globally unique, assigned by IANA/ISPs, routable on the Internet. Private IPs
(RFC 1918) are used internally, not routable on public Internet, require NAT to communicate
externally. Private addressing conserves the limited public IPv4 address space.

Q27: How do you subnet a Class C network into 4 equal subnets?


Ans: 1) Borrow 2 bits (2^2=4). 2) New mask: /26 = [Link]. 3) Block=64. 4) Subnets:
[Link]/26 (hosts 1-62, bcast 63), [Link]/26 (hosts 65-126, bcast 127), [Link]/26
(hosts 129-190, bcast 191), [Link]/26 (hosts 193-254, bcast 255).

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]).

Q29: What is an IP address conflict and how is it prevented?


Ans: An IP conflict occurs when two devices share the same IP address, causing connectivity loss for
one or both. Prevention: use DHCP with proper lease management, DHCP conflict detection (ARP
probing before assigning), static IP documentation, and network scanning tools (arp-scan, nmap) to
audit assignments.

Q30: Explain the IPv4 to IPv6 transition mechanisms.


Ans: Three main mechanisms: (1) Dual Stack — devices run both IPv4 and IPv6 simultaneously. (2)
Tunneling — IPv6 packets are encapsulated in IPv4 packets to cross IPv4-only networks (e.g., 6to4,
ISATAP, Teredo). (3) NAT64/DNS64 — translates between IPv6-only clients and IPv4 servers,
allowing IPv6-only networks to access IPv4 content.

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation


Computer Networking — IP Addressing | JU PMSCS / PMIT Admission Preparation

Quick Reference Summary

CLASS A: 1-126 (/8) | B: 128-191 (/16) | C: 192-223 (/24) | D: 224-239 Multicast | E: 240-255
RANGES Reserved

PRIVATE Class A: [Link]/8 | Class B: [Link]/12 | Class C: [Link]/16 | APIPA:


RANGES [Link]/16
(RFC 1918)

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

IPv6 KEY 128 bits | No broadcast | Loopback=::1 | Link-local=FE80::/10 | Multicast=FF00::/8 |


FACTS Global=2000::/3

Static=1-to-1 fixed | Dynamic=1-to-1 pool | PAT=many-to-1 via port numbers (most


NAT TYPES
common)

— End of IP Addressing Complete Guide —

IP Addressing Complete Guide | Jahangirnagar University Admission Preparation

You might also like