Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.

Similar presentations


Presentation on theme: "Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary."— Presentation transcript:

1 Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary Protocols

2 2 Topics l Introduction l Framing l Error Control l Flow Control l Elementary Data Link Protocols

3 3 Introduction l Algorithms to achieve reliable, efficient communication between two adjacent machines at the layer  Adjacent: Physically connected by a communication channel

4 4 Introduction l Issues  Providing well-defined services to network layer  Framing  Determining how bits are grouped into frames  Error control  Flow control

5 5 Functions of the Data Link Layer l Relationship between packets and frames.

6 6 Services to Network Layer l Transferring data between network layers of machines

7 7 Services l Unacknowledged connectionless service  Appropriate for  Low error rate  Let higher layer(s) recover errors  Real-time traffic, e.g., speech, video  Most LANs, such as Ethernet l Acknowledged connectionless service  Useful over unreliable channels  Each frame sent individually acknowledged  e.g., wireless systems, e.g. 802.11 (WiFi)

8 8 Services l Acknowledged connection-oriented service  Guarantees  Each frame sent is received without error  All frames sent are received in right order  Network layer always receives correct packets in the order in which the packets were sent  Three phases:  Connection establishment  Variables and counters initialization  Frame transmission  Connection release  Variables, buffers, resources freed up

9 9 Framing l Fact  Raw bit stream delivered by physical layer is not error free l Data link layer detects/corrects errors  Framing  Computing checksum  Handling error if any

10 10 Framing l Approaches  Byte count  Flag bytes with byte stuffing  Flag bits with bit stuffing  Physical layer coding violations

11 11 Character Count l A field in header specifies number of characters in a frame. l Problem?

12 12 Flag Bytes with Byte Stuffing l A frame delimited by flag bytes l Four examples of byte sequences before and after stuffing

13 13 Flag Bits with Bit Stuffing l Each frame begins and ends with special bit pattern (flag byte): 01111110 l Problem: 6 consecutive 1s in data l Solution: Bit Stuffing: inserting a 0 after 5 consecutive 1s l Used in USB Original Data After Stuffing After received and destuffed

14 14 Physical Layer Coding Violations l Encoding on physical medium l Framing by invalid physical code  Use some code that does not represent 0 nor 1 l Example  Manchester encoding in classic Ethernet l Combination of approaches is possible  E.g., Ethernet and 802.11 use preamble (well-defined pattern) + byte count

15 15 Error Control l Using acknowledgement  Positive  Negative l Problem: In some cases, sender waits for acknowledgement forever l Solution: Timer l Problem: Duplicate transmission l Solution: Sequence number

16 16 Positive Acknowledgement l Sender sends a message, waits for acknowledgement from receiver, and then sends next message l There’s no free lunch, though  overhead, delay l How does it work?

17 17 Reliability and Acknowledgement l Case 1: no error SenderReceiver TimeData Ack. l Case 2: data lost Sender Receiver TimeData Ack. X Timeout Timeout and retransmission

18 18 Reliability and Acknowledgement l Case 4: ack. lost Sender Receiver TimeData Ack. X Timeout New problem? Duplicate Solution: Sequence number l Case 3: data error Sender Receiver TimeData Ack. Error Timeout Timeout and retransmission

19 19 Flow Control l Needed l Problem  When frames are transmitted faster than receiver can accept, frames will be lost l Solution  Flow control by feedback mechanism

20 20 Elementary Data Link Protocols l Key Assumptions  Network, data link, and physical layers are independent processes communicating by sending messages  Machine A wants to send a long stream of data to machine B over a reliable, connection-oriented service

21 Implementation of Physical, Data Link, and Network Layers 21

22 22 Data Structures and Primitives

23 23 Data Structures and Primitives

24 24 Data Structures and Primitives

25 25 Unrestricted Simplex Protocol l Utopia protocol l Assumptions  Unidirectional data transmission  Transmitting/receiving network layers are always ready  Processing time is ignored  Infinite buffer space  No errors

26 26 Unrestricted Simplex Protocol - Sender

27 27 Unrestricted Simplex Protocol - Receiver

28 28 Simplex Stop-and-Wait Protocol l Assumptions  Unidirectional data transmission  Transmitting/receiving network layers are always ready  Finite processing speed  Finite buffer capacity  No errors l Problem: Sender sends too fast l Stop-and-wait  Senders sends one frame and then waits for an acknowledgement before processing

29 29 Simplex Stop-and-Wait Protocol - Sender

30 30 Simplex Stop-and-Wait Protocol - Receiver

31 31 Simplex PAR Protocol l For noisy channel l Positive acknowledgement w/ retransmission (PAR) l Sender waits for a positive acknowledgement before advancing to the next data item l A. k. a. ARQ (Automatic Repeat reQuest)

32 32 PAR Protocol l Assumptions  Unidirectional data transmission  Transmitting/receiving network layers are always ready  Finite processing speed  Finite buffer capacity  Errors, can be detected l Timer + sequence number  Size (i.e., # bits) of sequence number?

33 33 PAR Protocol – Sender

34 34 PAR Protocol – Sender (Cont’d)

35 35 PAR Protocol – Receiver


Download ppt "Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary."

Similar presentations


Ads by Google