Communication Networks 2 --- IPTV measurement

Measurement guide

1. Introduction

The goal of this measurement is to get to know network context of the Protocol (IPTV) technology, mostly focusing to multicast based IP packet transmission and Quality of Service (QoS) guaranteeing based on network features. Students will get to know multicast IP transport, methods of IPTV video-streaming and protocols. And they will measure network paramaters focusing to the QoS determination.

Hardware and software devices applied in the laboratory:

 AverMedia Volar HD PRO DVB-T receiver (for digital TV broadcast receiving)  Linux server for the DVB-T videostream conversion in real-time, properly for technological requirements of the IPTV services. o Video for Linux (V4L), w_scan, Dvblast, lighttpd  Emulator of network QoS (delay, jitter, packet loss) parameters: NetEm  Ethernet switches with Multicast (IGMPv3) support  Client side: PC-s for measurering (Windows 7 x64)  Wireshark protocol analyzer  KODI mediaplayer and Simple IPTV Client plugin  VLC mediaplayer

1. Figure: IPv4 Test-network

1

IPTV services

 transport of live TV and radio broadcast on the IP network  Digital Rights Management (DRM)  Electronic Program Guide (EPG)  Teletext  Recording of live broadcast (client side)  Picture on Picture (PiP) – During the TV program watching on the display (usually in the corner) other TV channel program comes up on a small window  Time shifting – recording of live program and delay-action replay  More recording in the same time + live broadcast (bandwidth of the internet service could be a limit)  Programmed recording based on the EPG  Video on Demand – (TV programs, films, serials, etc)  Applications running (news, weather, rates, messaging, etc)

Protocol stack and media codecs

 IPv4/IPv6  IGMPv3/MLDv2/PIM  UDP  RTP/RTCP  MPEG-2 Transport Stream  H.264/H.265 (video codec)  AAC (audio codec)

2. Multicast packet transport on the IP network Two spreading methods of media contents transporting exist in an IP network. In the first model based on everybody’s demands are initiated viewing of different contents. This is the Video on Demand (VoD) system. This type of service is provided by the Youtube, Netflix, TV.GO, IPTV providers, on the airplanes, etc. In this case provider has to deliver the proper content in the proper time. Accordingly, dedicated unicast media-streams have to be transported from the provider toward to every client. Resource requirements of a unicast transport are almost linearly scaled. Therefore the increase of subscriber/active viewers’ number needs to be followed by the appropriate amount of resources at the server side and network side as well (CPU, memory, bandwidth). In this case of this unicast spreading model the biggest challenge is handling of the periodic peak load.

Good example is for the second model, when the linear programme of the TV channel needs to be delivered to subscribers through an IP network. In this case viewers of the same channel can be gathered into a same group and only one media stream is needed to be transported to this group, without reference to the number of subscribers in this group. This model gives a very good scalability, because network services need to deliver the media stream to members of an appropriate group, but this requires a special multicast IP routing. Here we need to mention that some providers build up their own multicast IP routing (which is totally idependent from unicast routing) in their network, due to more effective serving of subscribers. Good example is for sutdents this measurement of an IPTV service.

2

Multicast IP addresses

In case of multicast message transport, we use a special IP address range 224.0.0.0/4 (D class), based on the IPv4 protocol. Very first four bits of the first octet in Class D IP addresses are set to 1110. In this address range one address is using for identification of more nodes (network interfaces) as a one group. This is the identificator of this specific group. Members (network interfaces) of this group do not need to be a part of a same IP network.

In this measurement one muticast address is used for one TV channel identification. Namely, a media stream got from the programme of this TV channel is forwarded to members of this multicast group with a D class type IP address. Class D has IP address range from 224.0.0.0 to 239.255.255.255.

IP address ranges:

Ranges inside the Name Goal D class

Protocol specific addresses, which are valid inside 224.0.0.0- Local subnetwork a local network. This range is managed by the 224.0.0.255 IANA.

Protocol specific traffic, which is forwardable on 224.0.1.0- Internetwork control block the public Internet network. This range is 224.0.1.255 managed by the IANA.

224.0.2.0- 224.0.255.255 This is for applications that don't fit either of the 224.3.0.0- AD-HOC block previously described two categories. This range is 224.4.255.255 managed by the IANA. 233.252.0.0- 233.255.255.255

Range using for source-specific multicast 232.0.0.0/8 Source-specific multicast forwarding.

An experimental, public multicast address range 233.0.0.0/8 GLOP addressing for publishers and Internet service providers

Address range provided to each organization that Unicast prefix based 234.0.0.0/8 has /24 or larger globally routed unicast address multicast addresses space allocated

Administratively scoped Address range for private using within an 239.0.0.0/8 multicast addresses organization. (Private multicast IP addresses)

3

Internet Group Management Protocol (IGMP)

The IGMP is a communications protocol used by IP hosts and routers for multicast membership management. The IGMP message changing operates between the client computer (host) and a local multicast router. These messages are directly embedded into IPv4 packets. Based on the “level view” like the ICMP, IGMP is also a part of the IP protocol set working on the network level.

The most important novelty of this protocol version 2 was that promoted the explicit leave group marking (Leave Group message). The current version 3 plus contains a possibility of source-specific multicast. More information about this can be read in the PIM protocol description. The IGMPv2 or IGMPv3 are used commonly in case of IPTV systems. The Leave Group message, benefit of the IGMPv2, allows quick traffic termination toward members of a specific group, when this group does not have active members anymore.

IGMPv2/v3 message types

 Membership Query – The IGMP querier is a hosts’ multicast membership querry. Three subtypes are known: general query, group-specific query and group-and-source-specific query.  Membership Report / Join – Membership report toward the multicast router (IGMP querier). A host with the same message can join this multicast group.  Leave Group – explicit mark of a group leaving

IGMPv3 source filtering

Source-specific multicast support can be specified with filters for address of source node.

 Include mode: In this mode, the receiver announces membership to a host group and provides a list of IP addresses (the include list) from which hosts wants to receive traffic.  Exclude mode: In this mode, the receiver announces membership to a host group and provides a list of IP addresses (the exclude list) from which hosts does not want to receive traffic.

The display filter igmp can be used for the IGMP messages displaying in the Wireshark program.

Tip: Other programs and Windows services than the VLC program also generate IGMP messages traffic in our PC. Therefore we have to pay attention to identification of IGMP Join/Leave messages in case of TV channel changing. In case of IGMP traffic analysis you could recognise that the network router gets hosts’ multicast group membership at stated intervals (it could be 20sec in the laboratory network). A Membership Query message is receiving from the router and the host is answering with a Membership Report message (messages). Important: do not be confused, these messages are separate from the join messages generated in case of TV channel changing!

 The General Membership Query messages are sent to the 224.0.0.1 target address by the multicast router. This is the global address of all multicast hosts.

4

 The Membership Report answer messages and the Join/Leave messages are sent to the 224.0.0.22 address by the endpoint.

IGMP Snooping

Ethernet switches commonly send all received packets with multicast address to all their ports (like in case of broadcat traffic). This causes unnecessary traffic to ports which are not connected with active members of the certain multicast group. The IGMP Snooping function of the IGMP layer 2 is like an optimization. IGMP snooping monitors the IGMP traffic between hosts and multicast routers. The switch uses what IGMP snooping has learned, forwarding multicast traffic only to interfaces that are connected to interested receivers. This conserves bandwidth by allowing to send multicast traffic to only those switch interfaces that are connected to hosts that want to receive traffic, instead of flooding traffics to all interfaces in the network.

Important: Ethernet switches in the laboratory network do not delete immediatly proper multicast group/port connections from the local IGMP table in the laboratory network. Therefore in case of TV channel changing, belong the new channel multicast traffic also the traffic of old channel is arriving to the network interface for a while. Check how long has appeared both groups’ traffic on the interface by the Wireshark! This information could be important when the duration of channel changing is observing. Because when we are changing to the channel, which was watched only before 60 seconds (or shorter time), then the duration of the second phase of this channel changing is zero second. (see chapter 8)

Multicast routing – Protocol Independent Multicast (PIM)

The PIM is not a single protocol it is a multicast routing protocol family. Three versions are used:

 PIM-SM (PIM Sparse Mode) – The multicast shared tree with a root named Rendezvous-point (RP) router is built up on the basis of explicit IGMP requests. The function model fits serving of physically sparsed multicast receivers (subscribers) in a WAN network.  PIM-DM (PIM Dense Mode) – The source initially broadcasts the multicast traffic in the whole network. Later forwarding is terminated to the network segments, where are not connected active receivers, by the IGMP messages. This is an implicit building of the multicast tree by this protocol. Due to the intensive bandwidth requirement of the broadcast forwarding, this protocol is not convenient for wide networks.  PIM-SSM (PIM Source-Specific Multicast) – The root of this multicast tree is a predefined source host (for example an IPTV headend). The multicast group can be defined by a source identifier/group identifier pair (S, G), where S is the source unicast address and G is the group multicast address. In case of an explicit source address definition Denial-of-Service attacks can be avoided from an unauthorized source inside the group.

The PIM-SM and PIM-SSM modes are applied in IPTV systems.

5

3. Important features of the transport stream forwarded in the IPTV system

Features SD HD

Bandwidth 2-3 Mbit/s 8-10 Mbit/s requirement

Resolution 720 x 576 px 1920 (1440) x 1080 px

Video codec H.264/MPEG4 AVC

Audio codec AAC, AC3

Media container MPEG2-TS (ISO/IEC 13818-1)

Transport protocol Real-time Transport Protocol (RTP)

Forwarding modell IP multicast

Protocol stack and media codecs

 IPv4/IPv6  IGMPv3/MLDv2/PIM  UDP  RTP/RTCP  MPEG-2 Transport Stream  H.264/H.265 (video codec)  AAC/AC3 (audio codec)

The most important benefit of the H.264 video codec (MPEG-4 AVC) is a half or even less bandwidth requirement, with a same visualization quality like in case of H.262, when we compare it with the H.262 (MPEG-2) codec. This is a very important factor in case of HD program transport, because instead of 15-20 Mbps bandwidth only 7-9 Mbps bandwidth is needed reaching the same video quality. In case of the IPTV service, an elementary stream, encoded by the H.264 codec, is transmitted in a MPEG-2 Transport Stream encapsulation. It is important to emphasize, that the MPEG Transport Stream (MPEG-TS, MTS or TS) is a standard digital container format (and it is not a codec type) for transmission and storage of audio and video content. Therefore this has not any effect onto videocoding or bandwidth requirement.

6

4. Schematic set-up of the IPTV headend

2. Figure: Schematic set-up of the IPTV headend

 Content aggregation: is a streams collection from various sources. A content provider (commonly TV companies) can deliver streams by using of various technologies toward the IPTV providers: DVB-T (Digital Video Broadcasting - Terrestrial), DVB-S (Digital Video Broadcasting - Satellite), SDI (Serial Digital Interface), ASI (Asynchronous Serial Interface).  Media transcoding: transcoding a mediastream (video and audio) based on the IPTV system requirements: bandwidth requirement, incidence of key video-frames, resolution, etc.  IP Scrambler: Transcoded media streams need to be prepared for the IP network forwarding. This phase is about the data packets preparing: IP/UDP/RTP/MPEG-2 TS/ES encapsulation.  CAS/DRM (Conditional Access System/Digital Rights Management): subsystems for access management (access list to channels and on-demand contents for subscribers), and for rights and technical protection of digital contents. The first is a transport protection mechanism and the second one a asset protection mechanism.

5. Network metrics influencing IPTV services Elemental network metrics influencing the Quality of Experience (QoE):

 Delay  Jitter  Packet loss  Packet reordeing  Throughput

7

Complex network metrics influencing the Quality of Experience (QoE):

 MDI (media delivery index) – includes 2 metrics o delay factor o media loss rate

Metrics influencing other service qualities:

 Zap time - time for channel change  EPG loading time

6. MPEG-2 Transport Stream MPEG-2 Transport Stream is a standard digital container format for multiplex transmission of video, audio and prProgram and System Information Protocl (PSIP) data (program guide, teletext, subtitles, etc.). It is used in broadcast systems such as Digital Video broadcasting (DVB) and IPTV systems for broadcasting. The multiplex transport creates an opportunity for elemental audio and video time syncronization. More Packetized Elementary Streams (PES) can be forwarded in one transport stream. One PES can include video, audio or text information. MPEG streams are typically transported with constant bitrate (CBR) by providers due to an efficient allocation of network resources (for the good QoS provision). In contrast with the DVB systems, in case of the IPTV every TV channel got a dedicated transport stream.

The MPEG-2 Transport Stream includes packets with fix size 188 bytes. Therefore into one UDP/RTP packet TS packets can be encapsulated. The next Wireshark display picture shows: every Ethernet frame = 1370 bytes, so 7 pieces of TS packet can be encapsulated into one Ethernet frame. In the Wireshark the MPEG-2 TS packet is marked with its official name ISO/IEC 13818-1 from the ISO standard.

Note: Behind the Packetized Elementary Streams also information tables are transported by the MPEG-2 Transport Stream (see belove).

Tip:

If the Wireshark cannot recognize the type of delivered traffic as an RTP mediastream, then under the Analyze menu -> Decode As -> is possible to set UDP payload decoding into RTP packets. From this point you will see RTP headers and the encapsulated MPEG-2 TS (ISO/IEC 13818-1) in the protocol hierarchy.

8

9

MPEG-2 TS terminologies

MPEG-2 Packet Identifier (PID): Every elementary stream or information table inside the transport stream has an identificator. This is the PID.

TV channel = TV program

One or more TV program can be forwarded inside of one transport stream. The Packetized Elementary Stream (PES) of the program is descripted in a PMT table. So, every TV program has got its own PMT table, which also has got an identificator inside of the transport stream.

MPEG-2 TS information tables

Program Association Table (PAT): A table including identificators of channels (programs) forwarded inside the transport stream. In case of the IPTV one MPEG-2 transport stream is forwarding only one program.

Program Map Table (PMT): A table including PID identificators of elementary streams belonging to the programs.

10

Event Info Table (EIT): The EPG susbsystem is preparing a programguide based on the EIT table information. This table includes names of programs, schedules, play-time and brief description.

Program Clock Reference (PCR): The reference clock for the elementary streams synchronization.

Tip:

We can use display filter for displaying information tables in the Wireshark. As a result only those RTP packets will be displayed which include a specified information table.

 Listing of RTP packets including elementary stream with the specified PID: mp2t.pid == value  Filtering of RTP packets including PAT tables: mpeg_pat  Filtering of RTP packets including PMT tables: mpeg_pmt  Filtering of RTP packets including EIT tables: dvb_eit

7. Playout buffer at the receiver side Media decoders at the receiver side are typically waiting for media packets with fixed rate at the receiver side. Contrarily IP packets of video- and audio-streams are not delivered with fixed delay from source to target – through the network. Network delay and jitter have not got guaranteed values in IP networks. Transport jitter is named Packet Delay Variation (PDV) in technical literature, but the jitter is also a relevant terminology. Due to network jitter, packets sended in correct time- interval at the source side, are received in various receiving time-interval at the target side. This jitter can be reduced significantly through playout or de-jitter buffer at the receiver side, because delivered packets are read by fixed bitrate from this buffer. Delay increasing is a drawback of buffer using, because delay value should be low in case of real-time applications. The correct buffer size setting is important according to the desirable network delay and jitter values.

Note: The palyout buffer is named network cache in case of the VLC media-player. Globally its size can be set in preferences menu, or individually can be set in case of the videostream opening. See Practical information part as well.

8. Channel change In case of channel change the client initiates multicast group leaving for the present TV program (IGMP Leave Group sending to the router) and initiates a multicast group joining to the new TV program (Membership Report/Join). If the client is only one active member of this group, the local router has to do multicast mediastream query from the next router, above this node in the multicast distribution tree (the multicast tree need to be improved). When the mediastream is delivered at the client side, the player has to fulfill the playout buffer to some level, before replaying the program. On the other hand, it has to wait for the PMT table delivering. Because need to be distributed Elementary Streams included in the Transport Stream for suitable decoders, based on information which has been delivered in this PMT table. Finally, condition of start the decoding is such a reference videoframe delivering in the elementary videostream, which can be referred in the next differential videoframes decoding. Accordingly this, the time of the TV channel change is influenced by 5 factors. The first 3 factors need to be analyzed and put information to the measurement report.

1. IGMP group changing (leave and join) 2. Expansion of multicast distribution tree (PIM routing)

11

3. Buffering at the endpoint (playout buffering - prefetch) 4. PMT (Program map specific data) information table arrival 5. Video keyframe arrival to the H.264 decoder

9. Practical information During the measurement the VLC mediaplayer and the Wireshark package-analyzer are needed to start.If the Windows Firewall is asking, you must enable the private network access for the VLC player. Next figures help to accomplish receiving and visualization of network mediastreams. Two Wireshark versions are installed to the PCs. The recommended version is the Wireshark legacy – form the ML4 menu at the bottom.

One TV channel information like pictures, audio and text information are multiplexed by the IPTV headend into one MPEG-2 transport stream. In this way prepared mediastream is forwarded to customers based on the multicast forwarding model. This mediastream can be disassembled into elemental streams, then decoded and visualized by a dedicated set-top-box or a proper software application. During our measurement the VLC mediaplayer is doing these tasks.

 The opening screen of the VLC:

12

 The network mediastream opening and replaying:

 Entering of a program title in the URL form and and display of special settings:

13

 Setting of the network cache: Note: In case of a media-stream opening the network-cache setting value is not always enforced by the VLC program (bug?). Therefore the cache setting in global mode is recommended in the exercises. See the next point:

14

 Global setting of the playout puffer: Tools – Preferences –Advances Preferences (SHOW SETTINGS ALL) – Input-Codecs – Network caching

15