Why maximum number of “Duration ID” and “AID” are “32767” and “2007” respectively?
What is logic behind these numbers?
in general the Duriation/ID Field is 16 Bits in length.
This field has several uses(Duration/CFP period/Power Save).
When it is used as Duration field the last Bit is set to 0. Thus 15 bits remain to set the duration value. 2^15=32768.
When this field is used in context to power save bit 15 and 16 are set to 1. Out of the 14 remaining bits 2^14 =16384 only the values 1-2007 are used. The values 0 and 2008 to 16383 are reserved.
Here you can read a detailed description by Matthew Gast: https://books.google.de/books?id=9rHnRzzMHLIC&pg=PA50&lpg=PA50&dq=duration+802.11+bit+15&source=bl&ots=3ytRJaW6Iq&sig=S2O7d2r3FLmQZsVCejO-QIEC3jA&hl=de&sa=X&ei=LNvcVLjXEsavU5KFglg&ved=0CCMQ6AEwAA#v=onepage&q=duration%20802.11%20bit%2015&f=false