1 / 25

Kingdom of Saudi Arabia high education ministry King Saud University

Kingdom of Saudi Arabia high education ministry King Saud University . المملكة العربية السعودية وزارة التعليم العالي جامعة الملك سعود. Data Link Layer Prepared By : Hind Annahidh supervised by : Dr.Soha. Outline . Data Link layer Issues Services Provided to NW/Layer Framing

elyse
Download Presentation

Kingdom of Saudi Arabia high education ministry King Saud University

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Kingdom of Saudi Arabia high education ministry King Saud University المملكة العربية السعودية وزارة التعليم العالي جامعة الملك سعود Data Link Layer Prepared By : Hind Annahidh supervised by : Dr.Soha

  2. Outline • Data Link layer Issues • Services Provided to NW/Layer • Framing • Error control • Flow control • Error-Correcting Codes

  3. Functions of the Data Link Layer • Provide service interface to the network layer • Dealing with transmission errors (Error control) • Regulating data flow (flow control ) Slow receivers not swamped by fast senders

  4. Relationship between packets and frames.

  5. Services Provided to Network Layer (a) Virtual communication. (b) Actual communication.

  6. Three possible types of connection • Unacknowledged connectionless service. • Acknowledged connectionless service. • Acknowledged connection-oriented service.

  7. Unacknowledged connectionless service • No logical connection is established. • No acknowledgment sent to sender by destination. • If the frame lost no attempt to detect the loss or recover from it It is Appropriate: When error rate is very low.

  8. Acknowledged connectionless service • No logical connection is established. • Each frame sent is acknowledged . It is Appropriate: - For unreliable channels such as wireless systems .

  9. Acknowledged connection-oriented service • Establish a connection before any data are transferred . • Each frame sent over connection is numbered. • Data link layer guarantees that each frame sent is indeed received. • Each frame is received exactly once and in the right order(because the frames are numbered)

  10. Framing 1- Framing by character count. A character stream. (a) Without errors. (b) With one error. Problem: Even if the error is detected, the receiver cannot figure out where the next frame starts ... its cannot resynchronize.

  11. Framing (cnt) 2- Framing by Flag bytes with byte stuffing (a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing. Problem: Too tied to the 8-bit per character format ... UNICODE uses 16-bits/char

  12. Framing (cnt) 3- Framing starting and ending flags with bit stuffing The goal is to have 01111110 as a unique bit pattern. Bit stuffing (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receiver’s memory after destuffing.

  13. Framing (cnt) 4-Physical layer coding violations It is applicable to networks in which the encoding on the physical medium contains some redundancy . Example : LANs encodes one bit of data by using 2 physical bits. 1 bit is a high-low 0 bit is low-high So the boundaries of the frame are either low-low or high-high

  14. Final note on framing Many data link protocols use a combination of a character count with one of the other methods (Extra safety)

  15. Error control To ensure reliable delivery : provide the sender with feedback Back frame called acknowledgment If sender does not get acknowledgment at all Frame does not arrive so ,there is no reason to send ack Acknowledgment may be lost

  16. PROBLEM : If the frame does not arrive : the sender will wait for along time. SOLUSION: Timer in Data link layer . PROBLEM : When the acknowledgment lost , the sender will send the same frame more than one time SOLUSION: Assign sequence numbers to outgoing frames so the frame will be discarded if it arrives more than one

  17. Flow control If the sender wants to transmit frames faster than the receiver can accept them . • Feedback-based flow control : Receiver sends back information to sender giving it permission to send more data • Rate based flow control : built in mechanism that limits the rate at which senders may transmit data without using feedback from the receiver .

  18. Error Detection and Correction Error-Correcting Codes On channels that are less reliable such as wireless links-makes many errors Error-Detecting Codes On channels that are highly reliable

  19. Error correcting code Hamming Code • Mark all bit positions that are powers of two as parity bits. (positions 1, 2, 4, 8, 16, 32, 64, etc.) • All other bit positions are for the data to be encoded. (positions 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, etc.) • Each parity bit calculates the parity for some of the bits in the code word. The position of the parity bit determines the sequence of bits that it alternately checks and skips. Position 1: check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc. (1,3,5,7,9,11,13,15,...)Position 2: check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc. (2,3,6,7,10,11,14,15,...)Position 4: check 4 bits, skip 4 bits, check 4 bits, skip 4 bits, etc. (4,5,6,7,12,13,14,15,20,21,22,23,...)etc.

  20. Hamming Code (cnt) • Set a parity bit to 1 if the total number of ones in the positions it checks is odd. Set a parity bit to 0 if the total number of ones in the positions it checks is even.

  21. Hamming Code Example A byte of data: 10011010 Create the data word,leaving spaces for the parity bits: _ _ 1 _ 0 0 1 _ 1 0 1 0Calculate the parity for each parity bit (a ? represents the bit position being set): Position 1 checks bits 1,3,5,7,9,11: ? _ 1 _ 0 0 1 _ 1 0 1 0. Even parity so set position 1 to a 0: 0 _1 _ 0 0 1 _ 1 0 1 0 Position 2 checks bits 2,3,6,7,10,11:0 ? 1_ 0 0 1 _ 1 0 1 0. Odd parity so set position 2 to a 1: 0 1 1 _ 0 0 1 _ 1 01 0 .

  22. Hamming Code Example (cnt) Position 4 checks bits 4,5,6,7,12:0 1 1? 0 0 1 _ 1 0 1 0. Odd parity so set position 4 to a 1: 0 1 1 1 0 0 1_ 1 0 1 0 Position 8 checks bits 8,9,10,11,12:0 1 1 1 0 0 1 ? 1 0 1 0. Even parity so set position 8 to a 0: 0 1 1 1 0 0 1 0 1 0 1 0 Code word: 011100101010

  23. Finding and fixing a bad bit Suppose the word that was received was 011100101110 instead of 011100101010 Where is the bad bit ?

  24. Finding and fixing a bad bit Write down all the incorrect parity bits parity bits 2 and 8 are incorrect  2 + 8 = 10, and that bit position 10 is the location of the bad bit

  25. References • Computer Networks (textbook) • School of computing and information science (website) http://www.cis.fiu.edu/ http://users.cs.fiu.edu/~downeyt/cop3402/hamming.html

More Related