edited by
11,925 views
54 votes
54 votes

Host $X$ has IP address $192.168.1.97$ and is connected through two routers $R1$ and $R2$ to an­other host $Y$ with IP address $192.168.1.80$. Router $R1$ has IP addresses $192.168.1.135$ and $192.168.1.110$. $R2$ has IP addresses $192.168.1.67$ and $192.168.1.155$. The netmask used in the network is $255.255.255.224$.

Given the information above, how many distinct subnets are guaranteed to already exist in the network?

  1. $1$
  2. $2$
  3. $3$
  4. $6$
edited by

8 Answers

2 votes
2 votes

You can always AND the netmask with the various IP addresses. I present a different method which I feel is more convenient. It's from Todd Lammle's CCNA prep book (for classful addressing specifically, but the approach extends to this situation).

We have the netmask $255.255.255.224$. I subtract the last octet value from $256$ to get what Todd calls the block size of that octet. It's 32 here. That means that our subnets, starting from $192.168.1.0$, are $192.168.1.0$, $192.168.1.32$, $192.168.1.64$, $192.168.1.96$, $192.168.1.128$, and so on. You get the picture. You keep adding the last octet's block size to get the subnet addresses for all subnets in the network.

Why this makes it easier, is that now I can just compare the last octet values and see which subnet an IP address is in. For example, $X$ is in $192.168.1.96$ and $Y$ is in $192.168.1.64$. Once you find out the subnets of all the given IPs, you'll see that there are only 3 distinct subnet addresses, and so the answer is $C)$.

1 votes
1 votes
Simply, Bitwise AND the bits of fourth octet for each of the following IP address with fourth octet of subnet mask. You will get only
XX.XX.XX.96, XX.XX.XX.64 and XX.XX.XX.128.
1 votes
1 votes

For each interface, router has one entry in routing table. 
Each interface out of a router = 1 subnet

Here the diagram is look like 

X---------R1-------common-------R2--------Y

R1 has 2 interface

R2 has 2 interface

One is common..so total 3 subnet..

For more clarity https://gateoverflow.in/371924/Gate-cse-2022-question-12

Answer:

Related questions