8.3k views
Every host in an IPv4 network has a $1-second$ resolution real-time clock with battery backup. Each host needs to generate up to $1000$ unique identifiers per second. Assume that each host has a globally unique IPv4 address. Design a $50-bit$ globally unique ID for this purpose. After what period (in seconds) will the identifiers generated by a host wrap around?

edited | 8.3k views
+1
can not ubderstand
0
Design a 5050-bit globally unique ID for this purpose.

pls someone explain this
+6

Please, can someone explain this question?

Every host in an IPv4 network has a 1-second resolution real-time clock with battery backup.

Design a 5050-bit globally unique ID for this purpose

What do the above two sentences mean?

0

Why 1000 is taken as 1024 ? nobody has explained this. Answer should be 262.144 Sec

Explanation is provided here but i am not getting it

https://stackoverflow.com/questions/33691136/design-a-50-bit-globally-unique-id

https://stackoverflow.com/questions/25201274/in-ipv4-network-finding-the-period-of-identifiers-generated-by-a-host-wrap-aroun

0

Various other websites like Geeksforgeeks and Techtud has also mentioned the options along with this question as -

(A) 128
(B) 64
(C) 256
(D) 512

So in order to pick up a right option, one has to take (1000 as 2^10) otherwise no option won't match, but if it would have been a numerical answer then surely answer is 262.14 seconds.

0
The only way to explain the approximation would be that if a computer has to generate 1000 IDs, it can't do so exactly. It'll have to use 10 bits somewhere, which will generate 1024 IDs. This generation is done regardless of the fact that we only need 1000 IDs in the worst case and hence, the wrap around time will be 256 seconds.
0
Couldn't imagine all 2^32 hosts will be involved!
0

After what period (in seconds) will the identifiers generated by a host wrap around?

This "a" is confusing.

0

One of the catch here is that word $\textbf{generate}$ , which means it is not saying $1000$ is the unique ID's given, but it's a requirement that has to be generated. Hence 10 bits are required for it  which will generate at max 1024 unique ID's.

Each host needs to generate up to 1000 unique identifiers per second

Worst case scenario can be that all $2^{32}$ host are present on the network each generating $1000$ packets simultaneously in $1$ second.

So, total packet produced in $1$ second $= 2^{32}\times 2^{10}$ $\text{(assuming 1024 = 1000)}= 2^{42}$

Now, we can distinguish $2^{50}$ packets, after that wrap around (so wrap around time will be when $2^{50}$ identifiers are used)

$2^{42}$ takes $1$ second,

$2^{50}$ will take $=\dfrac{2^{50}}{2^{42}}=2^8=256\text{ seconds.}$
by
edited
+58
How one is supposed to approximate 1000 to 1024 ? This was numerical answer question ! It was not like we could select one of answer.. Also One more thing, they said we are supposed to generate upto 100.. up to means, Maximum or As far as ! I think this question 's answer should be 262 !
0
What is the meaning of generating 50 bits?Design a 50-bit globally unique ID for this purpose?Can someone explain this?
+11
$262.144 sec$ is the precise answer for this qsn.
0

identification field in IP Header is of 16 bit, then why here 232 hosts are considered , why not 216??

0
32 bits of IP are teken .. And also they mentioned that each host has a globally unique I'd for this pourpose
in question given that
Identification No. (unique ID) field is 50 bit long..
.
We can make 50 bit Unique ID No. in combination with 32-bit source IP Address and 18-bit no.
.
50-bit unique Id no. = Concat(32-Bit source IP, 18-bit no.)
.
Now we need to generate only 18-bit no. at each host.
.
1000 No. are generated per sec.
.
so 2^18 numbers are generated in (2^18/1000)sec
(after that ID no. will repeat   at that host)
=2^8 (1000 approximately equal to 2^10)
+10
@Pooja, How one is supposed to approximate 1000 to 1024 ? This was numerical answer question ! It was not like we could select one of answer.. Also One more thing, they said we are supposed to generate up to 1000.. up to means, Maximum or As far as ! I think this question 's answer should be 262 ! Answer Debate Alert ! If they start approximating everything up / down for no reason GATE exam will become non deterministic !
0
even i am not able to understand why is this approximation done and negative marks to those who calculatted accurately, Why?? Its so unfair. Any expert advice needed. Arjun sir plzz tell
+1
I guess it has something to do with resolution of clock but I don't understand it
0

hello @Pooja Palod your explanation is great.....i have just one doubt...that why are we generating only 18 bit no ....and not 50 bit.

is this because already it's given that 32 bits are unique and we have to generate 18 bits more to make id of

50 bits?

0
The 32 bits are that of the IPv4 address itself. Thus these 32 bits are already unique.
0

@Akash Kanase Sir, @Arjun  Sir,

why263 second is not the answer? Answer would be given in range like (262 to 263). See this question-

https://gateoverflow.in/204099/gate2018-25

0

Well official answer was 256 only.
https://gatecse.in/w/images/9/9e/Key_CS_03.pdf

0

@Arjun sir, how would I know that when to use value 2^10= 1024 as 1000 while solving these kind of questions?

STEP 1:
IPv4 has size of 32 bits. so total hosts possible with 2^32
Each host can produce 1000 unique Ids(sequence numbers) per seconds
Therefore, total unique sequence number that can be produced in 1 second = (2^32)*1000
and 1 sequence number can be produced in = 1/((2^32)*1000) seconds.

STEP 2:
Design a 50-bit globally unique ID means that total possible unique sequence number can be produced using 50-bits.Therefore total unique sequence numbers that can generate using 50-bits  =  2^50

CONCLUSION:
From step 1 and step 2  we conclude that total 2^50 sequence numbers an be generated in (2^50)/((2^32)*1000) seconds = 262.14seconds = 262 seconds

Wrap around time = 262 seconds

edited
this is very strange that answer given is 256..ideally it should be 262 as 2^50/(2^32x1000)...for some reason they have considered 1000 as 2^10...don't why?
by Loyal
0
Those who calculated perfectly are fools and got -0.66??
+2
Can you answer this question ? @Arjun, I'm not satisfied with any of the answers :( Confused here ..
+4
@Arjun, How one is supposed to approximate 1000 to 1024 ? This was numerical answer question ! It was not like we could select one of answer.. Also One more thing, they said we are supposed to generate up to 100.. up to means, Maximum or As far as ! I think this question 's answer should be 262 ! Answer Debate Alert ! If they start approximating everything up / down for no reason GATE exam will become non deterministic !
0
why?? Its so unfair
+1
@Arjun Sir, I think question is NAT type so no negative marking..

Sorry for irrelevant comment
Wrap-around time is nothing but in how many seconds will all the hosts generate all IDs possible. (i.e. TOTAL_IDS / NO. OF IDS PER SEC). Total IDs possible with 50-bit is 2^50. One host generating 1000 identifiers per sec. So all hosts will generate 2^32 * 1000 ----> 2^32 * 2^10-----> 2^42 unique IDs. If we Divide them, we get answer (i.e. 2^50/2^42=2^8)
0
$1000 \neq 2^{10}$
0
1 second resolution real time clock means???
0
1 cycle time

In this question, they are saying that 50 bits are globally allocated for unique identity field,

with 50 bits in the unique identity field, we can distinguish  2^ 50 B data uniquely

now total Byte spend in 1 sec is-

let assume at worst case all host are there so the total number of host =( 2^32) and each consuming 1000 B (for simplicity takes 1024) so

total byte consumed = (2^ 32) * (2^10) = 2^ 42 B

now

2^ 42 B is consumed in 1 sec, then 2^ 50 B is consumed in 256 sec  (you please do the maths).

0
Why we are taking total number of hosts as 32?

Is there any general assumption for all protocols like this?
0

@Priyam Pandey

IPv4 has 32 bit IP address. So there can be max $2^{32}$ hosts connected on IPv4 network

Let's get the gist of the question first, breaking it down bit by bit.

Every host in an IPV4 network has a 1−second resolution real-time clock with battery backup.

It tells that hosts have a cycle of 1 sec each and the "battery backup" part is given that so that it is assumed that there is no concept of the clock going off before the sequences wrap. (Quite irrelevant actually!)

Each host needs to generate up to 1000 unique identifiers per second.

This pertains to the unique ID field of the IPv4 packet which is used to identify a packet over the whole global internet.

So, this means that a host on the internet has the capability of creating 1000 such nos. and due to that each host over the internet has the capability of sending a max of 1000 packets per second.

Design a 50−bit globally unique ID for this purpose.

Now, these nos. need be designed in such a way that they are unique throughout the world, i.e. there may be chances that all the hosts over the internet are sending out packets simultaneously and it may create confusion if all are not working in tandem with each other.

And it's assumed that this ID being generated ( by all the hosts simultaneously, in the worst case) is 50 bit long.

So, they are asking that is such a scenario where all hosts work together, how long will it take for them to consume all the nos. and wrap around back to 0.

Now, the calculation part.

Total hosts present globally in IPv4 = $2^{32}$

In 1 sec, each host generates = 1000 IDs

In 1 sec, $2^{32}$ host genetate  = $2^{32} \times 1000$

= $2^{32} \times 2^{10}$  (approximating 1000 as 1024 to make calculations easy)

= $2^{42}$

Nos. of possible IDs with 50 bits= $2^{50}$

Time to generate 1 ID = $\frac{1}{2^{42}}$ sec

Time to generate $2^{50}$ IDs = $\frac{2^{50}}{2^{42}}$

= 256 Seconds.

edited
0

Nos. of possible IDs with 50 bits = $2^{52}$.

0

Done!

Thnaks

After what period (in seconds) will the identifiers generated by a host wrap around?

IDs generated per second by a host = 1000

Total IDs possible = $2^{50}$

So, in $\frac{2^{50}}{1000}$ seconds, host will exhaust all IDs, and will have to wrap-around. This number is too high, and not in the options.

So, assume that the question means: every host generates 1000 IDs per second, after what time a random host will accidentally produce a duplicate ID?

IDs generated per second by a host = 1000

Total IDs possible = $2^{50}$

Total hosts possible with IPv4 = $2^{32}$ since IPv4 is a 32 bit address.

So, when all the hosts generate 1000 IDs each second, in how much time would they exhaust the total IDs =

$\frac{2^{50}}{2^{32}*1000}$; which is roughly equal to

$\frac{2^{50}}{2^{32}*2^{10}}$

$= \frac{2^{50}}{2^{42}}$

$= 2^{8}$

by Loyal
edited
0 Check ace acedmay explain

0
What is answer key suggested by gate official 256 or 262 sec?