Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSIS 6251 CSIS 625 Week 6 Data Link Layer Copyright 2001, 2002 - Dan Oelke For use by students of CSIS 625 for purposes of this class only.

Similar presentations


Presentation on theme: "CSIS 6251 CSIS 625 Week 6 Data Link Layer Copyright 2001, 2002 - Dan Oelke For use by students of CSIS 625 for purposes of this class only."— Presentation transcript:

1 CSIS 6251 CSIS 625 Week 6 Data Link Layer Copyright 2001, 2002 - Dan Oelke For use by students of CSIS 625 for purposes of this class only.

2 CSIS 6252 Overview Data Link Layer –Line Discipline –Flow Control –Error Control Byte Oriented Link Control Bit Oriented Link Control –HDLC MAC Protocols –Wireless –Ethernet

3 CSIS 6253 Line Discipline Line Discipline defines who can send and when they can send. Simplex system –Who is always known –When is usually any time In a duplex system, the sender should send only when it knows that the receiver is ready. –This is in theory, but in practice it only sometimes works this way

4 CSIS 6254 Line Discipline Three phases of communication –Establishment of communication Determines who is sending to whom –Data transfer Moving the data –Termination Tying up loose ends

5 CSIS 6255 ENQ/ACK system Process Sender sends a ENQ (Enquiry) to the intended receiver. Receiver sends back an ACK (Acknowledgement) when it is ready to receive Sender sends data Sender sends EOT (End of Transmission) when done sending. Receiver may send a NAK (Negative Acknowledgement) if it isn’t ready. Used in point to point systems

6 CSIS 6256 ENQ/ACK system Common to have one node a primary and another a secondary –Primary is responsible for initiating communication Some systems have nodes as peers –Either can initiate a transfer In full-duplex system, data and control messages can be sent simultaneously

7 CSIS 6257 Poll & Select system Always has a primary and secondary nodes Process - Poll –Primary node requests data from the secondary –If no data, secondary responds with a NAK –Otherwise secondary responds with the data Process - Select –Primary node selects a secondary node and sends data to it –Secondary responds with ACK after successful transfer of data

8 CSIS 6258 Network Addresses –In a multi-point system, addresses needed so that nodes know who is talking to who –Simple in some systems where physical position or dip-switch sets it. –Ethernet defines that all manufactures of devices include a unique 48-bit (6-byte) address in every device. –Polling 2^48 devices isn’t practical at 10Mbps, with a 60 byte poll it would take –2^24 / 10Mbps * 60 * 8 bytes = 1.35E+10 seconds –or about 428 years

9 CSIS 6259 Media Access Control MAC - Media access Control A multipoint network with no clear master and slave. –master == primary –slave == secondary In this system, there needs to be more complicated protocol than ENQ/ACK or select/poll to figure out who sends when See later on in this lecture….

10 CSIS 62510 Flow Control Flow control - a protocol to ensure that the sender does not overwhelm a receiving station Incoming data must be checked and processed before it can be used –This is often slower than the transmission rate –Receivers need to buffer received data until it is processed –Buffers are always limited

11 CSIS 62511 Flow Control - Stop-n-Wait Stop and Wait flow control is simplest form of flow control Process –Sender sends one frame of data –Sender waits for ACK before sending more –Receiver can slow down process by waiting to send ACK May be simple - but it is inefficient

12 CSIS 62512 Stop-n-Wait efficiency –Entire set of data is divided into n frames –t prop = time to go from sender to receiver depends on distance and medium –t frame = time to send one data frame depends on bit rate and frame size –T D = n(2 t prop + t frame ) = Time to send data –Actual transmission of data is n* t frame –Efficiency is (n* t frame )/ n(2 t prop + t frame ) –= 1 / (1 +2(t prop / t frame )) –If t prop is small and t frame for frame is large, it approaches 100%, but never reaches it.

13 CSIS 62513 Sliding Window Protocol Sliding Window flow control allows for more than one frame to be sent before an acknowledgement is received frames are numbered from 0 to n-1 Sender sends frames up until it has sent n-1 frames Receiver sends back an ACK with the number of the next frame it expects Sender can now send up to this new number Maximum window size is n-1 frames

14 CSIS 62514 Figure 10-14 WCB/McGraw-Hill  The McGraw-Hill Companies, Inc., 1998 Sliding Window Example

15 CSIS 62515 Sliding Window Efficiency If the sliding window is big enough, and the receiver is fast enough, then 100% efficiency can be achieved To get 100% - –2 * t prop  ((n - 1) * t frame ) –t prop = Time for a frame to propagate from one end to the other of the system –t frame = Time to send a frame (based on frame size and bit rate)

16 CSIS 62516 Error Control Error detection and retransmission Error detection is achieved using parity, checksums, CRC, etc –Extra data added to each frame ARQ - Automatic Repeat Request –This abbreviation isn’t really used much

17 CSIS 62517 Stop-n-Wait Error Control Extension of Stop-n-Wait flow control –When a good frame is received, an ACK sent back to originator. –When a damaged frame is received, a NAK is sent back to originator –When a NAK is received, the same frame is retransmitted

18 CSIS 62518 Stop-n-Wait Error Control Any frame may be dropped - data or NAK or ACK. –If ACK isn’t received after some time, a NAK is assumed –If a NAK is lost - timeout and retransmission –If a ACK is lost timeout and retransmission Frames must be numbered so receiver can throw away duplicates –If data is lost - timeout and retransmission Has same efficiency issues

19 CSIS 62519 Go-back-N Error Control Uses a Sliding window If a NAK is received or an ACK timeout occurs –all data since last ACK received is resent –This may be several frames ACKs contain next expected frame number NAKs contain errored frame number

20 CSIS 62520 Selective-Reject Error Control Uses a Sliding window –If a NAK is received, only the damaged frame is resent Selective Reject is more complicated to implement –Receiver must contain the sorting logic to enable it to reorder frames –Sending device must contain searching mechanism to enable it to find and select only the requested frame for retransmission –Buffer in the receiver must keep all previously received frames on hold until all retransmissions have been sorted, duplicates identified and discarded –ACK numbers must refer to the frame received instead of next frame expected

21 CSIS 62521 Selective-Reject Error Control More efficient as it resends less data –If errors don’t occur very often - there isn’t a big difference in efficiency Selective Reject is rarely implemented over Go-back-N method

22 CSIS 62522 Byte Oriented Link Control List here is all from Modem communications world –Normally people don’t address these as link layer controls Not just data-link as most of these protocols addressed issues of file-transfer XMODEM –Stop-n-Wait error control –Fixed data field of 128 bytes, CRC-8 YMODEM –increased data field to 1024 bytes, CRC-16

23 CSIS 62523 Byte Oriented Link Control ZMODEM –More features –Sliding window Kermit –sliding window –Also a terminal emulation package BSC - Binary synchronous communication –No-one cares about this one

24 CSIS 62524 Bit Oriented Link Control Many bit Oriented protocols today are oriented around HDLC Ethernet, Token-Ring and other LAN technologies are also bit-oriented SONET, T1, and most telephony systems are bit-oriented. It is common to use HDLC over a SONET or T1 system

25 CSIS 62525 HDLC node types Primary station –Has complete control over the link –Can be used in point-to-point or multi-link Secondary station –Receives commands from the primary and responds accordingly Combined station –Can both command and respond to commands –Used in peer to peer (or balanced) configurations

26 CSIS 62526 HDLC Configurations Unbalanced –One primary node and one or more secondary nodes –May be point-to-point or multi-point –Full or half-duplex Balanced –point-to-point topology only –Both nodes are combined stations

27 CSIS 62527 HDLC Modes of Communication NRM - Normal Response mode –Standard Primary-secondary relationship –Secondary can transmit only when polled ARM - Asynchronous Response Mode –A secondary may initiate a transmission without permission from the primary ABM - Asynchronous Balanced Mode –Combined stations - either can initiate –Point-to-point topology

28 CSIS 62528 HDLC Frame structure Frame of data consists of: –Flag: 8 bits –Address: 1 or more bytes –Control: 8 or 16 bits –Information: many bits –Frame Check Sequence (FCS): 16 or 32 bits –Flag: 8 bits

29 CSIS 62529 HDLC Flag byte The flag is a special bit pattern that signifies the start/end of a frame. A single flag byte may be used to end one frame and start another Flag bit pattern is 0111 1110 Bit stuffing is used to make sure this pattern does not occur any where else. Bit stuffing occurs on all bytes (control or data) that are not flag bytes

30 CSIS 62530 HDLC Address field First seven bits are used for address Last bit - if a 1 then there are no more address bytes Last bit - if a 0 then there is another address byte Last bit of last address byte is always a 1 Number of address bits is a multiple of 7

31 CSIS 62531 HDLC Control Field One or two byte segment for flow management Control fields change based on type of frame If first bit is 0 –frame is an I-Frame If first bit is 1 and second 0 –frame is an S-Frame If first bit is 1 and second 1 –frame is a U-Frame

32 CSIS 62532 HDLC Control Field I-Frame - Information Frame –3 bits for send sequence number –3 bits for receive sequence number (ACKs) –1-bit - Poll/Final bit From secondary - set to 1 if last I-frame of response From primary - set to 1 if polling secondary for data S-Frame - Supervisory Frame –3 bits for receive sequence number –2 bits for “supervisory” functions –1 bit - Poll/final bit –S-Frames used for ACK when no data

33 CSIS 62533 HDLC Control Field U-Frame - Unnumbered frame –1 bit- Poll/Final bit –5 bits - “Unnumbered function” bits S-frames can be used for: reject selective rejects receiver ready receiver not ready

34 CSIS 62534 HDLC Control Field U-frames can be used for Mode setting (primary/secondary) unnumbered information transfer recovery - bad commands, etc initialization disconnect test command/response

35 CSIS 62535 HDLC - Information field The information field is a series of bits until the next flag byte is found S-Frame has no information field The last 16 or 32 bits of the Information field is actually the FCS FCS - Frame check sequence –a 16 or 32-bit CRC on the data

36 CSIS 62536 MAC - Media Access Control When there are multiple nodes that can all transmit on a given link, a means of controlling them is necessary The MAC layer is a sub-layer of data link layer in these situations. The Logical Link Control (LLC) Layer is the other sub-layer MAC is the lower sub-layer, LLC is the upper sub-layer

37 CSIS 62537 MAC assumptions 1 - Station Model There are N independent stations (aka nodes) that generates frames of data for transmission 2 - Single Communications Channel 3 - Collision detection All stations can detect collisions 4 - Time frame Continuous time - any frames starts at any time Slotted time - Time divides into discrete slots 5 - Carrier sense (or not) The nodes can detect if the channel is busy

38 CSIS 62538 ALOHA protocol Ground based radio broadcasting Developed at University of Hawaii Pure ALOHA –Any node starts transmitting at any time –Receiving node detects if a collision occurs Same if partially or completely clobbered –If data not properly received, the transmitter waits a random amount of time and resends.

39 CSIS 62539 ALOHA Protocol Slotted ALOHA –A special node emits a “pip” at the start of each interval. –All frames start at the beginning of an interval Both Pure ALOHA and Slotted ALOHA have a point at which adding more traffic results in worse throughput –The collisions keep piling up and causing more and more collisions –Slotted ALOHA will take about 2x as much load as Pure ALOHA

40 CSIS 62540 Carrier Sense Multiple Access (CSMA) Protocols Nodes listen to see if someone else is transmitting before they send their packet. –Better performance than ALOHA 1-Persistent CSMA –Transmitter waits until the the line is idle and sends immediately Nonpersistent CSMA –Transmitter waits random time time if the line isn’t idle –Leads to better utilization AND longer delays

41 CSIS 62541 CSMA Protocols continued p-Persistent CSMA –Uses slotted channels - If slot is idle there is a probability of p that transmitter will use the channel.

42 CSIS 62542 CSMA/CD - Carrier Sense Multiple Access with Collision Detection Extend the idea so that if two nodes detect a collision they stop transmitting immediately Quickly terminating the transmission saves time and bandwidth To detect collision, need to transmit for 2x the maximum propagation time. –Time for signal to transmit from one end to the other –PLUS Time for colliding signal to transmit from far end back

43 CSIS 62543 Wireless Protocols Typically nodes are all trying to talk with a central (wired) hub Sometimes (but not always) the nodes can “hear” one another Hidden station problem –When one node can’t hear another and tromps on transmission to a third node Exposed station problem –When one node hears another node and so won’t transmit to a third, even through it could.

44 CSIS 62544 Wireless Protocols and CSMA CSMA tells the transmitter if there is activity near, but you want to know if there is activity by the receiver. MACA - Multiple Access with Collision Avoidance. MACAW - MACA with refinements CSMA/CA - another name for MACA like system –Carrier Sense Multiple Access with Collision Avoidance

45 CSIS 62545 Wireless Protocols continuted MACAW basics - A sending to B –A sends B an RTS (Request to Send) frame with length –B sends A a CTS (Clear to Send) frame with length –A sends B the data frame –Other nodes that hear CTS know to be quiet for that time period (based on length)

46 CSIS 62546 Further reference http://www.techfest.com/networking/index. htm


Download ppt "CSIS 6251 CSIS 625 Week 6 Data Link Layer Copyright 2001, 2002 - Dan Oelke For use by students of CSIS 625 for purposes of this class only."

Similar presentations


Ads by Google