Scheduling multipacket frames with frame deadlines

We consider scheduling information units called frames, each with a delivery deadline. Frames consist of packets, which arrive online in a roughly periodic fashion, and compete on allocation of transmission slots. A frame is deemed useful only if all its packets are delivered before its deadline. We focus on a “proportional” variant, where the value of each frame is proportional to its size, but the sizes and periods of the frames are arbitrary. We give a constant-competitive algorithm for this setting, assuming bounded jitter and some slack in the frames’ deadlines, the latter of which is necessary. Using standard techniques, our algorithm yields polylog-competitive algorithms for general instances with slack and bounded jitter.


Introduction
In many networking settings, the flows entering the network have a nice periodic or almost periodic structure. The network would like to guarantee the flows a pre-specified quality of service (QoS), where one of the most basic QoS guarantees is a deadline by which the transfer would be completed. The uncertainty regarding the arrival of future flows motivates the online setting. We study this setting from the competitive analysis viewpoint. Let us start by giving a few motivating examples.
Consider a switch with multiple incoming video streaming flows competing for the same output link. Each flow consists of frames, and each frame consists of a variable number of packets. The video source is completely periodic, but due to compression, different frames may consist of a different number of packets. On top of that, asynchronous network transfer typically adds some jitter, so the input at the switch is only approximately periodic. In order for a frame to be useful, all its packets must be delivered before the frame's deadline. A frame is considered completed if all its packets are delivered before the frame's deadline, and the goal of a scheduling algorithm is to maximize the number of completed frames. Partially completed frames are considered worthless.
As another example, consider a Voice over IP (VoIP) setting. Voice calls generate samples at a relatively fast rate. Samples are wrapped in packets which are aggregated in logical frames with lower-granularity deadlines. Frames deadlines are more lax due to the tolerance of the human ear. Completed frames are reconstructed and replayed at the receiver's side; incomplete frames are discarded, possibly resulting in an audible interruption (click) of the call. Our focus is on an oversubscribed link on the path of many such calls.
As a last example, consider a database or data center engaged in transferring truly huge files (e.g., petabytes of data) for replication purposes. It is common in such a scenario that the transfer must be completed by a certain given deadline. Typically, the transmission of such files is done piecemeal by breaking the file into smaller units, which are transmitted periodically so as to avoid overwhelming the network resources. We are interested in scenarios where multiple such transfers cross a common congested link.
Motivated by the above examples, we define the following abstract model. There are data units called frames, each with a deadline and a value. Each frame consists of several packets. Time is slotted. Packets arrive in an approximately periodic rate at a link, and can be transmitted (served) one packet at a step. A scheduling algorithm needs to decide which packet to transmit at each time slot. The goal of the algorithm is to maximize the total value of delivered frames, where a frame is considered delivered only if all its packets are transmitted before the frame's deadline.
The scheduling algorithm may be committing or noncommitting. An algorithm is called committing if any packet it transmits belongs to a frame which is eventually delivered, whereas a non-committing algorithm may transmit a packet from some frame but later decide not to complete that frame.
Our performance measure is the competitive ratio, i.e., the worst-case ratio between the value delivered by the optimum (off-line) schedule and the online algorithm, over all arrival sequences.
Our Approach and Results Our model assumes that the arrival sequence is not arbitrary. Studying restricted instance classes and/or adversaries is common: Related work typically assumes specific order of frames and packets or restricted bursts. Instead, we assume that once the first packet of a frame arrives, and the arrival times of the remaining packets are predictable within a given bounded jitter. Moreover, we focus on an important natural special case of proportional instances, where the value of the frame is proportional to its size. The central conceptual contribution of this work is to demonstrate that there are deterministic algorithms with constant competitive ratio for proportional instances, if frames of very small periods are disallowed. For classic single machine scheduling, it is known (using substantially different techniques) how to obtain constant competitive ratio for proportional instances with bounded periods by a deterministic algorithm (Baruah et al. 1992). Choosing one of these two algorithms at random in the beginning of the execution yields a constant competitive randomized algorithm for all proportional instances. Moreover, let frame density be defined as the ratio of frame value to the number of its constituent packets. Then, the algorithm can be extended to general instances, with competitive ratio which is logarithmic in the ratio of maximum density to minimum density, cf. Sect. 4.
We also consider a special case of frames with common period and unit value but arbitrary sizes (and thus also densities). As already mentioned, there is a simple randomized algorithm whose competitive ratio is logarithmic in the maximum number of packets in a frame. We show that in this case a few natural algorithms, such as earliest deadline first (EDF) or shortest remaining processing time (SRPT), cannot guarantee a significantly better competitive ratio. Related work The first multipacket-frame online model was introduced in Kesselman et al. (2013) and further studied in Scalosub et al. (2013). Emek et al. (2012) consider the basic model where the main difficulty is not deadlines but rather limited buffer space. Their results express the competitive ratio as a function of the maximum burst size and the number of packets in a frame. Subsequent work considered extensions to the basic model, including redundancy , and hierarchically structured frames Scalosub et al. 2013).
Possibly the work closest to ours is Markovitch and Scalosub (2014), which essentially uses the same model, except that in Markovitch and Scalosub (2014), each packet has its deadline, and the packet arrivals may be arbitrary (whereas we assume that packets arrive approximately periodically). It is shown in Markovitch and Scalosub (2014) that the competitive ratio of the problem (both a lower and an upper bound) is exponential in the number of packets in a frame. One can view our results as showing that adding the extra assumptions that (1) the packet arrival is approximately periodic, i.e., with bounded jitter (and sufficient slack), (2) the value of each frame is proportional to its size, and that (3) packets belong to the same frame share the same deadline, allows for significantly improved competitive ratio, namely constant (or logarithmic if we drop assumption 2).
We note that the classic preemptive job scheduling problem of maximizing (weighted) throughput on a single machine Pruhs 2000, 2003;Dürr et al. 2012;Lucier et al. 2013) corresponds to a special case of the problem we study in which all frames have period 1 and no jitter. For such setting, a combination of constant-competitive deterministic algorithm for proportional variant (Baruah et al. 1992) and the "classify and randomly select" technique (Awerbuch et al. 1994) yields an algorithm with competitive ratio logarithmic in the max-to-min ratio of frames densities. A matching (up to a constant factor) lower bound is known for randomized algorithms (Azar and Gilon 2015), and even stronger lower bounds (with focus on maxi-mum job/frame size) apply to deterministic algorithms (Dürr et al. 2012). However, all these lower bounds rely on the presence of "tight" jobs, and constant-competitive algorithms, for instances, where all jobs have sufficient slack are known (Kalyanasundaram and Pruhs 2000;Lucier et al. 2013). We note that neither algorithm applies directly to our problem for the case of non-unitary periods. Paper Organization We introduce the model and a few basic properties in Sect. 2. Our main result, i.e., for proportional instances, is given in Sect. 3. We point out how it extends to general instances (with a certain loss in the competitive ratio) in Sect. 4. Finally, in Sect. 5, we discus the case of different number of packets for each frame, assuming unit value and identical period.

Model and preliminary observations
In this section, we formalize the model and derive a few preliminary results. The notation we introduce here and use throughout the paper is summarized in Table 1.
We consider a standard scheduling model at the ingress of a link. Time is slotted, packets arrive online, and in each time slot at most one packet can be transmitted (meaning implicitly that we assume that all packets have the same length). The idiosyncrasies of our model are our assumptions about the arrival pattern and about the way the algorithm is rewarded for delivering packets, as described next.
Input: packets and frames The basic entities in our model are frames and packets. Each frame f has a value v f and consists of k f ≥ 1 packets, where k f is called its size. The value is a positive real number, and all other parameters (including the size) are nonnegative integers. We assume that packets of frame f arrive with periodicity π f ≥ 1 and jitter Δ f , namely if packet 1 of f arrives at time t 1 ( f ) ∈ N, called the frame f 's arrival time, then packet i ∈ 2, . . . , k f of f arrives at an integer actual arrival time where The deadline D p of a packet p of a frame f is simply D f (see also the "output" paragraph below). A frame f is called perfectly periodic if Δ f = 0 and s f = π f . The parameters Period: packets of f arrive roughly every π f steps Δ f Jitter: max. abs. difference between τ i ( f ) and Deadline of frame f and each of its packets p and slack s f ) are made known to the algorithm when the first packet of f arrives; it is also convenient to introduce a (real- The arrival time of the first packet of frame f , t 1 ( f ) is also called the arrival time of f . For convenience, we extend the arrival time notation to packets, i.e., for a given packet p, we let τ ( p) and t ( p) denote p's expected and actual arrival time, respectively.
We assume that the algorithm knows nothing about a frame f before its arrival, and even then, it does not know the exact arrival times of the remaining packets, though it is guaranteed that they satisfy (1).
For a given instance, and a parameter p ∈ {Δ, s, k, π, v, ρ}, we let p max = max f ( p f ) and p min = min f ( p f ), both taken over all frames in the instance, and extend these to instance classes. We assume that there exist constants ι, σ ≥ 0 such that s f ≥ σ π f and Δ f ≤ ιπ f hold for all frames f . As we prove in Sect. 2.1, the first assumption is necessary, i.e., unless each frame's slack is (at least) proportional to its period, then no algorithm can attain constant competitive ratio. We also show that the slack has to be at least proportional to the jitter for the same reason. This motivates our second assumption: The relation we assume between jitter and period implies the required relation between jitter and slack, captures the idea of bounded jitter, and reduces the number of parameters. The notation for frame parameters is summarized in Table 1.
Output: delivered frames A schedule specifies which packet is transmitted in each slot (also called time step). A slot is the interval [t, t +1] spanned by two successive integer times t and t + 1. The packet transmitted in the slot [t, t + 1] is delivered (or completed) at time t + 1. A frame f is said to be delivered (or completed) in a given schedule if all its packets are transmitted at or before the frame deadline. The value of a given schedule is the sum of values of the frames that it completely delivers.
Algorithms The duty of an algorithm is to produce a schedule for any given arrival sequence, and the goal is to maximize the value of that schedule. An algorithm is called online if its decision at any time t depends only on the arrivals and transmissions at or before time t. Recall that we assume that all packet arrivals and completions occur at integer times, so any algorithm need make decisions only at such times. Specifically, the following sequence of events happens at time t: (1) the transmission of the packet that started at time t −1 (if any) completes, (2) all packets with actual arrival time t arrive, and (3) the algorithm chooses the packet to start transmitting at time t. We assume that the buffer space is unbounded, which means that the only contention is for the transmission slots.
We now define the notion of a (non-)committing algorithm: An algorithm is committing if it always completes a frame that it starts, i.e., has completed at least one packet of; such frame is called accepted; an algorithm without such property is called non-committing. We remark that a distinction between "commitment on arrival" and "commitment on admission" is sometimes made (Lucier et al. 2013): Our definition corresponds to commitment on admission, though our committing algorithm will in fact satisfy the stronger commitment on admission property.
The competitive ratio of an algorithm A is the worst-case ratio, over all arrival sequences α, between the maximal value delivered on α by any (off-line) schedule and the value delivered by A. Formally, the competitive ratio of A on instance class I is where A(α) denotes the value of the schedule produced by A on α, and OPT(α) denotes the maximal value of over all schedules for α. Note that R(A) ≥ 1 by definition.

Relation between slack, period, and jitter
Some settings of the parameters are uninteresting. In particular, we show that the following lower bound holds even if all frames have identical period, jitter, slack, value, and size.
Theorem 1 No randomized algorithm on instances with all frames of size k, jitter Δ, slack s, and period π has compet-itive ratio smaller than Before proving Theorem 1, we note that its bounds for large k motivate our assumptions that s f ≥ σ π f and Δ f ≤ ιπ f for all frames f and some constants σ, ι > 0. Note that the latter quantifies our assumption of "bounded jitter," and that both imply a bound Δ f /s f ≤ ι/σ for all frames f . Our main result, namely Theorem 2, can be seen as roughly matching these bounds in a far more general setting.
Proof (of Theorem 1) Consider the following scenario. At time 0, a large number n (determined later) of first packets of distinct frames arrive. These are the only frames in the instance. All their remaining packets, except the last ones, arrive exactly on time, i.e., at times π, 2π, .
(t 0 is the earliest allowed arrival time of the last packet of the frames, and D is the deadline of all packets). For each frame f , let K f be the random variable whose value is the number of f 's packets that the algorithm delivers by the time t 0 . Let F be the set of 2Δ frames with the lowest expected value of K f , and letF denote the n − 2Δ remaining frames. Note that f ∈F E K f ≤ 2t 0 Δ n . From time t 0 the arrivals continue as follows: All the last packets of frames of F arrive at time t 0 , and all the last packets of frames inF arrive at time t 0 +2Δ. We now bound the number of frames completed by the algorithm. The number of frames fromF completed by the algorithm is at most the number of last packets from F the algorithm sends before the deadline, which in turn is bounded by the number of time slots between their arrival and the deadline, i.e., s. In the interval [t 0 , t 0 + 2Δ], the algorithm can complete only frames from F. Since only 2Δ packets can be sent in this interval, the expected number of completed frames from F is at most and hence, for n large enough, the expected number of frames completed by the algorithm is at most s + 2Δ/k . On the other hand, we now show that there is a schedule that delivers frames as follows. At time 0, choose the following set of frames X , with |X | = x. If x ≤ 2Δ, then X is any subset of F of size x, and if x > 2Δ, X consists of F and x −2Δ arbitrary frames fromF. The schedule sends only packets of frames in X . We claim that all frames of X can be completed. To see this, consider the bipartite graph with a node for each packet of X and a node for each time slot in the interval [0, D], and an edge connecting each packet-representing node p to all nodes representing a time-slot in which p can be sent, i.e., from its time of arrival until D. It is sufficient to show that in this graph there is a matching that matches all nodes representing packets of X . This in turn is easy to see using Hall's theorem. Let us number the packets of each frame 0 through k − 1 by arrival order. Consider any subset P of packets of X , and let a P be the first time slot in which a packet from P arrives. Suppose this is when a packet number i arrives. We proceed by case analysis according to the value of a P . Note , while the number of neighbors of P in the bipartite graph is (k − i)π + Δ + s ≥ |P| and we are done in this case. If a p = t 0 , then P consists of last packets only, and hence, |P| ≤ x, while the number of neighbors of P is 2Δ + s ≥ x and we are done in this case too. Finally, if a p = t 0 + 2Δ, then P ⊆ X \F and hence |P| ≤ s, while the number of neighbors of P is s.
We note that the bound of Theorem 1 is trivial for s ≥ π , as in such case, the algorithm can easily complete (nearly) as many frames as OPT does.

Classify and randomly select
In this section, we briefly describe how the classify and randomly select technique (Awerbuch et al. 1994) can be applied to our problem.
Lemma 1 Suppose that all frames can be partitioned into n classes, C 1 , . . . , C n such that, for each i, there is an algorithm A i that is R i -competitive on instances with frames of class C i only. Then, the randomized algorithm Algorithm 1 B(A 1 , . . . , A n ): 1. Select i ∈ {1, . . . , n} with probability p i = R i / j R j . 2. Run A i on frames from C i only, discarding packets of frames from other classes.
Proof Fix an instance I and suppose that a fixed optimum solution for I derives profit x i from frames of class i. Then, for each i, the expected profit of the algorithm described above is at least p i x i /R i = x i / j R j , since A i is R i -competitive. So overall, its expected profit is at least We note that the choice of probabilities in the randomized algorithm is optimal, as the relation between optimum profits x i from different classes C i are not known to the algorithm in advance and can be arbitrary. We also remark that Lemma 1 can be applied iteratively, i.e., a class C i can be further partitioned into subclasses, e.g., based on a different parameter than the previous classification. A simple example of such iterative classification is found in Sect. 5.

Proportional instances
The main result of this section (and the whole article) is a constant-competitive randomized algorithm for proportional instances, which can be seen as almost matching the lower bound(s) of Theorem 1. Throughout this section, we assume (w.l.o.g.) that the frame density is uniform, i.e., ρ f = v f /k f = 1 for every frame f . Clearly, if the densities can range from ρ min to ρ max , all the upper bounds we give still hold when scaled up by r = ρ max /ρ min . We assume that in proportional instances r is a constant, which we ignore. If a multiplicative factor of r is deemed too large, it can be reduced to O(log r ) using the classify and randomly select technique, cf. Sect. 4.
The algorithm in question is obtained by combining, as described in Sect. 2.2, two deterministic algorithms: LP (Algorithm 2) for frames of relatively large periods and SP (Algorithm 3) for frames of relatively small periods, presented and analyzed in the following two subsections. For convenience, we state the upper bounds on their competitive ratios here.

Theorem 3 For instances with period at least
Theorem 4 For instances with period at most π max , the Algorithm SP is (4 + π max + Δ max )-competitive.
Proof (of Theorem 2) Denote the following algorithm as ALG(π ). Frames of periods at most π form the class of smallperiod frames, and frames of periods at least π + 1 form the class of large-period frames. Then, ALG(π ) works as described in Sect. 2.2, using the algorithms SP (Algorithm 3) and LP (Algorithm 2) to handle frames of small and large periods, respectively. Lemma 1, Theorem 3 (with π min = π + 1), and Theorem 4 (with π max = π ) yield that the competitive ratio of ALG(π ) is at most We now fix π 0 = 2(1 + ι)/σ , and prove that ALG ( π 0 ) satisfies the theorem statement. To this end, we note that, in (2), the summand corresponding to the ratio of Algorithm LP is a decreasing function of π , and the one corresponding to the ratio of Algorithm SP is a linear function of π with slope 1 + ι. Thus, which concludes the proof.

Large periods
Our algorithm for instances with large periods, Algorithm LP (Algorithm 2), consists of two subroutines. The first decides, for each newly arriving frame, whether to accept or reject it, and the second schedules transmissions of packets of accepted frames. The algorithm classifies every frame as either completed, accepted, or rejected.

Algorithm 2 LP:
Frame Arrival: Accept a newly arriving frame f if and only if the set of all accepted frames together with f has a feasible schedule, assuming pessimal arrivals of all future packets of those frames. Packet Transmission: Send the packet with the earliest deadline from the set of all pending packets of accepted frames. If the sent packet was the last one of its frame, mark the frame "completed." The feasibility test that determines whether a frame is accepted considers packets rather than frames: The set of packets in question is that of all pending packets and those yet to arrive that belong either to an accepted frame or the frame f whose status is being decided. For the purpose of this test, the algorithm assumes that all such packets arrive as late as their frames' jitter allows. Clearly, this is the worst case for feasibility, i.e., if the set of frames is feasible under this assumption, it remains feasible if some packets arrive earlier than assumed. Testing the feasibility of a set of packets (which are just unit-length jobs) can be done by running EDF on that set, since EDF produces a (single machine) feasible schedule if there is one (Liu and Layland 1973). Conversely, our algorithm observes all deadlines because it produces an EDF schedule for a feasible set of packets.
Alternatively, the schedule for packets can be viewed as a bipartite matching of packets to time slots. Hence, one can test for feasibility with a new arriving frame f by using any dynamic matching algorithm that checks whether the current matching (schedule) can be augmented to match all packets of f as well. If so, the resulting schedule can then be reordered to become an EDF schedule.
We note that the algorithm either commits to a frame or rejects it immediately on its arrival. One can also consider a similar algorithm that commits on admission, i.e., decides to either accept or reject a frame only when its first packet would be scheduled by EDF. At such point, if the set of accepted frames together with f is feasible, then f is accepted and the packet is transmitted. Otherwise, f is rejected and another EDF packet is chosen for inspection. Intuitively, the algorithm that commits on admission should perform no worse than the one that does so on arrival. However, we consider the one that commits on arrival, for twofold reason: not only is commitment on arrival a more desirable property but also one that facilitates the analysis thanks to the algorithm's immediate decisions.

Small periods
Our algorithm, for instance, with small periods, Algorithm SP (Algorithm 3), is inspired by similar algorithms for proportional variants of job and interval (i.e., job with no slack) scheduling (Baruah et al. 1992;Woeginger 1994;Epstein et al. 2016). To introduce it, we define critical time of frame f as the latest time when f can still be completed if it was not scheduled at all before, i.e., c f = D f − k f . Again, we present the algorithm as separate subroutines, handling frame arrivals, critical times, and transmissions.

Analyses
In the analyses, we often consider time intervals. For this reason, we now introduce some notation for those, which is mostly standard. For an interval I , we denote its length by |I | Q: a queue of frames, sorted by critical times; initially empty f a : active frame: a frame or ⊥, initially ⊥

Subroutines:
Frame Arrival: When a new frame f arrives, add it to Q. Critical Time: When the critical time of the first frame in Q, f q , is reached, it is removed from Q. Then, if k f q ≥ 2k f a , preempt f a and set f a := f q . Transmission: If f a = ⊥ and Q is non-empty, set f a to the first frame in Q and remove it from Q. Next, if there is a packet of f a pending, send it. If this completes f a , set f a to ⊥.

Large periods
To analyze Algorithm LP (Algorithm 2), we design a charging scheme. We charge a frame f delivered both by OPT and the algorithm to itself. Thus, we can restrict our attention to frames delivered by OPT that the algorithm rejected. To explain how these frames are charged, we need to introduce some notation. We say that a set of time points covers a frame f if it contains a (closed) time interval [a, b] such that a ≤ t 1 ( f ) and b ≥ D f . A family of intervals I covers a frame f if its union I ∈I I covers f . Moreover, for any family of intervals I , we let u(I ) = | I ∈I I | and s(I ) = I ∈I |I |.
We observe in Lemma 2 below that for every rejected frame f , there is an interval I f that covers it such that the algorithm delivers a packet in roughly a constant fraction of I f 's slots; we call such I f a busy interval and formalize this notion as follows.

Definition 1
Given a frame f , we say that an interval I = [a, b] such that a = t 1 ( f ) and b ≥ D f is f -busy if the algorithm delivers at least σ σ +1+ι |I | − k f packets within I , each with a deadline no larger than D f . Intuitively, the existence of an f -busy interval for every rejected frame f should yield a constant competitive ratio, for the following reasons. As the algorithm is committing and all the frames have the same density, we may count the transmitted packets rather than frames in the analysis. First, we observe that every frame f delivered by OPT that is not covered by a busy interval is delivered by the algorithm as well. And second, in each busy interval I , OPT can deliver at most |I | packets, i.e., no more than a constant factor times the number that the algorithm does.
However, there are two issues. First, Lemma 2 states that the algorithm sends packets in σ σ +1+ι |I f |−k f slots of a busy interval I f , which means that we have a constant ratio on a packet basis only if I f is sufficiently large. Fortunately, it follows from the lemma that short busy intervals correspond to rejected frames of small periods, which are handled by Algorithm SP (Algorithm 3).
Second, busy intervals may overlap, leading to overcounting of the packets delivered by the algorithm (and OPT). Thus, we need a claim similar to Lemma 2 for the union of all busy intervals. We remedy this by showing, in Lemma 3, that there is a family of disjoint busy intervals with total length that is at least half the one of the union of all the I f intervals.
Proof Let B denote the set of all packets of f 0 and all unsent packets of frames that are accepted at time t 1 ( f 0 ) (including packets that haven't arrived yet). Let C = {t | t ≥ t 1 ( f 0 )} be the set of all time slots starting with t 1 ( f 0 ).
We define a bipartite graph G whose nodes are B ∪ C as follows. For any p ∈ B, we define the presumed arrival time of p, denoted t ( p), by where f ( p) is the frame that p belongs to (i.e., if p did not arrive yet, t ( p) is the latest possible arrival time of p). The edges of G connect each packet p ∈ B with all time slots in which it may be sent assuming that it arrives at time t ( p), i.e., p is connected to all time slots in the interval t ( p), D f ( p) . Since f 0 was rejected, there is no matching of B to C in G with all nodes of B matched. Therefore, by Hall's theorem, there is a subset P ⊆ B of packets such that |P| > |Γ (P)|, where Γ (P) denotes the set of neighbors of P in G. We note that without loss of generality, Γ (P) is an interval in C (i.e., a sequence of consecutive time slots): Γ (P) is trivially a union of disjoint intervals in C. As the neighbors of each packet constitute an interval, the disjoint intervals of Γ (P) induce a partition of P. Clearly, for at least one of these parts, say P ⊆ P, we have that |P | > |Γ (P )|. Thus, P can be used instead of P, and we assume henceforth that Γ (P) = [b, T ]. Since the set became infeasible only with the addition of f 0 , it must be the case that P contains at least one packet of f 0 , and hence, T ≥ D f 0 . We shall show that Let F denote the set of all frames f such that at least one packet of f belongs to P. Moreover, for every f ∈ F, let n f (a) denote the number of f 's packets in P(a) (i.e., To complete the proof, it suffices to prove that |P(t 1 ( f 0 ))| > σ σ +1+ι |T −t 1 ( f 0 )|: As LP is a committing algorithm, it will complete at least this many packets in [t 1 ( f 0 ), T ] minus at most k f 0 packets of f 0 , which belong to P (t 1 ( f 0 )). Clearly, an even stronger inequality holds when b = t 1 ( f 0 ) by (3), so assume that b > t 1 ( f 0 ).
In such case, we give simple bounds for n f (a) and consequently also r f (a). Suppose that n f (t f ) ≥ 1 for some time t f . Then, we know that for every decrease of the argument by π f , n f increases by 1, since π f is the difference between presumed arrival times of two successive packets of f , with the following single exception: For the first packet of f , its "presumed arrival time" coincides with the actual arrival time, and thus precedes the presumed arrival time of the second packet by π f + Δ f . Hence, for all a ∈ t 1 ( f 0 ), t f : We construct I 0 by choosing a subset of I , which ensures that the first property holds. To this end, we first partition I into components that correspond to the connected components in the interval graph of I . (In such graph, the intervals from I form the vertices, and edges connect intervals that intersect.) To facilitate the description, for a family of time intervals J and a time point ξ , we let J ξ = {I ∈ J | l(I ) ≤ ξ }. Now, for every component C, do the following. Initially, let X C = C, Y C = ∅, and ξ = min{l(I ) | I ∈ C}. Then, while X C = ∅, do the following: Let I ∈ X ξ C be the interval with the maximum r (I ); add I to Y C , remove from X C all I such that r (I ) ≤ r (I ), and set ξ := r (I ). The family I 0 is the union of all the (final) Y C 's over all components C, i.e., I 0 = C Y C .
By construction, every slot covered by I is covered by some I ∈ I 0 . Thus, the second property holds, as I covers every rejected frame f . (In fact, a stronger property holds for I : each such f is covered by an interval I ∈ I ; this need not be the case for I 0 .) To prove the third property, it suffices to restrict attention to a single component C as intervals of different components are disjoint. Let I 1 , I 2 , . . . be the intervals in Y C in the order they were added to it. Note that both l (I i ) and r (I i ) strictly increase with i by construction. Moreover, as we consider intervals of one component, it holds that l(I i+1 ) ≤ r (I i ), i.e., two successive intervals intersect. Now, consider three successive intervals I i , I i+1 , I i+2 for any i. Then, I i ∩ I i+2 = ∅ because otherwise I i+2 would be a candidate for the successor of I i and r (I i+2 ) > r (I i+1 ) would contradict the choice of I i+1 . This proves the second property as each slot in I 0 belongs to at most two intervals in I 0 .
Finally, we construct I 0 and prove that it satisfies the last property. To this end, from each Y C , choose either all the odd-numbered or all the even-numbered intervals, whichever maximize the total length. This implies that s I 0 ≥ 1 2 s (I 0 ). Moreover, it follows from the previous paragraph that the intervals in I 0 are disjoint. Thus, u I 0 = s I 0 holds.
Theorem 3 now follows from Lemmas 2 and 3.
Proof (of Theorem 3) The proof is via a charging scheme outlined in the beginning of this section. Let f be a frame that OPT delivered.
If the algorithm also delivered f , f is charged to itself. Clearly, each frame can receive at most one such charge.
All the frames rejected by the algorithm are charged simultaneously as follows. By Lemma 3, there is a family of busy intervals I 0 that covers every frame rejected by the algorithm. In the time slots covered by I 0 , OPT delivers at most u (I 0 ) ≤ s (I 0 ) packets. A subset of these slots is covered by I 0 , a family of disjoint busy intervals. It follows from the assumption and Lemma 2, that within each such busy interval I f 0 ∈ I 0 associated with a frame f 0 , the algorithm delivers at least σ σ +1+ι |I f 0 | − k f 0 ≥ σ σ +1+ι − 1 π min |I f 0 | packets. Thus, within all the time slots covered by I 0 , the algorithm delivers at least which proves the theorem.
The downside of Theorem 3 is that it guarantees a constant-competitive algorithm only if π min is bounded away from (σ + 1 + ι)/σ , as can be seen in the final inequality of the proof. But precisely such frames can be handled by Algorithm SP (Algorithm 3).

Small periods
Proof (of Theorem 4) To prove the theorem, we focus a single phase, defined as follows. A new phase starts whenever in the transmission procedure the first condition holds, i.e., the algorithm removes a frame from the queue. Such phase lasts until the third condition holds (including that step), i.e., until the algorithm completes some active frame and sets f a to ⊥. Note that there may be gaps between phases when the algorithm has no active frame, and thus also no frames in its queue.
We denote the single phase we consider I , and associate it with the time interval in which it lasts. Let f 0 , f 1 , . . . , f n denote all the successive active frames in I , and let k 0 , k 1 , . . . , k n denote their respective sizes, i.e., k i = k f i . We call the frames that were removed from the queue in I considered; note that this includes all the active frames, and that all the considered frames except possibly f 0 have reached their critical time. It is also easy to see that f n has the largest deadline among all the considered frames, possibly except f 0 , and that f n completes exactly at its deadline if n > 0.
We note that I starts when the algorithms sends the first packet of f 0 , and ends when it completes f n , the only frame it completes in I . For this phase, we credit OPT with all of the considered frames that it completes plus the value of all the (other) packets that OPT sends in I ; this one is a fractional value, i.e., credited per packet rather than per frame. We note that each considered frame has size less than 2k n by the preemption rule. As each considered frame f , possibly excluding f 0 , has reached its critical time within I , it follows that its deadline satisfies D f < r (I ) + 2k n . Consequently, the gain of OPT associated with phase I is at most |I | + 2k n + k 0 .
Thus, it only remains to relate OPT to k n . To this end, we note that, as all frames except f 0 have reached their critical time, and the sizes of active frames increase by at least a factor of 2: which concludes the proof, as every frame is considered in some phase.

General instances
In this section we demonstrate how the results of Theorem 2 extend to general instances. As this is a well known application of the classify and randomly select technique (Awerbuch et al. 1994, see also Sect. 2.2), we keep the description brief.
Proof Partition the frames into log ρ max ρ min +1 classes by their density, so that the i-th class (i ≥ 0) contains the frames of density [2 i ρ min , 2 i+1 ρ min ). Note that the densities in each class differ by at most a factor of 2. Thus, the (implicit) algorithm from (Theorem 2) guarantees a competitive ratio of O (1+ι) 2 σ on each class exclusively, i.e., when the other classes are ignored. Hence, picking one of the classes uniformly at random in the beginning and ignoring frames of all other classes, yields an O (1+ι) 2 σ log ρ max ρ min -competitive algorithm by Lemma 1, cf. Sect. 2.2.

Instances with common period and unit value
In this section we consider instances in which all frames have the same period π and unit value, but arbitrary sizes. Recall that such instances admit a randomized algorithm with competitive ratio O (1+ι) 2 σ log k max k min by Corollary 1. We could not find a better algorithm, even for perfectly periodic instances (to which Theorem 1 does not apply). In fact, two natural algorithms, EDF and SRPT, do not perform much better on those: we prove an Ω (log k max / log log k max ) lower bound on their competitive ratios. We do not provide any upper bound for either of them. One could expect SRPT to be O(log k max )-competitive, as it attains this ratio for single machine preemptive throughput maximization (Kalyanasundaram and Pruhs 2003;Dürr et al. 2012), which corresponds exactly to our setting with π = 1 and arbitrary s f values. However, we do not know whether that analysis can be extended to our problem.
EDF and SRPT are defined as follows. At any given time t, we say that a frame f with deadline D f is feasible if the number of remaining packets of f (ones that were not yet transmitted, including those that did not arrive yet) is at most D f − t. Clearly, an infeasible frame cannot be delivered. At step t, both algorithms examine the set of all available packets of feasible frames, and transmits one chosen as follows. EDF chooses a packet of the frame with the earliest deadline. SRPT chooses a packet of the frame with the smallest number of remaining packets. Ties can be broken arbitrarily in both algorithms.
Since a frame's deadline is roughly its arrival time plus π times its size, these algorithms behave similarly. In particular, they share the following property: If the algorithm starts transmitting packets of a frame whose deadline is D, then by time D at least one frame is completed. However, ignoring long frames may not be the right choice, as the following theorem shows.
Theorem 5 The competitive ratios of both EDF and SRPT on perfectly periodic instances with common period and unit values are Ω log k max log log k max .
Proof We construct an arrival sequence and inspect the number of frames delivered by either EDF or SRPT and by OPT. We first describe the construction parametrically.
Let k max be given. Define s 0 def = 0, t 0 def = π k max , and t 0 def = t 0 − επk max , where ε ∈ (0, 1/2) is a parameter we fix later. For i > 0, define Let H def = log k max log(1/ε) . Note that t H − s H = ε H π k max = π . The arrival sequence is as follows (see Fig. 1). At time s i , for i = 1, . . . , H , the first packets of frames from the following two sets arrive, c π frames.
-L i are frames of ε i k max packets, i.e., their common deadline is at time s i + ε i π k max = t i . -S i are frames of ε i (1−ε)k max packets, i.e., their common deadline is at time s i + ε i (1 − ε)πk max = t i .
Let us now track the behavior of EDF and SRPT on this sequence (see Fig. 1)-we claim they both behave the same short frames that the algorithm can complete in the interval [(k − 1)π, kπ ] is at most (S + π)/k ≤ π(1 + 1/k)/2, and then it can complete at most π frames in the interval k + k − 1 π, k + k π . By our assumption that k π , the total (rounded down) number of completed frames in this case is at most 3π/2. In the second case, the algorithm can complete at most π frames in the interval [(k−1)π, kπ ], and the expected number of long frames it can then complete in the interval k + k − 1 π, k + k π is at most L + k / k + k ≤ π · k+2k −1 2(k+k ) . Again, by our assumption that k k π , the total (rounded down) number of completed frames in this case is at most 3π/2.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecomm ons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.