1 Introduction

The bandwidth demand is continuously increasing due to increasing use of Internet worldwide. According to the International Telecommunication Union (ITU) facts and figures report 2020, the percentage of households with Internet access at home has increased by 10% compared to 2019 (International Telecommunication Union 2020). According to this report, in developed countries like in Europe and America 96% and 90% individuals respectively are using the Internet services. The report also shows that 70% of the youth nowadays is using Internet, which is indicative of further bandwidth demand increase in future due to rising youth population. The pandemic of COVID-19 has also accelerated the bandwidth usage growth rate by 6% higher compared to 2019 (International Telecommunication Union 2020).

This means that the network service providers need to enhance the capacity of their networks to meet the soaring bandwidth demands as a high-speed internet connection is becoming a necessity and is no more a luxury for every home. In this scenario, passive optical network (PON) is an appealing option for the ICT service providers to meet these rising bandwidth demands. PON is a widely studied optical access technology of the last decade (Memon 2020) as it offers very high bandwidth and high speed Internet connections to the residential and industrial customers. Now it is also drawing the attention of corporate customers and small scale telco service providers as they can get the part of PON infrastructure on rent from the bigger PON infrastructure providers (Kallergis and Douligeris 2020). Therefore, PON customers range from residential subscribers to single or multi-site enterprises as well as cellular operators. With the deployment of 5G technology the importance and need for PON is further increasing as PON has been proposed to be an efficient solution for front-haul in 5G to connect the Baseband unit (BBU) and remote radio heads (RRHs) (Liang et al. 2019).

Although, the expansion of ICT sector to meet the increasing future bandwidth demands is an encouraging sign, however, there is an associated drawback of greenhouse gas emissions. ICT sector is also significantly contributing to the global carbon footprint (Belkhir and Elmeligi 2018). The current carbon foot print of ICT sector is estimated to be 3.5% (Belkhir and Elmeligi 2018) with an increasing future trend. Although, PON is considered relatively greener broadband technology compared to copper based DSL and Active Optical Network (AON) technologies due to its passive nature in the outside plant, however, still, its power consumption needs optimization due to broadcast nature of downstream link. Thus, the energy efficiency of the PON equipment is also an important consideration as it helps to reduce the carbon footprint of the ICT and Telecom sector. Additionally, an energy efficient equipment also reduces the electricity bill of the network operator and the end users.

Figure 1 explains the general architecture of ITU compliant TWDM PON. It uses WDM technology to combine multiple wavelengths in the single ODN using either wavelength routed or wavelength selected architecture (Kachhatiya and Prince 2018a). Each wavelength is used for multiple ONUs in time division multiple access. As per ITU G.989.3 recommendations, four to eight wavelengths can be operated in DS in L band ranging from 1590 to1610 nm, all with a data rate of 10 Gbps (Kachhatiya and Prince 2018a). Additionally, same number of wavelengths can also be operated in C band ranging from 1520 to1540 nm, each bearing 2.5 Gb/s or 10 Gb/s data (Kachhatiya and Prince 2018b). Each TWDM PON ONU is equipped with a tunable transceiver for being able to communicate with the OLT on suitable US/DS wavelengths. Table 1.

Fig. 1
figure 1

General architecture of TWDM PON

Table 1 Important notations and descriptions

The ITU’s TWDM PON standard supports the cyclic sleep mode (CSM) for energy conservation of the PON. The CSM has been widely used and many different CSM schemes have been reported in literature. However, these schemes assume the dynamic wavelength and bandwidth (DWBA) process to be working perfectly. However, on the contrary, the CSM process actually affects the performance of the DWBA scheme and vice versa is also true. An efficient DWBA scheme not only alleviates any conflicts in terms of data transmission between various ONUs but also minimizes the transmission delays and delay variance as well as increases the network throughput, QOS and the quality of experience of the users (Sikora et al. 2019; Lai et al. 2015; Lei 2015; Sone et al. 2017). Additionally, an efficient wavelength-switching mechanism to balance the traffic load on all the wavelengths is also indispensable so that the ONUs can switch their operating wavelength under heavily load conditions. This wavelength switching is a handshaking process between the OLU and the OLT in which two Physical Layer Operation and Maintenance (PLOAM) messages Tuning_Control and Tuning Response are used for wavelength switching.

Dynamic wavelength and bandwidth allocation (DWBA) process in TWDM PON is of key importance for US link performance as it efficiently manages the available bandwidth and wavelength resources while adhering to the quality of the service requirements of the network as per service level agreements signed with the customers. The job of the wavelength assignment process is to equalize the traffic load on all the PON wavelengths while the DBA scheme is responsible for a fair and on demand driven allocation of the available bandwidth to minimize the idle waiting time of the newly arrived packets. Thus, an efficient DWBA scheme not only alleviates any conflicts in terms of data transmission between various ONUs but also minimizes the transmission delays and delay variance as well as increases the network throughput, QOS and the quality of experience of the users (Sikora et al. 2019; Lai et al. 2015; Lei 2015; Sone et al. 2017). A cooperation between the CSM and DWBA process can increase the energy efficiency with reduced US delays. Therefore, this study proposes a sleep aware wavelength and bandwidth assignment scheme (SA-WBA) that coordinates well with the CSM process. The SA-WBA scheme keeps check on the traffic load of each wavelength as well as the CSM states of each ONU on each TWDM PON wavelength. It collects the unused bandwidth of the Asleep ONUs, and assigns it to the other ONUs in the Active state. Additionally, it also balances the traffic load on all the wavelengths by migrating the ONUs from the higher traffic load wavelength to the wavelength with least traffic load. This approach not only improves the performance of the DWBA process but also boosts the performance of the CSM process by reducing the traffic queues quickly, accumulated during the ONU’s Asleep state.

Table 1 summarizes important notations and descriptions used in rest of the paper. The paper is organized as follows; Sect. 2 reviews the closely related previous work, Sect. 3 explains the sleep buffer approach based CSM process; Sect. 4 describes the modifications made in the CSM process, Sect. 5 presents the proposed sleep aware bandwidth assignment (SA-WBA) scheme. At the end, the Sect. 6 describes the simulation setup, results and discussions are presented in Sect. 5 and finally Sect. 6 concludes this study.

2 Related work

The energy efficiency of PON is a widely studied research areas. The main cause of higher power consumption in PON, especially the ITU complaint PON, is the broadcast nature of the DS link, which requires an ONU to receive and process every frame. The ONU consumes around 60% of the power in the PON, thus, most of the energy conservation schemes in PON target the ONU and only a few studies have addressed the OLT energy efficiency (Dutta et al. 2018; Pakpahan et al. 2017). The ONU based energy schemes for PON can be categorized into three approaches; Cyclic Sleep Mode (CSM) (Butt et al. 2018a; Mohammed et al. 2020), Adaptive Link Rate (ALR) (Garg and Janyani 2017) and ONU processing optimization (Butt et al. 2018b; Ayhan et al. 2015). For example the study in Xiong et al. (2017) uses load adaptive wavelength activation approach. Another similar approach in Pakpahan et al. (2019) achieves the energy efficiency by switching OLT transceivers to lower rate or turning them off in a SDN architecture, however, it requires SDN compliant OLT architecture. The sleep approaches sends ONUs completely or partially in sleep mode termed as CSM or Cyclic Doze Mode (CDM) (Lotfolahi et al. 2018) with the first providing higher energy savings with higher delays while CDM provides moderate saving with moderate increase in US delay (SafaeiSisakht et al. 2020). An integrated approached which combines benefits of both schemes, termed as Watchful sleep mode (WSM) (Butt et al. 2018c; Zeng et al. 2017) has also been investigated in many studies and now also adapted by ITU for its PON standards (2016). For TWDM PON energy consumption can also be reduced by turning off the unused wavelengths and only activating the wavelengths proportional to active traffic load (Xiong et al. 2017).

In order to efficiently arbitrate the available upstream (US) bandwidth in a fair manner among all the ONUs and all the active wavelengths, a dynamic bandwidth and wavelength assignment (DWBA) scheme in PON plays a key role (Sikora et al. 2019). Although, a simple static wavelength assignment scheme could also be used as in Singhal et al. (2020), it does not perform well as it may lead to an unbalanced traffic load on the wavelengths and, thus, lead to an inefficient utilization of the available bandwidth resource. A better approach is to employ a load adaptive wavelength (LA-WBA) activation approach as in Kallergis and Douligeris (2020), Garg and Dixit (2019). The scheme in Garg and Dixit (2019) uses a bin packing approach in which each wavelength is treated like a bin and are filled in proportion to traffic load. A similar scheme with a offline approach based DWBA scheme optimized for a PON deployed for providing Tactile Internet (TI) services for health care applications has been presented in Kallergis and Douligeris (2020). It follows the Institute of Electrical and Electronics Engineers (IEEE) standard where the classical Gate/Report message mechanism is used for DWBA implementation. ONU responds with the same US wavelength on which Gate message is received and sends high priority and low priority queue reports. The scheme works in four stages. In first stage the required number of wavelengths are computed. In stage 2 the number of the ONUs to be assigned to each wavelength are computed. The ONUs are sorted in the order of high priority queue demand. In stage 3, excess bandwidth is requested by each ONU for the next cycle but its computation method is not given. Finally, in stage 4 the OLT computes an US scheduling time table for all the wavelengths and the ONUs. The same authors have also proposed a Bayesian estimation based DWBA scheme for PON based LAN for a TI in Wong et al. (2017). A learning based wavelength activation concept has been presented in Liang et al. (2019) optimized for PON being used as front-haul medium for 5G. A dynamic wavelength assignment (DWA) scheme based on multithread DBA concept has been applied on multiple wavelengths in Hussain et al. (2017). The assignment is made in order of the transmission time of each ONU on each wavelength and all the four wavelengths are kept activated simultaneously. However, If the number of the active ONUs on the network are large then transmission on multiple wavelengths may result in out-of-order frame problem and will increase the computational load of the ONUs. An interesting concept of a cooperative customer for bandwidth sharing has been proposed in Ciceri et al. (2020). The cooperative customer can surrender his excessive bandwidth to the OLT from where it can be assigned to other user. However, computation of excessive bandwidth by a user has not been explained in this study. The concept of cooperative customer has also not been defined explicitly. A multi-OLT based DWBA process using an SDN controller has been proposed in Wu et al. (2019) in which an ONU is assigned a particular wavelength on a particular OLT depending upon its bandwidth demand and traffic priority. This architecture could be very useful in shared optical data network (ODN) between different service providers. However, the proposed scheme cannot be used with conventional PON architecture.

Although CSM is a widely studied energy conservation scheme for PON with a capability of achieving very high-energy savings, however, most of the studies neglect the impact of DBA or DWBA process on the energy conservation process. Only a few studies have addressed this problem and presented an integrated scheme such as in Lotfolahi et al. (2018), Garg and Dixit (2019), Dixit et al. (2012), Dixit et al. (2015), Rayapati and Rangaswamy (2019), Zhu et al. (2018), Zhu et al. (2020) The study in Lotfolahi et al. (2018) uses logistic regression to estimate the Doze duration based on the information of queue reports obtained through the DBA process. The study in Rayapati and Rangaswamy (2019) presents a sleep and doze control merging scheme using DBA process. The study assumes VSCEL laser transmitter to reduce initialization time of the ONUs. Based on the ONU idle time length, the ONU is either switched to Asleep state or Doze state. However, it is not clear in this study that how the authors compute the ONU idle time as it is a future parameter and can only be predicted but no prediction scheme has been used by the authors. Another similar scheme is also presented in Zhu et al. (2018, 2020). The authors introduce the concept of ONU pairing of the ONUs with highest and lowest bandwidth demand in order to minimize the polling cycle length. Another energy efficient DBA has been proposed in Dixit et al. (2012), Dixit et al. (2015) termed as sleep mode aware (SMA) algorithm which is actually a sleep supportive version of IPACT DBA scheme. The main idea of SMA scheme is to keep ONU in active state during its assigned tranmission slot and switch to Asleep state otherwise. The transmission time period is computed keeping view the both US as well as the DS traffic. If the the DS traffic time is higher than the ONU switches to Doze state for the remaining time period. The study in Khalili et al. (2020) also presents an hybrid doze and sleep mode assignments keeping in view US and DS queues for an EPON based architecture.

The integrated DWBA and sleep schemes discussed above are all for an EPON based architecture. To the best of our knowledge no ITU compliant DWBA scheme optimized for CSM process have been reported except our earlier work presented in Butt et al. (2018d). In this study, we had presented a sleep assistive DBA scheme for XGPON that keeps track of the Asleep and active ONUs and assigns the unused bandwidth of the Asleep ONUs to the Active ONUs. This result in longer sleep periods of the ONUs as the ONUs awake from sleep state get higher bandwidth and, thus, they are able to empty their traffic queues earlier. In this work, we extend our previous work and propose a sleep aware WBA scheme for TWDM PON. We also improve our previous work by using the sleep buffer approach (Butt et al. 2018e) for the computation of Asleep periods in accordance with the given US and DS delay limits.

3 Sleep buffer based CSM control process

The energy efficiency of the CSM process is critically dependent on the optimized control of the LWI events at the OLT and ONU. In this study we have used the sleep buffer approach to control the CSM process that was presented in our earlier work in Butt et al. (2018e) for XGPON. For TWDM PON some adjustments were made in this process to maximize the ONU Asleep state time according to the target US and DS delay limits; \({D}_{DS}^{{\lambda }_{k}}\) and \({D}_{US}^{{\lambda }_{k}}\) for each of the DS and US wavelength \({\lambda }_{k}\), where k ranges from 1 to 4 for TWDM PON. The TWDM PON network is modelled as an M/D/1 queuing system where for the DS link the OLT acts as the server while the ONU acts as the host node. For the US link the roles of the ONU and OLT interchange. The US and DS delays on each wavelength of TWDM PON comprise of three components as given by Eq. (1) and Eq. (2). For the US link an additional delay term of \(\frac{SI}{2}\) is introduced to overcome the waiting time of newly arrived frame that can either get bandwidth immediately or may have to wait for a period of SI in worst case. Using Pollaczek-Khinchin formula the \({D}_{Q}^{{\lambda }_{k}}\) can be expressed by Eq. (3), where \(\rho\) is the server or line utilization ratio and is actually the product of the traffic arrival rate and the expected value of the service time. Since the ITU compliant PONs have synchronous in nature, the service time is fixed to a frame duration of 125us while the traffic arrival rate depends upon the set traffic load and is assumed to follow the Poisson distribution and its details are given in Sect. 5.

$$D_{DS}^{\lambda_k} = D_Q^{\lambda_k} + TT_{ch}^{\lambda_k} + {\mathcal{T}}_{{Tune}}$$
(1)
$$D_{US}^{\lambda_k} = D_Q^{\lambda_k} + TT_{ch}^{\lambda_k} + {\mathcal{T}}_{{Tune}} + \frac{SI}{2}$$
(2)
$$D_Q^{\lambda_k} = \frac{{{\lambda^k}{{\overline{X}}^2}}}{{2\;\left( {1 - \rho } \right)}}$$
(3)

When the CSM process is introduced, the TWDM PON network can be modelled by the queueing system with server on vacations to incorporate the unavailable period of the ONU during the Asleep state. In this case, the \({D}_{Q}^{{\lambda }_{k}}\) increases by a factor of \(\frac{{\overline{V} }^{2}}{2{\overline{V}} }\) (Chen 2015), where \({\overline{V} }\) and \({\overline{V} }^{2}\) are the expected value and the second moment of vacation period. The \({\mathcal{T}}_{ch}^{{\lambda }_{k}}\) is estimated from the round trip delay time \(RT{T}_{k}\) of the kth wavelength and \({T}_{init}\) is the ONU initialization time that is taken by the ONU to switch on its transceiver block and tune to a wavelength assigned by the OLT after awaking from Asleep state. Thus, \({T}_{init}\) also includes \({\mathcal{T}}_{Tune}\) time. Therefore, the updated expressions for \({D}_{DS}^{{\lambda }_{k}}\) and \({D}_{US}^{{\lambda }_{k}}\) are given by Eq. (4) and Eq. (5). Instead of fixing the Asleep state time the sleep buffer approach binds the LWI events with the buffer occupancy. This means an ONU stays in the Asleep state until the \({T}_{AS}\) expiry or until the buffer overflows due to traffic arrival process at the OLT or ONU. The length of the sleep buffers \({N}_{DS}^{{\lambda }_{k}}\) for DS and \({N}_{US}^{{\lambda }_{k}}\) for US for each \({\lambda }_{k}\) are computed as a function of given DS and US delay limits \({D}_{DS}^{{\lambda }_{k}}\) and \({D}_{US}^{{\lambda }_{k}}\). The wavelength switching seldom occurs so \({\mathcal{T}}_{Tune}\) can be neglected in the average delay computation over a long simulation period.

$$D_{DS}^{\lambda_k} = \frac{{{\lambda_{DS}}{{\overline{X}}^2}}}{{2\;\left( {1 - \rho } \right)}} + \frac{{{{\overline{V}}^2}}}{2\overline{V}} + \;\frac{{RT{T_k}}}{2} + {T_{init}}$$
(4)
$$D_{US}^{\lambda_k} = \frac{{{\lambda_{US}}{{\overline{X}}^2}}}{{2\;\left( {1 - \rho } \right)}} + \frac{{{{\overline{V}}^2}}}{2\overline{V}} + \;\frac{{RT{T_k}}}{2} + \frac{SI}{2} + {T_{init}}$$
(5)

As shown in Fig. 2, during AS state, traffic arrival process following the Poisson process has an exponentially distributed inter-arrival time with mean inter-arrival time of \(\frac{1}{{\lambda }_{k}}\) for each wavelength of TWDM PON. Both ONU and OLT will assert LWI = 1, if and only if the respective US and DS sleep buffer is full. When in SA state, an ONU resumes AS state when these buffers are emptied and then sets \({LWI}_{ONU}=\) FWI = 0. During AS state if the arrival of the first frame is at t = 0 then the arrival of the second frame will be after \(\frac{1}{\lambda }\) seconds and the last frame will arrive after \(\frac{N}{{\lambda }_{k}}\) seconds. Therefore, it is easy to write, \(\overline{V }= \frac{N}{{\lambda }_{k}}\). Since, for a given\({\lambda }_{k}\), the vacation time remains constant so we can write \({\overline{V} }^{2}\)=\({( \frac{N}{{\lambda }_{k}} )}^{2}\).

Fig. 2
figure 2

US/DS Traffic arrival on \({\lambda }_{k}\) for ONU in its Sleep buffer during Asleep state

By substituting values of \(\overline{V }\) and \({\overline{V} }^{2}\) in Eq. (4) and Eq. (5), and re-arranging it, the required US and DS buffer sizes, the \({N}_{US}^{{\lambda }_{k}}\) and \({N}_{DS}^{{\lambda }_{k}}\) are computed in Eq. (6) and Eq. (7). Using these equations, the required buffer sizes can be calculated easily if the target delays \({D}_{US}^{{\lambda }_{k}}\) and \({D}_{DS}^{{\lambda }_{k}}\) are known for a given \({\lambda }_{DS }^{k}\) and\({\lambda }_{US }^{k}\). Since, ONU is required to support four different type of traffic classes; T1, T2, T3 (Ali and Ali 2018) and has to send OLT their buffer occupancy reports. Thus, the buffer sizes computed on average US delays are required to be divided further among the four traffic classes in proportion to their bandwidth share compliant to their SLAs.

$${N_{DS}} = \left( {{D_{DS}} - \frac{{{\lambda_{DS}}{{\overline{X}}^2}}}{{2\;\left( {1 - \rho } \right)}} - \frac{RTT}{2} - {T_{init}}} \right) \cdot 2{\lambda_{DS}}$$
(6)
$${N_{US}} = \left( {{D_{US}} - \frac{{{\lambda_{US}}{{\overline{X}}^2}}}{{2\;\left( {1 - \rho } \right)}} - \frac{RTT}{2} - {T_{init}} - \frac{SI}{2}} \right) \cdot 2{\lambda_{US}}$$
(7)

As soon as ONU quits the AS state, it transits to SA state. The ONU sojourn in SA state should be long enough so that both ONU and OLT are able to empty their sleep queue buffers. If time taken to empty sleep buffer is \({T}_{clear}\) then it is simple to write Eq. (8). Where, \(Gem Size\) is the frame carrying capacity of US or DS frame of TWDM PON on any of the wavelengths every 125us. The arrived traffic from the traffic generator divided among the ONUs using uniform probability distribution, thus, they have on average, identical load. Therefore, the \(Gem Size\) can be computed by Eqs. (9) and (10) for total ‘j’ ONUs. Therefore, to ensure that sleep buffer is empty during SleepAware state the condition \({T}_{SA}\ge {T}_{clear}\) must be satisfied for each wavelength. However, \({T}_{SA}\) will be different for each wavelength due to different values of \({N}_{US}^{{\lambda }_{k}}\) and \({N}_{DS}^{{\lambda }_{k}}\). Thus, the largest value of \({T}_{SA}\) should be chosen should be chosen.

$${T_{clear}} = \frac{1}{2}\left( {\frac{RTT}{2} + \frac{125}{{{{10}^6}}} \cdot \frac{N}{Gem\;Size}\;} \right)$$
(8)
$$Gem\,Size\left( {for\;D_{DS}^{\lambda_k}} \right) = \frac{155530}{{\mathcal{F}_{{avg}}}}$$
(9)
$$Gem\,Size\left( {for\;D_{US}^{\lambda_k}} \right) = \frac{38880}{{\mathcal{F}_{{avg}}}}$$
(10)

4 Sleep AWARE CSM process

The sleep buffer approach requires an accurate knowledge of ONU Asleep and SleepAware start and end state times. Using the standard CSM process it is not possible for the OLT to exactly keep track of the ONU sojourn in Asleep and SleepAware states. This is illustrated with the help of the OLT and ONU state diagrams shown in Figs. 3 and 4. Whenever, the ONU sends a SLEEP message to the OLT when entering the SleepAware state. The OLT is in AwakeFree state which on receiving the SLEEP message enters the LowPowerSleep state as shown in Fig. 5. In this state OLT does not receive any update from the ONU if it keeps on switching between Asleep and SleepAware states. The OLT is only informed via AWAKE message if it quits to ActiveHeld state. The solution to this problem was earlier proposed in our earlier work in Butt et al. (2018e) that two new messages AWARE and ASLEEP were added that ONU sends to the OLT while switching between the Asleep and SleepAware states, thereby, keeps OLT informed about its current state.

Fig. 3
figure 3

Cyclic sleep state diagram for ONU

Fig. 4
figure 4

Cyclic sleep state diagram for ONU

Fig. 5
figure 5

Cyclic sleep state diagram for OLT

5 Sleep AWARE dynamic wavelength and bandwidth assignment (SA-DWBA) scheme

The TWDM PON uses four US and DS wavelengths each identified uniquely by a DS/US wavelength identifier (DWLCH_ID/DWLCH_ID). Although OLT can ask any of the ONU to switch its wavelength, however, in this study our focus is on US bandwidth assignment so the DS wavelengths are uniformly distributed among all the ONUs. The US link requires both the bandwidth assignment as well as the wavelength assignment explained in the following sections.

5.1 Sleep aware bandwidth assignment

Similar to our earlier DBA schemes (Butt et al. 2018d, 2019), the bandwidth assignment part of the SA-DWBA scheme also comprises of three stages; Guaranteed Allocation Stage (GAS), Surplus Allocation Stage (SAS) and Remainder bandwidth allocation stage (RBS). The algorithm of each phase is explained with the help of Fig. 6. In contrast to the our earlier scheme the novelty in this proposed scheme is that in GAS and SAS phases the bandwidth assignment is made to T2, T3 and T4 traffic classes only if an ONU (i) is not in Asleep state, as evident from the second line of the GAS stage algorithm. The Asleep status of the ONUs is checked with the help of SleepFlag. This sleep flag is set high in the US traffic arrival process by the OLT if an AWARE message is received and Low if a SLEEP message is received from the ONU (i) as also earlier explained in Sect. 4. In the next four lines of the GAS stage algorithm, the DBA process assigns the bandwidth to each ONU by keeping in view the available bandwidth on each wavelength and the SLA limits of the traffic classes as well as the queue reports of the respective T2 and T3 traffic classes. Similarly, during the SAS, first, the ONU Sleep state is checked and only active ONUs are considered. The non-assured components of the T3 and T4 are assigned depending upon the bandwidth availability on the respective wavelength in compliance to their SLA limits and the received queue reports. Then the frame bytes counters of each wavelength (FB(k)) and the available byte counters for each traffic class of each ONU (i); \(V{B}_{2}\)(i), \(V{B}_{3}\)(i), \(V{B}_{3}\)(i), \(V{S}_{3}\)(i) and \({VS}_{4}\)(i) are recharged to their maximum bandwidth values; 38,880, \(A{B}_{min1}\)(k), \(A{B}_{min2}\)(k), \(A{B}_{min3}\)(k), \(A{B}_{sur3}\)(k) and \(A{B}_{sur4}\)(k) respectively after every SI to ensure the committed data rates.

Fig. 6
figure 6

DBA cycle of SA-DWBA scheme

At the end of DBA cycle if any bandwidth is still is found unassigned, it is equally divided among the all the Active state ONUs in the RBS stage. Since, assigning bandwidth to Asleep state ONUs is of no use, thus, a novel remainder bandwidth (RBW) assignment algorithm is presented in Fig. 7. The algorithm first inspects the sleep status of all the ONUs and then makes a list of active ONUs on each wavelength ‘k’ as AwakeONUList [k]. Then the available bandwidth is first equally divided among the Active ONUs on each wavelength and then in each ONU its 40% part is assigned to T4 and the rest is equally divided between the T2 and T3 traffic classes. This proportion of allocations not only maintains the class priority but also ensure a fixed share for T4. The rationale behind fixed allocations to a \(TCON{T}_{k}(i)\) is that this bandwidth cannot be allocated in a demand driven fashion as the queue reports of all the \(TCON{T}_{k}(i)\) have already exhausted during the GAS and SAS stages. The only other could be demand prediction for each \(TCON{T}_{k}(i)\), which may not be accurate due to bursty nature of network traffic.

Fig. 7
figure 7

DBA cycle of SA-DWBA scheme

5.2 Sleep aware wavelength assignment

The SA-DWBA scheme uses the load balancing based wavelength switching algorithms proposed in our earlier study presented in Butt et al. (2019) with minor modifications to work with the CSM process. The scheme uses machine learning approach to classify the US wavelengths as heavily loaded or lightly loaded and collects the positive errors proportional to the excessive load in the queue \({{\varvec{Q}}}_{{\varvec{p}}{\varvec{o}}{\varvec{s}}}.\) Then it uses an ONU selection algorithm to select the Onus from the heavily loaded wavelength to reduce the positive errors and queues these ONUs in a queue \({{\varvec{Q}}}_{{\varvec{M}}{\varvec{i}}{\varvec{g}}}.\) However, this scheme does not consider the CSM process during the load balancing process. Thus, it does not perform well when CSM is enabled as an ONU could have significant traffic queues at the ONU that are not reported due to the Asleep state of the ONU. Resultantly, the load balancing process may consider such Asleep ONUs to be lightly loaded may take a false decision about a wavelength to be lightly loaded and result in further increase of traffic load on a wavelength. The SA-DWBA scheme eliminates this weakness of the TA-DWBA scheme by improving its ONU selection algorithm. The improved algorithm is shown in Algorithm-1. In the lines, 10 and 20 the extra restriction of checking the SleepFlag of each ONU is added which makes sure that only those ONUs are selected for load balancing which are in Active state. This step improves the overall performance of the CSM process by efficiently balancing the traffic load on all the TWDM PON wavelengths.

Algorithm2: Algorithm for Active ONU Selection proportional to Excess Load on an US Wavelength

Input:\({{\varvec{Q}}}_{{\varvec{p}}{\varvec{o}}{\varvec{s}}}\) (Queue with Positive Traffic load values)

Output: \({{\varvec{Q}}}_{{\varvec{M}}{\varvec{i}}{\varvec{g}}}\) (Queue of ONUs to be migrated)

1

\(while\left({Q}_{pos}.size>0\right)\)

2

\(PosErr ={Q}_{pos}.front.ErrVal\)

3

\({\lambda }_{1} :={Q}_{pos}.front.wavelength\)

4

\(while(PosErr>0\))

5

\(If\left(postErr greater than 100\right)\)

6

\(largestLoad :=0\)

7

\(largestOnu :=256\)

8

\(For(i=0 to j\)) // j = Total Active ONUs

9

//Select Active ONUs according to PosErr

10

\(If(ONU \left[i\right]. Wavelength== {\lambda }_{1} \&\& ONU \left[i\right].SleepFlag\&\&/ j = Total Active ONUs\)

11

\(if((({Load}_{ONU}\left[i\right] > PosErr) || ({Load}_{ONU}\left[i\right]== PosErr)) \&\& {ONU}_{Flag}[i]==0 \&\& PosErr>0)\)

12

\(LargestLoad :=LoadOnu\left[i\right]\)

\(LargestOnuNo:=i\)

\({{\varvec{Q}}}_{{\varvec{M}}{\varvec{i}}{\varvec{g}}}\).push(\(LargestOnuNo\));

13

\(PosErr=LargestLoad\)

14

Break; //case complete

15

End if

16

End if

17

\(If\left(PosErr>0\right)\)// If PosErr still Greater than zero

18

\(LargestLoad :=0\)

\(LargestOnu :=256\)

19

\(For(i=0 to j)\)// j = Total No of ONUs

20

\(If(ONU \left[i\right]. Wavelength== {\lambda }_{1} \&\& ONU \left[i\right].SleepFlag\&\&/ j = Total Active ONUs\)

21

\(if(Loa{d}_{Highest}<{Load}_{ONU}\left[i\right] \&\& {ONU}_{Flag}[i]==0)\)

22

\(LargestLoad :=LoadOnu[i]\)

23

\(LargestOnu :=i\)

24

End For

25

End if

26

\(If\left(LargestOnu<64\right)\)

27

\(PostErr :=PostErr-LargestLoad\)

28

\({{\varvec{Q}}}_{{\varvec{M}}{\varvec{i}}{\varvec{g}}}.{\mathrm{push}}(LargestOnu);\)

29

End if

30

End if

31

End While

32

End While

6 Simulation setup

A TWDM PON network with a four tunable US and DS wavelengths was implemented in OMNET +  + . The line rate of the DS link for each wavelength was set to 10Gbps while the US line rate was set to 2.5Gbps as in Butt et al. (2019), Doo et al. (2015). The line rates for T1, T2 and T3 traffic classes are set in each ONU to 20Mbps, 90Mpbs and 90Mbps bandwidth respectively. For T4, a 90Mbps capacity is set for the best effort case. The US traffic buffers were fixed to 1 MB for each traffic class. buffer for T2, T3 and T4 traffic classes (Butt et al. 2017). Table 1 summarizes the main simulation parameters used in this study (Table 2).

Table 2 Simulation parameters

The traffic is injected into the network from a dedicated instance of the traffic generator node inside each ONU for the US traffic. However, for the DS traffic, the generator runs four independent instances of the Poisson traffic generator for each DS and US wavelength and then merges the arrivals in a Poisson batch arrival process. Two timers are used for the US and DS traffic to schedule the traffic frames with exponentially varying inter-arrival times (IAT). Since the merged traffic arrival process is also a Poisson process so according to the selected traffic load (\(Loa{d}_{\lambda }\)) for each wavelength by the user, the mean US and DS traffic arrival rates for US and DS are computed using Eqs. (11) and (12), where the \({\lambda }_{ONU}\) is the US or DS traffic arrival rate. The \(Link\_Rate\) is the maximum capacity of the US or DS wavelengths in bytes which has a value of 155,530 bytes for DS and 38,880 bytes for US (2016). Since the inter-arrival time (IAT) for a Poisson process is exponentially distributed, therefore, it is computed with Eq. (13) and the traffic generator timer is reloaded with this time whenever it expires. For each value of \(Loa{d}_{\lambda }\) in each run, the simulation is run for an hour to make sure that the mean IAT variance stays within a 95 percent confidence interval during this duration. For the US case, an independent instance of traffic generator runs. The 5% of the traffic share is reserved for T1 frames and the remainder is uniformly shared by T2, T3 and T4 TCONTs.

$${\lambda_{ONU}} = \sum\limits_{k = 1}^4 {\lambda_k}$$
(11)
$${\lambda_k} = \frac{{Loa{d_\lambda }*Link\_Rate}}{{j{*_{avg}}}}$$
(12)
$$IAT = Exponential\left( {\frac{1}{{\lambda_k}}} \right)$$
(13)

Initially all the wavelengths are assigned an equal no of 16 ONUs. To model and simulate an asymmetric load scenario, the traffic load generated for \({\mathrm{ONU}}_{{\rm ID}}\) 0 to 31 is reduced by 20%, while the traffic load for \({\mathrm{ONU}}_{{\rm ID}}\) 32 to 63 is raised by 20% as also in Singhal et al. (2020). These traffic configurations among the ONUs will equalize the traffic generator's overall network load.

7 Results and discussion

The performance of the SA-WBA is compared with the results of TA-WBA (Butt et al. 2019) and the LA-WBA (Doo et al. 2015) for traffic class T2 to T4 of all the ONUs. The results of the average ONU Asleep time, average Energy savings per ONU, mean US delays of T1 to T4 traffic classes and the mean Us delays of all the TWDM PON wavelengths are shown in Fig. 8 show the valuable reduction in US delay of T2, T3 and T4 traffic classes with improved bandwidth utilization and low variance as show in Figs. 9, 10, 11, 12, 13 and are discussed below.

Fig. 8
figure 8

Energy savings per ONU

Fig. 9
figure 9

Energy savings per ONU

Fig. 10
figure 10

US bandwidth lost at the ONU during ONU sleep

Fig. 11
figure 11

Unutilized bandwidth at the ONU

Fig. 12
figure 12

Mean US delay of T1 to T4 Traffic classes

Fig. 13
figure 13

Mean US delay of all the wavelengths

Since the SA-WBA scheme only allocates the bandwidth to an Active ONU this results in more bandwidth availability to an ONU which completes its Asleep state and returns to SleepAware or ActiveHeld state. This results in quick emptying of the traffic queues accumulated during the Asleep sate of the ONU. Thus, an ONU using SA-WBA scheme returns to Asleep state earlier compared to other two DWBA schemes, leading to higher ONU Asleep state times as evident form Fig. 8. The LA-WBA scheme shows the least Asleep state times because it activates only a minimum no of wavelengths according to the traffic demand of the ONUs which results in quite less bandwidth availability to the ONUs and, in fact, also wastes the available bandwidth on other wavelengths.

The average energy savings (ES) can be computed using Eq. 17 and Eq. 18, where \({\mathrm{T}}_{{\rm Active}}\) is the active state time of the ONU, \({\mathrm{T}}_{{\rm Asleep}}\) is the total Asleep state time of the ONU during the simulation time \({\mathrm{T}}_{{\rm Sim}}\). Similarly the \({\mathrm{P}}_{{\rm Active}}\) is the active state power consumption of the ONU and \({\mathrm{P}}_{{\rm Asleep}}\) is the Asleep state power consumption of the ONU. Both the \({\mathrm{T}}_{{\rm Active}}\) and \({\mathrm{P}}_{{\rm Active}}\) represent the time and power consumption of all the three active states; Activeheld, ActiveFree and SleepAware. The energy savings of the ONU are quite directly proportional to the Asleep sate time because this state has least power consumption and ONU sojourn in this state is highest, thus, the SA-WBA scheme exhibits the highest ONU energy savings due to its highest Asleep state time while TA-WBA scheme shows the lowest energy savings as evident from Fig. 8.

$${{\text{P}}_{{\text{CSM}}}} = \frac{{({{\text{T}}_{{\text{Active}}}}*{{\text{P}}_{{\text{Active}}}} + {{\text{T}}_{{\text{Asleep}}}}*{{\text{P}}_{{\text{Asleep}}}}\;}}{{{T_{Sim}}}}$$
(14)
$$ES\% = \left( {1 - \frac{{{{\text{P}}_{{\text{CSM}}}}*{T_{Sim}}}}{{{P_{Active}}}}} \right)*100$$
(15)

With the increase in Asleep state time, the US delays are sure to increase due to increase in traffic queues. Thus, the SA-WBA scheme shows the highest delays. However, due to sleep buffer approach, the maximum delays do not exceed the set average delay limits of 50 ms. For the T1 traffic the delays decrease as the traffic load decreases because of the decrease in Asleep state time. The delay pattern of T2 traffic for the LA-WBA and TA-WBA schemes is simple that with increase in traffic load the delay decreases due to decrease in Asleep time. However, the delay pattern of SA-WBA scheme is interesting. It initially stays high due to higher Asleep state of the ONU which also results in least bandwidth assignment and, thus, least bandwidth waste and bandwidth lost at the ONU as evident from Figs. 9 and 10. However, as traffic load increases, the Asleep time decreases resulting in increased bandwidth and remainder bandwidth assignment (RBW) assignment in SA-WBA scheme. However, as the traffic load reaches around 0.6, the Asleep time decreases sharply but the due to non-availability of RBW bandwidth the delays again start rising. The delay of T2 for LA-WBA remains higher than TA-WBA scheme because of the reduced RBW bandwidth availability due to reduced number of active wavelengths, which increases ONU density on the active wavelengths. The delay pattern of T3 traffic also almost follows the same trend as of T2 traffic.

The delay pattern of T4 traffic also follows the same pattern as of T2 and T3 for both LA-WBA and TA-WBA schemes at all loads while for SA-WBA only at low and medium traffic loads. However, as the traffic load increases 0.6 load, its delay in case of SA-WBA scheme does not increase because of the reservation of 40% bandwidth for T4 traffic class in the RBW.

The wavelength delays are actually an average delay of all the traffic classes and follow quite similar patterns with slightly higher delay values for W2 and W3 due to asymmetric simulation scenario in which their traffic load is kept 25% higher compared to W1 and W2. The W3 and W4 delay results for LA-WBA scheme remain zero as these are not activated at all while the Wavelength get activated after the traffic load of 0.2. Overall the average delay of SA-WBA scheme remains higher compared to other two schemes due to the same reasons as discussed above, however, the delays do not exceed the set delay limits of 50 ms which show the success of SA-WBA scheme that it maximizes the energy savings without degrading the set QOS limits.

8 Conclusion

In this study, we have proposed a CSM aware DWBA scheme for TWDM PON. The proposed scheme fully coordinates with the CSM process while executing the bandwidth and wavelength assignment process for US link. In order to avoid any bandwidth waste, the proposed scheme only assigns bandwidth to the ONUs in the Active state only during the guaranteed allocation, surplus allocation and remainder bandwidth assignment stages of the DBA process. The scheme also optimizes the wavelength switching process for traffic load balancing by only considering the Active state ONUs. OMNET +  + simulator is used to realize TWDM PON with 64 ONUs under an unbalanced traffic load scenario. Where the traffic load on two wavelengths is increased and the traffic load on other two wavelengths is decreased by the same amount to maintain the overall traffic load equilibrium. The simulation results show that the proposed scheme boosts the CSM performance by maximizing the ONU Asleep state times, Energy savings of the ONUs with minimum bandwidth wastage at the ONUs. This results in increased US delays due to higher traffic queueing due to prolonged Asleep state times. However, the maximum delays do not violate the set target delay limits of 50 ms due to the sleep buffer approach used to control the local wake up indication events.