OSI Model _Open System Interconnection Model_ Application by jlhd32

VIEWS: 88 PAGES: 30

More Info
									Data Link Control
OSI Model (Open System Interconnection Model)
                     Application    Layer 7 Protocol
                                                       Application    Layer 7
    Peer Processor




                     Presentation   Layer 6 Protocol
                                                       Presentation   Layer 6


                       Session      Layer 5 Protocol
                                                         Session      Layer 5


                      Transport     Layer 4 Protocol
                                                        Transport     Layer 4


                       Network      Layer 3 Protocol
                                                         Network      Layer 3


                      Data Link     Layer 2 Protocol
                                                        Data Link     Layer 2


                       Physical     Layer 1 Protocol
                                                         Physical     Layer 1
                                    Peer Protocol
Data Link Control

                Connectionless without reliability
             Establish connection is not necessary
                 Acknowledgment is not need
                 Connectionless with reliability
             Establish connection is not necessary
                    Acknowledgment is need
               Connection-oriented with reliability
               Establish connection is necessary
                   Acknowledgment is need
Data Link Control
Frame Synchronization
   Data are sent in blocks called frames. The beginning and end of each
   frame must be recognizable
Flow Control
   The sending station must not send frames at a rate faster then the
   receiving station can absorb them.
Error control
    Any bit errors introduced by the transmission system must be corrected

Addressing
   On a multipoint line, such as a local area network (LAN), the identity
   of the two stations involved in a transmission must be specified
Data Link Control
Control and data on same link
   It is usually not desirable to have a physically separate communications
   path for control information. Accordingly, the receiver must be able to
   distinguish control information from the data being transmitted.
Link management
    The initiation, maintenance, and termination of a sustained data exchange
    requires a fair amount of coordination and cooperation among stations.
    Procedures for the management of this exchange are required

                             Link management


     Flow Control              Error Detection             Error Control
Data Link Control
  Flow Control
 Flow control is
   a technique
  for assuring
       that
 a transmitting
      entity
    does not
   overwhelm
   a receiving
      entity
    with data.
    Buffer Size
Data Link Control
Stop-and-Wait Flow Control                                        simplest form of flow control.




                Only one frame




Transmission Time
Transmission        :    The time it take for a station to transmit a frame that is normalized to one
                                     take for a station to transmit a frame that is normalized to one
Propagation delay
Propagation delay   ::   The time it takes for a bit to travel from sender to receiver that is expressed as “a”
                         The time it takes for a bit to travel from sender to receiver that is expressed as “a”
Data Link Control
Stop-and-Wait Flow Control

    propagation time less than transmission time
           The frame is sufficiently long that the first bits of the frame have
           arrived at the destination before the source has completed the
           transmission of the frame.

    propagation time greater than transmission time
           The sender completes transmission of the entire frame before
           the leading bits of that frame arrive at the receiver


Transmission Time
Transmission        :    The time it take for a station to transmit a frame that is normalized to one
                                     take for a station to transmit a frame that is normalized to one
Propagation delay
Propagation delay   ::   The time it takes for a bit to travel from sender to receiver that is expressed as “a”
                         The time it takes for a bit to travel from sender to receiver that is expressed as “a”
Data Link Control
Sliding-windows flow control           Multiple Frame   Full-duplex link




                         3-bit field




 Sequence number of the next frame
Data Link Control
                         Each time a frame is sent, the shade window shrinks
                         Each time a frame is sent, the shade window shrinks
                         each time an acknowledgment is received the shade window grows
                         each time an acknowledgment is received the shade window grows




                                    ady   3
         Next 7 Frames
                          Receive-Re




                                                   RNR 5 ::
                                                   RNR 5
                                                    received 4 but unable to
                                                    received 4 but unable to
                                                    accept any more
                                                    accept any more
                             Example of a sliding-window protocol
Data Link Control
Error Detection
    Pb : Probability of a single bit error or bit error rate
    P1 : Probability that a frame arrives with no bit errors.
    P2 : Probability that a frame arrives with one or more undetected bit errors
    P3 : Probability that a frame arrives with one or more detected bit errors
         but no undetected bit errors
    F : the number of bit per frame



                         P = (1 − Pb )
                                                   F
                          1

                         P2 = 1 − P1
Data Link Control
Error Detection and Correction
    1. ใหผูรับตรวจสอบความผิดพลาดและแกไขขอมูลที่สงใหถูกตองดวยตัวเอง
    2. ใชเทคนิคการสะทอนกลับ (Echoplex) โดยผูรับจะสงขอมูลที่ไดรับกลับไป
       ที่ผูสง ถาขอมูลตรงกับแสดงวาการสงในครั้งนั้นถูกตอง
                                              ่
    3. การตรวจสอบแบบอัตโนมัติ โดยการเพิมขอมูลสําหรับใชในการตรวจสอบ
       เพิ่มเขาไปในนอกเหนือจากขอมูลที่สง

                                      Frame Check Sequence
                                      Frame Check Sequence
                                             (FCS)
                                             (FCS)
Data Link Control
Error Detection




              Parity Check   Cyclic Redundancy Check (CRC)
Data Link Control
Parity Check
    The simplest error-detection scheme is to append a parity bit to the end of
    a block of data.
        Synchronous transmission
                                                             XOR
               Even parity           G (1110001) + Odd parity
               Odd parity                  G (11100011)
                                             (11100011)

        Asynchronous transmission          G (11000011)
                                             (11000011)           ERROR

                                           G (11000001)
                                             (11000001)         NO ERROR
Data Link Control
Block Check Character   P   7   6   5   4   3   2   1   Character
                        1   1   0   0   0   0   0   1      1
                        1   1   0   0   0   0   1   0      2
                                                                    XOR
                        0   1   0   0   0   0   1   1      3
                        1   1   0   0   0   1   0   0      4
                        0   1   0   0   0   1   0   1      5
                        0   1   0   0   0   1   1   0      6
                        1   1   0   0   0   1   1   1      7
                        1   1   0   0   1   0   0   0      8
                        0   1   0   0   1   0   0   1       9
                        0   1   0   0   1   0   1   0      10
                        1   1   0   0   1   0   1   1      11
                        0   1   0   0   1   1   0   0      12
                        1   1   0   0   1   1   0   1      13
                        1   1   0   0   1   1   1   0      14
                        1   0   0   0   1   1   1   1     BCC
Data Link Control
Cyclic Redundancy Check (CRC) or Polynomial Code
   One of the most common, and one of the most powerful.

   110001    1 x X55 + 1 x X44 + 0 x X33 + 0 x X22 + 0 x X11 + 1 x X00   X55 + X44 + 1

  Transmitter
                               Frame Check Sequence)
  Generate an n-bit sequence ((Frame Check Sequence)                        k+n bit

   Modulo 2 Arithmetic Uses binary addition with no carries or XOR
    1111      11001            T = (k + n)-bit frame to be transmitted with n < k
   +1010     x   11            M = k-bit message, the first k bits of T
    0101     101011            F = n-bit FCS, the last n bits of T
                               P = pattern of n + 1 bits
                               E = error
Data Link Control
 CRC Calculating                                       1101010110    Q
                                       P   110101 101000110100000    2nM
                                                  110101
                                                   111011
   Message (M) = 1010001101 (10-bits)              110101
                                                     111010
                                                     110101
    Pattern (P) =    110101 (6-bits)                   111110
                                                       110101
                     To be calculated                     101100
       FCS (R) =                                          110101
                         (5-bits)                          110010
                                                           110101
  Transmitter                                                01110   R

                               Frame Check Sequence)
  Generate an n-bit sequence ((Frame Check Sequence)           k+n bit

  Transmitter                   Receiver                      Remainder
  101000110101110
   101000110101110              101000110101110
                                101000110101110                 00000
Data Link Control
Cyclic Redundancy Check (CRC)
   • All single-bit errors
   • All double-bit errors, as long as P(X) has at least three 1s
   • Any odd number of errors, as long as P(X) contains a factor (X-1)
   • Any burst error for which the length of the burst is less than the length
     of the divisor polynomial; that is, less than or equal to the length of the
     FCS
   • Most larger burst errors

      CRC-16
      CRC-16    = X16
                = X16      +
                           +   X15
                               X15   +
                                     +   X2 + 1
                                         X2 + 1
      CRC-CCITT = X16
      CRC-CCITT = X16      +
                           +   X12
                               X12   +
                                     +   X5 + 1
                                         X5 + 1
      CRC-32
      CRC-32    = X32
                = X32      +
                           +   X26
                               X26   +
                                     +   X25 + X23 + X22 + X16 + X12 +
                                         X25 + X23 + X22 + X16 + X12 +
                  X11
                  X11      +
                           +   X10
                               X10   +
                                     +   X8 + X7 + X5 + X4 + X2 + 1
                                         X8 + X7 + X5 + X4 + X2 + 1
Data Link Control
Error Control

                                 ERROR


            Lost Frame                      Damaged Frame

       A frame fails to arrive           A recognizable frame
         at the other side.              does arrive, but some
                                         of the bits are in error.
Data Link Control
Error detection

Positive acknowledgment
   The destination returns a positive acknowledgment to successfully
   received, error-free frames.
Retransmission after timeout
   The source retransmits a frame that has not been acknowledged after
   a predetermined amount of time.

Negative acknowledgment and retransmission
   The destination returns a negative acknowledgment to frames in which
   an error is detected. The source retransmits such frames.
Data Link Control
ARQ : Automation Repeat Request

   Stop-and-Wait ARQ
Data Link Control
ARQ : Automation Repeat Request

     Go-Back-N ARQ

        Pipelining


         Damaged Frame




           Damaged RR
Data Link Control
ARQ : Automation Repeat Request

                        Selective-Reject ARQ
Data Link Control
HDLC : High-level Data Link Control
Basic Characteristics

   Three type of stations   Two link configuration   Three data transfer modes

   Three types of stations
      Primary Station
          For controlling the operation of the link called “command”
      Secondary Station
          Operates under the control of the primary station called “responses”
      Combined Station

   Two link configurations
     Unbalanced configuration
          One primary and one/more secondary station and supports both full-
          duplex and half-duplex transmission.
     Balanced configuration
          Two combined stations and supports both full-duplex and half-duplex
           transmission.
Data Link Control
HDLC : High-level Data Link Control
Basic Characteristics

     Multidrop Line                          Synchronous TxRx
   Three data transfer modes
      Normal response mode (NRM)
          Used unbalanced configuration. Primary initiate data transfer to
          a secondary but a secondary may only transmit data in response to
          a command from the primary
      Asynchronous balanced mode (NRM)
          Used with a balanced configuration. Either combined station may
          initiate transmission without receiving permission from the other
          combined station.
      Asynchronous response mode (NRM)
          Used with an unbalanced configuration. The secondary may initiate
          transmission without explicit permission of the primary. The primary
          still retains responsibility for the line, including initialization, error
          recovery, and logical disconnection.
Data Link Control
HDLC : High-level Data Link Control : Frame Structure
 Frame Format




       Flag Field : unique pattern 01111110



                                 Bit Stuffing           Data transparency
Data Link Control
HDLC : High-level Data Link Control : Frame Structure
Data Link Control
HDLC : High-level Data Link Control : Frame Structure
 Frame Format




     Address Field : uniformity   if all bit is 1, it means broadcast communication

  Extended address field
Data Link Control
HDLC : High-level Data Link Control : Frame Structure
 Frame Format




                                               0 :: primary poll to secondary
                                               0 primary poll to secondary
                                               1 :: primary receive data
                                               1 primary receive data
8-bit control field format   Sliding-windows
                             Sliding-windows
Data Link Control
HDLC : High-level Data Link Control : Frame Structure
8-bit control field format   Sliding-windows
                             Sliding-windows




           00
           00         RR
                      RR         Receive ready
                                 Receive ready
           01
           01         REJ
                      REJ        Reject
                                 Reject
           10
           10         RNR
                      RNR        Receive not ready
                                 Receive not ready
           11
           11         SREJ
                      SREJ       Selective reject
                                 Selective reject
Data Link Control
                                  Initialization
  Three phase of HDLC operation                    Data Transfer
                                  Disconnect

								
To top