Presentation is loading. Please wait.

Presentation is loading. Please wait.

ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 13.

Similar presentations


Presentation on theme: "ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 13."— Presentation transcript:

1 ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 13

2 ICOM 6115©Manuel Rodriguez-Martinez Lecture Objectives Understand the services provided by the Data Link Layer (Layer 2) –Framing –Error Detection and Correction –Flow of Control

3 ICOM 6115©Manuel Rodriguez-Martinez Internet Protocol Stack Application Layer Transport Layer Internet Layer Data Link Layer Physical Layer

4 ICOM 6115©Manuel Rodriguez-Martinez Data Link Layer (Layer 2) Provides the mechanism for –reliable communication between machines in the same link Wire, fiber, phone line or radio frequency Guarantees that bits are delivered in the order they were sent –Detection and recover from data errors Bits that corrupted because of signal errors –Controlling the rate at which bits are sent Prevent the sender from overrunning the receiver

5 ICOM 6115©Manuel Rodriguez-Martinez Fundamental Abstraction: Frames Data link layer takes network layer packets and encapsulates them into frames

6 ICOM 6115©Manuel Rodriguez-Martinez Frame Exchange between Hosts Routers, switches and regular hosts exchange frames via their Network Interface Card (NIC)

7 ICOM 6115©Manuel Rodriguez-Martinez Frame Organization Header –Addressing Information Ethernet Address of Source and Destination –Control Flags Payload –Data part to store the packets from network layer Trailer –Typically hold error detection information Layer 2 is all about frame management

8 ICOM 6115©Manuel Rodriguez-Martinez Framing Services Data link will use Physical Layer to move bits from sender to receiver Frame is a well-identified group of bits threaded as an atomic unit Three basic types of services to deliver frames –Unacknowledged connectionless –Acknowledged connectionless –Acknowledged connection-oriented

9 ICOM 6115©Manuel Rodriguez-Martinez Unacknowledged connectionless Each framed is send and no ACK is received –No state information is kept between sender and receiver Advantages –Fast for reliable networks Fiber-based links –Simple Disadvantages –Need upper layers to make sure frames arrived, and do so in the proper order!

10 ICOM 6115©Manuel Rodriguez-Martinez Acknowledged connectionless Each frame is ACK as received by receiver –But, no state information is kept between sender and receiver Advantages –Can use less reliable media – Wireless systems! –Routers can work faster packet is correct, only needs forwarding Disadvantages –More overhead Extra frames are used to send ACK

11 ICOM 6115©Manuel Rodriguez-Martinez Acknowledged Connection-Oriented Source and Destination must establish a connection before data can be exchanged Frames are –Received once –Organized in the right order –Free of errors Source and Destination must close the connection when done –Release memory, variables and other resources

12 ICOM 6115©Manuel Rodriguez-Martinez Acknowledged Connection-Oriented Advantages –Reliability –QoS Guarantees –Very fast routing software Disadvantages –Overhead Connection setup and release –Complex to implement

13 ICOM 6115©Manuel Rodriguez-Martinez Framing Schemes Problem –Given a stream of data arriving from the wire, how do we know where a frame starts and end? –We need to know be able to braeak up the bits into bytes that are part of a frame MANUEL-OTC12 890R

14 ICOM 6115©Manuel Rodriguez-Martinez Byte Counting Algorithm Header of frame indicates number of bytes coming The frames have the data –MANUEL –-OTC –12 7MANUEL5-OTC312

15 ICOM 6115©Manuel Rodriguez-Martinez Byte Counting: Tradeoffs Advantages –Easy to implement Disadvantages –When error occurs, the receiver might loose the synchronization of where the frame stars

16 ICOM 6115©Manuel Rodriguez-Martinez Byte Counting Problem

17 ICOM 6115©Manuel Rodriguez-Martinez Sentinel Algorithm Eeach frame starts with a well know byte and ends with a well known byte –Could be the same –ESC – flag byte (sentinel) –HDR – frame header –Payload – frame portion –TR – frame trailer –ESC – flag byte (sentinel) ESCHDRPAYLOADTRESC

18 ICOM 6115©Manuel Rodriguez-Martinez Sentinel: Limitations What happens if sentinel appears on the data?

19 ICOM 6115©Manuel Rodriguez-Martinez Sentinel: Limitations If the sentinel can appear on the data, we must add a sentinel to the sentinel This is called byte stuffing The problem is that the second sentinel might also appear on the data So sentinel will not work unless we can do something clever.

20 ICOM 6115©Manuel Rodriguez-Martinez Cleverness: Bit stuffing Use a sentinel If the sentinel appears on the data, change the data! The receiver must know this –She must know how to change the data back to the original value

21 ICOM 6115©Manuel Rodriguez-Martinez Bit Stuffing (HDLC) Sentinel is special pattern 01111110 Every frame starts and ends with this pattern Normal operation –Sender puts data but if pattern appears on the data, then a 0 is inserted after the fifth consecutive 1 (stuffing) Then the rest of the bits are added –Receiver hunts for 01111110 First time seen means begin of frame Frame is read (de-stuffing) Second time seen means end of frame

22 ICOM 6115©Manuel Rodriguez-Martinez Example of Bit Stuffing

23 ICOM 6115©Manuel Rodriguez-Martinez Recovering from an error Suppose we sent –01111110 101010111110 01111110 But a bit error occurs –01111110 101011111110 01111110 What do we do now? –Hunt for the 01111110 pattern

24 ICOM 6115©Manuel Rodriguez-Martinez Issues with bit stuffing Frame size will be variable –Typically there is a min and max size More data is sent that there actually is Processing overhead incurred in stuffing process


Download ppt "ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 13."

Similar presentations


Ads by Google