Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be.

Similar presentations


Presentation on theme: "Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be."— Presentation transcript:

1 Review:

2 Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be addressed: Errors in the physical layer Two machines may have different speeds –Design issues: services interface to the network layer how to group bits into frames (framing) how to deal with errors (error control). how to deal with speed mismatch (flow control).

3 Service interface: unreliable connectionless service reliable connectionless service reliable connection-oriented service –Advantages of each service type: –Unreliable connectionless: »Efficient when error rate is very low, »Ideal for real time traffic –acknowledged connectionless: »Error rate is high, less retries are needed –acknowledged connection-oriented »guarantee order, upper level software is simpler

4 Framing (break the bit stream into frames) –Why framing? Raw bit stream cannot provide any error detection capability. –Bits may change (lightning strikes). –Bits may get lost (clock drift). Cut the raw bit stream into frames -> can then compute the checksum for the frame. Misunderstanding of the two parties will result in an unmatched checksum. –How to do framing? –Character count –Starting and ending characters with character stuffing –starting and ending flags with bit stuffing –physical level code violation.

5 Character count. Frame: Count + frame data E.g 5 1 2 3 4 5 6 7 8 9 8 0 1 2 3 4 5 6 Problem: what if a count is altered during transmission?

6 Byte oriented framing. –Each frame is a sequence of bytes. Use special characters to signal the start and end of a frame. –E.g STX: start of text, ETX: end of text. Frames: STX frame_data ETX STX frame_data ETX. PROBLEM: WHAT IF frame_data = ETX Solution: Byte stuff the character ETX Introduce another escape character: DLE: data link escape. Characters that need to be stuffed? Example: frame data = STX DLE ETX frame = ??? –Advantage: can recover frames. –Limitation: ties to a particular character set.

7 Bit oriented framing. –A frame is a sequence of bits, using special bit patterns to signal the start and end of a frame. –E.g: special pattern 01111110 Frames: 01111110 frame_data 01111110. PROBLEM: WHAT IF frame_data = 01111110 Solution: Bit stuffing: make sure that such bit pattern will not occur in the frame data --> after 5 1’s add a 0 automatically. Example: 011111100111110100111110 The sender always adds a 0 after five1’s, the receiver always deletes the 0 after five 1’s. Example: frame_data=011111011111111111111110

8 Physical layer coding violation. –Use special symbol (that never occur in the data) for the frame boundary. –E.g: Manchester code 1: low to high, 0: high to low. Frame boundary symbol: high-high or low-low.

9 Error control –How to make sure that each frame is eventually delivered to the destination (reliable service)? –Reliability through acknowledgement Sender knows that the frame is delivered when it gets the acknowledgement. –Sender sends, resends when NACK. –Receiver sends ACK when the checksum is correct, NACK when incorrect. Problem? What if the whole packet gets lost? –Solution: timeout. Problem? –Need to do more.

10 Flow control –To avoid swamping the slow receiver. –Use a feedback mechanism to make sure that the sender knows the status of the receiver. “send me N frames and no more until I tell you to continue”

11 Data link layer protocols: P0 - Nothing Sender –get a packet from the network layer –Add frame header, send the frame to the physical layer. Receiver –get a frame from the physical layer –strip the header –pass the packet to the network layer.

12 P1: Stop and wait (flow control) Assumption: no lost packets Sender –get a packet from the network layer –Add frame header, send the frame to the physical layer. –Wait for ACK Receiver –get a frame from the physical layer –strip the header –pass the packet to the network layer. –Send ACK.

13 P2: stop and wait + timeout + sequence number ( flow control + error control ) Sender –get a packet from the network layer –Add frame header (seq), send the frame to the physical layer. –Wait for ACK till timeout –If timeout, resend the packet, back to waiting Receiver –get a frame from the physical layer –strip the header –if (seq = expected) pass to the network layer. Send ACK –Else send ACK

14 Stop and Wait in action

15

16 Stop-and-wait operation first packet bit transmitted, t = 0 senderreceiver RTT last packet bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R

17 Performance of Stop-and-Wait rdt3.0 works, but performance stinks example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet: T transmit = 8kb/pkt 10**9 b/sec = 8 microsec –U sender : utilization – fraction of time sender busy sending –1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link –network protocol limits use of physical resources! L (packet length in bits) R (transmission rate, bps) =


Download ppt "Review:. Chapter 3: The Data Link Layer –achieve reliable, efficient communication between two physically connected machines. –Example problems to be."

Similar presentations


Ads by Google