Title: No Class Thursday 103
1- No Class Thursday 10/3
- Office hours Tue 315-4
- W 12-1
- Evans 315
2Data Link Layer
- Physical layer sending signals over transmission
medium. - Data link layer responsible for error-free
(reliable) communication between adjacent nodes. - Functions flow control, error control, framing,
fragmentation, and addressing (in multipoint
medium).
3Flow Control
- What is it?
- Ensures that transmitter does not overrun
receiver limited receiver buffer space. - Receiver buffers data to process before passing
it up. - If no flow control, receiver buffers may fill up
and data may get dropped.
4Stop-and-Wait
- Simplest form of flow control.
- Transmitter sends frame and waits.
- Receiver receives frame and sends ACK.
- Transmitter gets ACK, sends other frame, and
waits. - This continues until there are no more frames to
send. - This is a good method if the propagation delay
and data rate is small. Otherwise, it leads to
low link utilization.
5Bandwidth Delay Product
- Suppose that the baud rate is 10Mbaud/s.
- Suppose that there are 10bits per symbol.
- Suppose that the propagation delay is 25ms.
- How many bits can fill the wire?
- Baud rate bits/symbol delay bits
- 10M100.06 2500000 bits (2.5Mb)!
- This is bandwidth delay bandwidth delay
product.
- Suppose that we send a frame of 15008 bits over
this link and use stop and wait. What is the link
utilization?
For a satellite, stop and wait is not a good
approach. For a wireless link like 802.11, its ok
(and is used)
6Transmission Delay
- Suppose the data rate is 100Mbps.
- Suppose the frame is 1500bytes.
- How long does it take to put the frame on the
wire? (This is transmission delay.)
How long to send a frame over this link if the
propagation delay is 25ms?
7Sliding Window 1
- Allows multiple frames to be in transit at the
same time. - Receiver allocates buffer space for n frames.
- Transmitter is allowed to send n (window size)
frames without receiving ACK. - Frame sequence number labels frames.
8Sliding Window 2
- Receiver acks frame by including sequence number
of next expected frame. - Cumulative ACK acks multiple frames.
- Example if receiver receives frames 2,3, and 4,
it sends an ACK with sequence number 5, which
acks receipt of 2, 3, and 4.
9Sliding Window 3
- Sender maintains sequence numbers its allowed to
send receiver maintains sequence number it can
receive. These lists are sender and receiver
windows. - Sequence numbers are bounded if frame reserves
k-bit field for sequence numbers, then they can
range from 0 2k -1 and are modulo 2k.
10Sliding Window 4
- Transmission window shrinks each time frame is
sent, and grows each time an ACK is received.
11Example
12Sliding Window (contd)
- RR (ready to receive) n acknowledges up to frame
n-1. - There is also RNR n, which acks up to frame n-1
but no longer accepts more frames. - RNR shuts down the receive window and
consequently the transmission window. - Need subsequent RR to re-open window.
13Piggybacking
- When both endpoints transmit, each keeps 2
windows, transmitter and receiver windows. - Each send data and need to send ACKs.
- When sending data, transmitter can piggyback
the acknowledgment information. - When no data, send just the ACK.
14Duplicate ACKs
- When no data, must re-send last ACK.
- Duplicate ACKs report potential errors.
15Error Detection
- Transmission impairments lead to transmission
errors change of 1 or more bits in transmitted
frame. - Transmission errors defined using probabilities
transmission medium modeled as a statistical
system.
16Error Probabilities 1
- Definitions
- Pb probability of single bit error (bit error
rate) constant and independent for each bit. - P1 probability frame received with no errors.
- P2 probability frame received with 1 or more
undetected errors. - P3 probability frame received with 1 or more
detected bit errors, but no undetected ones.
17Error Probabilities 2
- If no error detection mechanism, P3 0.
- P1 (1 - Pb)F and P2 (1- P1), where F is size
of frame in bits. - P1 decreases as Pb increases.
- P1 decreases as F increases.
18Example
- 64-kbps ISDN channels bit error rate is less
than 10-6. User requirement of on average 1 frame
with undetected bit error per day. Frame is 1000
bits. - In a day, 5.529 x 106 frames transmitted.
- Required frame error rate of 1/ 5.529 x 106, or
P2 0.18 x 10-6. - But Pb 10-6, so P1 (1-Pb)F 0.999 and P2 1
- P1 10-3, which is gtgtgt required P2
19Error Detection Schemes
- Transmitter adds additional bits for error
detection. - Transmitter computes error detection bits as
function of original data. - Receiver performs same calculation and compares
results. If mismatch, then error. - P3 probability error detection scheme detects
error P2 residual error rate or probability
error goes undetected.
20Parity
- Simplest error detection scheme.
- Append parity bit to data block.
- Example ASCII transmission
- 1 parity bit appended to each 7-bit ASCII
character. - Even parity 8-bit code has even number of 1s.
- Odd parity 8-bit code has odd number of 1s.
21Parity Check
- Example transmitting ASCII G (1110001) using
odd parity. - Code transmitted is 11100011.
- Receiver checks received code and if odd number
of 1s, assumes no error. - Suppose it receives 11000011, then detects error.
- NOTE If more than 2 bits in error, may not be
detected.
22ISDN Example - Continued
- BER 10-6.
- Frame errors might occur when two or more bit
errors occur. Or, no frame error if no bit errors
or one bit error. - 1 ((1-Pb)1000 1000(1-Pb)999Pb) 5e-7
- With no parity, the frame error prob. 10-3
23Cyclic Redundancy Check
- CRC is one of the most effective and common error
detecting schemes. - Represent frames as polynomials
- M 1010001101 -gt x9x7x3x2x0
- Both source and destination use a generator
polynomial G r bits/r-1 degree polynomial - Idea Transmit extended frame MV, such that
the polynomial representation is exactly
divisible by G. Thus, if G does not exactly
divide the received frame, there is an error.
24CRC
- How to find V such that G exactly divides MV?
- Divide xrM by G. Set V the remainder.
- MV xrM V
- MV/G (xrM V)/G xrM/G V/G S V/G
V/G S 2V/G. But in binary 2 is the same as
zero. So MV / G S.
25CRC Example
- Frame M 1010001101 x9x7x3x2x0.
- Pattern G 110101.
- Dividing (frame25) by pattern results in 01110.
- Thus T 101000110101110.
- Receiver can detect errors unless received
message Tr is divisible by G.
26CRC Performance and Generators
- Instead of MV we receiver MV E (E is the
error). - Burst errors CRC detects bursts of length r or
less. - a string of errors, with E 0 0 1 X X X X 1 0
- E(x) xi(xk-1 1) where the burst length is
k. - If G is degree k or greater and G has a 0th
degree term, then G will not divide E.
e.g.
Will CRC detect single bit errors? Suppose that
you use 4 bits (as in Ethernet), and BER is 106
what is the frame error probability?
27CRC Performance and Generators
- Burst Errors Continued
- If the burst has length r1, then the errors will
not be detected if the burst is the same as G. If
an error of length r1 occurs and all
combinations of errors are equally likely, then
the burst will match G with prob. ½r-1. (So prob
is BERr1 x ½r-1) - In general, for longer bursts, the prob. is ½r
28CRC
- Lastly, if G contains x1 as a factor, and E has
an odd number of bit, then G will not divide E. - In IEEE 802
- x32 x26 x23 x22 x16 x12 x11 x10
x8 x7 x5 x4 x2 x 1 - CRC can be implemented in hardware with
registers. - Problem errors can occur in some pattern, so the
probabilities are not quite right.
29Error Correcting Codes
- Hamming distance between bit strings
- The number of bits where the string differ
- XOR them and count the 1s
- 1 0 1 0 0
- 1 0 0 1 0
- 0 0 1 1 0 2 the distance is two.
30Error Correcting codes
- Take an n bit string and encode it as nk bits in
such a way that each encoded n bit string is at
least d distance from any other encoded n bit
string. Then you can detect errors of length d. - Do the same thing, but make it so the distance
between any encoded n bit string is 2d1 bits.
Then the an error of d bits or less can be
corrected by assigning the string to its closest
legal value.
31Error Correcting Code
Legal strings these are the encoded versions of
n bit strings.
Illegal strings no n bit string is encode to
these
32Error Correcting Code
But this code 0 1 1 0 1 0 is received
Suppose that this code is 0 1 0 1 0
Then you know an error occurred, and you figure
that what was meant to be sent is the code 0 1 0
1 0 (the nearest legal neighbor).
33Error Correcting Code
But this code 0 1 1 0 1 1 is received
Suppose that this code is 0 1 0 1 0
Then you know an error occurred. But you are sure
which code was actually sent.
34Error Control
- Mechanisms to detect and correct transmission
errors. - Consider 2 types of errors
- Lost frame frame is sent but never arrives.
- Damaged frame frame arrives but in error.
- Error control combination of error detection,
feedback (ACK or NACK) from receiver, and
retransmission by source. - Coupled with flow control feedback.
35ARQ
- ARQ automatic repeat request.
- Works by creating a reliable data link from an
unreliable one. - 3 versions
- Stop-and-wait ARQ.
- Go-back-N ARQ.
- Selective-reject ARQ.
36Stop-and-Wait ARQ
- Single outstanding frame at any time.
- Simple but inefficient.
- Use of timers to trigger retransmission of data
or ACKs. - 2 types of errors
- Damaged or lost frame.
- Damaged or lost ACK.
- Sequence numbers alternate between 0 and 1.
37Stop-and-Wait ARQ Example
Frame 0
Sender
Receiver
ACK1
Frame 1
ACK 0
Frame 0
Timeout
Frame 0
ACK 1
Timeout
Frame 0
B discards duplicate.
ACK 1
38Go-Back-N ARQ
- Variation of sliding window for error control.
- Allows a windows worth of frames to be in
transit at any time. - RR acks receipt of frame.
- REJ negative acknowledgment indicating the frame
in error. - Destination discards frame in error plus
subsequent frames.
39Go-Back-N ARQ Example
S
R
R
f0
S
f7
f1
f0
rr0
Time out
f2
f1
rr3
f3
rr(P bit 1)
f4
rr4
f5
rr2
f6
Error
f2
f7
rej5
Discarded
f5
5, 6, 7 rexm.
f6
rr6
f7
40Go-Back-N ARQ Issues
- For k-bit sequence number, maximum window size is
(2k-1). - If window size is too large, ACKs may be
ambiguous not clear if ACK is a duplicate ACK
(errors occurred). - Example 3-bit sequence number and 8 -frame
window. - Source transmits f0, gets back rr1, then sends
f1--f0, and gets back another rr1. ???
41Selective-Reject ARQ
- Only frames transmitted are the ones that are
NACKed (SREJ) or that timeout. - More efficient than Go-Back-N regarding amount of
retransmissions. - But, receiver must buffer out-of-order frames.
- More restriction on maximum window size for
k-bit sequence s, 2k-1 window.
42Example Data Link Layer Protocol
- High-Level Data Link Control (HDLC)
- Widely-used (ISO standard).
- Single frame format.
- Synchronous transmission.
43HDLC Frame Format
- Flag frame delimiters (01111110).
- Address field for multipoint links.
- 16-bit or 32-bit CRC.
- Refer to book (pages 176-185) for more details.
flag
address
flag
control
data
FCS
8 bits
8 ext.
8 or 16
8
variable
16 or 32
44Other DLL Protocols 1
- LAPB Link Access Procedure, Balanced.
- Part of the X.25 standard.
- Subset of HDLC.
- Link between user system and switch.
- Same frame format as HDLC.
- LAPD Link Access Procedure, D-Channel.
- Part of the ISDN standard.
45Other DLL Protocols 2
- LLC Logical Link Control.
- Part of the 802 protocol family for LANs.
- Link control functions divided between the MAC
layer and the LLC layer. - LLC layer operates on top of MAC layer.
Dst. MAC addr
LLC ctl.
Src. MAC addr
Dst. LLC addr
Src. LLC addr
MAC control
Data
FCS
46Other DLL Protocols 3
- SLIP Serial Line IP
- Dial-up protocol.
- No error control.
- Not standardized.
- PPP Point-to-Point Protocol
- Internet standard for dial-up connections.
- Provides framing similar to HDLC.
47Multiplexing
- Sharing a link/channel among multiple
source-destination pairs. - Example high-capacity long-distance trunks
(fiber, microwave links) carry multiple
connections at the same time.
MUX
DEMUX
.
.
.
.
.
.
48Multiplexing Techniques
- 3 basic types
- Frequency-Division Multiplexing (FDM).
- Time-Division Multiplexing (TDM).
- Statistical Time-Division Multiplexing (STDM).
49FDM 1
- High bandwidth medium when compared to signals to
be transmitted. - Widely used (e.g., TV, radio).
- Various signals carried simultaneously where each
one modulated onto different carrier frequency,
or channel. - Channels separated by guard bands (unused) to
prevent interference.
50FDM 2
51TDM 1
- TDM or synchronous TDM.
- High data rate medium when compared to signals to
be transmitted.
52TDM 2
- Time divided into time slots.
- Frame consists of cycle of time slots.
- In each frame, 1 or more slots assigned to a data
source.
U1
U2
...
UN
1
2
...
1
2
N
...
N
Time
frame
53TDM 3
- No control info at this level.
- Flow and error control?
- To be provided on a per-channel basis.
- Use DLL protocol such as HDLC.
- Examples SONET (Synchronous Optical Network) for
optical fiber. - s simple, fair.
- -s inefficient.
54Statistical TDM 1
- Or asynchronous TDM.
- Dynamically allocates time slots on demand.
- N input lines in statistical multiplexer, but
only k slots on TDM frame, where k lt n. - Multiplexer scans input lines collecting data
until frame is filled. - Demultiplexer receives frame and distributes data
accordingly.
55STDM 2
- Data rate on muxed line lt sum of data rates from
all input lines. - Can support more devices than TDM using same
link. - Problem peak periods.
- Solution multiplexers have some buffering
capacity to hold excess data. - Tradeoff data rate and buffer size (response
time).