Transcript - Muhazam

EEC4113
Data Communication &
Multimedia System
Chapter 11: Application Layer – Networked
Multimedia
by Muhazam Mustapha, December 2011
and contributions by class members, October 2010
Learning Outcome
• At the end of this chapter, the students are
expected to have the knowledge about
– Application Layer Protocols
– Formats and Compression schemes of
Multimedia Data
– Some available multimedia techniques for the
internet
Chapter Content
• Application Layer Protocols
– HTTP, FTP, SMTP, POP(3)
• Multimedia Transfer Techniques
• Multimedia Transfer in Practice
– VoIP, IPTV, Video & Audio Streaming
• Compression of Multimedia Data
Application Layer Protocols
CO1
Application Layer
• Application Layer is the top most layer in
OSI Network Model
• It interacts with the end users through
network application software
• It consists of a large number of protocols
that is used by the application to make
network / web communication
– That is why the application is named web
application (like browsers, email client, etc)
CO1
Application Layer
• Almost all protocols are made of plain text
except for secured ones like HTTPS and
FTPS
• If any binary data needed to be sent
through HTTP, it will be encoded with
some binary-to-text encoding scheme like
Base64
CO1
Application Layer Protocols
• The protocols are also called process-toprocess protocols as they actually bind the
processes running on the end machines
• Examples of TCP/IP standard application
layer protocols:
– HTTP, FTP, SMTP, POP(3), IMAP, telnet,
DNS, DHCP, RPC, etc
• Examples of non-TCP/IP standard
protocols:
– Bit Torrent, NFS, NIS, DDS, etc
CO1
HTTP
• Hypertext Transfer Protocol – the protocol
that transfers web content
• Heart of WWW data transfer
• Almost all other technologies created for
the web is designed around HTTP protocol
– e.g. The concept of sessions in web
programming is nothing more than cookies in
HTTP protocol
• Consists of a request that is followed by a
response CO1
HTTP
• The request and response are of the
following format sequence:
– Request/Response line
– Header
– Blank line
– Body
• HTTP 1.1 major upgrade: Allowing
requests to be made to domains that
share the IP address
CO1
HTTP
• HTTP connection is non-persistent
– Means throughout the web download, if there
is any extra files required, there will be
separate connections made
• Example: An HTML file has 3 images
– First HTTP connection is made to download
the HTML, then disconnected
– It will be followed then by 3 more connectdisconnect sessions of HTTP to download the
3 images
CO1
HTTP Header
• The header in the request or response will
provide more information about the
request or the response
• This includes:
– User agent: browser type and operating
system
– Accepted language, encoding, MIME types
– Content length, last modified
CO1
HTTP Request
• Most widely used HTTP requests:
– GET: request for a file with extra info in query
string
– POST: request for a file with extra info in
STDIN
– PUT: request to upload file
– HEAD: request for header sample
CO1
HTTP Request
• GET Request examples:
– GET /images/logo.png HTTP/1.0
User-Agent: Mozilla/5.0 (Linux; X11)
Accept-Language: en
Request
Header
Blank line
– GET /images/logo.png HTTP/1.1
Specific domain name
Host: www.muhazam.com
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0
Accept-Language: en
Query string
– GET /script/student.asp?name=ain HTTP/1.0
User-Agent: Mozilla/5.0 (Linux; X11)
Accept-Language: en
CO1
HTTP Response
• Responses are given as status codes
• Some of the most common ones:
– 200: OK – request done
– 401: Unauthorized – password wrong
– 403: Forbidden – access to protected area
– 404: Not found – the isn’t in server
– 500: Internal server error – due to some
coding error
CO1
HTTP Response
• GET Response example:
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
<html>
<head>
.....
CO1
Response
Header
Blank line
Content
FTP
• File Transfer Protocol – the protocol that
transfers arbitrary file content
• FTP connection is persistent
– Means the user can perform many tasks
during a single session
• Needs a proper FTP client to operate fully
– WS FTP, CuteFTP, etc
• Nowadays browsers are already equipped
with some FTP capabilities
CO1
FTP
• Consists of a number of commands
– PWD – current working directory
– LIST – list the current directory
– DEL – delete a file
– MKDIR – make directory
– CHDIR – change to a directory
– etc
CO1
FTP
• Specifying URL:
ftp://[<user>[:<password>]@]<host>[:<port>]/<url-path>
– Example:
– ftp://public.ftp-servers.example.com/mydirectory/myfile.txt
–
ftp://user001:[email protected]/mydirectory/myfile.txt
• FTP clients are capable of taking
username and password discreetly, but for
browsers normally we need to specify it as
plain text
CO1
SMTP
• Simple Mail Transfer Protocol – the
protocol that transfers email
• It transfers both outgoing and incoming
emails – despite some misconceptions
• Consists of some commands to talk
between SMTP servers:
– HELO, MAIL FROM, RCPT TO, etc
CO1
SMTP
• Example:
S: 220 smtp.example.com ESMTP Postfix
C: HELO relay.example.org
S: 250 Hello relay.example.org, I am glad to meet you
C: MAIL FROM:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: RCPT TO:<[email protected]>
S: 250 Ok
C: DATA
S: 354 End data with <CR><LF>.<CR><LF>
C: From: "Bob Example" <[email protected]>
C: To: "Alice Example" <[email protected]>
C: Cc: [email protected]
C: Date: Tue, 15 Jan 2008 16:02:43 -0500
C: Subject: Test message
C:
C: Hello Alice.
C: This is a test message with 5 header fields and 4 lines in the message body.
C: Your friend,
C: Bob
C: .
S: 250 Ok: queued as 12345
C: QUIT
S: 221 Bye
{The server closes the connection}
CO1
POP
• Post Office Protocol – the protocol that
transfers email to email client
• Email clients like, MS Outlook, Netscape
Mail, Thunderbird, etc use this protocol to
download emails from server to local
machine
• Some of commands:
– LIST, STAT, RETR, DELE, etc
CO1
Multimedia Transfer
Techniques
CO1
Multimedia Transfer Techniques
• The main problem in multimedia transfer
over the internet is the speed and
efficiency
– Speed required to reduce delay and buffering
– Efficiency required to reduce packet loss and
jittering
• A few techniques employed
– Web server
– Streaming server
– RTSP
CO1
Web Server Technique
• Web browser makes the request
• After the server responds the browser
delegates the play process to a media
player
• The media player will then communicate
directly to the web server to play the
content
CO1
Web Server Technique
Browser
Request
Web
Server
Delegation
Streaming
Media
Player
CO1
Web Server Technique
• Advantage: Easiest to implement and least
costly
• Disadvantage: Still rely on normally slow
web servers
CO1
Streaming Server Technique
• Web browser makes the request
• After the web server responds with the
information about the streaming server,
the browser delegates the play process to
a media player
• The media player will then communicate
directly to the streaming server to play the
content
CO1
Streaming Server Technique
Browser
Request
Web
Server
Delegation
Media
Player
CO1
Streaming
Streaming
Server
Streaming Server Technique
• Advantage: Speedier and more reliable,
even though still as HTTP transfer
• Disadvantage: Requires an extra and
more expensive server
CO1
RTSP Technique
• Real Time Streaming Protocol
• Just like the streaming server, but now it is
using a dedicated protocol
• RTSP is a protocol the has some
capabilities of a media player, like play,
pause, stop, etc
CO1
Reducing Delay
• There is an interleaving technique used to
reduce delay in video streaming
• The in-sequence packets are re-arranged
into interleaving groups, then transferred
in that sequence
• At receiver, the interleaving groups are rearranged back to the original sequence
• If any group lost, it only causes small
distributed jittering instead of a long wait
CO1 for that lost group
Reducing Delay
Interleave
Streaming
LOST
Re-arrange
CO1
Small less annoying but distributed jitters
Multimedia Transfer in Practice
CO1
Radio over Internet
Protocol(RoIP)
• RoIP takes Internet Protocol (IP) input that convert
communications stream to IP
• RoIP is not just about linking radios
• Enables interoperable communications between
new and legacy public safety radio systems,
commercial wireless and wired phones
• Allows a dispatcher to dynamically drag and drop
parties and channels to form and dissolve talk
groups remotely
RoIP Slides contributed by: ABDUL MUIZ BIN SHAHIDAN,
MUHAMMAD ATIQ B CHE MOHD ROSLI
CO1
Radio over Internet
Protocol(RoIP)
• Session Initiation Protocol - SIP System
Diagram RoIP is not just about linking radios
CO1
Radio over Internet
Protocol(RoIP)
• HTML code for hot FM radios:
• <embed name="mediaplayer1"
pluginspage="http://www.microsoft.com/Windows/Media
Player/" src="http://rs9.radiostreamer.com:10000"
type="application/x-mplayer2" controller="true" loop="0"
transparentstart="1" autostart="true"
enablecontextmenu="false" showstatusbar="1"
width="320" height="80"></embed>
CO1
Radio over Internet
Protocol(RoIP)
• List of stations:
CO1
Radio over Internet
Protocol(RoIP)
• Malaysia Listing:
• Radio MMU (Multimedia University)
• iRadio OUM (Open University Malaysia)
• IIUM FM (International Islamic University
Malaysia)
• UFM (Universiti Teknologi Malaysia)
• Putra FM (Universiti Putra Malaysia)
• UMS KKFM (Universiti Malaysia Sabah)
• Radio Malaysia Johor
• Sinar FM
• Hot FM
CO1
Radio over Internet
Protocol(RoIP)
• Users:
• In the US military.
– Increasingly in business.
• Emergency agencies across the US.
• Network that joins 42 federal, state,
tribal, transit, and utility agencies
without buying a single new radio.
CO1
Voice over IP (VoIP)
• Voice over Internet Protocol (VoIP)-technology that
allows you to make voice calls using a broadband
Internet connection instead of a regular (or analog)
phone line.
• Some VoIP services may only allow you to call other
people using the same service, but others may allow
you to call anyone who has a telephone number including local, long distance, mobile, and international
numbers.
• Some VoIP services only work over your computer or
a special VoIP phone, other services allow you to use
a traditional phone connected to a VoIP adapter.
VoIP Slides contributed by: NURUL MARLIANA BT MUSA,
SUHANA BINTI MOHD TAHIR
CO1
Voice over IP (VoIP)
• Providers:
– Skype (peer to peer program – both side
must have Skype installed)
– Zamir Telecom Limited
– Google Voice
CO1
Voice over IP (VoIP)
• Protocols:
– MEGACO (H.248)
– MGCP
– MIME
– RVP ( Remote Voice protocol )
– SDP
– SIP
– SGCP
– SKINNY
CO1
Voice over IP (VoIP)
• Advantages:
– Operational cost
• Routing phone calls over existing data
networks to avoid the need for separate
voice and data networks
– Flexibility
• The ability to transmit more than one
telephone call over a single broadband
connection.
CO1
Voice over IP (VoIP)
• Advantages (continued):
– Location independence
• Only a sufficiently fast and stable Internet
connection is needed to get a connection
from anywhere to a VoIP provider
CO1
Voice over IP (VoIP)
• The operation:
• VoIP services convert your voice into a digital signal
that travels over the Internet.
• If you are calling a regular phone number, the signal
is converted to a regular telephone signal before it
reaches the destination.
• VoIP can allow you to make a call directly from a
computer, a special VoIP phone, or a traditional
phone connected to a special adapter.
• Wireless "hot spots" in locations such as airports,
parks, and cafes allow you to connect to the Internet
and may enable you to use VoIP service wirelessly.
CO1
Voice over IP (VoIP)
• Example of residential network including
VoIP:
CO1
IPTV
• IPTV – Internet Protocol Television
• It is digital television delivered on TV
(or PC) through high speed internet
connection (broadband)
• Channels are encoded to IP format
and delivered to TV through a Set
Top Box (STB)
IPTV Slides contributed by: WAN AHMAD GHAZLY BIN MD GHAUZ,
MUHAMMAD FARHAN BIN SHAHROM
CO1
IPTV
• How IPTV works
– IPTV converts television signal into
small packets of computer data
– The packets is the same like any other
form of online traffic such as webpages
or emails.
– IPTV was first used in 1994
• ABC’s World News Now was the first
television show to be broadcast over the
internet, using the CU-SeeMe video
conferencing software
CO1
IPTV
• Three main components:
– TV and content head end
• where the TV channels are received and
encoded
– Delivery network
• Consists of broadband and landline
network provided by telecom operator
CO1
IPTV
• Three main components (cont):
– Set Top Box (STB)
• Required at customer location
• STB reassembles data packets into TV
programs
• Connected between internet modem and
the customer’s TV
CO1
IPTV
• Protocols:
– For live TV programs
• IGMP version 2 or IGMP version 3 for
IPv4 for connecting to a multicast stream
(TV channel) and for changing from one
multicast stream to another (TV channel
change).
– For video-on-demand (VOD)
• Real Time Streaming Protocol (RTSP)
CO1
IPTV
• Codecs:
– Video contents typically compressed
with MPEG-2 or MPEG-4 codec and
sent in an MPEG transport stream
delivered…
• Via IP Multicast for Live TV and
• Via IP Unicast for VOD
*IP Multicast is a method in which information can be sent to
multiple computers at the same time
– H.264 (MPEG-4) is increasingly used
to replace MPEG-2.
CO1
IPTV
• Advantages of IPTV:
– Quality of digital video and audio is
better than traditional analogue TV
– More interactive features & contents
– Schedule of recording of favorite TV
programs is possible
– With video-on-demand (VOD), users
can browse an online movie catalog
and watch it instantly
CO1
IPTV
• Advantages of IPTV (cont):
– Lower cost for operator and user
– Ability to integrate a TV with other IPbased services like high speed Internet
access and VoIP
• Provider in Malaysia: TM’s Unifi
CO1
Video Streaming
• Streaming media are multimedia that are
constantly received by, and normally presented
to, an end-user while being delivered by a
streaming provider.
• The process involves a camera for the video, an
encoder to digitize the content, a video publisher
where the streams are pushed to and a Content
delivery Network to distribute and deliver the
content.
• True streaming is media content that is delivered
to the viewer’s media player in real-time.
Video Streaming Slides contributed by: MUHAMMAD AKMAL SAPON,
MOHD ESKANDAR MIRZA MOHD YUSOF
CO1
Video Streaming
• File formats:
1- Windows Media video 6- Flash Live Video
(.wmv)
(FLV)
2- RealMedia (.rm)
7- Audio Video
Interleave (.avi)
3- Quicktime
8- Apple Quick Time
4- MPEG (.mpg)
Movie (.mov)
5- Adobe Flash
9- DVD Video Object
(.vob)
CO1
Video Streaming
• Protocols
– HTTP
• Sending data from web server to web browser.
– MMS (MICROSOFT MEDIA SERVICES)
• NetShow services.
– RTSP (REAL TIME STREAMING
PROTOCOL)
• Developed by IETF & published in 1998.
• Allows client remotely control streaming media
server.
CO1
Video Streaming
• HTML Tags:
– ADOBE FLASH PLAYER
•
•
•
•
Runs SWF files
Created by Adobe Flash authoring tools
ActionScript (AS)
Available as plugin
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflas
h.cab#version=9,0,16,0"
width="320" height="400" >
<param name="movie" value="video-filename.swf">
<param name="quality" value="high">
<param name="play" value="true">
<param name="LOOP" value="false">
<embed src="video-filename.swf" width="320" height="400" play="true"
loop="false" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash">
</embed>
</object>
CO1
Video Streaming
• HTML Tags :
– HTML5 VIDEO
• Element introduced in the HTML5
• Example:
<video src="pr6.webm" width="320"
height="240">
</video>
CO1
Video Streaming
• Screen shot:
CO1
Compression of Multimedia
Data
CO2
Data Compression
• Data compression is a process of
encoding data in less than the normally
required no. bits
• Symbols may be encoded in variable no.
bits
• Redundancy of the used bits in normal
encoding will be reduced
CO2
Compression Models
• There are 2 main models in data
compression scheme:
– Statistical based
– Dictionary based
• Statistical based:
– Based on statistical content of the file
– E.g. Huffman coding, Arithmetic coding
• Dictionary based
– Based on repeated data replacement
– E.g. Ziv-Lempel
CO2
Compression Types
• There are 2 types of data compression:
– Lossless
– Lossy
• Lossless (Huffman & Arithmetic):
– Binary content doesn’t change after
compression-decompression
– Use: to compress binary / text file
• Lossy:
– Binary content changes after compressiondecompression, but not the semantic content
– Use: voice, image, video file
CO2
Multimedia Compression
• Multimedia data has little dictionary and
statistical feature that can contribute to
compression
• Hence lossless compression is of little use
• The amount of semantic content loss in
lossy compression can be set to some
acceptable level
• E.g. JPEG, GIF (image), AU, RM (audio),
MPEG (video)
CO2
Huffman Coding
• This might be the oldest compressing
technique that was invented by a PhD
student in MIT (Huffman)
• Requires prior knowledge of the file
(statistical frequency) – table of symbols
and their frequency
• It is a lossless scheme
CO2
Huffman Coding
Algorithm:
1. Sort the frequencies from largest to smallest
2. Give the 2 least frequent symbols a bit value
of 1 and 0 each (any order)
3. Then Combine them to form an unnamed
symbol with a combined frequency
4. Repeat (1) – (3) until there is no more
symbol in list – Huffman tree is formed
5. The Huffman code for a particular symbol in
the tree is the sequence of bits read from
the root until the symbol is reached at the
leaf
CO2
Huffman Coding
Example:
Compute a possible Huffman code for the
following symbol-frequency table:
f
symbol
CO2
69
A
18
D
15
T
12
M
6
Q
3
X
Huffman Coding
Initial:
A: 69
D: 18
T: 15
M: 12
Q: 6
X: 3
Combine the last 2 (no re-arrange needed):
A: 69
D: 18
T: 15
M: 12
:9
Q: 6
0
CO2
X: 3
1
Huffman Coding
Combine the last 2 again:
A: 69
D: 18
T: 15
: 21
M: 12
:9
1
0
Q: 6
0
CO2
X: 3
1
Huffman Coding
Re-arrange:
A: 69
: 21
M: 12
:9
1
0
Q: 6
0
CO2
D: 18
X: 3
1
T: 15
Huffman Coding
Combine:
A: 69
: 21
M: 12
:9
D: 18
1
0
Q: 6
0
CO2
: 33
0
X: 3
1
T: 15
1
Huffman Coding
Re-arrange:
A: 69
D: 18
0
: 33
: 21
M: 12
T: 15
1
:9
1
0
Q: 6
0
CO2
X: 3
1
Huffman Coding
Combine:
A: 69
: 54
0
D: 18
0
: 33
: 21
M: 12
T: 15
1
:9
1
0
Q: 6
CO2
1
0
X: 3
1
Huffman Coding
Final combination:
: 123
0
A: 69
: 54
0
D: 18
0
1
: 33
: 21
M: 12
T: 15
1
:9
1
0
Q: 6
0
CO2
1
X: 3
1
Huffman Coding
The Huffman code:
A: 0
D: 100
T: 101
M: 110
Q: 1110
X: 1111
1 bit
3 bits
3 bits
3 bits
4 bits
4 bits
The compressed file size:
Total of [(no. symbol’s bits) × (symbol’s frequency)]
A: 1×69
D: 3×18
T: 3×15
M: 3×12
Q: 4×6
X: 4×3
CO2
= 69 bits
= 54 bits
= 45 bits
= 36 bits
= 24 bits
= 12 bits
Total
= 240 bits = Round-up(240/8) = 30 bytes
Huffman Coding
Compression ratio:
Assume that the symbols were originally encoded by normal binary
coding, the required bits per symbol is:
= Round-up(Log2(No. symbols)) = 3
Total uncompressed file size = 3×123 = 369 bits = 47 bytes
Compression ratio= (47−30) / 47 = 17 / 47 = 0.362 = 36.2%
CO2
MPEG
• MPEG stands for Moving Picture Experts Group
• Used for coding audio-visual information (e.g.,
movies, video, music) in a digital compressed
format.
• Compared to other format such as WMF
(Window Media Format) and RM (Real Media) ,
MPEG files are much smaller for the same
quality. This is because MPEG uses very
sophisticated compression techniques.
MPEG Slides contributed by: MOHAMAD FUAD BIN ABDULLAH,
MOHD FAIZUL BIN CHE HASHIM
CO1
MPEG1
• It is designed to compress VHS-quality
raw digital video and CD audio down to
1.5 Mbit/s (26:1 & 6:1 compression ratios
respectively) without excessive quality
loss.
• Making video CD, some digital cable /
satellite TV and digital audio broadcasting
(DAB) possible.
CO1
MPEG2
• MPEG-2 is directed at broadcast
formats at higher data rates
• It provides extra algorithmic 'tools' for
efficiently coding interlaced video.
• MPEG-2 is the core of most digital
television including satellite TV and
DVD formats
CO1
MPEG4
• These standards made interactive video
on CD-ROM, DVD, mobile web and Digital
Television possible.
• MPEG-4 builds on the proven success of
three fields:
– Digital television
– Interactive graphics applications
– Interactive multimedia
CO1
Parts of MPEG Standard
• MPEG1:
– Systems
– Video
– Audio
– Conformance
testing
– Reference
software
CO1
• MPEG2:
–
–
–
–
–
–
–
–
Systems
Video
Audio
testing compliance
Software simulation.
DSM-CC
AAC
Extension for real
time interfaces
– Conformance
extensions for DSMCC
– IPMP
Parts of MPEG Standard
• MPEG4:
–
–
–
–
–
–
–
–
–
–
–
–
–
CO1
Systems
Visual
Audio
Conformance testing
Reference Software
Optimized reference
software
DMIF
AVC
AFX
Extension for real time
interfaces
Conformance extensions
for DSM-CC
IPMP
3D Graphics
Compression Model
– Audio Conformance
– 3D Graphics conformance
– Carriage of ISO/IEC 14496 contents
over IP networks
– Reference hardware description
– Scene description & application
engine
– ISO base media file format
– IPMP
– MP 4 file format
– Streaming file format
– Synthesized texture stream
– SAF & LASeR
– MPEG-J GFX
– Open Font format
– SMR
– Audio and systems interaction
MPEG Streaming Format
MPEG-1
– Lower quality than
MPEG-2
– Doesn’t need as much
bandwidth as MPEG-2
– A less efficient audio
compression system
MPEG-2
– High Quality
– High Bandwidth
– Streamed from highoutput servers or
network appliances.
MPEG-4
• Absorbs many of the features of MPEG-1
& MPEG-2, adding some new features.
•Aimed primarily at low bit-rate video
communications.
CO1
MPEG Streaming Format
CO1