Data Link Layer Protocols
42 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

The order of G(x) represents the number of data bits.

False (B)

The most significant and least significant terms of the generator polynomial must be non-zero.

True (A)

The sender uses G(x) to encrypt the message.

False (B)

The receiver uses G(x) to detect any errors.

<p>True (A)</p> Signup and view all the answers

In the sender algorithm, all operations are modulo 4.

<p>False (B)</p> Signup and view all the answers

A character count field in the header specifies the number of bytes in the frame.

<p>True (A)</p> Signup and view all the answers

The character count method is widely used due to its reliability, even in the presence of errors.

<p>False (B)</p> Signup and view all the answers

Flag bytes are typically used only at the start of a frame to signal its beginning.

<p>False (B)</p> Signup and view all the answers

Each frame starts and ends with different flag bytes.

<p>False (B)</p> Signup and view all the answers

The data link layer at the destination disregards the character count.

<p>False (B)</p> Signup and view all the answers

In bit stuffing, bits are added to the data stream by the sender.

<p>True (A)</p> Signup and view all the answers

In bit destuffing, bits are removed from the data stream by the receiver.

<p>True (A)</p> Signup and view all the answers

Forward Error Correction (FEC) involves requesting re-transmission of data when errors are detected.

<p>False (B)</p> Signup and view all the answers

Automatic Repeat Request (ARQ) uses error-detecting codes.

<p>True (A)</p> Signup and view all the answers

In error-correcting codes, redundant bits are added to the data bit stream.

<p>True (A)</p> Signup and view all the answers

If the number of data bits is m, the number of legal codewords is $2^m$.

<p>True (A)</p> Signup and view all the answers

The Hamming distance between 10001001 and 10110001 is 5.

<p>False (B)</p> Signup and view all the answers

The Hamming distance represents the maximum number of bit differences between two codewords.

<p>False (B)</p> Signup and view all the answers

Error correction is always possible, even if a valid codeword is converted into another valid codeword.

<p>False (B)</p> Signup and view all the answers

To detect d errors, you need a code with a minimum Hamming distance of d + 1.

<p>True (A)</p> Signup and view all the answers

A code with a Hamming distance of 5 can correct up to 3 errors.

<p>False (B)</p> Signup and view all the answers

If a transmitted frame has a Hamming distance of d from the received frame, then d errors occurred during transmission.

<p>True (A)</p> Signup and view all the answers

If the receiver gets an invalid codeword, it will choose the valid codeword that is farthest away.

<p>False (B)</p> Signup and view all the answers

In Hamming code, bits that are powers of 3 are check bits.

<p>False (B)</p> Signup and view all the answers

In Hamming code, data bits occupy positions that are powers of 2.

<p>False (B)</p> Signup and view all the answers

In Hamming code, data bit 10 contributes to the computation of check bits 2 and 8.

<p>True (A)</p> Signup and view all the answers

In the example, the frame is 1101011011.

<p>True (A)</p> Signup and view all the answers

In the example, the generator is 10010.

<p>False (B)</p> Signup and view all the answers

Four zero bits are appended to the original message before the division.

<p>True (A)</p> Signup and view all the answers

The transmitted frame in the example is 11010110111110.

<p>True (A)</p> Signup and view all the answers

The receiver divides the received bit string by the bit string corresponding to G(x).

<p>True (A)</p> Signup and view all the answers

If the remainder is equal to 1 after division at the receiver, no errors occurred.

<p>False (B)</p> Signup and view all the answers

If remainder != 0, no errors occurred.

<p>False (B)</p> Signup and view all the answers

The appended bits are the result of a modulo-2 division.

<p>True (A)</p> Signup and view all the answers

The error-detection capability is independent of the $G(x)$ polynomial choice.

<p>False (B)</p> Signup and view all the answers

The polynomial $G(x) = x^{32} + x^{26} + x^{23} + x^{22} + x^{16} + x^{12} + x^{11} + x^{10} + x^{8} + x^{7} + x^{5} + x^{4} + x^{2} + x^{1} + 1$ can detect all bursts of errors of length 32 bits or less.

<p>True (A)</p> Signup and view all the answers

The polynomial $G(x) = x^{32} + x^{26} + x^{23} + x^{22} + x^{16} + x^{12} + x^{11} + x^{10} + x^{8} + x^{7} + x^{5} + x^{4} + x^{2} + x^{1} + 1$ can detect all bursts of even number of errors.

<p>False (B)</p> Signup and view all the answers

Automatic Repeat Request (ARQ) protocols include Stop-and-Wait, Go-Back-N, and Selective Repeat.

<p>True (A)</p> Signup and view all the answers

In the Stop-and-Wait protocol, the sender transmits multiple frames at a time before waiting for an acknowledgment.

<p>False (B)</p> Signup and view all the answers

In Stop-and-Wait, if a frame is received with error, the receiver sends a negative acknowledgment (NAK) to the sender.

<p>False (B)</p> Signup and view all the answers

A lost ACK in the basic Stop-and-Wait protocol can cause the receiver to receive duplicate frames.

<p>True (A)</p> Signup and view all the answers

In the modified Stop-and-Wait protocol, the receiver ignores the sequence number of the incoming frame.

<p>False (B)</p> Signup and view all the answers

Flashcards

Character Count

A field in the header that specifies the number of characters in the frame. It tells the receiver how many characters to expect.

Character Count Vulnerability

If a transmission error alters the character count, the receiver may misinterpret the frame boundaries and fail to locate the start of the next frame.

Flag Bytes

Special bytes (FLAG) that mark the beginning and end of a frame. Often the same byte is used for both start and end.

Bit Stuffing

Inserting a '0' bit after five consecutive '1's in a data stream.

Signup and view all the flashcards

Error Control

A method for managing errors in data transmission.

Signup and view all the flashcards

Forward Error Correction (FEC)

Receiver corrects errors using redundant info.

Signup and view all the flashcards

Automatic Repeat Request (ARQ)

Receiver requests re-transmission upon error detection.

Signup and view all the flashcards

Error-Correcting Codes

Adding extra bits to a data stream for error detection/correction.

Signup and view all the flashcards

Data Bits (m)

The original message before adding redundant bits.

Signup and view all the flashcards

Check Bits (r)

Added bits for error detection/correction.

Signup and view all the flashcards

Hamming Distance

Bits that differ between two codewords.

Signup and view all the flashcards

Order of G(x) (r)

The number of check bits added to data bits in CRC.

Signup and view all the flashcards

G(x) Term Requirements

Ensures the polynomial can detect errors at both ends of the data.

Signup and view all the flashcards

Role of G(x)

Used by sender to generate check bits and by receiver to detect errors.

Signup and view all the flashcards

Appending Zeros to Frame

Padding the frame with zeros allows for the long division by G(x).

Signup and view all the flashcards

Transmitted Frame T(x)

The final frame that is transmitted after adding the remainder to the original frame.

Signup and view all the flashcards

Frame

A sequence of bits representing data transmitted over a communication channel.

Signup and view all the flashcards

Generator (CRC)

A pre-defined bit sequence used in CRC (Cyclic Redundancy Check) for error detection.

Signup and view all the flashcards

Appending Zero Bits

Process of adding extra bits (usually zeros) to the message before applying the generator in CRC.

Signup and view all the flashcards

Remainder (CRC)

The result of dividing the message (with appended zeros) by the generator in CRC.

Signup and view all the flashcards

Transmitted Frame (CRC)

The complete bit sequence transmitted, including the original message and the CRC remainder.

Signup and view all the flashcards

Receiver Algorithm (CRC)

Algorithm used by the receiver to verify the integrity of the received frame.

Signup and view all the flashcards

Division at Receiver (CRC)

The process of dividing the received bit string by the generator at the receiver's end.

Signup and view all the flashcards

Remainder Interpretation (CRC)

In CRC, a zero remainder indicates no errors, while a non-zero remainder indicates that errors have occurred during transmission.

Signup and view all the flashcards

Undetectable Errors

Errors are undetectable if a valid codeword transforms into another valid codeword.

Signup and view all the flashcards

Error Detection Code

To detect 'd' errors, you need a code with a minimum Hamming distance of 'd + 1'.

Signup and view all the flashcards

Error Correction Code

To correct 'd' errors, you need a code with a minimum Hamming distance of '2d + 1'.

Signup and view all the flashcards

Hamming Distance and Errors

The Hamming distance between the transmitted and received frame will be 'd'.

Signup and view all the flashcards

Closest Valid Codeword

The receiver chooses the closest valid codeword (minimum Hamming distance).

Signup and view all the flashcards

Hamming Code Check Bits

In Hamming code, bits that are powers of 2 (1, 2, 4, 8, 16,...) are check bits.

Signup and view all the flashcards

Hamming Code Data Bits

In Hamming code, non-power-of-2 bits are data bits.

Signup and view all the flashcards

Hamming Code Contribution

Rewrite the bit position 'k' as a sum of powers of 2 to see which check bits it contributes to.

Signup and view all the flashcards

G(x) in Ethernet

A standard polynomial in Ethernet used for error detection. An example is G(x) = x32 +x26 +x23 +x22 +x16 +x12 +x11 +x10 +x8 +x7 +x5 +x4 +x2 +x1 +1.

Signup and view all the flashcards

Error Detection by G(x)

G(x) can detect error bursts of a specific length. For example, x32 can detect bursts of 32 bits or less and odd number of errors.

Signup and view all the flashcards

Stop-and-Wait Protocol

A retransmission strategy where the sender transmits one frame at a time and waits for an acknowledgment (ACK) before sending the next.

Signup and view all the flashcards

Stop-and-Wait Timeout

When the sender doesn't receive an ACK in time, it retransmits the frame.

Signup and view all the flashcards

Lost ACK Problem

A problem in Stop-and-Wait where a lost ACK causes the sender to retransmit a frame that was already received, leading to duplication.

Signup and view all the flashcards

Modified Stop-and-Wait

A modification to Stop-and-Wait where each frame includes a sequence number to help the receiver distinguish new frames from duplicates.

Signup and view all the flashcards

Sequence Number Check

The receiver checks the sequence number to determine if a frame is new or a duplicate; duplicate frames are discarded.

Signup and view all the flashcards

Study Notes

  • The main task of the data link layer is to transform a raw transmission facility into a virtual communication channel for sending frames error-free
  • The main design issues of the data link layer include framing, error detection and correction, and flow control

Framing

  • Framing involves breaking the received bit stream into discrete frames
  • A frame and packet are distinct units in data transmission.
  • Framing methods include character count, flag bytes with byte stuffing, and start/end flags with bit stuffing.

Character Count

  • A field in the header specifies the number of characters in the frame
  • If the data link layer at the destination finds a character count, it knows how many characters follow and where the end of the frame is
  • Character count can be changed by a transmission error, which makes it unreliable
  • Due to error vulnerability, the character count method is rarely used.

Flag Bytes with Byte Stuffing

  • Each frame starts and ends with special flag bytes (FLAG)
  • Protocols often mark the start and the end of a frame with the same FLAG byte
  • Two consecutive FLAG's indicate the end of a frame and the start of a new frame
  • The FLAG's bit pattern might occur in the data and cause issues
  • A solution is byte stuffing or character stuffing
  • The sender's data link layer inserts a special escape byte (ESC) before each "accidental" flag byte in the data
  • The receiver's data link layer removes ESC before passing the data to the network layer, and understands that the FLAG that follows is part of the data
  • If ESC itself occurs in the data, it undergoes the same stuffing
  • Single ESC indicates an escape sequence, and double ESC indicates that the second ESC is part of the data
  • A disadvantage is that it is closely tied to using 8-byte characters

Starting and Ending Flags with Bit Stuffing

  • Allows character codes with an arbitrary number of bits per character
  • Each frame starts and ends with the special bit pattern 01111110
  • If 5 consecutive 1s occur in the data, the sender automatically stuffs a 0 in the outgoing data stream
  • If the receiver sees 5 consecutive 1s followed by a 0, it automatically deletes the 0

Error Control

  • Error control can be classified into two broad categories: Forward Error Correction (FEC) and Automatic Repeat Request (ARQ)

Forward Error Correction (FEC)

  • FEC involves adding enough redundant information to the data to enable the receiver to correct any errors and recover the original transmitted data on its own
  • FEC uses error-correcting codes

Automatic Repeat Request (ARQ)

  • ARQ involves adding only enough redundant information to the data to allow the receiver to detect that some errors occurred (without locating or correcting them)
  • The receiver then requests a re-transmission
  • ARQ uses error-detecting codes

Error-Correcting Codes

  • Error-correcting codes are based on adding redundant bits to a data bit stream
  • If the number of data bits is m, the number of legal codewords (messages) is 2^m
  • The number of added check (redundant) bits is r
  • If the total length of the codeword is n, then m + r = n
  • The total number of possible codewords is 2^n, where only 2^m of them are legal

Important Definitions

  • Hamming distance between 2 codewords is the number of bits the two codewords differ; it can be computed by an X-OR operation
  • Hamming distance of a code is the distance between the 2 codewords whose Hamming distance is a minimum

Error Correction and Detection Capability of Codes

  • Error will not be detected if it converts a valid codeword into another valid codeword
  • To detect d errors, a distance of d + 1 code is needed
  • Meaning that when the receiver sees an invalid codeword, it can tell that errors occurred
  • To correct d errors, a distance of 2*d + 1 code is needed
  • The valid (legal) codewords are so far apart that even with d changes, the original codeword is still closer than any other codeword, so it can be uniquely determined
  • If a frame is transmitted and 'd' errors occurred during transmission, the received frame and the transmitted frame will have a Hamming distance 'd'
  • If the receiver receives an invalid codeword, it chooses the closest (with respect to Hamming distance) valid codeword

The Hamming Code

  • The bits of the codeword are numbered starting from 1
  • The bits that are powers of 2 (1, 2, 4, 8, 16, ...) are check bits
  • The rest of the bits (3, 5, 6, 7, 9, 10, 11, 12, ...) are filled up with the m data bits
  • Each check bit forces the parity of some collection of bits, including itself, to be even (or odd)
  • To see which check bits the data bit in position k contributes to, rewrite k as a sum of powers of 2
  • If check bits 1, 2, and 8 are incorrect then bit 11 is inverted (because it is the only data bit checked by 1, 2, and 8)

Decoding

  • The receiver examines each check bit to see if it has the correct parity.
  • If all check bits have the correct parity, then the codeword has no errors.
  • If any incorrect parity then the sum of the check bit positions having incorrect parity gives the position of the incorrect bit.

Error Detecting Codes

  • Error-correcting codes are useful on communication channels with a high error rate, such as wireless channels.
  • When the error rate is much lower, such as on copper wires or fiber-optic links, using error detection and retransmission is typically more efficient.
  • Cyclic Redundancy Check (CRC) codes are an error-detecting code that is widely used in practice.

Cyclic Redundancy Check (CRC) Codes

  • A k-bit frame is regarded as a polynomial with k terms and of order k - 1
  • Example: 110001 is regarded as the polynomial M(x) = x^5 + x^4 + 0x^3 + 0x^2 + 0*x^1 + x^0 = x^5 + x^4 + 1
  • Sender and receiver agree upon a generator polynomial G(x)
  • If r is the order/degree of G(x), then r will also be the number of check bits appended to the data bits
  • The most significant and least significant terms of the generator polynomial must be non-zero (the generator starts with 1 and ends with 1)
  • Example of a generator polynomial of degree 4: G(x) = x^4 + x + 1
  • The sender uses G(x) to compute the r check bits and appends them to the data bits
  • The receiver uses G(x) to detect any errors

Sender Algorithm

  1. Let r be the degree of G(x). Append r zeros to the low-order end of the frame, which now contains m + r bits (and the last r bits are zeros), so that it corresponds to x^r M(x)
  2. Divide the bit string corresponding to x^r M(x) by the bit string corresponding to G(x) using long division, with all operations modulo 2 (addition and subtraction being X-OR operations)
  3. Subtract (modulo 2) the remainder of the long division from the bit string corresponding to x^r M(x)
  • Results in the polynomial T(x) with the corresponding bit string being the Transmitted Frame

Sender Algorithm - additional information

  • The remainder of long division has length equal to or less than 'r' bits, in which case zeros are added to the left to make it 'r' bits
  • Replacing the zeros yields the remainder obtained in Step 2
  • The resulting polynomial T(x) is divisible by G(x) with no remainder

Receiver Algorithm

  1. The receiver will receive the bit string corresponding to T(x) with possible errors.
  2. Used for dividing the received bit string by the bit string corresponding to G(x).
    • A zero remainder indicates no errors
    • A non-zero remainder indicates some errors
  • Error-detection capability depends on the choice of G(x)
  • One of the standard polynomials used in Ethernet (e.g., IEEE 802 standard): G(x) = x^32 + x^26 +* x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1
  • G(x) above can detect all bursts of errors of length 32 bits or less, and all bursts of an odd number of errors

Retransmission Strategies

  • If the receiver detects an error (using some error-detecting code, e.g., Cyclic Redundancy Check), the frame will have to be retransmitted
  • 3 different retransmission strategies inclue Stop-and-Wait Protocol, Go-Back-N Protocol, and Selective Repeat Protocol
  • These protocols are also known as Automatic Repeat Request (ARQ) protocols

Stop-and-Wait Retransmission Strategy

  • The sender transmits one frame at a time
  • If a frame is received correctly at the receiver, the receiver sends an acknowledgement frame (ACK) to the sender
    • If the sender receives an ACK, it sends a new frame
  • If a frame is received with an error, the receiver discards the frame
    • If the sender times out, it sends the same frame again
  • Drawbacks to stop-and-wait:
    • Frame is received correctly by receiver, receiver sends ACK, but ACK gets lost.
    • Sender will time out, assuming that the original frame had an error and will send new frame
    • The repeated frames and loss of ACK results in loss of tracking the frames

Modified Stop-and-Wait

  • The sender transmits a frame including its sequence number in its header
  • The receiver checks the sequence number
    • A new frame is accepted, while a duplicate frame is discarded
  • If the receiver receives a new frame with no errors, it will send the sequence number of what the next frame it expects

Go-Back-N Retransmission Strategy

  • The sender transmits frames (including sequence numbers) and does not wait for ACK to be received.
  • The receiver sends an ACK for every correctly received frame
  • The receiver discards all frames that follow
  • The sender will notice a lack of any ACK of any frame after some timeout
  • Finally, the sender will back up and start all over again sending frames and the processes are looped

Selective Repeat Retransmission Strategy

  • The sender transmits frames (including sequence numbers), and does not wait for ACK to be received (same as Go-Back-N)
  • The receiver sends ACK for every correctly received frame (same as Go-Back-N)
  • In the event of an error:
    • The receiver discards only the frame with errors and buffers all subsequent frames
    • The sends a negative acknowledgement (NAK) for the error frame
    • Sends a negative acknowledgement NAK for the error frame

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

Explore data link layer protocols. Learn about frame structure, error detection using generator polynomials G(x), character count, and bit stuffing techniques. Understand Forward Error Correction (FEC) and Automatic Repeat Request (ARQ).

More Like This

Use Quizgecko on...
Browser
Browser