Networks Part 3 (Datalink Layer) Flashcards
What services does the data link layer provide?
- Unacknowledged Connectionless Service
Frames are sent with no connection or error recovery (e.g Ethernet) - Acknowledged Connectionless Service
Frame is sent with retransmissions if needed. (e.g 802.11) - Acknowledged Connection-Oriented Service
Connection is set up, which is rare (Used for long unreliable links)
What is the main role of the datalink layer?
Detect damage and/or loss of frames between adjacent nodes, and recover from the problem.
What is the datalink responsible for?
- Framing - Delimiting data units flowing on the channel.
- Error Handling - detecting and correcting layers introduced by the physical layer.
- Flow Control - Prevents a fast sender from overloading a slow receiver.
What is a frame?
The transmitted element used in the Data Link layer.
Can either be regarded as a block of bytes or a sequence of bits.
Senders assemble frames, receivers deconstruct them back into bytes/bits.
What is bit stuffing?
The practice of putting a 0 after every 5 consecutive 1’s.
What is a “Parity Bit”?
When a bit is added on the end of data signifying if the amount of bits being sent is odd or even.
Is only suitable for single bit error detection.
What is a “Checksum”?
Where chunks of bits are sent along with the actual bits of data.
When they are added together, they should equal 0.
What is a “Cyclic Redundancy Check”?
A more effective error checking method than Checksums.
The transmitted frame is viewed as a polynomial. The transmission polynomial must be evenly divisible by an attached generator polynomial.
CRC operates on the entire frame, not just individual bytes.
Why is the “Simple Stop and Wait” protocol unsuitable for flow control?
If frames get lost, the protocol can enter deadlock.
The transmitter will be constantly waiting for an acknowledgment from a frame that got lost, i.e it will never receive a acknowledgment.
A timeout can be set to mediate this, however timeouts can reduce the efficiency of transfer protocols due to the time spent waiting to receive the file.
The timeout can be shortened, but that might not account for slow files, meaning the received file will then be made incorrect.
TL;DR: Simple Stop and Wait does not take into account the Round Trip time of the data.
What is the “Stop and Wait Automatic Request” protocol?
Why is it unsuitable for flow control?
“Stop and Wait ARQ” is better than “Simple Stop and Wait” as it also has frames include their unique sequence numbers.
If a timeout is triggered, and a frame ends up arriving late (after the resend has arrived), it won’t be inserted into the overall data unless it’s sequence number matches where the protocol is currently up to in the overall data.
It is not suitable for flow control as its utilisation still remains low resulting in an inefficient protocol.
What is the “Piggy-Backing” protocol?
Similar to the “Stop and Wait” protocol, however instead of acknowledgments being sent after receiving and then continuing with data transfer, acknowledgements are sent along with the next frame of data.
This has the advantages of better channel utilisation as less bits need to be transmitted, and less computation by the host as both pieces of data can be unpacked at once.
This disadvantages are that if the receiver waits too long to send a bundled frame and acknowledgement, the sender will timeout and retransmit the frame.
This means there should only be a brief wait. If no data is available, the ack is sent on its own. This means the receiver also needs a timeout.
Slightly complex solution.
What is the “Go-Back N ARQ” protocol?
Sends a group of frames before it requires an acknowledgement. Frames are sequentially numbered. Uses the concept of a sliding window at the sender and the receiver, so is also called the “Go-Back-N Sliding Window Protocol”.
If an error is detected, the transmitter keeps transmitting until timeout, at which point it will resend both the file where the error occurred, and every file after that.
This creates bad efficiency in unreliable/error prone systems.
The minimum range of sequence numbers that must be used for the “Go Back N ARQ” protocol to work properly is “Window size + 1”.
What is the “Selective Repeat ARQ” protocol?
Receiver sends negative acknowledgment if frames being received are not in the correct order. Transmitter keeps sending data unaware until it receives the negative acknowledgment. Once received, it will send the data that was damaged.
Utilisation is better if used in an unreliable system.
The minimum range of sequence numbers that must be used for the selective repeat protocol to work properly is “Window size *2”