A method for allocating timeslots for transmission of data packets in a passive optical network, PON, said PON comprising an Optical Line Terminal, OLT, managing one or more Optical Network Unit, ONU, wherein GATE message is sent from the OLT to a given ONU and is used to assign one or several transmission window to the ONU, and REPORT message is a feedback mechanism used by an ONU to indicate to the OLT the length of a queue of waiting data packets to be sent by the ONU, wherein start and length of transmission windows in GATE as well as queue lengths in REPORT messages are expressed in Time Quantum, TQ, a fixed time interval, each queue being associated to a logical link LL i in said OLT, a minimum bit rate b i being required by each logical link for transmission of the data packets, time being divided in cycles, each cycle being divided in said equal timeslots TQs, a theoretical transmission time TTT i being initially defined in said OLT for each logical link LL i, said initial TTT i being based on b i, each transmission being associated with a fraction of overhead, the OLT storing an image queue length Q i for each logical link LL i corresponding to data to be sent by logical link LL i, wherein the method comprises the following steps implemented at each cycle k by the OLT: - receiving at least one REPORT message from at least one logical link LL i, said REPORT message comprising an updated queue length of said logical link LL i, said length being expressed in timeslots; - upon reception of said REPORT message from said logical link LL i, updating said image queue length Q i based on the updated queue length; characterized in that: M being a prefixed maximum number of logical links LLi (3.11; 3.12;3.21;3.31) to be served during one cycle k, wherein R being the total number of TQs in one cycle; and in that the method further comprises: - selecting only the M logical links LLi having the lowest theoretical transmission times TTTi for which image queue length is not zero; - allocating to said selected M logical links LL i, a number of timeslots TQ in the next cycle k+1 based on a granularity N i of each logical link LL i; and - incrementing the theoretical transmission time TTT i of each selected logical link LL i based on b i and N i and decrementing the image queue length Q i of said logical link LL i of the number of timeslots TQ allocated to it; timeslots TQs being allocated to said selected M logical links LL i until all timeslots TQs of the next cycle k+1 are allocated or until all image queue lengths Q i of said selected M logical links LLi are zero; and wherein the OLT waits for the end of cycle k before transmitting GATE messages to the selected ONUs so that they can transmit data packets in the selected M LL i during the timeslots of the cycle k+1 that have been allocated to them. - receiving at least one REPORT message from at least one logical link LL i, said REPORT message comprising an updated queue length of said logical link LL i, said length being expressed in timeslots; - upon reception of said REPORT message from said logical link LL i, updating said image queue length Q i based on the updated queue length; M being a prefixed maximum number of logical links LLi (3.11; 3.12;3.21;3.31) to be served during one cycle k, wherein R being the total number of TQs in one cycle; and in that the method further comprises: - selecting only the M logical links LLi having the lowest theoretical transmission times TTTi for which image queue length is not zero; - allocating to said selected M logical links LL i, a number of timeslots TQ in the next cycle k+1 based on a granularity N i of each logical link LL i; and - incrementing the theoretical transmission time TTT i of each selected logical link LL i based on b i and N i and decrementing the image queue length Q i of said logical link LL i of the number of timeslots TQ allocated to it; - selecting only the M logical links LLi having the lowest theoretical transmission times TTTi for which image queue length is not zero; - allocating to said selected M logical links LL i, a number of timeslots TQ in the next cycle k+1 based on a granularity N i of each logical link LL i; and - incrementing the theoretical transmission time TTT i of each selected logical link LL i based on b i and N i and decrementing the image queue length Q i of said logical link LL i of the number of timeslots TQ allocated to it; timeslots TQs being allocated to said selected M logical links LL i until all timeslots TQs of the next cycle k+1 are allocated or until all image queue lengths Q i of said selected M logical links LLi are zero; and wherein the OLT waits for the end of cycle k before transmitting GATE messages to the selected ONUs so that they can transmit data packets in the selected M LL i during the timeslots of the cycle k+1 that have been allocated to them.