Question

Question1. Suppose computers A and B have IP addresses 10.105.1.113 and 10.105.1.91 respectively and they both use the same net mask N. Which of the values of N given below should not be used if A and B should belong to the same network?

  1. 255.255.255.0
  2. 255.255.255.128
  3. 255.255.255.192
  4. 255.255.255.224

Question2. While opening a TCP connection, the initial sequence number is to be derived using a time-of-day (ToD) clock that keeps running even when the host is down. The low order 32 bits of the counter of the ToD clock is to be used for the initial sequence numbers. The clock counters increments once per millisecond. The maximum packet lifetime is given to be 64s. Which one of the choices given below is closest to the minimum permissible rate at which sequence numbers used for packets of a connection can increase?

  1. 0.015/s
  2. 0.064/s
  3. 0.135/s
  4. 0.327/s

During an interview in company interviewer ask me these questions. How to solve these question. Please help me.

Thank you.

Was it helpful?

Solution

Really you should ask only one question per post...

For question 1, after masking the IP addresses have to look the same. Masking is a bitwise AND operation, so you need to write down the numbers in question in binary. Now the first three groups don't matter, since 255 == 11111111 and you will not change anything. Let's focus on the last number only:

113 = 0111 0001
 91 = 0101 1011

And for the mask:

  0 = 0000 0000
128 = 1000 0000
192 = 1100 0000
224 = 1110 0000

Now for the masking:

Example:

1110 0000
0111 0001
========= AND
0110 0000 

Since 0 AND 1 == 0, but 1 AND 1 == 1

Applying this mask to the two addresses, we get

      113         91
  0 0000 0000  0000 0000
128 0000 0000  0000 0000
192 0100 0000  0100 0000
224 0110 0000  0100 0000 **** when this mask is applied to the two IP addresses, the result is different

We conclude that the two addresses would end up on different subnets.

Conclusion: you can't use 255.255.255.224 as the mask if you want these two IP addresses on the same subnet. For more information you can go to https://en.wikipedia.org/wiki/Subnetwork for example.

As for question 2, it is one of those badly phrased questions. Is a "minimum rate" the lowest number, or the highest number? When you say "this is the maximum rate" you typically mean "the lowest number" but it's open for interpretation. I think in this case they are asking about the "maximum rate" (the smallest number), since the literal interpretation of the question makes no sense. Still I am struggling to understand what they are asking. When two computers communicate, they increase the sequence number on each packet. So what is "permissible"? I don't know. But 0.015/s is close to 1/64s - if I were a betting man, that's where I'd put my money but I can't explain it. I hope the answer to your first question at least is useful... and maybe that the rambling for the second spurs some good discussion and an actual answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top