Lab 3. DBA Algorithm Chuan-Ching Sue DCNLAB, CSIE NCKU firstname.lastname@example.org
Outline • Dynamic Bandwidth Allocation Algorithm • Objective of DBA • Interleaved Polling with Adaptive Cycle Time (IPACT) • IPACT Services • Implement DBA algorithm • Conclusion
Maximum Transmission Window • If the OLT authorizes each ONU to send its entire buffer contents in one transmission, ONUs with high data could monopolize the entire bandwidth. • To avoid this situation, OLT will limit the maximum transmission size • Too large: increase delay for all packets • Too small: guard times will waste bandwidth
Maximum Transmission Window (Cont’d) • Each ONU have the maximum bandwidth to transmit the data.
Two Categories of Bandwidth Allocation • Static bandwidth allocation (SBA) • OLT allocates a fixed timeslot to each ONU in every cycle. • Dynamic bandwidth allocation (DBA) • OLT allocates the timeslot depend on the REPORT of each ONU in every cycle.
Comparison of the Two Mechanisms • Static bandwidth allocation (SBA) • The algorithm is much simpler. • The average packet delay is longer than DBA. • Dynamic bandwidth allocation (DBA) • The algorithm is more complex than SBA. • The average packet delay can be shorter.
Objective of DBA • A good bandwidth allocation algorithm can let the data transmitting efficiently. • Decrease the average packet delay • Increase the throughput • Decrease the drop probability • The DBA algorithm for example here is based on the interleaved polling with adaptive cycle time (IPACT) method .
Sequential Timeslot Assignment • The OLT assigns a timeslot to ONU i only after the data from ONU i-1 have been received • The scheme is very inefficient, because after a GATE has been sent, the channel would remain idle for the entire round-trip time. • In EPON, the distance between the OLT and an ONU can reach 20 km, so the walk-time could be as high as 200 μs.
Pipelined timeslot assignment • To eliminate the walk-time overhead, MPCP allows a pipelined timeslot assignment. • In this mode, the OLT may send a GATE to ONU i before data from ONU i-1 have arrived. • The pipelined mode requires the OLT to know the round-trip time to each ONU. The OLT is able to calculate future time when all pending transmissions will complete and the upstream channel will become idle, and to schedule the following timeslot to start at that time.
Example - IPACT • Initially, OLT keeps how many bytes are waiting in each ONU’s buffer and round-trip time (RTT) in a polling table. • OLT sends a GATEto ONU1, allowing it to send data. • A Grant should contain the ID of the destination ONU, the size of the granted window.
Example – IPACT (Cont’d) • The OLT can calculate the time when the last bit from ONU1 will arrive. Hence, it will know when to send the GATE to ONU2 so that its data is tailed to the end of ONU1’s data. • By keeping track of times when GATE s are sent out and data is received, the OLT constantly updates the RTT entries for the corresponding ONUs.
Example – IPACT (Cont’d) • Upon receiving the Grant from the OLT, ONU1 starts sending its data up to the size of the granted window. • At the same time the ONU keeps receiving new data packets from users • At the end of its transmission window, ONU1 will sent Request tells the OLT how many bytes were in ONU1’s buffer and The OLT will update new request in polling table
Example – IPACT (Cont’d) • If an ONU emptied its buffer completely, it will report 0 bytes back to the OLT. • In the next cycle, the ONU will be granted 0 bytes, that is, it will be allowed to send a new Request, but no data.
IPACT Services • Fixed service • Gate service • Limited service • Constant credit scheme • Linear credit scheme • Elastic service
IPACT-Fixed Service • This scheduling discipline ignores the requested window size and always grants the maximum window. • This approach Corresponds to the fixed TDMA PON system • Formula:
IPACT-Gated Service • This scheduling discipline ignores the requested window size and always grants the ONU’s demand. • Formula:
IPACT-Limited Service • It grants the requested number of bytes, but no more than Wmax. • It is the most conservative scheme and has the shortest cycle of all the schemes. • Formula:
IPACT-Constant Credit Service • This scheme adds a constant credit to the requested window size • This service assume that an ONU will receive some packets between the ONU sent a Request and received the Grant. • The granted window size equals requested window + credit, these packets will not have to wait for the next grant. They will be transmitted with the current grant, and the average packet delay will be lower than non-credit service. • Formula:
IPACT-Linear Credit Service • This scheme uses a similar approach to the constant credit scheme. • The size of the credit is proportional to the requested window. • The reason is that if we observe a long burst of data, then this burst is likely to continue for some time into the future. The arrival of more data during the last cycle time may signal that we are observing a burst of packets.
IPACT-Elastic Service • The maximum window is granted in such a way that the accumulated size of last N Grants (including the one being granted) does not exceed N x BMAX bytes (where N is the number of ONUs).
Simulation Configuration • Simulation environment is set as below. • EPON upstream transmission rate: 1 Gbps • Number of ONUs: 16 • Transmission cycle: 2 ms • Guaranteed bandwidth for all ONUs: 24952 bytes • Guard time: 1 μs (125 bytes) • OLT/ONU queue size: 10Mbytes • Distance from the OLT to each ONU: 20km • RTT: 100 μs (12500 bytes) • Upstream traffic: self-similar  with Hurst parameter = 0.8.
Rangeof Lab 3 • Since some modules have been implemeted in the previous labs. • The network topology is followed the deployment of EPON in lab 1. • Knowing that the user module has be done in lab 2. • The undefined modules such as the OLT, the ONU and the splitter will be defined in lab 3. • Moreover, a simple MPCPDU will also implemented in lab 3.
Steps for Lab 3 • Create MPCP message • Create Splitter module • Create ONU module • Create OLT module • Reuse User module from lab 2
MPCP • In lab 3, we use a reduced Multi-Point Control Protocol. Only Gate and Report will be used in this simulation. • A Gate contains • LLID, start time, length • A Report contains • LLID, bandwidth requirement
Create MPCP Message • Open the EPON project in lab 1. • Create a msg file in the folder to define the MPCP message
Input msg File Name • Here we take “mpcp.msg” as an example
Edit mpcp.msg • The Gate message containLLID, start_time and length • The Report message contain LLID and require_bandwidth
Create C++ code for MPCP • Build the project and it will create two files • mpcp_m.h • mpcp_m.cc
Create Splitter Class • Create Splitter.h and Splitter.cc in src folder
Input Splitter Class Name • Input class name “Splitter” • Note that the class mustbe the same as the name of splitter in device.ned file. • case sensitive
Edit Splitter.h • The Splitter module should • broadcast all messages from the OLT to all ONUs • pass messages and data from all ONUs to the OLT
Create ONU Module • Create Onu.h and Onu.cc in src folder • Note that the class mustbe the same as the name of ONU in device.ned file. • case sensitive
Edit Onu.h • A ONU module should contain • a buffer to restore data packet temporarily. • cached start time and length to know when to transmit data and report message. • maximum buffer size and maximum windows size for DBA agent
Handling Gate Message • When an ONU received a Gate Message • First, the ONU should check the Gate is belong to the ONU. • Second, the ONU should cache the start time and length from the Gate message and wait to the start time to transmit data.
Handling Data Packet • When an ONU received a data packet • If the ONU’s buffer has space to contain the income packet, then the ONU will buffer it. • Otherwise, the packet will be dropped.
Handling Self-Event • The self-event “send_event” is used to notify the ONU itself to send data packet • ie. it’s the time slot of the ONU • If the remainder slot size is big enough to transmit data packet, the ONU will transmit data packet from its buffer. • Otherwise, the ONU will transmit a report message to the OLT
Sending Report Message • The Report message should carry the ONU’s state • Llid • bandwidth requirement
Create OLT Module • Create Olt.h and Olt.cc in src folder • Note that the class mustbe the same as the name of OLT in device.ned file. • case sensitive
Edit Olt.h • A OLT module should contain • knowing the number of ONU, available time, maximum window size. • a buffer to contain incoming traffic like report message.
Handling Data Packet • Because upstream traffic terminated at the OLT in the simulation. • When the OLT receive a data packet, the packet can be dropped immediately.
Handling Report Message • When the OLT receive a report message, the OLT should process the report message immediately if the OLT is not processing other report message. • Otherwise, the OLT should finish the previous report process first.
Handling Self-Event • The self-event “gate_event” is to process the gate message sending. • The OLT should check the previous available time is still available or not. • if the previous available time is out of date, then update the available time. • Second, the OLT should compute the grant length according to its DBA agent’s service. • Finally, the OLT record the start time(available time) and length into the gate message and send it to the ONU.