Put five hundred tags in front of a reader and every one of them wants to talk.
The reader can hear one at a time. The tags can’t hear each other, so they can’t take turns by agreement. Something has to stop them talking over each other, and in Gen2 that something is a lottery.
The lottery
The reader opens a round with a Query that carries a number, Q. Every tag that’s listening picks a slot at random between 0 and 2^Q − 1 and goes quiet. Q = 4 is sixteen slots.
Then the reader counts down. Each slot ends one of three ways.
One tag picked it. The tag sends a random 16-bit number, the reader echoes it back, and the tag answers with its EPC. At the Impinj dense-reader setting, mode 244, that exchange takes about 3.7 ms in the simulator.
Two tags picked it. Both answer, neither is heard, and both try again next round.
Nobody picked it. The reader waits, hears nothing and moves on. About 0.4 ms, wasted.
Sixteen slots for five hundred tags
Five hundred tags into sixteen slots is thirty or so in each. Every slot collides. Nothing is ever read.
So the reader doesn’t stay at 4. The spec’s example algorithm keeps a floating-point Q. A collision adds a little, an empty slot takes a little off, and when the rounded value moves the reader restarts the round with the new Q. The spec suggests steps between 0.1 and 0.5, smaller when Q is large. Ours are my choice inside that range, not Impinj’s numbers.
For five hundred tags it climbs to 9. That’s 512 slots, and in the simulator’s first round at Q = 9 about 38% of them read clean. That’s about as good as slotted ALOHA gets. The best case is 1 in e, 37%, when slots and tags are about even. A reader guessing Q well still wastes most of its slots.
The flag
Reading a tag once isn’t the end of it. Every tag keeps a flag, A or B, for each of four sessions. The reader asks for the A tags. A tag that’s been read flips to B and sits out. What happens next is the session.
In session 2 the flag holds while the tag has power, and for at least two seconds after. The crowd thins every round. The tags at the back finally get a slot to themselves. In the simulator all five hundred are read once in 2.49 seconds, in 353 rounds.
In session 0 the flag lasts only as long as the tag is energised. Drop the carrier, even briefly, and every tag is back in A. So a reader that stops transmitting between rounds gets the same tags answering again. I made the simulator drop it every round. That’s a simplification, and how often a real reader does it is up to its software. Run five hundred tags for ten seconds and the average tag answers four times. Nine never get a word in.
Session 1 sits between: the flag lasts somewhere from half a second to five, and the simulator uses two. Session 3 behaves like 2 here, and exists so a second reader can keep its own flags.
How slow is slow?
The simulator works out each slot’s time from the bits in it: a QueryRep is 4 bits, an ACK 18, an RN16 reply is a preamble and 16 bits, an EPC reply is that plus 128. It adds the gaps the spec leaves between them. There are no retries. No weak tags. No reader software in the way. It’s a best case.
Impinj quotes typical read rates for a large population on its E710 board: 1,000+ tags a second in mode 103, 300+ in 223, 150+ in 244 and 50+ in 285. The simulator comes out at about 1,100, 380, 200 and 85 for the same modes. It’s above Impinj’s floor each time and it should be. Treat its times as the fastest the air interface allows and the real number as lower.
If you’ve got your own timings, the demo lets you type them in.
Run it with 500 tags, pick a session, then change Q and watch which slots read. Same seed, same run, so you can send someone the link.
Where the numbers come from
The Q algorithm, the persistence times and the command lengths are from the EPC Gen2 v2.0.1 air interface specification (Annex D, Table 6.20 and the command tables). Reader modes, Tari and link frequencies are from the Impinj E910/E710/E510/E310 reader chip datasheet, v1.4. The 3.7 ms and 0.4 ms, the 2.49 seconds and the four answers a tag are the simulator’s, at mode 244.
The sessions are the part I’d check against your own reader. Reader software chooses its own search mode and decides when the carrier drops, and that decides how S0 behaves on your floor.