Unformatted text preview:

Introduction to Computer Networks CMPE 150 Fall 2005 Lecture 12 CMPE 150 Introduction to Computer Networks 1 Announcements TA office hours this week Instead of tomorrow they will be held Friday 12pm at E2 315 Book should be on reserve at S E Library CMPE 150 Introduction to Computer Networks 2 Last Class Layer 2 Cont d Mechanisms for error control ACKs NACKs retransmissions timers etc Flow control Flow versus congestion control Types of flow control Error detection and correction Trade offs Hamming distance Error detection mechanisms and examples Error correction mechanisms and examples CMPE 150 Introduction to Computer Networks 3 Reading Assignment Tanenbaum Chapter 3 CMPE 150 Introduction to Computer Networks 4 Today Error control cont d Error flow control CMPE 150 Introduction to Computer Networks 5 Error Correction Cont d CMPE 150 Introduction to Computer Networks 6 Hamming Code Bits in positions that are power of 2 are check bits The rest are data bits Each check bit used in parity even or odd computation of collection of bits Example check bit in position 11 checks for bits in positions 11 1 2 8 Similarly bit 11 is checked by bits 1 2 and 8 CMPE 150 Introduction to Computer Networks 7 Hamming Code Example 7 bit Hamming codes can only correct single errors But to correct bursts of errors send column by column CMPE 150 Introduction to Computer Networks 8 Error Detecting Codes Typically used in reliable media Examples parity bit polynomial codes a k a CRC or Cyclic redundancy Check CMPE 150 Introduction to Computer Networks 9 Polynomial Codes Treat bit strings as representations of polynomials with coefficients 1 s and 0 s K bit frame is coefficient list of polynomial with k terms and degree k 1 from xk 1to x0 Highest order bit is coefficient of xk 1 etc Example 110001 represents x5 x4 x0 Generator polynomial G x Agreed upon by sender and receiver CMPE 150 Introduction to Computer Networks 10 CRC Checksum appended to frame being transmitted Resulting polynomial divisible by G x When receiver gets checksummed frame it divides it by G x If remainder then error CMPE 150 Introduction to Computer Networks 11 More on CRC CMPE 150 Introduction to Computer Networks 12 Cyclic Redunancy Check At Transmitter with M 1 1 1 0 1 1 compute 2rM 1 1 1 0 1 1 0 0 0 with G 1 1 0 1 T 2 rM R note G starts and ends with 1 Transmit R 111 T 1 1 1 0 1 1 1 1 1 CMPE 150 Introduction to Computer Networks 13 Cyclic Redundancy Check At the Receiver compute Note remainder 0 no errors detected CMPE 150 Introduction to Computer Networks 14 CRC Performance Errors go through undetected only if divisible by G x With suitably chosen G x CRC code detects all single bit errors And more CMPE 150 Introduction to Computer Networks 15 Flow Error Control CMPE 150 Introduction to Computer Networks 16 Flow Error Control How do Layer 2 protocols implement them What s a frame F H Payload T F What s F What s in T What s in H CMPE 150 Introduction to Computer Networks 17 Header and Trailer Trailer typically has checksum How is it used processed Header has type sequence number and ack CMPE 150 Introduction to Computer Networks 18 Stop and Wait Simplest form of flow control How does it work assume error free channel 1 Send 1 frame 2 Wait for ACK 3 Go to 1 CMPE 150 Introduction to Computer Networks 19 Stop and Wait Pros and Cons Very simple But poor link utilization High data rates Long propagation delay CMPE 150 Introduction to Computer Networks 20 Noisy Channels From Stallings Data and Computer Communications CMPE 150 Introduction to Computer Networks 21 Stop and Wait in Noisy Channels Need timers retransmissions and duplicate detection Use sequence numbers Why Distinguish frames How large e g in number of bits are sequence numbers CMPE 150 Introduction to Computer Networks 22 ARQ Protocols Automatic Repeat Request Protocols that wait for ACK before sending more data ACKs now are used for flow AND error control What can happen At receiver frame arrives correctly frame arrives damaged frame does not arrive At sender ACK arrives correctly ACK arrives damaged ACK does not arrive CMPE 150 Introduction to Computer Networks 23 ARQ Protocols Sender Send frame 0 Start timer If ACK 0 arrives send frame 1 If timeout re send frame 0 CMPE 150 Introduction to Computer Networks Receiver Waits for frame If frame arrives check if correct sequence number Then send ACK for that frame Go to 24 Simplex versus Duplex Transmission Simplex Send data in one channel and control in another channel Duplex Send data and control on the same chanel CMPE 150 Introduction to Computer Networks 25 Can we do better Can we do better Piggybacking Bi directional transmission Wait for data packet and use that to piggyback the ACK Use ACK field only a few additional bits in the header But how long should Layer 2 wait to send an ACK ACK timers CMPE 150 Introduction to Computer Networks 26 Sliding Window Protocols Window number of outstanding frames at any given point in time Every ACK received window slides CMPE 150 Introduction to Computer Networks 27 Sliding Window Example A sliding window of size 1 with a 3 bit sequence number a Initially b After the first frame has been sent c After the first frame has been received d After the first acknowledgement has been received CMPE 150 Introduction to Computer Networks 28


View Full Document

UCSC CMPE 150 - Lecture 12 Notes

Documents in this Course
Load more
Loading Unlocking...
Login

Join to view Lecture 12 Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 12 Notes and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?