Physical Link Layer
Multiplexing Techniques
Multiplexing: A Way for Multiple Channels of Data to Share a Media Frequency Division Multiplexing (FDM) E.g., AM/FM radio, Wireless channels Time Division Multiplexing (TDM) E.g., T1/T3 Wavelength Division Multiplexing (WDM) E.g. OC-3/OC-12
Frequency Division Multiplexing
Time Division Multiplexing T1 BW = 193 bits / 125 us = 1.544 Mbps
T1 Line Was Originally Developed to Carry 24 Voice Signals There was no Internet (Data services) at that time! Voice signal’s effective frequency range is between 0 ~ 4 kHZ. According to the “Sampling theorem”, 8 kHZ sampling rate is needed. (thus one sample every 125 us) Using Pulse Code Modulation (PCM), each sample can be 7/8 bits.
Multiple T1 Lines Can be Multiplexed to Form T2/T3/T4 Lines 7 6 T3 BW = 44.736 Mbps = T1 * 4 * 7.
(Dense) Wavelength Division Multiplexing On Optical Fibers The Internet backbone network’s hope!
SONET Links Build The Backbones of Internet BW of OC-1 is 810 bits / 125 us = 51.84 Mbps
SONET Hierarchy OC-192 (10 Gbps) links are common in the Internet.
02/24/2009 Traffic between TANET and Internet
Ethernet Hub Instead of using a ring topology for connecting all Ethernet devices, a star topology is used for better fault isolation. An Ethernet hub is the center point of a star topology. It propagates the signal received from one link to all other links. Hub
Ethernet Hub (Cont’d) A Tx+ Rx+ Rx- B Tx+ Rx+ Rx- A C B Tx- Tx- When using an Ethernet hub, full-duplex cannot be used, only half-duplex can be used. Only one transfer at one time.
Ethernet Switch C A B D When using an Ethernet switch, full-duplex can be used. Many transfers (e.g., A->D and B->C) can happen at the same time.
Data Link Layer
Data Link Layer (L2) Provides A Virtual Data Path for Network Layer (L3)
A Layer-3 Link May Be Composed of Many Layer-2 Links (Switches). Taipei Hsinchu A single link at the data link layer A single link at the network layer
Common Services Provided by Layer 2 Unacknowledged connectionless service E.g., IP network. Simple and robust, but hard to provide QoS. Acknowledged connectionless service L2 acknowledgement is not a requirement. Transport layer can do the same job. When BER is high, L2 ACK can significantly improve performance. Acknowledged connection-oriented service Need to set up a connection first, then transfer data, then tear down the connection. No packet reordering, duplicate packets Long connection set up delay, not suitable for short-lived data transfers
Logical Link Control (LLC) layer
IEEE 802.2 Standard
Multiplexing Using LLC
LLC PDU Format
Control Field Definition of LLC
Four Framing Methods Character count Only useful on top of a reliable data stream Starting and ending characters, with character stuffing Good for text files, may have problem with binary files Starting and ending flags, with bit stuffing Physical layer violations In a particular data encoding scheme, use the signal pattern that is impossible to appear to represent the flag.
The Character Count Method’s Problem
The Flag (Preamble/Postamble) Method If errors corrupt one flag, we can simply wait until the next flag to show up, which indicate the beginning of another frame.
Bit Stuffing To Avoid the Flag to Appear in the Data Stream By putting a 0 after 5 consecutive 1s, we can avoid the flag (01111110) to appear in the data stream.
SLIP and PPP Are Two Popular Framing Protocols
SLIP’s Framing Format Problems with SLIP: There is no type field. Only IP is supported. Each end must know the other’s IP address There is no checksum to detect errors.
PPP’s Framing Format Support multiple protocols (IP is just one of them) Has CRC to detect errors Has link and network control protocols (LCP and NCP) to set up a link, negotiate IP addresses, exchange gateway and DNS information.
Error Detection and Correction
Error Detection and Correction Codes General idea: add some redundant bits to a frame to detect or correct errors. Suppose that each frame has m data bits, we add r redundant bits, so that the total length is n bits. (n = m + r) Depending on how we generate these r bits, the resulting 2m n-bit strings form a particular set of codewords. The hamming distance (HD) between two codeword A and B is the number of 1 bits of A xor B. The HD of a set of codewords is the minimum of the HD of any pair of two codewords.
HD = D+1 Can Detect D Errors E.g., Parity bit Even or odd The even parity bit is set to 1 if the number of 1 in the data frame plus the resulting parity bit is even. The Hamming distance of parity codewords is 2. E.g., (1111111+ 1 ) xor (1111110 + 0) = 00000011 The HD distance is 2. Therefore, using parity bit scheme, we can detect one bit error.
Cyclic Redundancy Code For Error Detection Also called polynomial codes because we treat a bit string as the representation of a polynomial with coefficients of 0 and 1 only. E.g., 110001 represents x^5 + x^4 + 1 Polynomial arithmetic is done module 2. (xor) E.g., 10011011 + 11001010 = 01010001, 11110000 – 10100110 = 01010110 The sender and receiver agree upon a generator polynomial G(x)
The Idea Behind CRC The idea is to compute a r-bit CRC and append it to the end of the m-bit data frame so that the resulting polynomial x^r * M(x) is divisible by G(x). When the receiver receives the (m+r)-bit frame, it also divide it by G(x). If it is divisible, then there is no error. Otherwise, the frame is in error.
CRC Computation Let r be the degree of G(x), append r 0 bits to the end of the frame to generate x^r * M(x). Divide x^r* M(x) by G(x) using module 2 division. Subtract the remainder from the bit string of x^r * M(x) using module 2 subtraction. The resulting string T(x) now is divisible by G(x). T(x) then is transmitted to the receiver.
A CRC computation example.
A Good G(x) Can Detect Many Different Types of Errors A polynomial code with r CRC check bits will detect all burst errors of length <= r. If the burst length is r+1, the probability of detecting the error is 1/ (2^(r-1)) If the burst length > r+1, the probability is 1/(2 ^ r). E.g., CRC-16 = x^16 + x^15 + x^2 + 1 All burst errors < = 16 bits can be detected. 99.996% to detect burst errors of 17 bits 99.998% to detect all burst errors > 17 bits.
HD = 2D+1 Can Correct D Errors The Hamming code: HD = 3, thus can correct one bit of error The bits of 1, 2, 4, 8, 16, 2^k are parity bits. The rest bits are filled with m data bit. If a data bit’s position is expressed as 2^k1 + 2 ^k2 + 2^k3 …, it contributes to the parity bit computations at positions 2^k1, 2^k2, 2^k3, … E.g., 11 = 1 + 2 + 8 When the n1’th, n2’th, .., nk’th parity bits are wrong, the (n1+n2+ … +nk)’th data bit is in error.
Transmitting HC Codewords Vertically Can Make HC Correct a Burst of Errors Although HC can correct only one bit error …
Error Control (Retransmission)
Retransmission is unavoidable Error correcting codes cannot correct all errors. Also, sometimes a whole frame may be lost due to congestion. Data retransmission of corrupted or lost data thus is unavoidable for a reliable transfer. Fortunately, using sequence numbers enables packet losses to be easily detected. Also error detecting codes such as CRC can detect transmission errors with high probabilities. However, do not forget that some errors still happen undetected! (Did you ever receive a broken FTPed file?)
Error and Flow Control Schemes Stop-and-wait Only 1 outstanding frame, simple, but low throughput Also called ARQ (Automatic Repeat reQuest) Sliding window protocols N outstanding frames, complicated, but high throughput Go-back-N Selective repeat
Stop-And-Wait’s Throughput Analysis
Sliding Window Scheme Example
Sliding Window Scheme Example
Ethernet’s Frame Format The source and destination addresses are each 6-byte long. Each Ethernet card has a globally unique 6-byte MAC (medium access control) address.