# Q1D · IPv4 address block

Subject: Computer Networks

Exam: TEE

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

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

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

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

#### Answer

## Given

IP/prefix = `172.18.7.33/23`.

## 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−23=9; N=29=512.

#### Step 2. Construct the mask

Mask=`255.255.254.0`; binary=`11111111.11111111.11111110.00000000`.

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

The changing octet is number 3. Its mask value is 254, so step=256−254=2. The IP value 7 lies in 6…7.

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

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

#### Step 5. Show the AND operation

| Octet | IP bits | Mask bits | AND result | Decimal |
| --- | --- | --- | --- | --- |
| 1 | 10101100 | 11111111 | 10101100 | 172 |
| 2 | 00010010 | 11111111 | 00010010 | 18 |
| 3 | 00000111 | 11111110 | 00000110 | 6 |
| 4 | 00100001 | 00000000 | 00000000 | 0 |

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

Use 7 in the changing octet and 255 in any later octets. Broadcast=**172.18.7.255**.

#### Step 7. State usable hosts

First usable=172.18.6.1; last usable=172.18.7.254; count=512−2=510.

**Final answer:** Network 172.18.6.0; broadcast 172.18.7.255; 512 total, 510 ordinary usable; range 172.18.6.1–172.18.7.254.

#### What this result means

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