dll ppt
TRANSCRIPT
Overview• Introduction• Functions • Adapters• Link layer protocol Services• Types of services provided to the network
layer• Flow Control• Error Control• Error detection and correction
Introduction Some terminology:hosts and routers are nodescommunication channels
that connect adjacent nodes along communication path are links wired links wireless links LANs
DataLink Layer 3
data-link layer has responsibility of transferring datagram from one node to adjacent node over a link
Functions of DLL•Provide service interface to the
network layer•Deals with transmission errors
( error control )•Regulates data flow
•Slow receivers not swamped by fast senders ( flow control )
Adapters communicationFor a given communication link, the link-
layer protocol is for the most part implemented in a pair of adapters
An adapter is a board that typically contains RAM, DSP chips, a host bus interface and a link interface
Adapters are also commonly known as network interface cards
The adapter encapsulates the datagram in a frame and then transmits the frame into the communication link. At the other side, the receiving adapter receives the entire frame, extracts the network-layer datagram, and passes it to the network layer
Link layer protocol provides certain services
Link layer protocol services If the link-layer protocol provides error detection, then it is the sending adapter sets the
error detection bits and it is the receiving adapter that performs the error checking. error detection:
errors caused by signal attenuation, noise. receiver detects presence of errors: signals sender for retransmission or drops frame
error correction: receiver identifies and corrects bit error(s) without resorting to retransmissionhalf-duplex and full-duplexwith half duplex, nodes at both ends of link can transmit, but not at same time
Contd ..If the link-layer protocol provides reliable
delivery, then the mechanisms for reliable delivery (e.g., sequence numbers, timers and acknowledgments) are entirely implemented in the adapters.
DataLink Layer 8
Types of services provided to the Network LayerUnacknowledged Connectionless service
Acknowledged Connectionless service
Acknowledged Connection-Oriented service
Unacknowledged Connectionless serviceUnacknowledged connectionless service - Source
machine sends independent frames to the destination machine without having the acknowledgement from the destination machine.
Uses:Used where there is a very low chance of transmission
errors.Used on reliable medium like coax cables or optical
fiber, where the error rate is low.Appropriate for voice, where delay is worse than bad
data.
Acknowledged Connectionless service
Acknowledged connectionless service - The source machine send the frames independently to the destination machine, but with acknowledgement to each and every frame from the destination machine.
Useful on unreliable medium like wireless.
Acknowledged Connection-oriented serviceIn connecting oriented service a connection is
established between the source and the destination until all the data is transferred.
Most reliable Guaranteed service –
Each frame sent is indeed receivedEach frame is received exactly onceFrames are received in order
Flow controlWhat if sender transmits the frames faster
than the receiver accepts them ?Solution : Introduce the flowcontrol to
throttle the sender into sending no faster than the receiver can handle the traffic. The throttle generally requires some kind of feedback mechanism, so the sender can be made aware of whether or not the receiver is able to handle the frame.
Error ControlPositive and Negative feedback is necessary If the sender receives a positive ack it assumes that the
frames has arrived correctly at the destination, a negative ack means that something has gone wrong, and the frame must be transmitted again.
Timers What happens when a frame completely vanishes?
Receiver neither sends a +ack nor –ack … then timer comes to help.
It may result in a frame being sent more than once and received more than once
solution : assign sequence numbers to frames
Error Detection and CorrectionIn some cases it is sufficient to detect an
error and in some, it requires the errors to be corrected also. For eg.On a reliable medium : ED is sufficient where
the error rate is low and asking for retransmission after ED would work efficiently
In contrast, on an unreliable medium : Retransmission after ED may result in another error and still another and so on. Hence EC is desirable.
DataLink Layer 16
Error DetectionEDC= Error Detection and Correction bits (redundancy)D = Data protected by error checking, may include header fields
• Error detection not 100% reliable!• protocol may miss some errors, but rarely• larger EDC field yields better detection and correction
otherwise
Error detection and correction Techniques
Parity checksChecksumming methodsCyclic redundancy check(CRC)
Parity Checking
DataLink Layer 18
Single Bit Parity:Detect single bit errors
Two Dimensional Bit Parity:Detect and correct single bit errors
0 0
Internet checksum (review)
DataLink Layer 19
Goal: detect “errors” (e.g., flipped bits) in transmitted packet (note: used at transport layer only)
Sender: treat segment contents as sequence of 16-bit integers checksum: addition (1’s complement sum) of segment
contents sender puts checksum value into UDP checksum field
Receiver: compute checksum of received segment check if computed checksum equals checksum field
value: NO - error detected YES - no error detected. But maybe errors nonetheless?
Checksumming: Cyclic Redundancy Checkview data bits, D, as a binary numberchoose r+1 bit pattern (generator), G goal: choose r CRC bits, R, such that
<D,R> exactly divisible by G (modulo 2) receiver knows G, divides <D,R> by G. If non-zero
remainder: error detected! can detect all burst errors less than r+1 bits
widely used in practice (Ethernet, 802.11 WiFi, ATM)
DataLink Layer 20
CRC Example
Want:D.2r XOR R = nG
equivalently:D.2r = nG XOR R
equivalently: if we divide D.2r by
G, want remainder R
DataLink Layer 21
R = remainder[ ]D.2r
G