Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 76 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
76
Dung lượng
3,53 MB
Nội dung
Data Communication and Networking Dr –Ing Vo Que Son Email: sonvq@hcmut.edu.vn Telecomm Dept Faculty of EEE DCN HCMUT Content Chapter 1: Medium of PHY Layer Wired and Wireless Media Physical layer standards: RS232, RS422, RS485 Line Coding Digital modulation/demodulation Channel parameters Gaussian noise and BER Chapter 2: Data Communications Asynchronous transmission Synchronous transmission Channel Coding Data Compression Telecomm Dept Faculty of EEE DCN HCMUT Coding schemes EBCDIC (Extended Binary Coded Decimal Interchange Code): Invented by IBM 8-bit character encoding used mainly on IBM mainframe and IBM midrange computer operating systems ASCII (American Standards Committee for Information Interchange): defined by ITU-T character-encoding scheme originally based on the English alphabet that encodes 128 specified characters - the numbers 09, the letters a-z and A-Z, some basic punctuation symbols, some control codes that originated with Teletype machines, and a blank space - into the 7-bit binary integers ASCII codes represent text in computers, communications equipment, and other devices that use text Most modern character-encoding schemes are based on ASCII, though they support many additional characters Telecomm Dept Faculty of EEE DCN HCMUT EBCDIC Table Data characters Control characters Telecomm Dept Faculty of EEE DCN HCMUT ASCII Table Data characters Control characters Telecomm Dept Faculty of EEE DCN HCMUT ASCII Table ASCII unprintable characters: Telecomm Dept Faculty of EEE DCN HCMUT Network Topology Bus Point-to point Star Multipoint Ring Mesh Telecomm Dept Faculty of EEE DCN HCMUT Communication types Simplex communication is permanent uni-directional communication (e.g Radio, TV) Half duplex: A half duplex link can communicate in only one direction, at a time Two way communication is possible, but not simultaneously E.g talkback radio, Citizen Bands radio Full duplex communication is two-way communication achieved over a physical link that has the ability to communicate in both directions simultaneously E.g Telephone system Telecomm Dept Faculty of EEE DCN HCMUT Transmission modes The transmission of binary data across a link can be accomplished in either parallel or serial mode In parallel mode, multiple bits are sent with each clock tick In serial mode, bit is sent with each clock tick While there is only one way to send parallel data, there are three subclasses of serial transmission: asynchronous, synchronous, and isochronous Telecomm Dept Faculty of EEE DCN HCMUT Parallel transmission Bits are transmitted in bus at the same time High speed over short distance Example: PC-printer Telecomm Dept Faculty of EEE DCN HCMUT 10 Sources of Compressibility Redundancy Recognize repeating patterns Exploit using • Dictionary • Variable length encoding Human perception Less sensitive to some information Can discard less important data Telecomm Dept Faculty of EEE DCN HCMUT 62 Data Compression Packed Decimal: A packed decimal representation stores two decimal digits in one byte For example, the value 23 would be stored in two nibbles, using the hexadecimal digits and (the bit representation would be 0010 0011) Relative coding: instead of transmitting the whole number value, the transmitter only transmits the difference between values Character Suppression: when transmitting the same continuous printable characters, all the same continuous characters will be encoded with a representative character and the number of this character Example: AAAAABBBBCC = A5B4C2 Telecomm Dept Faculty of EEE DCN HCMUT 63 Huffman What is difference in this table? Why the length of letter A, E is shorter than the length of letter Y, Z? What is the basic principle to build this Morse table? Telecomm Dept Faculty of EEE DCN HCMUT 64 Huffman code Huffman coding is statistical coding technique Approach Variable length encoding of symbols Exploit statistical frequency of symbols Efficient when symbol probabilities vary widely Principle Use fewer bits to represent frequent symbols Use more bits to represent infrequent symbols A A A Telecomm Dept Faculty of EEE A B B A A DCN HCMUT 65 Huffman Code Example Expected size Symbol A B C D Frequency 13% 25% 50% 12% Original Encoding 00 01 10 11 Huffman Encoding bits bits bits bits 110 10 bits bits 111 bit bits Original 1/82 + 1/42 + 1/22 + 1/82 = bits/symbol Huffman 1/83 + 1/42 + 1/21 + 1/83 = 1.75 bits/symbol Telecomm Dept Faculty of EEE DCN HCMUT 66 Huffman coding principle Encoding Calculate frequency of symbols Create binary tree representing “best” encoding Use binary tree to encode symbols • For each symbol, output path from root to leaf • Size of encoding = length of path Save binary tree Symbol Stage Stage Stage S0 0.4 0.4 0.4 0.6 S1 0.2 0.2 0.4 0.4 S2 0.2 0.2 0.2 S3 0.1 S4 0.1 Telecomm Dept Faculty of EEE 0.2 Stage Codeword 00 10 11 010 011 DCN HCMUT 67 Huffman coding principle Decoding Read compressed file & binary tree Use binary tree to decode file Follow path from root to leaf Example: Encoder Telecomm Dept Faculty of EEE Decoder DCN HCMUT 68 Performance Evaluation Entropy: H=pi log2 (1/pi) (bits/symbol) Average length of codewords: N = piNi (bits/symbol) Variance: measure what? 2=pi (Ni-N)2 Efficiency of codeword set: h = H/N Bit rate (after encoding): Rb= RS.N Telecomm Dept Faculty of EEE (bps), RS is the symbol rate (symbol/s) DCN HCMUT 69 Huffman Code Properties Prefix code No codeword is a prefix of another codewords Example: • Huffman(“I”) • Huffman(“X”) 00 001 // not legal prefix code Can stop as soon as complete code found No need for end-of-code marker (auto-terminated) Non-deterministic Multiple Huffman coding possible for same input If more than two trees with same minimal weight Telecomm Dept Faculty of EEE DCN HCMUT 70 Run-Length coding Run-length encoding is probably the simplest method of compression It can be used to compress data made of any combination of symbols It does not need to know the frequency of occurrence of symbols and can be very efficient if data is represented as 0s and 1s The general idea behind this method is to replace consecutive repeating occurrences of a symbol by one occurrence of the symbol followed by the number of occurrences The method can be even more efficient if the data uses only two symbols (for example and 1) in its bit pattern and one symbol is more frequent than the other Telecomm Dept Faculty of EEE DCN HCMUT 71 Run-Length coding Used in Black-White Facsimile Page is divided into: Height: 3.85-7.7 lines/mm Width: 8.05 (pels/mm) Each unencoded Fax page contains about 2Mb Telecomm Dept Faculty of EEE DCN HCMUT 72 Run-Length coding Each line in a page will have a number of black/white pixel continuous sequence Each continuous bit sequence is encoded by Termination code: in the range 63 switches between black and white code Makeup code: can extend length of a run by a multiple of 64 EOL is inserted at the end of each line (EOL=00000000001) End of each page will be ended with EOL Telecomm Dept Faculty of EEE DCN HCMUT 73 Run-Length coding Example 1: line with w, b, 200 w, b, EOL! 0111 011 010111 10011 10 00000000001 Example 2: What is the transmitted bit stream? Telecomm Dept Faculty of EEE DCN HCMUT 74 Lempel Ziv encoding Lempel Ziv (LZ) encoding is an example of a category of algorithms called dictionary-based encoding The idea is to create a dictionary (a table) of strings used during the communication session If both the sender and the receiver have a copy of the dictionary, then previously-encountered strings can be substituted by their index in the dictionary to reduce the amount of information transmitted Telecomm Dept Faculty of EEE DCN HCMUT 75 Lossy Compression Methods JPEG (Joint Photographic Experts Group) MPEG (Moving Picture Experts Group) MP3 (MPEG audio layer 3) Telecomm Dept Faculty of EEE DCN HCMUT 76