Download presentation
Presentation is loading. Please wait.
1
CSC 3352 Computer Communications Chapter 3&41 The Link Layer Has 2 main Components The Data Link Layer Medium Access Control (MAC) Examples:SLIP, PPP, Ethernet.
2
CSC 3352 Computer Communications Chapter 3&42 Logical Link Layer Function Provides service to the network layer Has two Components 1. Data link layer Framing Error Handling Flow control 2. Medium access control In the case of a shared medium, this function provides means for sharing optimally the medium
3
CSC 3352 Computer Communications Chapter 3&43 Framing What is it? breaking up the bits into discrete frames and checking the total number of received bits (the checksum)… Why? to ensure that the number and the value of the sent and the received bits are exact… How? character count, Start/Stop characters, Start/stop flags
4
CSC 3352 Computer Communications Chapter 3&44 Character Count 51234567898012345687890123 Frame 1 with 5 char Frame 4 with 8 char Character count 51234767898012345687890123 Frame 1 with 5 char Transmission Error New Character counts The problem with this method is:
5
CSC 3352 Computer Communications Chapter 3&45 Start/Stop characters A DLEB A B STXDLEETX DLE Stuffed DLE A DLEB STX is Start of TeXt DLE is Data Link Escape ETX End of TeXt
6
CSC 3352 Computer Communications Chapter 3&46 Start/stop flags
7
CSC 3352 Computer Communications Chapter 3&47 Error Handling… What is it? A mechanism to make sure all frames are delivered to the right destination and in the right order and only once… Why? The sent data may be corrupted or vanish in the network… How? Give feedback to the source machine by acknowledging the reception and using temporal flags (i.e. a timer)… Then after correcting the errors…
8
CSC 3352 Computer Communications Chapter 3&48 Error Handling Error detection 1. Parity bit 2D/Crossed parity Hamming code Error correction Hamming Code
9
CSC 3352 Computer Communications Chapter 3&49 Parity bit The sender adds a parity bit to the end of the word such that the total number of bits (including the parity bit) is even (Even parity) 01110110 becomes 011101101 Detects only odd number of corrupted bits… Why?
10
CSC 3352 Computer Communications Chapter 3&410 2D/Crossed Parity
11
CSC 3352 Computer Communications Chapter 3&411 Hamming code (Detecting + Correcting) Hamming distance of two WORDS is the number of bits that differ (exclusive OR between the 2 words) Example: 10001001 and 10110001, the Hamming distance is 3… The Hamming distance of a list of codewords is the smallest distance between any pair of codewords on this list
12
CSC 3352 Computer Communications Chapter 3&412 Assume the following list of valid codewords: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 What is the hamming distance of this list? It is 5 since the smallest distance between any two codewords of this list is 5 Hamming code (Detecting + Correcting)
13
CSC 3352 Computer Communications Chapter 3&413 How can we use hamming codes in errors detection/correction Codeword= Data + Checkbits N bits = M bits + R bits Given the structure codewords, we can build a complete list of valid codewords… A Hamming distance of d will allow to detect up to (n-1) corrupted bits… Why? A Hamming distance of d will allow to correct up to (n/2) or ((n-1)/2) corrupted bits… Why?
14
CSC 3352 Computer Communications Chapter 3&414 Hence: we need a distance of d+1 to detect d errors… we need a distance of 2d+1 to correct d errors… A hamming distance of 5bits can: detect errors of 4bits correct errors of 2bits See the example in page 185 Generally, Checkbits bits are put at power of 2 positions (1, 2, 4, 8, etc.) and Data elsewhere... Hamming code (Detecting + Correcting)
15
CSC 3352 Computer Communications Chapter 3&415 Building a Hamming Code of Distance 3
16
CSC 3352 Computer Communications Chapter 3&416 Family of Hamming Codes…
17
CSC 3352 Computer Communications Chapter 3&417 Flow Control (FC) What is it? Synchronization mechanism to allow faster machines and slow machines to coexist on the net… Why? The flow of faster machines is higher than the one of slow machines… How? Throttling the sender into sending no more than the receiver’s capacity The basic principle: Send n frames now but, after they have been sent, don’t send any more until getting an OK to continue… The protocol contains well defined rules about when a sender may transmit the next frame…
18
CSC 3352 Computer Communications Chapter 3&418 Elementary FC protocols: fundamentals Read carefully pages 191..193 for the basic definitions of the standard variables and functions that are used…
19
CSC 3352 Computer Communications Chapter 3&419 Elementary FC protocols: example 1 The unrestricted Simplex Protocol… The Utopia Protocol (fig. 3-9, page 196)
20
CSC 3352 Computer Communications Chapter 3&420 Elementary FC protocols: Example 2 A simplex protocol for noisy channels… The stop and wait Protocol (fig. 3-10, page 198)
21
CSC 3352 Computer Communications Chapter 3&421 Elementary FC protocols: Example 3 A positive acknowledgement with retransmission protocol
22
CSC 3352 Computer Communications Chapter 3&422 See fig. 3-13 page 205 Elementary FC protocols: Example 4
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.