480 likes | 670 Views
Multimedia on the Internet. Edo Biagioni University of Hawaii at M ānoa Information and Computer Sciences. Overview of the Tutorial. Multimedia on the Internet Encoding Principles Storage and Transmission Media Characteristics How the Internet works Protocols, including TCP/IP
E N D
Multimedia on the Internet Edo Biagioni University of Hawaii at Mānoa Information and Computer Sciences
Overview of the Tutorial Multimedia on the Internet • Encoding Principles • Storage and Transmission • Media Characteristics How the Internet works • Protocols, including TCP/IP • How to build an Internet
Part 1: Multimedia on the Internet Types of Multimedia • Voice and – generally – sound • Still Images • Video Use for Internet • Live communication • Storage, Retrieval, Backup etc
Multimedia -- Outline • Compression • Quality of Service • Real-Time and non-Real-Time • Relevant Internet Characteristics • Specific Formats: GIF, MPEG
Voice Quality and Compression • Telephone-Quality uncompressed voice: 64Kb/s -- 8KByte every second: 8000 samples/second, 1 byte/sample • high-quality sound: 40,000 samples/second, 2 bytes/sample, 80,000 bytes/second, 160,000 Kb/s • Compression can reduce this data rate considerably, e.g. MP-3 (MPEG version 3)
Compression • Lossless compression: eliminate redundancies in the data stream, reconstruct the original data exactly • Lossy compression: eliminate “unimportant” data in the data stream, reconstruct an approximation of the original data • Lossy compression gives better compression, lossless gives better signal
Lossless Compression • Sound at one millisecond usually resembles (same frequency and volume) the sound in the next few milliseconds • So, only send the difference, using fewer bits • If all the preceding data has been received correctly, can reconstruct the sound • Note: more vulnerable to data losses
Lossy Compression • Humans “hear” more information in the lower frequencies (down to about 20Hz) • Use more bits to encode information about lower frequencies, fewer bits for information about higher frequencies • Humans think reconstructed signal sounds the same as (or similar to) the original • High quality requires high data rate
Quality of Service -- Scenario • Voice over IP sends real-time voice data over the Internet (or an Intranet) • If the network is congested, it will start discarding packets • Discarding VoIP packets can be very disruptive • We need a way to tell the network what kind of service we need
Quality of Service – Traffic Types • Data traffic is best effort: if packets are dropped, we will recover, not much disruption • Uncompressed voice (video) is constant bit rate (CBR): each second produces n bits • Compressed voice (video) is variable bit rate (VBR): the number of bits produced each second varies with the data being sent
Quality of Service – Other Factors • Bandwidth: higher for video, not exactly predictable for VBR traffic • Burstiness: what is the maximum short-term bandwidth? • Delay: can the network guarantee delivery in 100ms or less? • Error rate: can the network guarantee no packet loss? At most 1% packet loss?
Real-Time Multimedia • Interactive Communication • Voice • Voice and Video • “Shared Workspaces”: drawings, documents, bank accounts, etc. • Near-real time: Real-time source, but a delay is acceptable (e.g. pay-per-view)
Non-Real-Time Multimedia • Image databases • Napster and friends • Distance Learning
Multimedia over the Internet:A fundamental Choice • Data for the internet will be broken into small (a few K Byte) packets before transmission • Some of these packets may be lost If we retransmit, we lose (real-) time If we don’t retransmit, we lose data
Adapting to Packet Loss • A real-time stream can adapt to lost (or delayed) packets by reproducing the most recent signal (e.g. tone, screen), giving graceful quality degradation • A non-real-time stream can buffer n seconds of data while retransmission occurs No strategy works if many packets are lost
Other Internet Characteristics Pros • Nearly Universal Connectivity • Well-defined, open standards Cons • Congestion is essentially unpredictable • QoS is (essentially) nonexistent • Large variations in available bandwidth
Internet of the near future Multicast • Efficient single sender, many receivers • Adaptive to congestion, to variable QoS IPv6 • More addresses, networks • Autoconfiguration • Encryption and Authentication
Specific Formats • Graphic Interchange Format (GIF) • Joint Picture Experts Group (JPEG) • Moving Picture Experts Group (MPEG) • All three are lossy compression of images (MPEG is for motion pictures)
GIF • Most (small) images have a small number of distinct colors • Pick 256 of the most common colors, and use them to encode each pixel in one byte -- approximate where necessary • Use a lossless compression (LZ) over the resulting pixel values
JPEG • Divide image into 8x8 blocks • Do a spatial-frequency analysis on each block (Discrete Fourier Transform, DFT) • Use more bits for the lower spatial frequencies (is the picture light or dark?) than for the higher spatial frequencies (where is that edge?) • Run-length encoding efficiently codes “zero” frequencies (no energy)
JPEG – What does it all Mean? • Many 8x8 blocks have very simple structure (in the frequency domain) • Others have only a few relevant features, captured in few non-zero frequency components →Good compression
MPEG • Encode each frame in a manner similar to JPEG: this is an I (Intrapicture) frame • Successive frames tend to resemble each other, so only encode the differences from the I frame: this is a P (Predicted) frame • Predict in both directions: a B (Bidirectional) frame
MPEG Characteristics • Excellent compression! • You need the preceding I frame to reconstruct P or B frames • You need the following P or I frame to reconstruct a B frame • I frames tend to be the largest • Example: one I frame , 3 B frames, 1 P frame, 3 B frames, 1 P frame, 3 B, 1 I
MPEG Characteristics (continued) • B frames cannot be used for real-time (forward prediction is difficult) • Good encodings take time (or hardware) • Loss of an I frame means loss of all the P frames that follow, and the B frames immediately before and after • If we have priorities or QoS, we can mark I frames as “more important” so the network will only drop them as a last resort
Multimedia Summary • Many different types of traffic • Lossy compression makes bandwidth demands tolerable, introduces issues • Real-time is not well-suited to congested Internet, works well on uncongested networks • QoS describes both type of traffic and type of service
Part II: The Internet • Basic Internet Connectivity • End-to-end data transfers • What is the Internet? Internet standards • What can (or can’t) the Internet run on? • Other technologies: Ethernet, ATM, Frame Relay, Modems, Cable, Wireless, Cellular
Basic Internet Connectivity We are on the Internet if: • We can send/receive Internet Protocol packets (IP packets) • to another machine which is connected to the Internet: a router • Recursive, decentralized definition • Any machine that forwards packets among two networks is a router
Internet Example Router 2 Net 3 Net 5 Net 1 Host 1 Host 2 Router 1 Router 3 Net 6 Net 4 Net 2
Routing • The IP address has a network part and a host part • A router must know where to forward packets destined for other networks • To do so, it runs a routing protocol: RIP, OSPF, BGP, etc • Manual configuration is also possible • Most hosts have a default route(r)
Internet Protocol • Each packet carries source and destination address • Large packets (up to 65KB) can be fragmented • TimeToLive kills packets after n seconds • Protocol field identifies next higher level • There are no sequence numbers, no retransmissions, no error detection
Common IP errors Packets may be: • Dropped • Duplicated • Delivered out of order • Delivered with bit errors or missing bytes • Arbitrarily delayed • Misdelivered Some of these are infrequent, but observed
Types of Internet Addresses • IP address: 1.2.3.4 is a dotted decimal notation, where each decimal (0..255) represents one byte of a 4-byte address • DNS name: www.biagioni.org • “hardware” addresses such as 00:FF:33:53:78:21 (Ethernet) • IPv6 addresses: 128-bit address, hex 1234:5678:9ABC:DEF0::33:5AB8
More on Internet Addresses The above addresses are globally unique An address can be permanent or temporary Network Address Translation (NAT): a single machine forwards packets for other machines that don’t have an IP address, pretending the packets are from itself Firewalling is (usually) NAT with additional checking
Domain Name System • Independent of IP addresses • Hierarchical system • Each DNS name can be mapped to one IP address • Authoritative DNS servers maintain the mapping for each organization • Servers will query each other, and clients will query servers, to find the mapping
End-to-end Data Transfers Transmission Control Protocol: • Reliable (always delivers if possible) • Stream-Oriented (re-packetizes) • Congestion control lessens congestion User Datagram Protocol • Very simple and efficient • Unreliable, packet oriented
User Datagram Protocol • Good for Real-Time • Same classes of errors as for IP, except can protect against data corruption and mis-delivery • Users of UDP must be prepared to deal with packet loss • Users of UDP should be prepared to slow down if congestion is present
Transmission Control Protocol • Used by most services, such as WWW, email, telnet/ssh • Usually, sub-second response • Used for reliable transfers, e.g. files • Adapts to congestion by slowing down • Connection-oriented: connection established before any data is sent
TCP and UDP Ports • Ports are used to identify the intended servers (also for UDP) – some ports are “well known” to correspond to specific services • HTTP (www) is usually on port 80, but • http://host.com:6431/file identifies a server on port 6431
Internet Standards • IP, TCP, DNS are all open standards • Defined by Internet Engineering Task Force (IETF), mostly via email long-distance communication • “Rough consensus and running code” • Originally “Request For Comments”, RFC • Available online at www.ietf.org • Delegate power to other organizations: IP, DNS addresses
The Internet connects other Networks • IP doesn’t say how we reach our router • Carrier pigeon? (RFC 1149) • Serial Line (SLIP, PPP) • Broadcast Medium (Aloha, Ethernet, Cable, Wireless, Cellular) • Telephone Lines (Modems) • Virtual Connections (ATM, Frame Relay) • Satellite point-to-point
Ethernet • Can broadcast or send to a specific address • How do I find the address of my router? • I broadcast a request containing my router’s IP address: Address Resolution Protocol, ARP • Speeds: 10Mb/s, 100Mb/s, 1Gb/s, 10Gb/s • Hubs connect computers to each other to form a Local Area Network: LAN
Aloha and Satellites • When two Ethernet NICs (network interface cards) send at the same time, they can detect the collision and retransmit • When sending to a satellite, senders cannot detect a collision • Satellite broadcasts to everyone, so a ground station can retransmit if it doesn’t see its message in the broadcast
ATM: Asynchronous Transfer Mode • Much better support than IP for real-time, multicast, and QoS • Point-to-Point, Point-to-Multipoint, and Multipoint-to-Multipoint virtual channels allow reservation of QoS for a specific stream of traffic • No support for broadcast, so hard to ARP • Virtual Private Networks, VPNs
Frame Relay • ATM has fixed-size cells (48-byte payloads) • Frame relay has frames large enough to carry an average-sized packet • Like ATM, FR uses virtual circuits, requiring a connection setup step before transmission can occur
Modems and Cable Modems • Carrying data over a medium (a wire) with given frequency characteristics • Encode the bits in such a way that they are received at the opposite side • Framing: where is the start of a packet? • Byte framing: where is the start of a byte?
Wireless Internet • Connect a modem to a radio to give a wireless connection • Collisions are worse than for Ethernet but better than for Aloha, since detection is faster • 802.11 protocol (up to 11Mb/s, 100+m) • In the future, maybe Bluetooth (10m)
Cellular Internet • Connect a modem to a cell phone to give cellular internet access • Cellular protocols know how to avoid collisions • Many cellular protocols are connection-oriented, reserving the bandwidth even when it is not needed
Summary • Many choices for encoding multimedia • Can choose reliability or speed, not both • Multicast, IPv6 may help • Understanding the Internet may help understand multimedia performance • These slides are athttp://www.ics.hawaii.edu/~esb/talk/2001mmin.ppt or http://www.ics.hawaii.edu/~esb/talk/2001mmin.html