Module 2
Module 2
(Week 5)
ANDREW S. TANENBAUM
COMPUTER NETWORKS
FOURTH EDITION
PP. 183-211
A character stream. (a) Without errors for four frames of sizes 5, 5,8,
and 8 characters, respectively. (b) With one error.
BLM431 Computer Networks 24
Dr.Refik Samet
Framing (6/12)
2) Flag bytes with byte stuffing.
• This method gets around the problem of
resynchronization after an error by having each
frame start and end with special bytes.
• The starting and ending Flag Bytes are same in
recent years.
• If the receiver ever loses synchronization, it can
just search for the flag byte to find the end of
the current frame.
• 2 consecutive flag bytes indicate the end of one
frame and start of next one.
BLM431 Computer Networks 25
Dr.Refik Samet
Framing (7/12)
Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receiver’s memory after destuffing.
BLM431 Computer Networks 30
Dr.Refik Samet
Framing (12/12)
4) Physical layer coding violations:
• This method is only applicable to networks in
which the encoding on the physical medium
contains some redundancy.
• For example, some LANs encode 1 bit of data by
using 2 physical bits.
• Normally, a 1 bit is a high-low pair and a 0 bit is a
low-high pair.
• 11 or 00 are not used for data but are used for
delimiting frames in some protocols.
BLM431 Computer Networks 31
Dr.Refik Samet
Error Control (1/1)
• The usual way to ensure reliable delivery is to
provide the sender with some feedback about what
is happening at the other end of the line.
• Typically, the protocol calls for the receiver to send
back special control frames.
• If the sender receives a positive acknowledgement
about a frame, it knows the frame has arrived
safely.
• On the other hand, a negative acknowledgement
means that something has gone wrong, and the
frame must be transmitted
BLM431 Computeragain.
Networks 32
Dr.Refik Samet
Flow Control (1/2)
•Another important design issue that occurs in the data
link layer (and higher layers as well) is what to do
with a sender that systematically wants to transmit
frames faster than the receiver can accept them.
•To solve this problem feedback-based flow control
and rate-based flow control are used.
Calculation of the
polynomial code
checksum. BLM431 Computer Networks 58
Dr.Refik Samet
Error-Detecting Codes (9/10)
• What kinds of errors will be detected?
• Imaging that a transmission error occurs, so that
instead of the bit string for T(x) arriving, T(x)+E(x)
arrives.
• Each 1 bit in E(x) corresponds to a bit that has been
inverted.
• If there are k 1 bits in E(x), k single-bit errors have
occurred.
• A single burst error is characterized by an initial 1, a
mixture of 0s and 1s, and a final 1, with all other bits
being 0. BLM431 Computer Networks 59
Dr.Refik Samet
Error-Detecting Codes (10/10)
• Upon receiving the checksummed frame, the
receiver divides it by G(x); that is, it computes
[T(x)+E(x)]/G(x).
• T(x)/G(x) is 0, so the result of the computation is
simply E(x)/G(x).
• Those errors that happen to correspond to
polynomials containing G(x) as a factor will slip by;
all other errors will be caught.