Held Wednesday, February 16, 2000
Overview
Today we continue our investigation of the data-link layer by
visiting techniques for representing bits and handling potential
errors in the data.
Notes
- Cool upcoming events:
- Convocation Thursday: Richard Guy on ``Mathematics 4000 Years Ago''
- CS Brown Bag Lunch Thursday: Growing a Language
- Math/CS Journal Club Thursday: Fun at IBM
- When you compile your C files, it helps to use the
-Wall
flag (which tells the compiler to print out warnings for any odd bit
of code).
- If you use make, put the following at the top of your files and
then don't explicitly specify how to make the .o files.
- Are there any final questions on
assignment 2?
- I'll be in my office much of tomorrow. While I'll primarily be
working on grading and some stuff I need to write, I will be happy
to stop and answer reasonable questions.
- A few of you asked how I printed your code ``two up''. Here's
the alias I put in my
.cshrc:
alias twoup "nenscript -2r -p- \!* | lp -oduplex";
- Quiz! Error correcting codes
Contents
Summary
- Encoding bit sequences
- Framing sequences
- At every level, there are some core issues we must consider.
- What are the issues we are concerned with for directly-connected
nodes?
- How do we connect the nodes?
- How do we represent bits?
- How do we multiplex the line?
- How do we make chunks of bits (frames)?
- How do we detect errors in those chunks?
- How do we correct errors in those chunks?
- In the previous class, we saw a few techniques for encoding bits
by changing some attribute of the wave form. Let us now look at
some other issues.
- We may also have to consider the clock (if clocks drift, we're going
to get pretty damn confused about the signal).
- Some schemes:
- NRZ (non-return to zero): high signal is 1, low signal is 0.
- NRZI (non-return to zero inverted): transition is 1, non-transition
is 0.
- Manchester: exclusive or of clock and NRZ encoded data.
- 4B/5B: encode four bits with five
- Problems with NRZ:
- Distinguish string of 0's from lost connection
- Distinguish high and low in a world of changing
voltages (normal solution, take average of signals
for midline -- what happens with long sequences).
- What happens when clocks stray? Need encoding
to help with clock recovery
- We'll do an NRZ example
- Problems with NRZI are similar
- Problems with Manchester: you need to sample the data twice as often!
(Bit rate is only half of baud rate.)
- 4B/5B gives a compromise. By using an extra bit, you can ensure
that there is sufficient change across time.
| 4-bit | 5-bit |
|
4-bit | 5-bit |
| 0000 | 11110 |
|
0001 | 01001 |
| 0010 | 10100 |
|
0011 | 10101 |
| 0100 | 01010 |
|
0101 | 01011 |
| 0110 | 01110 |
|
0111 | 01111 |
| 1000 | 10010 |
|
1001 | 10011 |
| 1010 | 10110 |
|
1011 | 10111 |
| 1100 | 11010 |
|
1101 | 11011 |
| 1110 | 11100 |
|
1111 | 11101 |
- No, I have no clue how they came up with these (other than that
the last bit gives parity). Do you?
- It is helpful to break data into small chunks, which we
typically call ``frames''.
- Why?
- By grouping information, we can more easily insert
error detecting codes and error correcting codes.
- By grouping information, we can ``name'' chunks, which is
useful if we need to request retransmission
- Most framing mechanisms use some special values to designate the
start (and, often, the end) of the frame.
- Most framing mechanisms include some other information (the frame
header) at the start of the frame.
- What do we do if the special ``start of frame'' values appear
within the body of the frame?
- Byte stuffing solution: Prefix those values with a
special byte, like the backslash in C.
- Advantages: easy; fairly reliable
- Disadvantages: adds overhead; frame length differs; a bit error in the
``quote byte'' can be disasterous
- Bit stuffing solution: Use special sequences and insert
an extra bit if those sequences appear.
- HDLC (High-level Data Link Control) uses 01111110
- After five consecutive 1's in the body, it inserts a 0.
- The receiver knows that 01111110 is the end of the body.
- 01111111 is an error
- 01111101 is really 0111111
- Advantages: easy, fairly reliable
- Disadvantages: frames do not have a uniform length; two bit errors
can lead to a fake end-of-frame
- Clock based framing solution: The start-of-frame
value appears at a specified interval in the data. If it
appears out of synch, it must be part of the data.
- Advantages: no overhead
- Disadvantages: recovery may require multiple frames
Thursday, 20 January 2000
- Created as a blank outline.
Wednesday, 16 February 2000
- Filled in the details.
- Some were taken from the previous outline (and, previously, from
some outline of Dartmouth's CS78 1996S)
Back to Data-Link Basics.
On to Common Structures.