Quiz 3 Flashcards
(23 cards)
What is the purpose of framing in the link layer?
Framing determines where a frame begins and ends in a stream of bits, ensuring proper data boundaries.
What are the main approaches to framing?
Fixed-sized frames, byte counting, byte stuffing, and bit stuffing.
What is fixed-sized frames? What are the pros and cons of fixed-sized frames?
Every frame has a fixed num of bit. Smaller frames are padded to reach the required size.
Pros: Simple to implement. Cons: Wasted bandwidth if frames are smaller than the fixed size.
What is byte counting in framing? What are the pros and cons?
A method where each frame starts with a length field indicating the frame size.
PRO: Efficient use of bandwidth
CON: error in the length field can throw off synchronization.
How does byte stuffing work? What are the pros and cons?
Special flag bytes are used to mark frame boundaries, and escape sequences (ESC) are added before flag/ESC bytes in the payload.
PRO: self-sync.
CON: slightly more complex processing.
How should a receiver interpret byte stuffing sequences?
FLAG - start or end of frame
ESC - bad frame
ESC FLAG - stuffed FLAG
ESC ESC - stuffed ESC
ESC ESC FLAG - stuffed ESC and FLAG
ESC FLAG FLAG - stuffed FLAG
What is bit stuffing?
EX. if the FLAG is 6 consecutive ones. It inserts a 0 after five consecutive 1s in the data to prevent false flag detection, useful when flags are not byte-aligned.
How can you apply byte stuffing to example data?
By adding ESC before any FLAG or ESC in the data, per the interpretation rules.
How do modern networks typically handle framing?
They use byte stuffing or bit stuffing methods.
Why are error detection and correction necessary in data transmission?
To ensure reliable communication over noisy channels.
What is a codeword?
An n-bit block containing both data (m bits) and check bits (r bits), where n = m + r.
Define Hamming distance.
The minimum number of differing bit positions between any two valid codewords.
How many errors can a code with Hamming distance d detect and correct?
Detect: up to d − 1 errors. Correct: up to ⌊(d − 1)/2⌋ errors.
How does parity bit error detection work?
Even/odd parity ensures a specific number of 1s in a codeword. Errors disrupt the parity.
EX (even parity):
received code word:
- odd parity = at least one error
- even parity = 0 or even number of error (can’t be sure)
What kind of errors can parity detect?
It can only reliably detect odd numbers of bit errors.
What is two-dimensional parity?
Data is arranged in a grid; parity is calculated for rows and columns to detect and correct single-bit errors.
Can detect and correct all single bit error.
Can detect two or three bit error that occur any where in the matrix.
When is error detection preferred over correction?
When errors are less frequent, a channel is less noise, or retransmission is cheap.
Wired networks.
When is error correction better?
When errors are more frequent, a channel is more noisy, or retransmission is expensive or impossible.
Wireless networks.
Real-time constraints exist.
What do modern systems typically use for error control?
A combination of error detection and correction for optimal reliability.
What functions does the link layer provide?
- framing
- error detection and correction
- reliable transmission
- multiple access
- switching (forwarding frames b/w different links)
What is code rate?
fraction of codeword that carries info that is not redundant.
m (num message bits/ n (total length, m+r)
How does a sender and receiver use error codes?
sender computes r and send n-bit code word.
receiver:
- receives code word
- recomputes r
- checks if r matches the recomputed r
Between error detection and error correction schemes, which scheme requires more overhead (checkbits)? Briefly explain
why.
Error correction schemes require more overhead b/c we need to detect AND locate the error which requires more checkbits.
Error detection schemes only need to detect errors, and do not need to correct them so they need less checkbits.