Quality Adaptation of Constrained Application Protocol Multimedia Streaming in Internet of Things

In this paper, we present a quality adaptation of constrained application protocol (CoAP) multimedia streaming, which is abbreviated as QACMS, in the Internet of Things (IoT). The QACMS is designed to support reliable and high-quality multimedia streaming in a constrained environment. To achieve this, the QACMS adaptively selects the quality level of multimedia content considering the available bandwidth of the wireless link and decides the bitrate of chunks by adjusting the CoAP observation period. To verify the effectiveness of the QACMS, an experimental simulation is conducted in various simulation scenarios. The results show that the QACMS performs better than the existing CoAP-based streaming in terms of packet loss rate and bandwidth utilization.


Introduction
The Internet of Things (IoT) is considered a promising solution for the realization of various intelligent services because it can connect things to the Internet anytime and anywhere. In general, most IoT applications use a number of smart devices, and they communicate with one another through various wireless sensor network (WSN) technologies. (1) However, most smart devices in IoT applications have limited resources and use low-power and lossy networks (LLNs) such as ZigBee, Bluetooth Low Energy, and low-power Wi-Fi, so they may suffer from a significant reduction in packet delivery ratio. To address this problem, the Internet Engineering Task Force (IETF) Constrained RESTful Environments (CoRE) working group has standardized the constrained application protocol (CoAP). The CoAP is a lightweight web transfer protocol designed to use a notably small-sized header with a user datagram protocol (UDP) that is a transport layer protocol providing a best-effort datagram service. (2) As the IoT has become more widespread, the demands for various multimedia applications based on IoT, such as environmental monitoring, online gaming, and remote surveillance, have sharply increased. (3,4) Especially, the recent improvement and miniaturization of video and image sensors have fostered the development of multimedia IoT applications. These sensors collect and deliver the multimedia content via a WSN where it is necessary to use the CoAP to support data delivery in IoT environments. However, the existing CoAP cannot support such multimedia applications because the CoAP standard does not define any mechanism for multimedia transmission among devices. (5) To support multimedia applications, CoAP streaming is proposed, which defines a simple streaming mechanism by extending the CoAP observation technique. (6,7) In particular, it enables a server to periodically send chunks to a client by establishing an observation relationship between the server and the client. However, the existing CoAP streaming does not consider the available bandwidth of the wireless link. Consequently, frequent playout interruptions and decreased bandwidth utilization may occur when the existing CoAP streaming is applied to multimedia applications.
In this paper, we propose a quality adaptation of CoAP multimedia streaming (QACMS), which is designed to support reliable and high-quality multimedia streaming in a constrained environment. For this purpose, the QACMS adaptively selects the quality level of multimedia content depending on the available bandwidth of the wireless link. Then, it decides the bitrate of chunks by adjusting the CoAP observation period to support the selected quality level of multimedia content. The operation of QACMS consists of two phases: (1) quality level selection and (2) bitrate decision. In the first phase, the server classifies the quality levels of the multimedia content into "selectable" and "nonselectable" according to the available bandwidth of the wireless link. "Selectable" indicates the quality level of the multimedia content that the server can select for reliable streaming, and "nonselectable" is the opposite. Then, the server selects the quality level that requires the highest bandwidth among the selectables. In the second phase, the server adjusts the CoAP observation period by considering the chunk size and selected quality level to decide the bitrate of chunks. To evaluate the performance of the QACMS, we conducted an experimental simulation in various scenarios. The results show that the QACMS performs better than the existing CoAP streaming in terms of the packet loss rate and bandwidth utilization.
The remainder of this paper is organized as follows. In Sect. 2, the details of the QACMS design are described. In Sect. 3, the experimental simulation results are presented. Finally, we conclude this paper in Sect. 4.

Design of QACMS
In this section, we describe the QACMS, which is designed to support reliable and highquality multimedia streaming in constrained environments. The QACMS adaptively selects the quality level of multimedia content depending on the available bandwidth of the wireless link. Then, it decides the bitrate of chunks by adjusting the CoAP observation period to support the selected quality level. The operation of the QACMS consists of two phases: (1) quality level selection and (2) bitrate decision. We assume that the server supports the multiple quality levels for multimedia content (240p, 360p, 480p, etc.). In the following subsections, we present the operation of the QACMS in detail.

Quality level selection
In this phase, the quality level of multimedia content is classified and selected by the server. Specifically, the server classifies the content into "selectable" and "nonselectable" considering the required bandwidth of the quality level and available bandwidth between the server and the client. "Selectable" indicates the quality level of multimedia content that requires a lower bandwidth than the available bandwidth. Thus, one of the selectables is selected for reliable multimedia streaming in the QACMS.
For the classification, the server uses the following quality level information: frame size, frame rate, color depth, and compression ratio. Table 1 shows examples of the quality level information, where the unit of color depth is bit size per pixel. The server calculates the required bandwidth of quality levels by using each of the values listed in the quality level information (i.e., required bandwidth = frame size × frame rate × color depth × compression ratio) and compares it with the available bandwidth, which is measured by the server. (8) If the available bandwidth is greater than the required bandwidth, the corresponding quality level is classified as a selectable; otherwise, it is nonselectable. Then, the server selects the selectable with the highest required bandwidth for high-quality multimedia streaming. Table 2 shows the quality level selection result for Table 1 when the available bandwidth is measured as 3 Mbps. In Table 2, quality levels 1 and 2 are classified as selectables because their required bandwidths are lower than 3 Mbps. Quality level 2 is selected by the server because it has the highest required bandwidth among the selectables.

Bitrate decision
The QACMS determines the bitrate of chunks by adjusting the CoAP observation period because the transmission interval of chunks is determined on the basis of the CoAP observation period of the server. To support reliable and high-quality multimedia streaming, the bitrate of chunks should be between the required bandwidth and the available bandwidth. Thus, the  QACMS adjusts the CoAP observation period on the basis of the chunk size and the required bandwidth of the selected quality level. (9) According to the CoAP standard, the payload size of a CoAP message is bounded to 1024 B to avoid undesirable packet fragmentation at the Internet protocol (IP) layer. (4) However, the size of multimedia content commonly exceeds 1024 B. Therefore, the QACMS divides the multimedia content into multiple data blocks and uses them as the payload of each chunk. The increased payload size can reduce overhead caused by the header of the chunks; thus, the QACMS sets the payload size to be equal to the maximum payload size of the CoAP message (1024 B). If the multimedia content is smaller than 1024 B, the QACMS uses the multimedia content without dividing it.
The size of the chunk header is determined by the fixed-size 4-B header and the optional extensions that follow. In the QACMS, a token and two CoAP options (observe and streaming options) are included in the chunk header as optional extensions. The token is used to match a response with the request. The observe and streaming options are used for the observation relationship establishment and chunk indication, respectively. However, the size of these optional extensions is not specified in the CoAP standard and Internet-draft documents. Thus, we assume that the size of the chunk header is predefined by the server.
To adjust the CoAP observation period, the server estimates the number of chunks per second (NC), which is the inverse of the CoAP observation period. The CoAP observation period (COP) is calculated as follows: In this regard, the bitrate of chunks can be matched to the required bandwidth of the selected quality level. In an actual environment, the bitrate of chunks may slightly vary with the required bandwidth of the selected quality level because some servers cannot support the CoAP observation period with long decimals owing to their limited resources. However, this difference does not significantly affect the bitrate of chunks because it changes only a notably short time in the CoAP observation period. Therefore, the difference is negligible in a real environment. Figure 1 shows an operational example of the QACMS when the client requests an MPEG video to the server over the CoAP. In Fig. 1, the negotiation, registration, quality adaptation, and streaming are conducted step by step. The main difference with the existing CoAP streaming is its quality adaptation using the QACMS to support reliable and high-quality multimedia streaming.

Operational example of QACMS
Negotiation is used to select the right uniform resource identifier (URI) by discovering the multimedia resource of the server that supports various codecs. The client sends a request message with a certain resource type using the GET method. In the example, the client uses /.well-known/core?rt=video to discover the multimedia resource whose resource type is video.
When the server receives the request message, it responds with URIs of the corresponding multimedia resources in a successful 2.05 Content response. Two URIs (i.e., video/MPEG and video/AVI) are given in response by the server in the example.
In the registration, the client establishes the observation relationship with the server. The client selects one of the URIs and sends the request message, which include the selected URI, observe option value, and token value. In Fig. 1, the client selects /video/MPEG as the URI. In addition, it sets the observe option value to 0 and the token value to 0x4a to establish the observation relationship.
After the registration, the server begins the quality adaptation, where the QACMS is run. In the quality adaptation, the server adaptively selects the quality level of multimedia content and adjusts the CoAP observation period. The QACMS is only run on the server. Moreover, its operation is conducted only once during the entire multimedia streaming process. Therefore, the overhead of the QACMS is negligible considering that the multimedia streaming quality mainly suffers from several message exchanges over a long period of time.
Finally, the server periodically sends the chunks using the adjusted CoAP observation period in streaming. The server sets the streaming option to chunked to indicate that the message includes a chunk of multimedia content. The observe option value increases by one whenever a chunk is sent from the server. The token is always identical to that of the request message for registration.

Performance Evaluation
The experimental simulation was conducted to evaluate the performance of the QACMS. The simulation results are compared with those of the existing CoAP streaming to verify the effectiveness of the QACMS. In the following subsections, the simulation setting and result are described in detail.

Simulation setting
In the simulation, the client and server communicate with each other over the CoAP, and the available bandwidth of the wireless link is 1-10 Mbps. In the QACMS, the server selects one of the quality levels by considering the available bandwidth of the wireless link. Multiple quality levels of multimedia content, which are used in YouTube, are used in the simulation. (10) Table  3 lists the multiple quality levels of multimedia content for simulation. In the existing CoAP streaming, the server uses a fixed quality level (1080p, 720p, 480p, and 360p). The payload and header sizes of the chunks are set to 1024 and 10 B, respectively. Table 4 shows the results of quality level selection and bitrate decision when the available bandwidth of wireless link changes. In Table 4, the required bandwidth does not exceed the available bandwidth because the server selects the quality level with the highest required bandwidth among the selectables. With the increase in available bandwidth, the CoAP  observation period tends to decrease because the server uses the fixed size of chunks and selects a high quality level of multimedia content when the available bandwidth increases. Figure 2 shows the variation in the packet loss rate with increasing available bandwidth of the wireless link. In the simulation, the QACMS and existing CoAP streaming with 360p do not lose any packets because their required bandwidth does not exceed the available bandwidth. More specifically, the QACMS can avoid packet loss because of the lack of bandwidth by selecting the quality level on the basis of the available bandwidth of the wireless link. For the existing CoAP streaming with 1080p, 720p, and 480p, packet loss occurs because of the lack of bandwidth. Figure 3 shows the channel utilization for various available wireless channel bandwidths. In the figure, the QACMS channel utilization irregularly changes because the QACMS selects the quality level considering the available bandwidth of the wireless link. The average channel utilizations of the QACMS and the existing CoAP streaming with 360p are 81.9% and 29.3%, respectively. In other words, the QACMS provides higher-quality multimedia content than the existing CoAP streaming with 360p. In the simulation, the existing CoAP streaming with 1080p obtains higher channel utilization than QACMS, but it suffers from frequent playout interruptions because of the high packet loss rate as a result of the lack of bandwidth.

Conclusions
In this paper, we propose a QACMS in the IoT. To support reliable and high-quality multimedia streaming in constrained environments, the QACMS adaptively selects the quality level of multimedia content considering the available bandwidth of the wireless link and decides the bitrate of chunks by adjusting the CoAP observation period. An experimental simulation was conducted to verify the effectiveness of the QACMS. The results show that the QACMS obtains a lower packet loss rate than the existing CoAP streaming with 1080p, 720p, and 480p and higher channel utilization than the existing CoAP streaming with 360p. Thus, the QACMS can provide high-quality multimedia content with no packet loss in constrained environments.