Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Chapter 6 Multimedia Networking Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,

Similar presentations


Presentation on theme: "1 Chapter 6 Multimedia Networking Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,"— Presentation transcript:

1 1 Chapter 6 Multimedia Networking Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley, July 2002. A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in powerpoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following:  If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!)  If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material. Thanks and enjoy! JFK / KWR All material copyright 1996-2002 J.F Kurose and K.W. Ross, All Rights Reserved

2 2 Multimedia, Quality of Service: What is it? Multimedia applications: network audio and video (“continuous media”) network provides application with level of performance needed for application to function. QoS

3 3 Chapter 6: Goals Principles  Classify multimedia applications  Identify the network services the apps need  Making the best of best effort service  Mechanisms for providing QoS Protocols and Architectures  Specific protocols for best-effort  Architectures for QoS

4 4 Chapter 6 outline  6.1 Multimedia Networking Applications  6.2 Streaming stored audio and video m RTSP  6.3 Real-time Multimedia: Internet Phone Case Study  6.4 Protocols for Real-Time Interactive Applications m SIP

5 5 MM Networking Applications Fundamental characteristics:  Typically delay sensitive m end-to-end delay m delay jitter  But loss tolerant: infrequent losses cause minor glitches  Antithesis of data, which are loss intolerant but delay tolerant. Classes of MM applications: 1) Streaming stored audio and video 2) Streaming live audio and video 3) Real-time interactive audio and video Jitter is the variability of packet delays within the same packet stream

6 6 Streaming Stored Multimedia Streaming:  media stored at source  transmitted to client  streaming: client playout begins before all data has arrived  timing constraint for still-to-be transmitted data: in time for playout

7 7 Streaming Stored Multimedia: What is it? 1. video recorded 2. video sent 3. video received, played out at client Cumulative data streaming: at this time, client playing out early part of video, while server still sending later part of video network delay time

8 8 Streaming Stored Multimedia: Interactivity  VCR-like functionality: client can pause, rewind, FF, push slider bar m 10 sec initial delay OK m 1-2 sec until command effect OK m RTSP often used (more later)  timing constraint for still-to-be transmitted data: in time for playout

9 9 Streaming Live Multimedia Examples:  Internet radio talk show  Live sporting event Streaming  playback buffer  playback can lag tens of seconds after transmission  still have timing constraint Interactivity  fast forward impossible  rewind, pause possible!

10 10 Interactive, Real-Time Multimedia  end-end delay requirements: m audio: < 150 msec good, < 400 msec OK includes application-level (packetization) and network delays higher delays noticeable, impair interactivity  session initialization m how does callee advertise its IP address, port number, encoding algorithms?  applications: IP telephony, video conference, distributed interactive worlds

11 11 Internet Multicasting

12 12 Multicast: Connecting multiple users  Unicast: connecting two users  Multicast: connecting multiple users m Conference call m Event broadcast m Chat room  Supporting multicast m Multiple unicast Inefficient m Build a multicast tree Assume cost on links

13 13 The Multicast Problem  GIVEN: Network  GIVEN: User Requests (and quality requirements)  ESTABLISH: Efficient distribution trees ?

14 14 What is The Need for Multicasting?  Use bandwidth efficiently m Replace many unicast connections with one multicast connection m Duplicate packets only when necessary  Theoretical model m Links have cost m Find the minimum cost multicast tree 3 times the traffic

15 15 Steiner Tree Problem  Input: m Given a graph G(V,E) m Costs on edges m Set of nodes S  Output: m Tree T, m Includes all the nodes in S m Minimum cost  Complexity: m NP-complete

16 16 Steiner Tree: MST Heuristic  MST Heuristic : m define GS = complete graph on terminals edge cost = shortest path cost m find T MST = MST of GS m replace each edge of T MST with the path in G m output T MST

17 17 MST Approximation ratio  MST is at least 2-approximation m T MST = output of MST algo (on G(S)) m T* = optimal ST in G m Cost(T MST,G) ≤ Cost(T MST,GS) m Cost(T *,GS) ≤ 2Cost(T *,GS) m Conclusion: Cost(T MST,G) ≤ 2Cost(T *,GS)  MST is at most 2-approximation m Edges cost black = 2 red =1 m MST cost = 2k-2, OPT cost = k m Ratio 2-(1/k) 1 2 3 k 5 4

18 18 Multicast: Online setting  Online Steiner problem m Terminal arrive one at a time m Need to allocate a tree to current terminals  Online Greedy : m At time t: Current tree T t-1 arriving terminal v t Find shortest path P v from v t to T t-1 Let T t be the union of P v and T t-1

19 19 Performance of Online Greedy  Sort terminal by their cost cost(u 1 ) ≥ cost(u 2 ) ≥ … ≥ cost(u n )  CLAIM: cost(u k ) ≤ 2OPT/k (need to prove it … )  Assuming the claim: cost(T)= cost(u 1 ) + … + cost(u n ) ≥ 2OPT/1 + … + 2OPT/n ≥ 2OPT(1 + ½ + ⅓ + ¼ +⅛ … + 1/n) ≈ 2 ln(n) OPT

20 20 Proving the claim  Consider U k = {u 1, …, u k }  Suppose cost(u k ) > 2 OPT /k,  Then cost(u i ) > 2OPT/k, for i<k (they where sorted)  Every u i and u j are distance at least 2OPT/k  MST(U k ) > 2OPT m Contradiction to the MST heuristic m It is at 2-approximation!  QED

21 21 Chapter 6 outline  6.1 Multimedia Networking Applications  6.2 Streaming stored audio and video m RTSP  6.3 Real-time Multimedia: Internet Phone Case Study  6.4 Protocols for Real-Time Interactive Applications m SIP

22 22 Streaming Stored Multimedia Application-level streaming techniques for making the best out of best effort service: m client side buffering m use of UDP versus TCP m multiple encodings of multimedia  jitter removal  decompression  error concealment  graphical user interface w/ controls for interactivity Media Player

23 23 Internet multimedia: simplest approach audio, video not streamed:  no, “pipelining,” long delays until playout!  audio or video stored in file  files transferred as HTTP object m received in entirety at client m then passed to player

24 24 Internet multimedia: streaming approach  browser GETs metafile  browser launches player, passing metafile  player contacts server  server streams audio/video to player

25 25 Streaming from a streaming server  This architecture allows for non-HTTP protocol between server and media player  Can also use UDP instead of TCP.

26 26 constant bit rate video transmission Cumulative data time variable network delay client video reception constant bit rate video playout at client client playout delay buffered video Streaming Multimedia: Client Buffering  Client-side buffering, playout delay compensate for network-added delay, delay jitter

27 27 Streaming Multimedia: Client Buffering  Client-side buffering, playout delay compensate for network-added delay, delay jitter buffered video variable fill rate, x(t) constant drain rate, d

28 28 Streaming Multimedia: UDP or TCP? UDP  server sends at rate appropriate for client (oblivious to network congestion !) m often send rate = encoding rate = constant rate m then, fill rate = constant rate - packet loss  short playout delay (2-5 seconds) to compensate for network delay jitter  error recover: time permitting TCP  send at maximum possible rate under TCP  fill rate fluctuates due to TCP congestion control  larger playout delay: smooth TCP delivery rate  HTTP/TCP passes more easily through firewalls

29 29 Streaming Multimedia: client rate(s) Q: how to handle different client receive rate capabilities? m 0.5+ Kbps ADSL m 100Mbps Ethernet A: server stores, transmits multiple copies of video, encoded at different rates 1.5 Mbps encoding 28.8 Kbps encoding

30 30 User Control of Streaming Media: RTSP HTTP  Does not target multimedia content  No commands for fast forward, etc. RTSP: RFC 2326  Client-server application layer protocol.  For user to control display: rewind, fast forward, pause, resume, repositioning, etc… What it doesn’t do:  does not define how audio/video is encapsulated for streaming over network  does not restrict how streamed media is transported; it can be transported over UDP or TCP  does not specify how the media player buffers audio/video

31 31 Chapter 6 outline  6.1 Multimedia Networking Applications  6.2 Streaming stored audio and video m RTSP  6.3 Real-time, Interactive Multimedia: Internet Phone Case Study  6.4 Protocols for Real-Time Interactive Applications m SIP

32 32 Real-time interactive applications  PC-2-PC phone m instant messaging services are providing this  PC-2-phone  videoconference with Webcams Going to now look at a PC-2-PC Internet phone example in detail

33 33 Interactive Multimedia: Internet Phone Introduce Internet Phone by way of an example  speaker’s audio: alternating talk spurts, silent periods. m 64 kbps during talk spurt  pkts generated only during talk spurts m 20 msec chunks at 8 Kbytes/sec: 160 bytes data  application-layer header added to each chunk.  Chunk+header encapsulated into UDP segment.  application sends UDP segment into socket every 20 msec during talkspurt.

34 34 Internet Phone: Packet Loss and Delay  network loss: IP datagram lost due to network congestion (router buffer overflow)  delay loss: IP datagram arrives too late for playout at receiver m delays: processing, queueing in network; end-system (sender, receiver) delays m typical maximum tolerable delay: 400 ms  loss tolerance: depending on voice encoding, losses concealed, packet loss rates between 1% and 10% can be tolerated.

35 35 Jitter: Definitions  Input: t 0, …, t n  Delay Jitter: m Delay jitter J m For every k: |t 0 + kX - t k |  J m X = (t n - t 0 ) / n  Rate Jitter m Rate Jitter A m I k = t k - t k-1 m For every k and j: |I j - I k |  A  Jitter and buffering m delay versus jitter

36 36 constant bit rate transmission Cumulative data time variable network delay (jitter) client reception constant bit rate playout at client client playout delay buffered data Delay Jitter  Consider the end-to-end delays of two consecutive packets: difference can be more or less than 20 msec

37 37 Internet Phone: Fixed Playout Delay  Receiver attempts to playout each chunk exactly q msecs after chunk was generated. m chunk has time stamp t: play out chunk at t+q. m chunk arrives after t+q: data arrives too late for playout, data “lost”  Tradeoff for q: m large q: less packet loss m small q: better interactive experience

38 38 Fixed Playout Delay Sender generates packets every 20 msec during talk spurt. First packet received at time r First playout schedule: begins at p Second playout schedule: begins at p’

39 39 Adaptive Playout Delay, I Dynamic estimate of average delay at receiver: where u is a fixed constant (e.g., u =.01).  Goal: minimize playout delay, keeping late loss rate low  Approach: adaptive playout delay adjustment: m Estimate network delay, adjust playout delay at beginning of each talk spurt. m Silent periods compressed and elongated. m Chunks still played out every 20 msec during talk spurt.

40 40 Adaptive playout delay II Also useful to estimate the average deviation of the delay, v i : The estimates d i and v i are calculated for every received packet, although they are only used at the beginning of a talk spurt. For first packet in talk spurt, playout time is: where K is a positive constant. Remaining packets in talkspurt are played out periodically

41 41 Adaptive Playout, III Q: How does receiver determine whether packet is first in a talkspurt?  If no loss, receiver looks at successive timestamps. m difference of successive stamps > 20 msec -->talk spurt begins.  With loss possible, receiver must look at both time stamps and sequence numbers. m difference of successive stamps > 20 msec and sequence numbers without gaps --> talk spurt begins.

42 42 Recovery from packet loss (1) forward error correction (FEC): simple scheme  for every group of n chunks create a redundant chunk by exclusive OR-ing the n original chunks  send out n+1 chunks, increasing the bandwidth by factor 1/n.  can reconstruct the original n chunks if there is at most one lost chunk from the n+1 chunks  Playout delay needs to be fixed to the time to receive all n+1 packets  Tradeoff: m increase n, less bandwidth waste m increase n, longer playout delay m increase n, higher probability that 2 or more chunks will be lost

43 43 Recovery from packet loss (2) 2nd FEC scheme “piggyback lower quality stream” send lower resolution audio stream as the redundant information for example, nominal stream PCM at 64 kbps and redundant stream GSM at 13 kbps. Whenever there is non-consecutive loss, the receiver can conceal the loss. Can also append (n-1)st and (n-2)nd low-bit rate chunk

44 44 Recovery from packet loss (3) Interleaving  chunks are broken up into smaller units  for example, 4 5 msec units per chunk  Packet contains small units from different chunks  if packet is lost, still have most of every chunk  has no redundancy overhead  but adds to playout delay

45 45 Summary: Internet Multimedia: bag of tricks  use UDP to avoid TCP congestion control (delays) for time-sensitive traffic  client-side adaptive playout delay: to compensate for delay  server side matches stream bandwidth to available client-to-server path bandwidth m chose among pre-encoded stream rates m dynamic server encoding rate  error recovery (on top of UDP) m FEC, interleaving m retransmissions, time permitting m conceal errors: repeat nearby data

46 46 Chapter 6 outline  6.1 Multimedia Networking Applications  6.2 Streaming stored audio and video m RTSP  6.3 Real-time, Interactivie Multimedia: Internet Phone Case Study  6.4 Protocols for Real-Time Interactive Applications m SIP

47 47 SIP  Session Initiation Protocol  Comes from IETF SIP long-term vision  All telephone calls and video conference calls take place over the Internet  People are identified by names or e-mail addresses, rather than by phone numbers.  You can reach the callee, no matter where the callee roams, no matter what IP device the callee is currently using.

48 48 SIP Services  Setting up a call m Provides mechanisms for caller to let callee know she wants to establish a call m Provides mechanisms so that caller and callee can agree on media type and encoding. m Provides mechanisms to end call.  Determine current IP address of callee. m Maps mnemonic identifier to current IP address  Call management m Add new media streams during call m Change encoding during call m Invite others m Transfer and hold calls

49 49 Setting up a call to a known IP address Alice’s SIP invite message indicates her port number & IP address. Indicates encoding that Alice prefers to receive (PCM ulaw) Bob’s 200 OK message indicates his port number, IP address & preferred encoding (GSM) SIP messages can be sent over TCP or UDP; here sent over RTP/UDP. Default SIP port number is 5060.

50 50 Setting up a call (more)  Codec negotiation: m Suppose Bob doesn’t have PCM ulaw encoder. m Bob will instead reply with 606 Not Acceptable Reply and list encoders he can use. m Alice can then send a new INVITE message, advertising an appropriate encoder.  Rejecting the call m Bob can reject with replies “busy,” “gone,” “payment required,” “forbidden”.  Media can be sent over RTP or some other protocol.

51 51 Example of SIP message INVITE sip:bob@domain.com SIP/2.0 Via: SIP/2.0/UDP 167.180.112.24 From: sip:alice@hereway.com To: sip:bob@domain.com Call-ID: a2e3a@pigeon.hereway.com Content-Type: application/sdp Content-Length: 885 c=IN IP4 167.180.112.24 m=audio 38060 RTP/AVP 0 Notes:  HTTP message syntax  sdp = session description protocol  Call-ID is unique for every call. Here we don’t know Bob’s IP address. Intermediate SIP servers will be necessary. Alice sends and receives SIP messages using the SIP default port number 506. Alice specifies in Via: header that SIP client sends and receives SIP messages over UDP

52 52 Name translation and user location  Caller wants to call callee, but only has callee’s name or e-mail address.  Need to get IP address of callee’s current host: m user moves around m DHCP protocol m user has different IP devices (PC, PDA, car device)  Result can be based on: m time of day (work, home) m caller (don’t want boss to call you at home) m status of callee (calls sent to voicemail when callee is already talking to someone) Service provided by SIP servers:  SIP registrar server  SIP proxy server

53 53 SIP Registrar REGISTER sip:domain.com SIP/2.0 Via: SIP/2.0/UDP 193.64.210.89 From: sip:bob@domain.com To: sip:bob@domain.com Expires: 3600  When Bob starts SIP client, client sends SIP REGISTER message to Bob’s registrar server (similar function needed by Instant Messaging) Register Message:

54 54 SIP Proxy  Alice send’s invite message to her proxy server m contains address sip:bob@domain.com  Proxy responsible for routing SIP messages to callee m possibly through multiple proxies.  Callee sends response back through the same set of proxies.  Proxy returns SIP response message to Alice m contains Bob’s IP address  Note: proxy is analogous to local DNS server

55 55 Example Caller jim@umass.edu with places a call to keith@upenn.edu (1) Jim sends INVITE message to umass SIP proxy. (2) Proxy forwards request to upenn registrar server. (3) upenn server returns redirect response, indicating that it should try keith@eurecom.fr (4) umass proxy sends INVITE to eurecom registrar. (5) eurecom regristrar forwards INVITE to 197.87.54.21, which is running keith’s SIP client. (6-8) SIP response sent back (9) media sent directly between clients. Note: also a SIP ack message, which is not shown.

56 56 Comparison with H.323  H.323 is another signaling protocol for real-time, interactive  H.323 is a complete, vertically integrated suite of protocols for multimedia conferencing: signaling, registration, admission control, transport and codecs.  SIP is a single component. Works with RTP, but does not mandate it. Can be combined with other protocols and services.  H.323 comes from the ITU (telephony).  SIP comes from IETF: Borrows much of its concepts from HTTP. SIP has a Web flavor, whereas H.323 has a telephony flavor.  SIP uses the KISS principle: Keep it simple stupid.

57 57 Basic IP Telephony Audio Packet Transfer Digitization (e.g., sampling at 8kHz, 16 bits per sample, i.e, 128 kb/s or 320 bytes per 20 ms) Real-time compression/encoding (e.g., G.729A at 8 kb/s) Transport to remote IP address and port number over UDP (Why not TCP?) Processing on receiver side is the reverse …

58 58 Basic IP Telephony Sampling, Quantization, Encoding +127 +0 -127 10101111…01101101 Sample at twice the highest voice frequency 2 x 4000=8000 Round off samples to one of 256 levels (introduces noise) Encode each quantized sample into 8 bit code word PCM: 8000 x 8 bits = 64 kb/s Other techniques (differential coding, linear prediction) 2.4 kb/s to 64 kb/s

59 59 Basic IP Telephony Problems with UDP Unreliable UDP a)Packet loss b)Out-of-order (very rarely) c)Jitter (delay variation) 123576 1234567 timeline Sender Receiver (a) (b)

60 60 Basic IP Telephony Receive buffer Sequence number: to detect packet loss; Just ignore the loss! Receive buffer: to absorb jitter 123576 1234567 Sender Receiver 890234 8901234 127 1257 89023 123567 8902

61 61 Basic IP Telephony Timestamp Vs sequence number 1234 1234 Sender Receiver 567 567 Silence … t1 t2t3t4t5t6t7t8t9 Playout time vs packet loss detection Silence suppression Variable length packets

62 62 Basic IP Telephony Real-time Transport Protocol - RTP Encoded Audio RTP Header UDP header IP header msg sendto(…, msg, …) recvfrom(…, msg, …) Sequence number Optional contributors’ list (CSrc) Source identifier (SSrc) Timestamp (proportional to sampling time) Payload typeCCMV PX

63 63 Basic IP Telephony RTP based conference   Mixer Transcoder PCMU G.729 PCMU An example RTP conference (without multicast)

64 64 Basic IP Telephony Why do we need signaling? What is the IP address of Alice’s host? What audio encoding can it support? Bob’s host Alice’s host 128.59.19.194 Register as Alice=>128.59.19.194 Query for Alice 128.59.19.194

65 65 Basic IP Telephony Session Initiation Protocol - SIP Address based on email (alice@home.com) Columbia.edu Cisco.com home.com office.com Alice Bob 1.DNS SRV for SIP home.com  pc1.home.com pc1.home.com  129.59.19.140 2.INVITE alice@home.com 3.INVITE alice@m2.home.com (proxy mode) (2) (3) m2.home.com

66 66 Basic IP Telephony SIP Message Format INVITE sip:alice@home.com SIP/2.0 From: “Bob” To: “Alice” Subject: do you know SIP?... SIP/2.0 200 OK From: “Bob” To: “Alice” Subject: do you know SIP?... Request Response

67 67 Basic IP Telephony Session Description Protocol - SDP AliceBob INVITE Alice I can support PCMU and G.729 Send me audio at 202.16.49.27:6780 OK; I can support PCMU Send me audio at 128.59.19.194:8000 202.16.49.27 128.59.19.194 To port 6780 To port 8000 RTP

68 68 Basic IP Telephony SDP Message Format INVITE sip:alice@home.com SIP/2.0... v=0 o=bob 26172 27162 IN IP4 202.16.49.27 s=SIP call c=IN IP4 202.16.49.27 t=0 0 m=audio 6780 RTP/AVP 0 8 5 m=video 6790 RTP/AVP 31 Request Response SIP/2.0 200 OK... c=IN IP4 128.59.19.194 t=0 0 m=audio 8000 RTP/AVP 0 8 m=video 0 RTP/AVP 31

69 69 Basic IP Telephony Example scenario Cisco.com Home.com Office.com Alice Bob (1) (2) (3) (4) 1.Invite alice@home.com 2.Moved to alice-john@cisco.com 3.Invite alice-john@cisco.com 4.Invite alice-john@pc5.cisco.com pc5

70 70 Basic IP Telephony VoIP Gateways External line 7043 7040 7042 PBX Corporate/Campus Internet LAN 8154 8151 8152 8153 PBX Another campus LAN (Plain Old) Telephone Network Gateway


Download ppt "1 Chapter 6 Multimedia Networking Computer Networking: A Top Down Approach Featuring the Internet, 2 nd edition. Jim Kurose, Keith Ross Addison-Wesley,"

Similar presentations


Ads by Google