Univ. of TehranIntroduction to Computer Network1 An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.

Slides:



Advertisements
Similar presentations
EE 4272Spring, 2003 Chapter 7 Data Link Control Objectives: Effective & reliable data communication between two directly connected transmitting-receiving.
Advertisements

Lecture 3, 1Spring 2003, COM1337/3501CCN: Direct Link Networks Direct Link Networks Textbook: Computer Networks: A Systems Approach, L. Peterson, B. Davie,
CSCI-1680 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Spring 2002CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
Fundamentals of Computer Networks ECE 478/578 Lecture #3: Encoding and Framing Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
EE 122: Error detection and reliable transmission Ion Stoica September 16, 2002.
1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
The OSI Reference Model
1 Hardware Building Blocks Five Issues –Encoding –Framing –Error Detection –Reliable delivery –Access Mediation Direct Link Networks.
Spring 2004 EE4272 Direct Link Networks (I) Hardware Building Blocks (nodes & links) 5 Issues before Exchanging Packets  Encoding  Framing  Error Detection.
Spring 2003CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
Framing and Encoding EECS 122: Lecture 26 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
18-Aug-154/598N: Computer Networks Overview Direct link networks –Error detection - Section 2.4 –Reliable transmission - Section 2.5.
CS 640: Introduction to Computer Networks Aditya Akella Lecture 5 - Encoding and Data Link Basics.
EE 122: Encoding And Framing Ion Stoica September 9, 2002.
CSE331: Introduction to Networks and Security Lecture 3 Fall 2002.
14-Oct-15Computer Networks1 Reliable Transmission.
CSS CSS432 Point-to-Point Links Textbook Ch2.1.2 – 2.5 Professor: Munehiro Fukuda.
Univ. of TehranIntroduction to Computer Network1 An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
Lecture 7: Reliable Packet Transmission. Cyclic Redundancy Check Add k bits of extra data (the CRC field) to an n-bit message to provide error detection.
Error Coding Transmission process may introduce errors into a message.  Single bit errors versus burst errors Detection:  Requires a convention that.
Univ. of TehranComputer Network1 Computer Networks Computer Networks (Graduate level) University of Tehran Dept. of EE and Computer Engineering By: Dr.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
CHAPTER 2 HARDWARE BUILDING BLOCK ENCODING FRAMING ERROR DETECTION.
Advanced Computer Networks Chapter 2: Direct Link Networks.
Lecture 6: Framing and Error Detection-Data Link Layer Functions
27-Oct-15Computer Networks1 Outline Chapter 2: Direct Link Networks Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
Fall 2000Datacom 11 Outline Hardware Building Blocks Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
CS3505: DATA LINK LAYER. data link layer  phys. layer subject to errors; not reliable; and only moves information as bits, which alone are not meaningful.
1 CHAPTER 2 HARDWARE BUILDING BLOCK ENCODING FRAMING ERROR DETECTION.
Link Layer Dr. Mozafar Bag-Mohammadi Ilam University.
CSCI-1680 Physical Layer Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Computer Science Division
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 12: Reliability Slides used with permissions.
Computer Networks Lecture 2: Data Link Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn 2015 by S.
Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.
CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.
9-Jan-164/598N: Computer Networks Overview Performance metrics - Section 1.5 Direct link networks –Hardware building blocks - Section 2.1 –Encoding - Section.
An Introduction to Computer Networks
Point-to-Point Links: Framing
Transport Layer: Sliding Window Reliability
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 6: Datalink layer problems Slides used.
1 Hardware Building Blocks Five Issues –Encoding –Framing –Error Detection –Reliable delivery –Access Media Direct Link Networks.
Transmission Errors Error Detection and Correction.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
1 Direct Link Networks: Reliable Transmission Sections 2.5.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Reliability Some slides used with permissions.
CSE331: Introduction to Networks and Security Lecture 4 Fall 2002.
Univ. of TehranComputer Network1 Computer Networks Computer Networks (Graduate level) University of Tehran Dept. of EE and Computer Engineering By: Dr.
Univ. of TehranIntroduction to Computer Network1 An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr.
Computer Networking Lecture 16 – Reliable Transport.
Reliable Transmission
Data Link Networks Hardware Building Blocks Nodes & Links CS380
Data Link Layer.
Advanced Computer Networks
Data Link Layer What does it do?
COMP/ELEC 429/556 Introduction to Computer Networks
Reliable transmission
Point-to-Point Links Outline Encoding Framing Error Detection
Ion Stoica September 6, 2001 EE 122: Lecture 4 Ion Stoica September 6, 2001.
Advanced Computer Networks
Fundamentals of Computer Networks
Hardware Building Blocks
Transport Layer Outline Intro to transport UDP
Dr. Mozafar Bag-Mohammadi Ilam University
Error detection: Outline
EECS 122: EE122: Error Detection and Reliable Transmission
Data Link Layer. Position of the data-link layer.
Presentation transcript:

Univ. of TehranIntroduction to Computer Network1 An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Point-to-Point link Lecture 6: Point-to-Point link

Univ. of TehranIntroduction to Computer Network2 Concepts: Data signal Links Link functions Encoding Framing Error Detection Error correction or reliable transmission Outline

Univ. of TehranIntroduction to Computer Network3 Link Functions Functions 1. Construct Frame with Error Detection Code 2. Encode bit sequence into analog signal 3. Transmit bit sequence on a physical medium (Modulation) 4. Receive analog signal 5. Convert Analog Signal to Bit Sequence 6. Recover errors through error correction and/or ARQ Adaptor Signal Adaptor: convert bits into physical signal and physical signal back into bits

Univ. of TehranIntroduction to Computer Network4 Encoding Goal: send bits from one node to another node on the same physical media Encode binary data onto signals This service is provided by the physical layer Bits flow is between network adaptors. Problem: specify a robust and efficient encoding scheme to achieve this goal How to send clock information? Extract from changes in signals.

Univ. of TehranIntroduction to Computer Network5 Encoding (crieria) Criteria for encoding: Bit rate (in limited BW) Recovering time information (in LAN) Error detecting Immunity to noise and interference Complexity and cost of implementation. Bit rates V.s Baud Rates Baud rates is the number of pulses sent over the link or changing in signals.

Winter 2008CS244a Handout 126 Encoding for clock recovery Problem : Different hosts use locally-generated clocks of nominally the same frequency, but slightly different. E.g. 10MHz +/- 100ppm (“parts per million”) 1. The receiver needs to “recover” the senders clock from the data stream, for example : 10MHz clock +/- 100ppm Flip- Flop Flip- Flop Sender Sender’s Clock Flip- Flop Clock Recovery Unit 10MHz clock +/- 100ppm Receiver Network Link 1) One part per million equals %. Elasticity buffer

Univ. of TehranIntroduction to Computer Network7 Assumptions We use two discrete signals, high and low, to encode 0 and 1 The transmission is synchronous, i.e., there is a clock used to sample the signal In general, the duration of one bit is equal to one or two clock ticks If the amplitude and duration of the signals is large enough, the receiver can do a reasonable job of looking at the distorted signal and estimating what was sent.

Univ. of TehranIntroduction to Computer Network8 Non-Return to Zero (NRZ) 1  high signal; 0  low signal NRZ (non-return to zero) Clock

Univ. of TehranIntroduction to Computer Network9 Problem with NRZ Consecutive 0’s or 1’s may create problems. Synchronization problem because of difference in the sender or receiver clocks. The average of signals which is used to distinguish between low or high may move and make the decoding difficult. This is called baseline wander Unable to recover clock

Univ. of TehranIntroduction to Computer Network10 Non-Return to Zero Inverted (NRZI) 1  make transition; 0  stay at the same level Solve previous problems for long sequences of 1’s, but not for 0’s Clock NRZI (non-return to zero intverted)

Univ. of TehranIntroduction to Computer Network11 Manchester 1  high-to-low transition; 0  low-to-high transition Addresses clock recovery and baseline wander problems Disadvantage: needs a clock that is twice as fast as the transmission rate Efficiency of 50% Clock Manchester

Univ. of TehranIntroduction to Computer Network12 Encodings (cont) Bits NRZ Clock Manchester NRZI

Univ. of TehranIntroduction to Computer Network13 4-bit/5-bit (100Mb/s Ethernet) Goal: address inefficiency of Manchester encoding, while avoiding long periods of low/high signals Solution: Use 5 bits to encode every sequence of four bits such that no 5 bit code has more than one leading 0 and two trailing 0’s Use NRZI to encode the 5 bit codes Efficiency is 80% bit 5-bit bit 5-bit  Unused code are used for control. I.e is for line idle or for the line is dead.  FDDI is using this scheme.

Univ. of TehranIntroduction to Computer Network14 Framing How to distinguish between data and garbage. Break sequence of bits into a frame Typically implemented by network adaptor Frames Bits AdaptorAdaptor Node B Node A

Univ. of TehranIntroduction to Computer Network15 Byte-oriented Approaches Sentinel-based delineate frame with special pattern: or STX, ETX, etc characters. e.g., HDLC, SDLC, PPP Problem: special pattern or characters appear in the payload. Character escaping or stuffing: in BISYNC (from IBM) with DLE character. Body CRC Beginning sequenc e Ending Header

Univ. of TehranIntroduction to Computer Network16 Byte-oriented Approaches (cont) Counter-based include payload length in the header e.g., DDCMP protocol from DEC. problem: count field corrupted solution: catch when CRC fails

Univ. of TehranIntroduction to Computer Network17 Bit-oriented Approaches Frame is a collection of bits, SDLC (IMB) (synch. Data Link Control), later changed to HDLC (high) by OSI Beginning and end with problem: How if the sequence appear in the body. solution: Bit stuffing: add after 5 consecutive 1 a zero. Beginning SequenceHeader Body …….CRCEnding Sequence

Univ. of TehranIntroduction to Computer Network18 Clock-Based Framing e.g., SONET: Synchronous Optical Network By Bellcore Use NRZ, but scramble it for enough transition Multiplex multiple low-speed links into a high sp STS-n (STS-1 = Mbps), each frame 125 us Overhead Payload 90 columns 9 rows

Univ. of TehranIntroduction to Computer Network19 Error Detection To send extra information to find error in the frame. The simplest form is sending two copies, inefficient. Sending the sum of values (?) in the frame, checksum. In Internet, consider 16 bits sequences and then use one-complement to find the result. Sending parity, Odd or even parity. Two dimensional parity.

Univ. of TehranIntroduction to Computer Network20 Error Detecting (goals) Goals: Reduce overhead, i.e., reduce the number of redundancy bits Increase the number and the type of bit error patterns that can be detected

Winter 2008CS244a Handout 1321 Bit error rate An example Assume an N-bit packet, with known BER and independent errors: Packet Error Rate = PER = 1 – (1 – BER) N PER ~= N (BER) if N (BER) << 1 e.g. N = 10 4, BER = = PER = In practice, bit errors occur in bursts: Perhaps caused by mechanical switches that switch slowly relative to a bit-time. If a bit is in error, it is likely that the next bit is in error too. Therefore, bit errors are not independent. So for a given BER, PER < N (BER)

Univ. of TehranIntroduction to Computer Network22 Internet Checksum Algorithm View message as a sequence of 16-bit integers; sum using 16-bit ones-complement arithmetic; take ones- complement of the result. u_short cksum(u_short *buf, int count) { register u_long sum = 0; while (count--) { sum += *buf++; if (sum & 0xFFFF0000) { /* carry occurred, so wrap around */ sum &= 0xFFFF; sum++; } return ~(sum & 0xFFFF); }

Univ. of TehranIntroduction to Computer Network23 Even Parity Check EDC field has 1 bit Sender: If number of 1’s in payload is odd, the check bit is 1, else it is 0 Receiver: Accept the packet if payload number of 1’s match the value of the check bit. Can detect an odd number of bit errors

Univ. of TehranIntroduction to Computer Network24 Two-dimensional Parity Add one extra bit to a 7-bit code such that the number of 1’s in the resulting 8 bits is even (for even parity, and odd for odd parity) Add a parity byte for the packet Example: five 7-bit character packet, even parity

Univ. of TehranIntroduction to Computer Network25 How Many Errors Can you Detect? All 1-bit errors Example: error bit odd number of 1’s Can detect AND correct 1-bit errors

Univ. of TehranIntroduction to Computer Network26 Cyclic Redundancy Code (CRC) T M m R MSB i.e. T = M.2 r + R Modulo-2 addition (XOR) Add r bits of redundant data to an n-bit message Where r << n e.g., r= 32 and n = 12,000 (1500 bytes) r

Univ. of TehranIntroduction to Computer Network27 CRC(cont) Represent n-bit message as n-1 degree polynomial e.g., MSG= as M(x) = x 7 + x 4 + x 3 + x 1 Let k be the degree of some divisor polynomial e.g., C(x) = x 3 + x Transmit polynomial T (x) that is evenly divisible by C(x) shift left k bits, i.e., M(x)x k subtract remainder of M(x)x k / C(x) from M(x)x k

Univ. of TehranIntroduction to Computer Network28 CRC (cont) Receiver polynomial T(x) + E(x) E(x) = 0 implies no errors Divide (T(x) + E(x)) by C(x); remainder zero if: E(x) was zero (no error), or E(x) is exactly divisible by C(x) All operation is done in modulo 2 in which there is no carry. Then, the operation can be done by XOR only.

Univ. of TehranIntroduction to Computer Network29 CRC(cont) Example: M(x)= , C(x) = R The final transmitted message is: T(x) =

Univ. of TehranIntroduction to Computer Network30 Selecting C(x) All single-bit errors, as long as the x k and x 0 terms have non-zero coefficients. All double-bit errors, as long as C(x) contains a factor with at least three terms Any odd number of errors, as long as C(x) contains the factor (x + 1) Any ‘burst’ error (i.e., sequence of consecutive error bits) for which the length of the burst is less than k bits. Most burst errors of larger than k bits can also be detected See Table 2.6 on page 102 for common C(x)

Winter 2008CS244a Handout 1331 Circuit for Calculating CRC +++ g2g2 g1g1 g0g0 M T R G(x) = g 0 + g 1 x + … + g L-1 x L-1 Multiplier

Univ. of TehranIntroduction to Computer Network32 Hamming Distance Given codewords A and B, the Hamming distance between them is the number of bits in A that need to be flipped to turn it into B Example H(011101,000000)=4 If all codewords are at least d Hamming distance apart, then up to d-1 bit errors can be detected and (d-1)/2 error can be corrected.

Univ. of TehranIntroduction to Computer Network33 Reliable Transmission Error detection code Very costly Acknowledgment and timeout Send Acks in opposite direction. Retransmit if sender did not receive Ack.

Univ. of TehranIntroduction to Computer Network34 Acknowledgements & Timeouts Sender Receiver Frame ACK T Timeout Time Sender Receiver Frame ACK T Timeout Frame ACK T Timeout Sender Receiver Frame ACK T imeout Frame ACK T imeout Sender Receiver Frame T imeout Frame ACK T imeout (a) (c) (b)(d)

Univ. of TehranIntroduction to Computer Network35 Stop-and-Wait Problem 1: keeping the pipe full Example 1.5Mbps link x 45ms RTT = 67.5Kb (8KB) 1KB frames imples 1/8th link utilization Problem 2: How about repeated frames? Add a sequence number to frames. Sender Receiver

Univ. of TehranComputer Network36 Performance of Stop & Wait? Without Error T (total time) = 2t p + t f + 2t proc + t ack T proc and t ack are usually negligible. Take a= t p /t f, then utilization η= t f /( 2t p + t f ) =1/(2a+1) Then, utilization depends on a frame Sender Receiver t p = propagate time tftf

Univ. of TehranComputer Network37 Performance of Stop & Wait? a = (D/V)/(L/R) where D= distanceV= Velocity of light L= Length of packet R= Rate a= RD/VL Constant Then, L determines the link utilization, the longer the packet the more link utilization. frame Sender Receiver t p = propagate time tftf

Univ. of TehranComputer Network38 Performance of Stop & Wait? With Error N r is the expected value of sending a frame. η= 1/ N r (2a+1), Then what is N r ? ρ= prob. Of a frame in error N r = i ρ i-1 (1-ρ) =1/ (1-ρ) η= (1-ρ)/(2a+1), frame Sender Receiver t p = propagate time tftf

Univ. of TehranIntroduction to Computer Network39 Sliding Window Allow multiple outstanding (un-ACKed) frames Upper bound on un-ACKed frames, called window SenderReceiver T ime … …

Univ. of TehranIntroduction to Computer Network40 SW: Sender Assign sequence number to each frame ( SeqNum ) Maintain three state variables: send window size ( SWS ) last acknowledgment received ( LAR ) last frame sent ( LFS ) Maintain invariant: LFS - LAR <= SWS Advance LAR when ACK arrives Buffer up to SWS frames  SWS LARLFS ……

Univ. of TehranIntroduction to Computer Network41 SW: Receiver Maintain three state variables receive window size ( RWS ) largest frame acceptable ( LFA ) last frame received ( LFR ) Maintain invariant: LFA - LFR <= RWS Frame SeqNum arrives: if LFR < SeqNum < = LFA accept if SeqNum LFA discarded Send cumulative ACKs  RWS LFR LFA ……

Univ. of TehranIntroduction to Computer Network42 Sequence Number Space SeqNum field is finite; sequence numbers wrap around Sequence number space must be larger then number of outstanding frames SWS <= MaxSeqNum-1 is not sufficient suppose 3-bit SeqNum field (0..7) SWS=RWS=7 sender transmit frames 0..6 arrive successfully, but ACKs lost sender retransmits 0..6 receiver expecting 7, 0..5, but receives second incarnation of 0..5 SWS < (MaxSeqNum+1)/2 is correct rule Intuitively, SeqNum “slides” between two halves of sequence number space

Univ. of TehranComputer Network43 Performance sliding window? Without Error, the same assumption as stop and wait. t p = a, t f =1 W ≥ 2a+1 => η= 1 W η= W/(2a+1) It is the same for selective repeat/reject. frame Sender Receiver 2a +1 for 1 st ack. tftf

Univ. of TehranComputer Network44 Performance of sliding window? With Error, W ≥ 2a+1 => η= 1/ N r, Then what is N r ? W η= W/ N r (2a+1) ρ= prob. Of a frame in error N r = i ρ i-1 (1-ρ) =1/ (1-ρ) W ≥ 2a+1 => η= 1- ρ, W η= W(1- ρ)/ (2a+1) frame Sender Receiver 2a +1 for 1 st ack. tftf

Univ. of TehranIntroduction to Computer Network45 Concurrent Logical Channels Multiplex 8 logical channels over a single link Run stop-and-wait on each logical channel Maintain three state bits per channel channel busy current sequence number out next sequence number in Header: 3-bit channel num, 1-bit sequence num 4-bits total same as sliding window protocol Separates reliability from order