Transcript Lecture 3
CS 164: Slide Set 3: Chapter 2
Direct Link Networks
What are we looking at ?
• Networks in which there is no routing
involved.
• We will look at the physical layer
– signal representation, error correction.
• We will look at the link layer
– Point to Point links
– Multiple-access
• Ethernet, Token Ring
Network Adaptor and
Device Driver
• Network adaptor sits on the Systems I/O
and delivers data from the workstation’s
memory to the network link.
• Device driver is the software module that
manages this adaptor.
– Issues commands such as from what memory
location should outgoing data be transmitted,
where should the incoming data be stored etc.
Example architecture
CPU
Netw ork
adaptor
Cache
I/O bus
Memory
(To netw ork)
Links
• We have already seen -–
–
–
–
Twisted pair -- phone
Coaxial cable -- Cable TV
Optical Fiber
Free space -- IR etc.
Leased Lines
• Telephone lines -- long distance
– DS1 or T1 line -- 1.544 Mbps
– DS3 or T3 line --- 44.736 Mbps -- 30 T1
lines.
• T1 lines originally conceived for 24
digital voice circuits -- each of 64 Kbps.
• Leased line does not have to be a single
unbroken piece of fiber -- logical
connection.
Synchronous Transport
Signal (STS)
• Optical signals -- also called OC
for optical carrier.
• We have STS-1 (or OC-1), STS-3,
STS-12, STS-24 and STS-48.
• STS-1 --> 840 Mbps.
Last Mile Links
• We talked about this -- ADSL,
POTS --(Plain old telephone
service) etc.
1.554─8.448 Mbps
16─ 640 Kbps
Central
office
Local loop
Subscriber
premises
Signals
• Electromagnetic waves -- travel at
speed of light
• Frequency -- rate at which wave
oscillates (Measured in Hertz).
• Wavelength = speed of light/
frequency -- distance between
maxima and minima of a wave.
The spectrum
f(Hz) 10
0
2
10
10
4
6
10
Radio
4
10
5
10
6
10
7
10
8
10
10
10
Microw ave
8
10
9
10
10
12
14
10
Infrared
10
10
10
11
10
TV
18
10
20
22
10
X ray
12
10
Coax
FM
10
UV
Satellite
AM
16
Terrestrial microw ave
13
10
10
24
Gamma ray
14
10
15
10
Fiber optics
16
10
Modulation
• Data is in bits -- we need to
somehow translate this to signal
variations.
– This process is modulation.
• Vary either the amplitude,
frequency or phase of the signal -- dictated by the bit stream.
Encoding
• Represent binary data as signals.
• Let us ignore modulation for the moment.
• We have two signals -- high and low for
representing 0s and 1s.
– signals represent voltages.
– 1 is high voltage, 0 is low voltage
– As an example +5 V and -5 V.
The NRZ scheme.
Bits
NRZ
0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0
Problem with NRZ
•
Receiver keeps an average of the signal received so far.
•
Compares incoming signal to this average -- if
significantly higher -- high, if significantly lower,
then low.
• If too many zeroes or ones, difficult to track
this average -- the average wanders -- called
the baseline wander.
• If there are clock drifts between the sender
and receiver, this cannot be detected -- how
many bits were transmitted ?
Other encoding schemes
Bits
0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0
NRZ
Clock
Manchester
NRZI
• NRZI : Transition from current signal to encode
a `1’. Stay at the same signal if it is a `0’.
• Solves problem with consecutive 1s but not
zeroes.
Manchester Encoding
Bits
0 0 1 0 1 1 1 1 0 1 0 0 0 0 1 0
NRZ
Clock
Manchester
NRZI
• X-OR the NRZ with a clock
• 0 --> represented as a low to high transition.
• 1 -- > represented as a high to low transition.
Problem with Manchester
Encoding
• Doubles the rate of transitions.
• Half the time for the receiver to detect each
pulse
– Increase in complexity
• Bit rate = 1/2 Baud rate for Manchester
encoding.
• Note -- baud rate represents signal rate and in
some cases, bit rate could be higher than baud
rate -- multiple bits mapped onto a signal.
4B/5B encoding
• Insert extra bits into bit stream to break long
sequences of 0’s and 1’s.
• Specifically every four bits of data encoded into a
five bit code.
• Codes such that no more than 2 trailing zeroes and
no more than 1 leading zero. (When codes are
transmitted back to back no more than 3
consecutive zeroes.
• Resulting codes transmitted using NRZI.
• Specific codes -- 11111 -- Line idle
00000 -- Line dead
00100 -- Halt
Framing
• Blocks of data (each consisting of
bits) exchanged between nodes that
form a link-- these blocks are
called frames.
• Network adaptor allows exchange of
frames.
Point to Point Links
• Link Layer protocols are used.
• Popular Link layer protocols are
BISYNC, PPP and DDCMP.
• The protocols deal with the
transfer of frames across point-topoint links.
BISYNC
• Binary Synchronous Communication (IBM).
8
8
8
8
Header
8
Body
16
CRC
• STX and ETX denote start of text and end of text.
• If ETX appears in body of message, precede with DLE
(Data Link Escape).
• If DLE appears precede with another DLE.
• Called Character Stuffing
DDMCP
• Digital Data Communication Message Protocol
• Instead of indicating end of text, frame length
specified by a “count”.
8
8
8
14
42
Count
Header
16
Body
CRC
• The danger is that count could get corrupted.
• Similar ETX in BISYNC could get corrupted.
• Framing errors could result -- error
correction/ retransmissions
PPP
• Point to Point protocol -- most
popular
– Commonly run over dial up modem
links.
– Can be used over Ethernet too -->
Look for RFC.
PPP Frame
8
8
8
16
Flag
Address
Control
Protocol
Usually contain default
values
Payload
16
8
Checksum
Flag
Used for demultiplexing
• The protocol field identifies the higher layer
protocol -- typically IP.
• Payload default is 1500 bytes but negotiable.
LCP -- Link Control
Protocol
• Initial PPP set up.
• Can be used to negotiate payload
size.
• LCP messages encapsulated into PPP
frames.
– Protocol field set to LCP
LCP Operations
carrier detection or indication
that PHY layer is present by
system admin.
Dead
Link
Establishment
Terminating
Open
Send Link
Configuration Options
•Set Protocol = LCP
• Configure req/ack
exchange
Authenticate
Network
Layer Conf
Configure Network
Layer
Exchange IP addr.
Bit Oriented Protocols
• Previous protocols were byte
oriented.
• Bit oriented protocols not concerned
with byte boundaries.
• HDLC is an example.
HDLC
• High level data link control
8
16
Beginning
sequence
Header
Body
16
8
CRC
Ending
sequence
• Both beginning and ending by a “distinguished”
bit sequence.
• If sequence appears in text use character
stuffing
•
Analog of DLE -- bit stuffing -- upon 5 consecutive 1s,
inserts a zero.
SONET
• Synchronous Optical Network
Standard developed for transmission
over fiber.
• SONET frame has special
information that tells receiver
where frame starts and ends -- no
bit stuffing.
SONET or STS-1 Frames
Overhead
Payload
9 row s
90 columns
• First three bytes overhead
• Total 810 bytes.
• 2 byte pattern at beginning -- receiver has to
see this every 810 bytes -- if it does it concludes
that it is in sync.
Multiplexing with SONET
STS-1
Hdr
•
•
•
•
STS-1
STS-1
STS-3c
Time is the same but now, a different amount of data is
transmitted.
In each STS-3 frame we have 3x810 = 2430 bytes.
Interleave bytes --1st byte of first STS-1, 1st byte of 2nd
STS-1 and so on.
– Ensures that bytes from each STS-1 are evenly paced and arrive at
a smooth 51 Mbps rate at receiver.
Bottomline: STS-3 channel could contain multiple low-data rate
STS-1 channel.
STS-Nc frames.
• Payloads linked together instead of
interleaving.
• Concatenation instead of multiplexing.
– Cannot be multiplexed from different streams.
– Called STS-Nc (As an example STS-3c).
• One of the fields in header used to
denote concatenation.
• Read rest of stuff on SONET from book.
Error Detection
• How does one deal with bit errors ?
• Simplest thing to do -- send two copies
of each bit.
– If copies match, then data ok, else in error.
– Too much redundancy --in most cases errors
not that frequent (especially on fiber and
coax).
• However, some redundancy will be
needed.
Adding parity bits
• We can add parity bits.
• One dimensional parity -- One extra
parity bit added to a 7 bit code to
balance the number of 1s.
– If number of 1’s is odd, parity bit is odd.
– Else it is even.
• If one of the bits gets corrupted, then it
can be detected.
• Multiple errors cannot be :(.
Two Dimensional Parity
• Do a similar thing
across frames in
addition to along
bytes!
• Catches 1 bit, 2 bit,
3 bit errors and most
4 bit errors.
• How? -- both row
and column parities
are affected by a bit
error.
Parity
bits
Data
Parity
byte
0101001
1
1101001
0
1011110
1
0001110
1
0110100
1
1011111
0
1111011
0
Internet Checksum
• Simple algorithm to compute a
checksum.
• Take all words -- add up and
transmit result of the sum using 1’s
complement arithmetic.
• Smaller number of error protection
bits but less protection.
Summary
• We have so far seen
– What is modulation ?
– Encoding schemes.
• Link layer protocols --BISYNC, PPP,
DDMCP, SONET, HDLC.
• Error detection using parity
• Internet Checksum.
• Sections 2.1 to 2.4.2
Next
• CRC --cyclic redundancy check.
• Retransmissions for reliable
transmission.
• Multiple access channels.