Presentation is loading. Please wait.

Presentation is loading. Please wait.

Physical Link Layer.

Similar presentations


Presentation on theme: "Physical Link Layer."— Presentation transcript:

1 Physical Link Layer

2 Multiplexing Techniques

3 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

4 Frequency Division Multiplexing

5 Time Division Multiplexing
T1 BW = 193 bits / 125 us = Mbps

6 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.

7 Multiple T1 Lines Can be Multiplexed to Form T2/T3/T4 Lines
7 6 T3 BW = Mbps = T1 * 4 * 7.

8 (Dense) Wavelength Division Multiplexing On Optical Fibers
The Internet backbone network’s hope!

9 SONET Links Build The Backbones of Internet
BW of OC-1 is 810 bits / 125 us = Mbps

10 SONET Hierarchy OC-192 (10 Gbps) links are common in the Internet.

11

12 02/24/2009 Traffic between TANET and Internet

13 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

14 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.

15 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.

16 Data Link Layer

17 Data Link Layer (L2) Provides A Virtual Data Path for Network Layer (L3)

18 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

19 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

20 Logical Link Control (LLC) layer

21 IEEE Standard

22 Multiplexing Using LLC

23 LLC PDU Format

24 Control Field Definition of LLC

25 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.

26 The Character Count Method’s Problem

27 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.

28 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 ( ) to appear in the data stream.

29 SLIP and PPP Are Two Popular Framing Protocols

30 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.

31 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.

32 Error Detection and Correction

33 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.

34 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., ( ) xor ( ) = The HD distance is 2. Therefore, using parity bit scheme, we can detect one bit error.

35 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., represents x^5 + x^4 + 1 Polynomial arithmetic is done module 2. (xor) E.g., = , – = The sender and receiver agree upon a generator polynomial G(x)

36 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.

37 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.

38 A CRC computation example.

39 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.

40 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 = When the n1’th, n2’th, .., nk’th parity bits are wrong, the (n1+n2+ … +nk)’th data bit is in error.

41 Transmitting HC Codewords Vertically Can Make HC Correct a Burst of Errors
Although HC can correct only one bit error …

42 Error Control (Retransmission)

43 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?)

44 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

45 Stop-And-Wait’s Throughput Analysis

46 Sliding Window Scheme Example

47 Sliding Window Scheme Example

48 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.


Download ppt "Physical Link Layer."

Similar presentations


Ads by Google