The Gateway to Computer Science Excellence
+29 votes
In the network $$, the $fourth$ octet (in decimal) of the last $IP$ address of the network which can be assigned to a host is _____.
in Computer Networks by
edited by | 5.5k views
What is meant by fourth octet ?

@hem chandra joshi ji

fourth octet (in decimal) of the last IP address of the network means

__ __ __ __ __ __ __ __($1^{st}$ octet) . __ __ __ __ __ __ __ __($2^{nd}$ octet) . __ __ __ __ __ __ __ __ ($3^{rd}$ octet). X X X X X X X X ($4^{th}$ octet)

4 Answers

+55 votes
Best answer
Answer= $158$

$144$ in binary = $100 10000$

out of this $3$ $bits$ in left are subnet bits. ($27$ $bits$ are used for subnet, which means top $3$ $bytes$ and leftmost $3$ $bits$ from the last byte)

So, the $4$th octet in the last $IP$ address of the network which can be assigned to a host is $100 11110$. (its not $100 11111$ because its network broadcast address)

So, $10011110$ is $158$ in decimal.
edited by

10011110  is actually 158 in decimal. But is this method correct @Arjun Sir ????

yes. It is 158. Thats the most straightforward method :)
please give a clearer view why it is not 100 11111. i am unable to understand.
here we have 5 bits for hosts, so total 32 addresses. In which 00000 is the network address and 11111 is the broadast address (means this address is used to broadcast a message to every user) thus we are left with a range of 00001 to 11110. so last address is 10011110 which is 158

@arjun sir,

Given Net ID  $$

$\underset{24 \text{ bits} }{\underbrace{200.10.11.}} \mathbf{{\color{Red} {10010000}}}$

Now we can borow $3$ bits from $4^{\text{th}}$ octact .AFAIK , There is no standard rule that it should be always from Left .

This can also be done like this ?

$\underset{24 \text{ bits} }{\underbrace{200.10.11.}} \mathbf{{\color{Red} {10010}}}\underset{3\text{ bits}}{\underbrace{\mathbf{{\color{Blue} {000}}}}}$

Actaully I think Subnet Mask must also be given with the question .

Correct me if wrong

@pc. If each one borrows from from different place, then how the interpretation is to take place? One router may interpreet in one way and other router in some other way.

Hence, its standard that we borrow from left.


Now, we are creating directly hosts instead of subnets.

SO, this is it.

@pC your approach would have been correct if classful notation is given.

Here, /27 implies that it is CIDR notation in which most significant 27 bits are considered as network id and remaining host id. Hence, the given approach is correct.

How it would be allowed in classful notation? Could you give example and how the routers would interpret?

@Sushant Gokhale theoretically it is possible in classful notations, practically, convention you said is followed.



Do you have any reference for

its standard that we borrow from left.

Actually what I knew by $$ is We are given a NID from which we have to make subnets having $27$  bits we have to take first $24$ bits as we dont have any choice for it . But for last byte to choose $3$ bits we have got 8 positions .
So unless specified a Subnet Mask . How can we be sure about$\mathbf{ 200.10.11.{\color{Red} {100}{\color{Blue} {00000}}}}$ is the first network in our subnet ?



Here, /27 is the netmask and not subnet mask.

Regarding your query that why cant we borrow last 3 bits?    Theorotically you can do it. But all the network devices in the world should follow the same protocol.

Also, the bits are not simply representing the hosts. They are placeholders like the binary digits e.g 20=1, 21=2 and so on. By having the placeholders, hierarchical interpretation becomes possible.


I guess I have made a wrong interpretation


Even if its a subnet mask, its still a network. So in general, its a netmask. But, if they give it specifically or we want to create subnets, then we need to differentiate betn netmask and subnet mask.

Hope the below info. from wiki support ur discussion.

subnet mask is a bitmask that encodes the prefix length in quad-dotted notation: 32 bits, starting with a number of 1 bits equal to the prefix length, ending with 0 bits, and encoded in four-part dotted-decimal format: A subnet mask encodes the same information as a prefix length, but predates the advent of CIDR. In CIDR notation, the prefix bits are always contiguous, whereas subnet masks may specify non-contiguous bits. However, since IP addresses are almost always allocated in contiguous blocks, a subnet mask has no practical advantage over CIDR notation.

Is it true that in all subnets 2 addresses are spent on network and broadcast addresses?

That means total no of available addresses would be 32 -2= 30. Right?
+22 votes

last octate will be 100 11111 = 1 + 2 + 4+ 8+ 16 + 128 = 159

The question seems to by asking about host address. The address with all 1s in host part is broadcast address and can't be assigned to a host. So the maximum possible last octal in a host IP is 10011110 which is 158 ( 159 - 1 = 158 ) . 

+4 votes
NID = 27 bits

HOST ID = 5 bits

144 in binary = 10010000

so, 200 . 10 . 11 . 100 00000 ( Reserved for Network id)

      200 . 10 . 11 . 100 00001

      200 . 10 . 11 . 100 00010



     200 . 10 . 11 .100 11110 = 200 . 10 . 11 .158 (Last IP address of the network which  is assigned to host)

     200 . 10 . 11 .  100 11111 = 200 . 10 .11 . 159 (Reserved for DBA)
0 votes
Reusing Todd Lammle's method (CCNA) here, which I used in another answer.

$/27$ bits turned on is $$. Thus $256 - 224 = 32$ is the block size for the last octet. So subnet addresses follow the pattern $$, $$, $$, $$, $$, $$ and so on.

Thus we can easily see that the given IP address is in the $$ subnet, whose last valid host address is $$. (as $$ is the broadcast address).

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,345 questions
60,482 answers
95,283 users