1 lecture 05 making connections efficient: multiplexing and compression

59
1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

Post on 19-Dec-2015

222 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

1

Lecture 05

Making Connections Efficient: Multiplexing and Compression

Page 2: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

2

Making Connections Efficient

• Under simplest conditions, medium can carry only one signal at any moment in time

• But, this approach is not efficient. In practice, multiple signals share a medium.

• The technique used to place multi-signals onto a medium is called multiplexing

• Different multiplexing techniques (to p3)

Page 3: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

3

Making Connections Efficient

• Most common multiplexing techniques:

1. Frequency division multiplexing2. Time division multiplexing3. Wavelength Division Multiplexing4. Discrete Multitone5. Code division multiplexing

Comparison(to p4)

(to p28)

(to p11)

(to p5)

(to p37)

(to p32)

(to p30)

Page 4: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

4

Making Connections Efficient

• Data Compression concept

• Application examples (to p57)

(to p39)

Page 5: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

5

Frequency Division Multiplexing (FDM)

– it is a technique to pack several analog signals onto a telephone wire

– General concept – It works this way because a telephone signal

is carried signal range of 0 to 4000 hz– A twisted pair of wire can carry 1 million hz.– how multiplexing is done?

(to p6)

(to p7)

Page 6: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

6

FIGURE 5-22 Frequency multiplexed voice signals.

(to p5)

Page 7: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

7

Frequency Division Multiplexing (FDM) (cont.)

– we need to transmit a sine wave in the new freq range, the change of the carrier wave is called Modulation

– similar token, we would have frequency modulation ((FM), amplitude modulation (AM), phase modulation (PM).

– at the other end, we need to demodulation so that signals are can unscrambled back to the original form

(to p8)

(to p9)

Page 8: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

8

FIGURE 5-23 Amplitude and frequency modulation.

(to p7)

Page 9: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

9

Frequency Division Multiplexing (FDM) (cont.)

– In tel system, the modulation occurs at the central office, and demodulation takes place at the serving central office near the user home/office. (same as MODEM at home?)

– multiplexing equipment (multiplexers) at central office grouped as shown in

» Figure 5-24

• 12 voice channels grouped as a base group• 5 base groups into a super group• 10 super groups into a master group

(to p10)

(to p3)

Page 10: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

10

FIGURE 5-24 The hierarchy of voice channels as they are multiplexed together.

(to p9)

Page 11: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

11

Time division Multiplexing (TDM)

– is a technique uses to divide a circuit’s capacity into time slots so that data could be transmitted in a long distance on a single circuit without the need of the regeneration (why important?)

– Digital signaling is used exclusively– Time division multiplexing comes in two basic

forms:• Synchronous time division multiplexing• Statistical time division multiplexing

(to p12)

(to p22)

(to p3)

Page 12: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

12

Synchronous Time Division Multiplexing

• Sharing of the signal is accomplished by dividing available transmission time on a medium among users– A TDM takes one character from each

terminal and group them into a frame before transmit them on the circuit

– At the end, another TDM breaks down the frame and direct individual message to respective receivers

(to p13)

Page 13: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

13

(TDM)

– TDM effect is totally a transparent to users, terminal and computer

– total # of terminals could be packed into a TDM is depended on capability of a circuit

• Eg:

If a circuit has a speed of 9600 bps, then

it may carry 4 x 2400 pbs or 8 x 1200 pbs etc

(to p14)

Page 14: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

14

(TDM)– it takes one bit from each terminal instead

of one character and transmit a frame in bit

– Different between FDM and TDM

– T-1 and ISDN telephone lines are common examples of synchronous time division multiplexing. (what is T-1 and ISDN?)

– Similar applied to Sonet system

(to p11)

(to p20)(to p19)

(to p18)

(to p15)

Page 15: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

15

Synchronous Time Division Multiplexing (continued)

Mechanical data-transmission procedure(to p14)

(to p16)

Page 16: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

16

Synchronous Time Division Multiplexing (continued)

• If one device generates data at faster rate than other devices, then the multiplexor must either sample the incoming data stream from that device more often than it samples the other devices, or buffer the faster incoming stream

• If a device has nothing to transmit, the multiplexor must still insert something (by reserving a blank!) into the multiplexed stream, So that the receiver may stay synchronized with the incoming data stream, the transmitting multiplexor can insert alternating 1s and 0s into the data stream

(to p17)

Page 17: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

17

Synchronous Time Division Multiplexing (continued)

(to p15)

Page 18: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

18

FIGURE 9-14 FDM channels have full time use of a limited range of frequencies. TDM channels can use the full range of frequencies but only during predetermined time slots.

(to p14)

Page 19: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

19

T-1 Multiplexing

• The T-1 multiplexor stream is a continuous series of frames

(to p14)

Page 20: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

20

ISDN Multiplexing

– The ISDN multiplexor stream is also a continuous series of frames

– Each frame contains various control and sync info

(to p14)

Page 21: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

21

SONET/SDH Multiplexing

– Likewise, SONET incorporates a continuous series of frames

(to p14)

Page 22: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

22

2) Statistical TDM (STDM)

– does not assign a specific time slot for each terminal, but transmit terminals address along with each character or message of data

i.e. A statistical multiplexor transmits the data from active workstations only– If a workstation is not active, no space is wasted in the multiplexed stream

– it avoids of having empty slot in a frame, and attempt to allocate next terminal has data to send so that efficiency rate is improved

– See Figure 9-16 (to p23)

(to p25)

Page 23: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

23

FIGURE 9-16 The STDM tries to avoid having empty slots in a frame, thereby improving the line use. If a terminal has no data to send in a particular time period, the STDM will see if the next terminal has data that can be included in the time slot. When the STDM at the receiving end breaks the frame apart, it uses the terminal address to route the data to the proper device.

(to p22)

Alternative layout

(to p24)

Page 24: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

24

(to p23)

Page 25: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

25

STDM

– Its mechanical steps– STDM requires a storage area (ie buffer) so

that data can be saved until line can accept for transmission

– Typically, it has buffer size up to 32,000 char, but may encounter a slighter delay for transmission when buffering is occurred

– In STDM, 12 terminals running at 1200 pbs could be handled by a 9600 pbs line in most cases

(to p11)

(to p26)

Page 26: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

26

How it works

• To identify each piece of data, an address is included, see Figure 5-10

• If the data is of variable size, a length is also included, see Figure 5-11

• More precisely, the transmitted frame contains a collection of data groups, see Figure 5-12

(to p25)

(to p27)

(to p27)

(to p27)

Page 27: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

27

(to p26)

(to p26)

(to p26)

Page 28: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

28

Wavelength Division Multiplexing

• Wavelength division multiplexing multiplexes multiple data streams onto a single fiber-optic line

• Different wavelength lasers (called lambdas) transmit the multiple signals

• Each signal carried on the fiber can be transmitted at a different rate from the other signals

• Dense wavelength division multiplexing combines many (30, 40, 50 or more) onto one fiber

• Coarse wavelength division multiplexing combines only a few lambdas

(to p3)

(to p29)

Page 29: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

29

Wavelength Division Multiplexing (continued)

(to p28)

Page 30: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

30

Discrete Multitone

• Discrete Multitone (DMT) – a multiplexing technique commonly found in digital subscriber line (DSL) systems

• DMT combines hundreds of different signals, or subchannels, into one stream

• Each subchannel is quadrature amplitude modulated (recall eight phase angles, four with double amplitudes)

• Theoretically, 256 subchannels, each transmitting 60 kbps, yields 15.36 Mbps

• Unfortunately, there is noise(to p3)

(to p31)

Page 31: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

31

Discrete Multitone (continued)

(to p30)

Page 32: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

32

Code Division Multiplexing

• Also known as code division multiple access• An advanced technique that allows multiple devices to

transmit on the same frequencies at the same time• Each mobile device is assigned a unique 64-bit code• To send a binary 1, a mobile device transmits the unique

code• To send a binary 0, a mobile devices transmits the

inverse of the code• Receiver gets summed signal, multiplies it by receiver

code, adds up the resulting values– Interprets as a binary 1 if sum is near +64– Interprets as a binary 0 if sum is near -64

(to p33)

Page 33: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

33

Code Division Multiplexing (continued)

• For simplicity, assume 8-bit code• Example

– Three different mobile devices use the following codes:

• Mobile A: 10111001• Mobile B: 01101110• Mobile C: 11001101

– Assume Mobile A sends a 1, B sends a 0, and C sends a 1

– Signal code: 1-chip = +N volt; 0-chip = -N volt(to p34)

Page 34: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

34

Code Division Multiplexing (continued)

• Example (continued)– Three signals transmitted:

• Mobile A sends a 1, or 10111001, or +-+++--+• Mobile B sends a 0, or 10010001, or +--+---+• Mobile C sends a 1, or 11001101, or ++--++-+

– Summed signal received by base station: +3, -1, -1, +1, +1, -1, -3, +3

(to p35)

Page 35: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

35

Code Division Multiplexing (continued)

• Example (continued)– Base station decode for Mobile A:

• Signal received: +3, -1, -1, +1, +1, -1, -3, +3• Mobile A’s code: +1, -1, +1, +1, +1, -1, -1, +1• Product result: +3, +1, -1, +1, +1, +1, +3, +3

– Sum of Products: +12– Decode rule: For result near +8, data is binary

1

(to p36)

Page 36: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

36

Code Division Multiplexing (continued)

• Example (continued)– Base station decode for Mobile B:

• Signal received: +3, -1, -1, +1, +1, -1, -3, +3• Mobile A’s code: -1, +1, +1, -1, +1, +1, +1, -1• Product result: -3, -1, -1, -1, +1, -1, -3, -3

– Sum of Products: -12– Decode rule: For result near -8, data is binary

0

(to p3)

Page 37: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

37

Comparison of Multiplexing Techniques

(to p38)

Page 38: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

38

Comparison of Multiplexing Techniques (continued)

(to p3)

Page 39: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

39

Compression–Lossless versus Lossy

• Compression is another technique used to squeeze more data over a communications line

– If you can compress a data file down to one half of its original size, file will obviously transfer in less time

• Two basic groups of compression:1. Lossless – when data is uncompressed, original data

returns

2. Lossy – when data is uncompressed, you do not have the original data

1 vs 2

(to p4)

(to p41)

(to p44)

(to p40)

Page 40: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

40

Compression–Lossless versus Lossy (continued)

• Compress a financial file? – You want lossless

• Compress a video image, movie, or audio file?– Lossy is OK

• Examples of lossless compression include: – Huffman codes, run-length compression, and

Lempel-Ziv compression

• Examples of lossy compression include:– MPEG, JPEG, MP3

(to p39)

Page 41: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

41

Lossless Compression

• Run-length encoding– Replaces runs of 0s with a count of how many

0s.00000000000000100000000011000000000000000000001…

1100000000000

^

(30 0s)

14 9 0 20 30 0 11

(to p42)

Page 42: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

42

Lossless Compression (continued)

• Run-length encoding (continued)– Now replace each decimal value with a 4-bit

binary value (nibble)• Note: If you need to code a value larger than 15,

you need to use two consecutive 4-bit nibbles– The first is decimal 15, or binary 1111, and the second

nibble is the remainder» For example, if the decimal value is 20, you would

code 1111 0101 which is equivalent to 15 + 5

(to p43)

Page 43: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

43

Lossless Compression (continued)

• Run-length encoding (continued)– If you want to code the value 15, you still

need two nibbles: 1111 0000• The rule is that if you ever have a nibble of 1111,

you must follow it with another nibble

(to p39)

Page 44: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

44

Lossy Compression

• Relative or differential encoding – Video does not compress well using run-

length encoding– In one color video frame, not much is alike– But what about from frame to frame?

• Send a frame, store it in a buffer• Next frame is just difference from previous frame• Then store that frame in buffer, etc.

(to p45)

Page 45: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

45

5 7 6 2 8 6 6 3 5 66 5 7 5 5 6 3 2 4 78 4 6 8 5 6 4 8 8 55 1 2 9 8 6 5 5 6 6First Frame

5 7 6 2 8 6 6 3 5 66 5 7 6 5 6 3 2 3 78 4 6 8 5 6 4 8 8 55 1 3 9 8 6 5 5 7 6Second Frame

0 0 0 0 0 0 0 0 0 00 0 0 1 0 0 0 0 -1 00 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0Difference

Lossy Compression (continued)

(to p46)

Page 46: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

46

Lossy Compression (continued)

• Image Compression – One image (JPEG) or continuous images

(MPEG)– A color picture can be defined by

red/green/blue, or luminance/chrominance/chrominance which are based on RGB values

• Either way, you have 3 values, each 8 bits, or 24 bits total (224 colors!)

(to p47)

Page 47: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

47

Lossy Compression (continued)

• Image Compression (continued)– A VGA screen is 640 x 480 pixels

• 24 bits x 640 x 480 = 7,372,800 bits – Ouch!• And video comes at you 30 images per second – Double

Ouch!• We need compression!

• JPEG (Joint Photographic Experts Group)– Compresses still images– Lossy– JPEG compression consists of 3 phases:

• Discrete cosine transformations (DCT)• Quantization• Run-length encoding

(to p48)

Page 48: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

48

Lossy Compression (continued)

• JPEG Step 1 – DCT – Divide image into a series of 8x8 pixel blocks– If the original image was 640x480 pixels, the

new picture would be 80 blocks x 60 blocks (next slide)

– If B&W, each pixel in 8x8 block is an 8-bit value (0-255)

– If color, each pixel is a 24-bit value (8 bits for red, 8 bits for blue, and 8 bits for green)

(to p49)

Page 49: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

49

80 blocks

60 blocks

640 x 480 VGA Screen ImageDivided into 8 x 8 Pixel Blocks

Lossy Compression (continued)

(to p50)

Page 50: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

50

Lossy Compression (continued)

• JPEG Step 1 – DCT (continued) – So what does DCT do?

• Takes an 8x8 array (P) and produces a new 8x8 array (T) using cosines

• T matrix contains a collection of values called spatial frequencies

• These spatial frequencies relate directly to how much the pixel values change as a function of their positions in the block

(to p51)

Page 51: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

51

Lossy Compression (continued)

• JPEG Step 1 – DCT (continued) – An image with uniform color changes (little

fine detail) has a P array with closely similar values and a corresponding T array with many zero values

– An image with large color changes over a small area (lots of fine detail) has a P array with widely changing values, and thus a T array with many non-zero values

(to p52)

Page 52: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

52

Lossy Compression (continued)

• JPEG Step 2 -Quantization – The human eye can’t see small differences in

color• So take T matrix and divide all values by 10

– Will give us more zero entries» More 0s means more compression!

– But this is too lossy– And dividing all values by 10 doesn’t take into account

that upper left of matrix has more action (the less subtle features of the image, or low spatial frequencies)

(to p53)

Page 53: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

53

1 3 5 7 9 11 13 153 5 7 9 11 13 15 175 7 9 11 13 15 17 197 9 11 13 15 17 19 219 11 13 15 17 19 21 2311 13 15 17 19 21 23 2513 15 17 19 21 23 25 2715 17 19 21 23 25 27 29

U matrix

Q[i][j] = Round(T[i][j] / U[i][j]), for i = 0, 1, 2, …7 andj = 0, 1, 2, …7

Lossy Compression (continued)

(to p54)

Page 54: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

54

Lossy Compression (continued)

• JPEG Step 3 – Run-length encoding – Now take the quantized matrix Q and perform

run-length encoding on it• But don’t just go across the rows

– Longer runs of zeros if you perform the run-length encoding in a diagonal fashion

(to p55)

Page 55: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

55

Lossy Compression (continued)

(to p56)

Page 56: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

56

Lossy Compression (continued)

• How do you get the image back?– Undo run-length encoding– Multiply matrix Q by matrix U yielding

matrix T– Apply similar cosine calculations to get

original P matrix back

(to p39)

Page 57: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

57

Business Multiplexing In Action

• XYZ Corporation has two buildings separated by a distance of 300 meters

• A 3-inch diameter tunnel extends underground between the two buildings

• Building A has a mainframe computer and Building B has 66 terminals

• List some efficient techniques to link the two buildings.

• Possible solution(to p59)

(to p58)

Page 58: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

58

Business Multiplexing In Action (continued)

(to p57)

Page 59: 1 Lecture 05 Making Connections Efficient: Multiplexing and Compression

59

Business Multiplexing In Action (continued)

• Possible solutions – Connect each terminal to the mainframe computer

using separate point-to-point lines

– Connect all the terminals to the mainframe computer using one multipoint line

– Connect all the terminal outputs and use microwave transmissions to send the data to the mainframe

– Collect all the terminal outputs using multiplexing and send the data to the mainframe computer using a conducted line