Chapter 7 - Data Link Layer

Document Sample
Chapter 7 - Data Link Layer Powered By Docstoc
					Chapter 7 - Data Link Layer
 It is about various protocols being used in
  data link layer, the second lowest layer in
  ISO/OSI reference model.
 The protocols are generally classified into
  byte oriented and bit oriented protocols.
 Error detection and correction is done in
  this layer by re-transmitting the error
  frame.
Objective
 Understand the functions of data link layer
 Identify the structure of Bisync frame or
  block
 Understand high level Data Link Control
  Procedures
Functions of Data Link Layer
 Frame Flow control, To prevent the sender from
  sending too fast.
 Error Control and Detection, To maintain the
  frames being transmitted/received are in
  sequence and to make sure the frames haven't
  been distorted due to transmission error.
 Link awareness, To monitor the link conditions
  and ensure the other end is still alive.
Example of Flow Control
Other Link Protocols
 High Level data Link Control (HDLC: ISO). It is also
  the superset of SDLC, LAP and LAPB.
 Synchronous Data Link Control (SDLC: IBM). It is
  the proprietary product of IBM System Network
  Architecture (SNA)
 Advanced Data Communication Control
  Procedure (ADCCP: ANSI)
 Link Access Protocol (LAP: ITU-T)
 Hewlett Packard Data Link Control (HPDLC: HP)
Layer 2 frame
 Protocol Data Unit (PDU) for data link layer
  is often called a frame
  • Header, Data Field.............., Trailer
 The header: called PCI in OSI model) and
  contains control information.
 Data Field: Data
 Trailer: Frame Check Sequence
Sources of error
   White Noise
     • It is present in all electronic devices and cannot be
       eliminated by any circuits.
   Interference
     • It is caused by picking up the unwanted
       electromagnetic signals nearby such as crosstalk due
       to adjacent cables transmitting electronic signals or
       lightning causing power surge.
   Human error
     • Noise sometimes is caused by human being such as
       plugging or unplugging the signal cables, or power
       on/off the related communications equipment.
Example of the presence of noise
Noise Prevention
 Shielding (with protection)
 Changing multiplexing techniques
 Improving connection quality with better
  equipment
Error Detection
 A few codes or bits in association with the
  data are appended to the
 frame so that the receiver can detect the
  presence of error by using a simple
  algorithm.
  • Vertical Redundancy Check
  • Longitudinal Redundancy Check
  • Cyclic Redundancy Check
Vertical Redundancy Check
   A single bit either '1' or '0' is appended to the end of each
    character to produce an odd or even number of '1' bits.
   This method is commonly used in start/stop transmission
Longitudinal Redundancy Check
 This method is better than a simple Vertical
  Redundancy Check.
 The data is grouped into blocks of
  characters, say for example 12 bytes.
 A block check character (BCC) is then
  appended to the end of each transmission
  block.
 The size of BCC can be 8, 12 or 16 bits
  depending on the algorithm.
Cyclic Redundancy Check
   This is a faster method and is commonly used in protocol
    operating at synchronous mode such as SDLC.
    In this method, the data to be sent is divided by a set of
    binary constant called the generator polynomial.
   The remainder after division called Frame Check
    Sequence (FCS) will be appended to the original data
    stream.
   The original data plus the frame check sequence will be
    transmitted over the transmission media.
Byte and Bit protocols
 The data link layer protocols based on the
  frame structure
 can be classified into:Byte oriented such
  as IBM BSC
  • SYN, SYN, DLE, STX, Data, DLE, ETX, BCC, BCC
 Bit oriented such as HDLC (High level Data
  Link Procedure) or SDLC
  • Flag, Address, Control, Data........, FCS, FCS
Byte-oriented Protocols
 This type of protocols was developed a long
  time ago.
 A well known example is the IBM BISYNC
  protocol used in Remote Job Entry (RJE).
 Although this protocol is pretty old, it is still
  used by Banks as one of the protocols
  because of reliability.
Byte-oriented Protocols
   Half duplex in Data Link Level ( can have FDX or HDX in
    physical level.)
   Data link Level (not in physical level)
   An industry standard
   Used in Synchronous modem (Some users may use
    Sync/Async protocol converter to fit into his own system
    such as Reuters.)
   Uses either ASCII or EBCDIC as the code sets
   Ideal for Low speed and High volume transaction
   Uses VRC, CRC or LRC to determine transmission error
Byte stuffing
   Since BISYNC uses a lot of binary characters (STX, SYNC)
    for control purpose, a pair of special characters DLE is
    used to quote the binary data so that the receiver will
    transparently treat the bracket data.
   For example, Binary data contains STX will be converted
    by DLE STX to inform the receiver that STX is not the start of
    text but part of data.
   Use of DLE to quote data is called byte stuffing
BSC Line States
   There are FOUR line states that BSC will be used to
    transfer data. Initially, BSC will be in disconnected state
    until it receives an event, it will then change to other state
    and take appropriate action.
   Disconnected, No virtual connection has been established
   Connected, A virtual connection has been established.
    The line can then move to Text or Control state.
   Control, Can exchange control information such as ENQ or
    ACK0 etc.
   Text, Data frame is exchanged.
Data Flow
 It is to lay down rules to control   if a sender
  can transmit a frame.
 For simplicity, both send and receive party
  can be considered to consist of a sender
  and a receiver.
Normal BSC Data Flow (BSC
Contention)
   It shows the normal data flow with acknowledgment
    frame.
   The transmitter initially transmits an ENQ and waits for an
    ACK0 prior to sending the test frame.
Line Bid Time outs (BSC
Contention)
 After polling the remote for eight times, the
  sender may assume that the remote
  machine is dead (usually power off) and
  will stop polling.
Error Control - NAK (BSC Contention)

   A NAK (negative acknowledgment) will be sent back to the
    transmitter, if the received data has detected a transmission error by
    checking the received frame against the Block Check Character
    (BCC).
Error Control - Lost Acknowledgment (BSC
Contention)


   If the transmitter cannot receive the acknowledgment
    from the receiver, it will send an ENQ instead of data frame
    and waits for the positive acknowledgment from the
    receiver.
Error Control - Lost Message (BSC
Contention)
   The transmitter will send an ENQ instead. However, the
    receiver will send an ACK0 instead of ACK1 after receiving
    the second ENQ
WAIT FOR ACK - WACK (BSC
Contention)
 If the receiver is busy, it will respond an
  WACK to temporarily stop the sender until
  the busy condition is removed.
Temporary Text Delay - TTD (BSC
Contention)
 In this case, the sender is busy, it delays for
  2 seconds and sends an TTD to inform the
  receiver to suspend the transmission.
Duplicated frames
   Duplicated frames occur for various reasons such as lost
    of acknowledgment.
   It shows the duplication of data frame due to lost frame.
    and the condition when the receiver is too late to
    acknowledge the frame.
Bit-oriented Protocols
 These protocols interpret the message as a
  stream of unstructured bits and uses the relative
  bit position to determine the control information.
 This mechanism is more efficient compared to
  byte-oriented protocols and is extremely suitable
  for simultaneous communications protocols
  such as HDLC and SDLC.
 The entire message is delineated by a Flag
  whereas the BSC has to use numerous control
  fields such as SYNC, STX etc.
Control field format
   There are three different formats for this fields, with a few
    bits assigned to identify which format is being sent.
   Information format (I), Supervisory format Non sequence
    format,
Bit stuffing
 Bit-oriented protocols use a unique
  sequence of bits such as 7E for the start and
  end of frame.
 To avoid an occurrence of this flag bit
  pattern (01111110) anywhere, the sending
  station will automatically insert an extra
  zero into the five contiguous '1' bit stream.
 The receiving station will monitor the bit
  stream and delete the extra zero.
HDLC
 The High-level data link control protocol
  (HDLC) is a full-duplex bit-oriented protocol.
 This protocol has a few configurations
Flow Control
   There are two methods namely rate control and sliding
    window to regulate the flow of frames.
   Sliding window uses the size of sending window to
    restrict the number of frames being sent out.
     • Link Initialization & Disconnection
     • Sliding Window (The normal value is 7 for 3-bit control
       field).
     • It consists of
         – Sending Window
         – Receiving Window
         – Error Handling
Link Initialization
   It shows the methods of establishing a call under
    three response modes. UA frame is used to
    respond to all three cases.
Link Disconnection
 It shows the methods of terminating a call
  under three response modes
Sliding Window Example
   It shows two examples of using sliding send windows to
    control the number of frames to be delivered.
   In case 1, the transmitter can send out a series of frame
    numbered from 0 to 6 and in case, it sends out from 0 to 4
Error Handling
   In case there is a transmission error, the receiver simply
    responds a Reject frame against the corrupted frame or a
    Receive Ready.
   In case various errors as listed below are not caused by
    transmission, the receiver will send a FRMR such as
     • Bad Address field
     • Fewer than 32 bits between flags
     • Information field is not a multiple of 8 bits
   Receiver does nothing upon receipt of an invalid frame. It
    simply reports this event to higher layer and waits for a
    link re-initialization.
Go Back N, Error Handling
   An REJ signal is sent to A for an invalid frame of sequence
    5. Note that A has to re-send the data frame starting from
    sequence 5.    A                    B
                            I 0,0
                            I 1,0
                            I 2,0
                            I 3,0
                            I 4,0
                            I 5,0
                            I 6,0               Invalid Frame
                                              Sequence error
                            REJ 5             frame discarded
                                               Information frame = i
                                               NS,NR Supervisory
                            I 5,0
                                               REJ frame = REJ NR
                            I 6,0
Selective Repeat, Error Handling
 An SREJ frame is sent from B to A for an
  invalid frame of sequence 4 as shown
  below         Information frame = i
                NS,NR Supervisory
                SREJ frame = SREJ NR
         A          I 0,0             B
                    I 1,0
                    I 2,0
                    I 3,0
                    I 4,0
                    I 5,0                Invalid Frame
                    I 6,0            frames buffered
             SREJ 4
                       I 4,0           Acknowledges
                                       frames 0-3
                       I 7,0

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:12
posted:2/29/2012
language:English
pages:38