Professional Documents
Culture Documents
Framing
Framing by character count.
Framing (2)
Esc
Flag
Flag
Esc
Flag
Esc
Flag
The receiver will ignore this Esc, and accept the flag. The receiver will ignore this flag.
Framing (3)
The goal is to have 01111110 as a unique bit pattern.
Bit stuffing
(a) The original data.
(b) The data as they appear on the line.
(c) The data as they are stored in receivers memory after destuffing.
a) Error-Correcting Codes
b) Error-Detecting Codes
The bits of the codeword are numbered consecutively, starting with bit 1 at the left
end, and so on.
The bits that are powers of 2 (1, 2, 4, 8, 16, ) are check bits.
The rest (3, 5, 6, 7, 9, ) are data bits.
Each check bit forces the parity of some collection of bits, including itself, to be even.
To see which check bits the data bit in position k contributes to, rewrite k as a sum of
power of 2, e.g.,:
11 = 1 + 2 + 8
and
29 = 1 + 4 + 8 + 16
1001000
is encoded as
00110010000
When a codeword arrives, the receiver examines each check bit for the correct parity.
It the error counter is nonzero, it contains the number of incorrect bits.
Hamming codes can correct single errors:
If check bits 1, 2, and 8 are in error, the inverted bit is 11, because:
11 = 1 + 2 + 8
Error-Correcting Codes
Error-Detecting Codes
Error-correcting codes are widely used on wireless links that are noisy.
However, they generate too large transmission overhead for reliable links such as
copper wire or fiber. Therefore, here error-detection codes are used.
When error is detected, the data is retransmitted.
The goal for error correcting codes it to add redundancy to the data so that the
errors are not only detected but can be at the same time corrected (without
retransmission).
For error-detecting codes the goal is to only detect the errors with the minimal
transmission overhead. They are based on polynomial code also known as CRC
(Cyclic Redundancy Check)
A k-bit frame is regarded as polynomial with coefficients 0 and 1 with terms from
xk-1 to x0
For example: 110001 ->
x5 + x4 + x0
Polynomial arithmetic is done modulo 2 using the rules of algebraic field theory.
Both addition and subtraction are identical to exclusive OR. For exampe:
10011011
+11001010
-------------01010001
11110000
-10100110
------------01010110
Calculation of the
polynomial code
checksum.
Eachprotocolisincreasingincomplexity
anddropsunrealisticassumptions.
Sender
sends as fast
as possible
Receiver can
always
process fast
enough
Sender
waits for
ack
Sender
sends
frame
Rcvr sends
ack after
processing
Continued
Pipelining
Consider a 50 kbps channel to a satellite with round-trip propagation delay 500 msec.
Using window size 1:
At t = 0 sender starts sending first bit of 1000 bit frame
At t = 20 msec frame completely sent
At t = 270 frame completely received
At t = 520 ack received by sender
Sender busy for 20/520 = 4% of time ... very inefficient.
Why ?
Sender has to wait till a frame is acked before sending the next frame.
Solution: Allow sender to send up to w (>1) frames without waiting for ack.
So from t = 0 to t = 520, sender could have sent 26 frames, so let w should be atleast 26.
Need for large window occurs when the bw x delay is big .... think about this !!
bw x delay determines how many frames can fit in the pipe. We will revisit this later.
Protocol Verification
Finite state machines
and Petri nets are used.