Escolar Documentos
Profissional Documentos
Cultura Documentos
Physical Layer
Source node
Destination node
Application
Application
Presentation
Presentation
Session
Session
Intermediate node
transport
Network
Packets
transport
Network
Network
Data link
Data link
Physical
Physical
Frames
Data link
Physical
Bits
Signals
Flow Control
Necessary when data is being sent faster
than it can be processed by receiver
Computer to printer is typical setting
Can also be from computer to computer,
when a processing program is limited in
capacity
Sliding-Window Flow
Control
Allows multiple frames to be in transit
Receiver sends acknowledgement with
sequence number of anticipated frame
Sender maintains list of sequence
numbers it can send, receiver maintains
list of sequence numbers it can receive
ACK (acknowledgement) supplemented
with RNR (receiver not ready)
7
Error Detection
Parity Check
Cyclic Redundancy Check (CRC)
Error Correction
Two types of errors
Lost frame
Damaged frame
10
Stop-and-Wait ARQ
One frame received and handled at a time
If frame is damaged, receiver discards it
and sends no acknowledgment
Sender uses timer to determine whether or
not to retransmit
Sender must keep a copy of transmitted
frame until acknowledgment is received
Go-Back-N ARQ
Uses sliding-window flow control
When receiver detects error, it sends
negative acknowledgment (REJ)
Sender must begin transmitting again
from rejected frame
Transmitter must keep a copy of all
transmitted frames
12
Flow Control
Technique for controlling data rate so that
sender does not over-run receiver
Two approaches exist:
1. Stop-and-wait
2. Sliding-window
13
14
Utilization (Efficiency) = U
Vertical-Time
Sequence
Diagram
17
This shows that for large a (Propagation Time>Transmission Time), the line is under-utilized
18
So
19
2). LAN
d = 0.1 ~ 10 km, B = 10 Mbps, V = 2 x 108 m/sec
L = 1000 bits a = 0.005 ~ 0.5 U = 0.5 ~ 0.99
21
Utilization: U is a function of a
and N
Case 1: N > 1 + 2a : U = 1
Ack for frame 1 reaches Sender before
transmission of Nth frame continuous
transmission possible
23
Utilization: U is a function of a
and N
Case 2: N < 1 +
2a : U = N / (1 +
2a)
Wasted time
between N and 1
+ 2a
24
Error Detection
Basic Principle
Transmitter: For a given bit stream M,
additional bits (called error-detecting code)
are calculated as a function of M and
appended to the end of M
Receiver: For each incoming frame, performs
the same calculation and compares the two
results. A detected error occurs if there is a
mismatch
25
Error Detection
Two common techniques
Parity checks
Cyclic redundancy checks (CRC)
Parity Check
One extra parity bit is added to each word
Odd parity: bit added so as to make # of 1s odd
Even parity: makes total # of 1s even
Single parity is very effective with white noise (noise
on a line without any active signals on it; e.g.,
Thermal Noise, see chapter 3), but not very robust
with noise bursts (which may extend over whole word
duration.)
26
Q
Note:
P
P
P P
P
Remainder
Note: R+R=0 in mod-2 arithmetic
R=F=FCS
00 0
11 0
in these
examples
29
30
31
32
33
34
Can detect
1. All single-bit errors
2. All double-bit errors, as long as P(X)
has a factor with at least three terms (as
long as p has at least three 1s)
3. Any odd number of errors, as long as
P(X) contains a factor (X+1)
4. Any burst error for which the length of
the burst is less than the length of the
FCS
5. Most larger burst errors
35
Why?
Error can also be represented by
T=Transmitted frame
polynomial, E(X).
E=Error pattern with 1s in positions where errors happen
Why?
2. Double-bit error: E(X) = Xi +Xj = Xi (1+Xk
), k=j-i>0
P(X) does not divide into Xi
P(X) can be chosen which does not divide
1+Xk up to the maximum value of k (i.e., up to
the practical frame length). (e.g., X15 + X14 +1
will not divide 1+Xk for any k below 32768)
37
Why?
3. No polynomial with an odd # of terms is
divisible by (X+1)
Assume E(X) has an odd # of terms and is
divisible by (X+1). Then E(X) = (X+1)Q(X). E(1) =
(1+1)Q(1) = 0. However, E(1) cannot be zero
since it has an odd # of 1s
Implementation
Implemented by a circuit consisting of
exclusive-or gates and a shift register
The shift register contains n bits (length of
FCS)
There are up to n exclusive-or gates
The presence or absence of a gate
corresponds to the presence or absence of a
term in P(X)
39
Implementation
40
Example
Note:R=01110
Error Control
42
43
ARQ
Based on
Error detection
Positive ack
Retransmission after timeout
Negative ack. And retransmission
ARQ
Stop-and-wait ARQ
Continuous ARQ
Go-back-N ARQ
Selective-reject ARQ
44
45
Go-back-N ARQ
If the receiver detects an error on a frame,
it sends a NAK for that frame. The
receiver will discard all future frames until
the frame in error is correctly received.
Thus the sender, when it receives a NAK
or timeout, must retransmit the frame in
error plus all succeeding frames. (Sender
must maintain a copy of each
unacknowledged frame.)
47
Go-backN ARQ
48
Selective-reject ARQ
The only frames retransmitted are those
that receive a NAK or which timeout
Can save retransmissions, but requires
more buffer space and complicated logic
See Figure 7.9b Page 212
49
50
51
53
0
1
The first one or
2 bits identify
the frame type
55
Flag fields
8 bits (01111110)
Bit stuffing is used for data transparency
Bit stuffing: whenever five 1s are
transmitted, extra zero is inserted
56
Flag fields
57
58
59
61
62
63
Examples of Operation
64