Monday, 13 December 2010

Streaming video over wireless network(s)

I was asked to create a small wireless network for 16 clients/students (guess NIC 802.11g) to watching video streams.

With file sharing or web browsing we may wait for file or web page few seconds, however is not fun, when video stream stops often and repeatedly.

The very first question they asked me: How many routers we need?

Well question was simple, but we did talk about video where video presents many chalenges for:

- server file system (SMB for other 60 clients)
- AP congestion
- Wireless interference, speed and distance (video stream may stop)
- latency, packet loss and delays (video stream may stop)

I don't like guess. Whether two or twenty of AP could by enough?
In spite of all I found very nice article which nice explains all of my concerns about reliability WiFI Access Points concentrated nearby.

Network Video Overview
Traditional analog video is sent as a continuous stream of electrical signals over a cable from the source (camera) to the destination such as a video monitor in a command center. Digital technology and IP has changed that. With this new type of video, a digital camera translates the viewed image into digital signals which it then converts (encodes) into a series of IP packets that can be sent out over an IP-based network as a data stream. The IP network may be a local area network, a company wide area network, or even the public internet. At the destination, the receiver re-assembles these packets back into the original video stream. The reconstructed video can then be viewed, stored, searched, replayed, or retransmitted to virtually any location anywhere in the world.

This sounds simple, but IP video is a totally new area with significant technological and integration challenges. Unlike other types of data, video requires large amounts of bandwidth, as well as highly reliable, predictable delivery mechanisms. Unfortunately, IP was not designed to provide this guaranteed quality of service (QoS) to the different types of traffic it carries and frequently one or more packets may be dropped during transmission. For bulk data transmissions such as file transfers, this is effectively managed by re-transmitting the dropped packets and reinserting them into the data; however, for applications such as video, packet re-transmission is a poor option since the missing packets are required to accurately reproduce the video image. Unmanaged, these factors cause latency and jitter, which result in poor quality or even unusable video at the receiving end.

Wireless Network Challenges
While latency and jitter is minimal in a wired network, wireless networks are quite different. Because of the uncertainty in the wireless medium, Wireless LAN (WLAN) networks employ a variety of techniques in attempt to overcome these problems. When a packet is to be transmitted, the sender first listens for any activity on the frequency, and if there is none, waits a random amount of time before transmitting. This methodology is called Carrier Sense Multiple Access/Collision Avoidance (CSMA/CA). If an acknowledgement (ACK) is not received, either due to interference, collision, or other anomaly, the entire process is repeated. This protocol enhances the reliability of the WLAN network, however, this process also adds jitter and latency to the video traffic which can produce poor quality video or total loss of continuity. The WLAN process also includes a request to send/clear to send (RTS/CTS) mechanism which is used to decrease the chance of collision on a system by making sure that end stations in the vicinity of the source and destination hear the RTS and CTS signals before sending actual data packets. While this mechanism increases robustness it also adds to the latency of packets.

Packet Errors, Latency, Delay and Jitter – Why Video and Wireless Don’t Mix
Low, predictable and consistent latency is key for running video applications over networks, regardless of the available bandwidth; large amounts of bandwidth does not guarantee high quality video. While most wired IP networks can support this requirement, wireless networks are extremely susceptible to errors, which ultimately result in packet loss and packet errors. In many wireless networks a 20% to 40% packet loss is not uncommon. While the built-in mechanisms described above can prevent or recover from some amount of packet errors, each retransmission creates up to 4 ms of additional latency and up to 16 retransmissions can be required per packet error. This process results in unacceptable levels of latency, delay and jitter, which is seen as frozen, jerky, or pixilated video on the viewing screen. In extreme cases, video transmission can stop altogether until the video stream is re-synchronized with the receiver. This is clearly unacceptable for commercial video surveillance applications.

Factors Contributing to Packet Errors, Latency, Jitter, and Delay

Interference is the predominate cause of packet errors and loss in wireless networks. While the automatic packet recovery process used in typical networks may help, this process introduces increased latency, delay, and jitter which can compromise video quality and reliability. Following is a brief summary of the most common causes of problems in wireless networks.

Direct spectrum interference and noise
The most obvious source of interference, this occurs when other wireless elements are set up on the same, or overlapping, frequencies or when other devices create radio frequency waves (RF) that conflict with those of the wireless device. For example, microwave ovens, portable telephones, and bluetooth devices can produce RF waves (noise) that interfere with many wireless communications systems.

Near-angle interference
Near-angle interference is a form of direct spectrum interference that can happen when there are 2 or more point-to-point shots with two centrally located antennas arranged physically close to one another. For example, a campus environment where multiple remote buildings have point-to-point shots back to a central building. The transmitted signals from one antenna supporting a point-to-point link can interfere with it’s adjacent antenna.

Multipath and Reflection
Multipath and reflection are two related types of interference that usually occurs when parts of a transmission beam are refracted from objects (e.g., glass, water, furniture, metallic surfaces) between the sending and receiving radios causing the signals to be received a different times or severely attenuated. The refracted beams are received by the receiving radio at different and the radio gets confused. Multipath interference is likely to occur in large enclosed environments such as warehouses and manufacturing facilities or when used in proximity to large reflective objects such as high-rise buildings.

Other contributing factors
Beyond interference, other factors such as congestion and bandwidth limitations can also cause packet loss and produce unacceptable levels of delay and jitter in wireless video applications.  The delay in the IP network is caused by propagation delay in the transmission lines, buffers in routers, and jitter buffers. Transmission delay is split into two parts: a constant or slowly varying network delay and rapid variations referred to as jitter. Because of the nature of the IP network, the amount of delay is different in each direction.

The jitter present in packet networks complicates the decoding process in the receiver device because the decoder needs to have packets of data readily available at the right time instants. A jitter buffer is normally used to make sure that packets are available when needed, resulting in additional delay that increases with the magnitude of the jitter.  Packet loss occurs either if a packet is lost in the network or if a packet arrives too late to be handled by the decoder. By allowing for a long delay in the jitter buffer, the latter type of packet loss can be almost completely removed, but at the price of increased system delay. For real time video surveillance applications, this solution is unacceptable.

Implications for Wireless LANS
The lossy nature of the 802.11 medium amplifies the effects of these factors. The challenges in deploying Video over WLAN stem mainly from issues related to access point congestion and link quality. This is particularly relevant when multiple video sources are connected to the same access point. The efficiency of the system quickly deteriorates when the number of users increases, resulting in significantly higher delay, network jitter, and packet loss than wired LANs.

As we have seen, high quality full motion video delivery over ordinary wireless links is a complicated problem because of dramatic and frequent changes in the quality of the underlying wireless channel. This is further complicated by latency constraints and typical TCP/IP protocol processing overhead, which often results in poor quality or unusable video. There are some interesting technolgies that are able to overcome much of the packet loss seen in wireless networks to deliver high quality video regardless of network anomalies... 



0 komentářů:

Post a comment