190 likes | 200 Views
This lecture covers the design issues of the data link layer, including framing, error detection and correction, and flow control. It also discusses the services provided to the network layer and the functions of the data link layer.
E N D
EEC-484/584Computer Networks Lecture 12 Wenbing Zhao Cleveland State University wenbing@ieee.org
Medium Access Control (MAC) DLL Data Link Outline • Quiz#3 Result • Reminder: EEC584 initial draft due midnight today • Data Link layer • Data Link Layer Design Issues • Framing • Error Detection and Correction (omitted) • EEC484 only: project walk-through We Cover This SubLayer in this lecture EEC-484/584: Computer Networks
EEC484 Quiz#3 Result • Average: 80.8, high: 95, low: 57 • Q1-37.5, Q2-16.9, Q3-12.9, Q4-13.5 EEC-484/584: Computer Networks
EEC584 Quiz#3 Result • Average: 92, high: 100 (4), low: 80 • Q1-44.2, Q2-18.7, Q3-14.8, Q4-14.4 EEC-484/584: Computer Networks
Data Link Layer Design Issues • Services Provided to the Network Layer • Point-to-point, source-to-destination • Framing • Physical bit stream divided up into frames • Error Control • Acknowledgements (acks), retransmission, duplicate suppression • Flow Control • Throttle sender so sends no faster than receiver can receive them EEC-484/584: Computer Networks
Functions of Data Link Layer • Provide a virtual source-to-destination communication channel to the network layer • Dealing with transmission errors • Regulating data flow EEC-484/584: Computer Networks
Services Provided to Network Layer (b) Actual communication (a) Virtual communication EEC-484/584: Computer Networks
Placement of Data Link Protocol EEC-484/584: Computer Networks
Types of Services Provided to Network Layer • Unacked connectionless • Ok if low error rate, real time applications • Acked connectionless • Unacked connection-oriented • Acked connection-oriented EEC-484/584: Computer Networks
Framing • DL layer divides physical bit stream into frames • Checksum computed by source included in frame • Checksum recomputed by destination and checked against checksum included in the frame • Discard/recover bad frame, notify source EEC-484/584: Computer Networks
How Does DL Layer Form Frames? • Insert time gaps between frames: too risky • Character count • Flag bytes with byte stuffing • Starting and ending flags, with bit stuffing • Physical layer coding violations • Example: encode 1 bit of data with 2 bits • 1 => 10 • 0 => 01 • Can use 00 or 11 to delimit frames EEC-484/584: Computer Networks
Framing Based on Character Count • Use field in header to indicate number of characters in frame • Problem: Count might be garbled EEC-484/584: Computer Networks
Framing Based on Byte Stuffing • Each frame starts and ends with a special flag byte • Problem: flag byte might appear in data • Solution: • Source inserts ESC (DL escape) before each flag byte; ESC before each ESC • Destination removes inserted ESC bytes • Disadvantage: depends on 8-bits characters in ASCII EEC-484/584: Computer Networks
Framing Based on Byte Stuffing EEC-484/584: Computer Networks
Framing Based on Bit Stuffing • Each frame begins and ends with special bit patterns, 01111110 (in fact, a flag byte) • When source’s data contains 11111, stuff 0 • When destination receives 111110, deletes 0 • Advantages: • Allows arbitrary number of bits per frame • Allows arbitrary number of bits per character EEC-484/584: Computer Networks
Framing Based on Bit Stuffing: Example Original Frame (payload only) Frame after bit stuffing Received Frame after taken stuffed bit out EEC-484/584: Computer Networks
Exercise • Q1. The following character encoding is used in a data link protocol: A: 01000111; B: 11100011; FLAG: 01111110; ESC: 11100000 Show the bit sequence transmitted (in binary) for the four-character frame: A B ESC FLAG when each of the following framing methods are used: (a) Character count. (b) Flag bytes with byte stuffing. (c) Starting and ending flag bytes, with bit stuffing EEC-484/584: Computer Networks
Exercise • Q2. The following data fragment occurs in the middle of a data stream for which the byte-stuffing algorithm described in the text is used: A B ESC C ESC FLAG FLAG D. What is the output after stuffing? EEC-484/584: Computer Networks
Exercise • Q3. A bit string, 0111101111101111110, needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing? EEC-484/584: Computer Networks