# Q1D · IPv4 address block

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/mocks/tee-mock-b/q1d

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/mocks/tee-mock-b--q1d/

TEE · 100 attempted marks · solutions for every choice · current syllabus 702AI0C023

### TEE practice mock · Q1D. One address in a block is 10.20.45.200/20. Find its subnet mask, first/last address, total address count and ordinary usable-host range. [5 mock marks]

#### Answer

## Given

IP/prefix = `10.20.45.200/20`.

## To find

The complete containing address block and its usable host range.

## Formula and why



$$
h=32-p,\qquad N=2^h
$$





$$
\text{step}=256-\text{changing mask octet}
$$



Use the explicit prefix. We show both the interval method and bitwise AND so the boundary can be understood.

## Step-by-step solution

#### Step 1. Count host bits and addresses

h=32−20=12; N=212=4,096.

#### Step 2. Construct the mask

Mask=`255.255.240.0`; binary=`11111111.11111111.11110000.00000000`.

#### Step 3. Find the changing-octet interval

The changing octet is number 3. Its mask value is 240, so step=256−240=16. The IP value 45 lies in 32…47.

#### Step 4. Form the first/network address

Keep earlier octets; place 32 in octet 3; set any later octets to zero. Network=**10.20.32.0**.

#### Step 5. Show the AND operation

| Octet | IP bits | Mask bits | AND result | Decimal |
| --- | --- | --- | --- | --- |
| 1 | 00001010 | 11111111 | 00001010 | 10 |
| 2 | 00010100 | 11111111 | 00010100 | 20 |
| 3 | 00101101 | 11110000 | 00100000 | 32 |
| 4 | 11001000 | 00000000 | 00000000 | 0 |

#### Step 6. Form the last/broadcast address

Use 47 in the changing octet and 255 in any later octets. Broadcast=**10.20.47.255**.

#### Step 7. State usable hosts

First usable=10.20.32.1; last usable=10.20.47.254; count=4096−2=4094.

**Final answer:** Network 10.20.32.0; broadcast 10.20.47.255; 4,096 total, 4,094 ordinary usable; range 10.20.32.1–10.20.47.254.

#### What this result means

The first address in a block means its network address. It is different from the first usable host address.
