Chapter 4 Data Link Layer

22
Chapter 4 Chapter 4 Data Link Layer MIS 430

description

Chapter 4 Data Link Layer. MIS 430. Data Link Layer Functions. Media access control – when computers can transmit Detects and corrects transmission errors Identifies the start and end of messages. I. Media Access Control. - PowerPoint PPT Presentation

Transcript of Chapter 4 Data Link Layer

Page 1: Chapter 4 Data Link Layer

Chapter 4

Chapter 4 Data Link Layer

MIS 430

Page 2: Chapter 4 Data Link Layer

Chapter 4 2

Data Link Layer Functions

Media access control – when computers can transmit

Detects and corrects transmission errors

Identifies the start and end of messages

Page 3: Chapter 4 Data Link Layer

Chapter 4 3

I. Media Access Control

Def’n – method to control when computers can transmit on same circuit (not needed with full duplex circuit) Controlled Access

XON/XOFF: if ready to receive, sends XON character If not ready, sends XOFF character

Hardware: DTR line in serial port

Page 4: Chapter 4 Data Link Layer

Chapter 4 4

Media Access Control, contd Polling: send a signal to a client

that allows it to transmit Roll-call: server works consecutively

through the clients Hub polling (aka token passing): a

computer starts the poll, sends it message, then passes the token to next computer; can transmit only if it holds the token

Page 5: Chapter 4 Data Link Layer

Chapter 4 5

Media Access Control, contd Contention

Wait until free, then broadcast 802.3 (Ethernet) uses contention Can have collisions

Relative performance: response time Contention better for small networks (~20) Polling better for larger networks with more

transmissions See Fig 4.1 p. 118 for comparison chart

Page 6: Chapter 4 Data Link Layer

Chapter 4 6

II. Error Control Human errors

Control thru the application program Network errors

Corrupted data Lost data

Networks should prevent, detect, and correct corrupted data Prevention is much preferred!

Page 7: Chapter 4 Data Link Layer

Chapter 4 7

Source of Errors Line noise/distortion Line outages: cuts! Faulty equipment White noise: background hiss Impulse noise: spikes Cross-talk: signal picked up in another circuit Echo: poor connections Attenuation: loss of signal power over distance Intermodulation: several circuits combine Jitter: phase changes can cause volume

fluctuation Harmonic distortion: amp doesn’t reproduce

Page 8: Chapter 4 Data Link Layer

Chapter 4 8

Error Prevention

Shielding Move cables away from noise Change mux technology (crosstalk) Replace repeater/amplifier or put

closer together Purchase conditioned circuit (better

quality lines) from common carrier

Page 9: Chapter 4 Data Link Layer

Chapter 4 9

Error Detection Send extra data with each packet so

that receiving side checks message received with message sent Parity checking

Make number of ones an even or odd number by adding another bit to byte (50% accuracy)

LRC: longitudinal redundancy checking Add block check character to packet Similar to parity through packet 98% error detection rate

Page 10: Chapter 4 Data Link Layer

Chapter 4 10

Error Detection

Polynomial Checking Based on mathematical algorithm CRC: Cylic Redundancy Check adds 8,

16, 24, or 32 bits to message CRC-16: 99.998% error detection CRC-32: 99.99999998% error detection!

For example, see next slide..

Page 11: Chapter 4 Data Link Layer

Chapter 4 11

UPC Code: CRC Check Digit UPC: 12345 67890 + check digit

12345 = is manufacturer code 67890 = is product code for that manufacturer

Algorithm: Starting from right, add odd digits Multiply sum by 3 Starting from right, add even digits Add to previous number Check digit is ten’s complement of 1s digit

Page 12: Chapter 4 Data Link Layer

Chapter 4 12

UPC Example: checksum Suppose UPC is: 12345 67890

0+8+6+4+2=20 20*3=60 9+7+5+3+1=25 60+25=85 10-5=5 which is the check digit added to end

Scan product, calculate check digit If same as with packet, OK If not same as with packet, need to rescan

Page 13: Chapter 4 Data Link Layer

Chapter 4 13

Correction: Retransmission

If error is detected, correction occurs when packet is retransmitted ARQ – Automatic Repeat reQuest

Stop and Wait ARQ: ACK/NAK Continuous ARQ: send next packet unless

get a NAK Both of these are flow control

techniques

Page 14: Chapter 4 Data Link Layer

Chapter 4 14

Forward Error Correction

Add redundant bits to correct errors without retransmitting packet Hamming Code (corrects 1-bit errors) Reed-Solomon (corrects longer errors)

RAID: redundant array of inexpensive disks uses forward error correction RAID 5: 3 drives = 2 drives

(18+18+18=36 GB with redundancy)

Page 15: Chapter 4 Data Link Layer

Chapter 4 15

III. Data Link Protocols

Asynchronous transmission Start-stop: each character sent

independently of other characters Start bit, 7 data bits, stop bit, parity or 10

bits per character (2/8 overhead)

Asynchronous file transfer protocols Xmodem: CRC-8 with 132 char packets Kermit: CRC-24 with 1000 char packets

Page 16: Chapter 4 Data Link Layer

Chapter 4 16

Data Link Protocols Synchronous Transmission

Message sent in a block (packet) w/ checksum

Less overhead – sync characters at start and end of packet rather than for each character

SDLC: Synchronous Data Link Control – IBM 3270 standard Bit-oriented protocol for 3270 terminals 3270 represents IBM mainframe connection

PC can do this with 3270/IRMA card

Page 17: Chapter 4 Data Link Layer

Chapter 4 17

Synchronous Transmission

HDLC: High-level data link control ISO standard, very similar to SDLC

Ethernet (802.3) Similar to SDLC but length is carried

along with other signal characters CRC-32 plus up to 1492 byte packets:

Dest Addr|Source Addr|Length|Control|…message…|CRC-32

Page 18: Chapter 4 Data Link Layer

Chapter 4 18

Synchronous Transmission

PPP: Point to Point Protocol 1990s: dial-up networking to ISP CRC-16 plus packet up to 1,500

bytes:Flag|Address|Control|Protocol|…message…|CRC-16|Flag

Page 19: Chapter 4 Data Link Layer

Chapter 4 19

IV. Transmission Efficiency

How many overhead bits are needed beyond the information bits?

TE=total # information bits/total # bits Ex: 7-bit ASCII asynchronous 3 overhead bits, 7 data bits TE=7/10=70% Thus V.90 56K maximum is 43.6 Kbps

Page 20: Chapter 4 Data Link Layer

Chapter 4 20

Improving Efficiency Increase size of message in packet Decrease number of overhead bits

But CRC will detect errors Problem:If a much longer packet has an error and must

be retransmitted, this reduces efficiency!

Page 21: Chapter 4 Data Link Layer

Chapter 4 21

TRIB Calculation TRIB=K(M-C)(1-P) (M/R)+TK=information bits/character 7M=packet length in characters 400R=data transmission rate in char/sec 600C=avg number of noninformation char/block 10P=probability that a block will require retransmission .01T=time between in blocks in seconds .025 secExample using values above:

TRIB=7(400-10)(1-.01)/[400/600+.025]=3,908 bps

Page 22: Chapter 4 Data Link Layer

Chapter 4 22

Mgt Focus 4-2: Packet Size

Standard Commercial tested packet size from 500 to 32,000 bytes 32,000 byte more 44% more efficient

but response time delays occurred Ideal packet size was between 4,000

and 8,000 bytes However, this depends on the

application and message pattern