data link layer.ppt

download data link layer.ppt

of 23

Transcript of data link layer.ppt

  • 8/9/2019 data link layer.ppt

    1/23

    COMPUTER NETWORKS

    (DATA-LINK LAYER)

    Data-Link Layer

    BITS edu campus

  • 8/9/2019 data link layer.ppt

    2/23

    Computer

    Networks

    !uest"o# to $e %#swere& '

    Why it is important to have DatalinkLayer?

    What are Functions performedon Data-link layer?

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    3/23

    Computer

    Networks

    te #ee& *or D%t%-+"#k +%,er

    1) Communication circuits make errors

    occasionally!) Communication circuits have a

    limited date rate

    ") #here is a non$ero propa%ation delay&et'een the time a &it is sent and the

    time it is received

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    4/23

    Computer

    Networks

    .u#/t"o#s per*orme& o# D%t%-+"#k

    +%,er %re0

    1- .r%m"#2- .+ow Co#tro+

    - Error Co#tro+

    - Error Dete/t"o# 3 Corre/t"o#

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    5/23

    Computer

    Networks

    4

    .r%m"#2 #he transmitted &it stream &y the physical

    layer is not %uaranteed to &e error *ree

    (t is up to the data-link layer to &ete/t andif necessary to /orre/t errors

    #he data-link layer $re%ksthe &it stream

    up into &"s/rete *r%mesand /omputethe/e/ksumfor each frame

    When a frame arrives at the destination

    the /e/ksum "s re/ompute&

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    6/23

    Computer

    Networks

    5*elationship &et'een packets and frames

    Data-Link Layer

    6e%&er P%,+o%& *"e+& Tr%"+er

    P%/ket

    Se#&"#2 m%/"#e

    6e%&er P%,+o%& *"e+& Tr%"+er

    P%/ket

    Re/e"7"#2 m%/"#e

    .r%me

  • 8/9/2019 data link layer.ppt

    7/23

  • 8/9/2019 data link layer.ppt

    8/23

    SERVICES PROVIDED TO NETWORK

    LAYER (2)

    Placement of the data link protocol.

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    9/23

    Computer

    Networks

    8

    .r%m"#2 #he easiest 'ay to achieve framin% is to

    "#sert t"me 2%ps&et'een frames

    +et'orks rarely make any %uaranteesa&out timin%

    ,ther .r%m"#2 Meto&sare

    1) Character count

    !) Fla% &ytes 'ith &yte stuffin%").tartin% and encodin% fla%s 'ith &it stuffin%

    /) 0hysical layer codin% violations

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    10/23

    Computer

    Networks

    19

    .r%m"#21) C%r%/ter /ou#tframin% method uses a

    field in the header to specify the num&er of

    characters in the frame

    Data-Link Layer

    5 1 1 4 1

    C%r%/ter /ou#t

    .r%me 1

    C%r%/ters

    .r%me

    5 C%r%/ters

    .r%me

    C%r%/ters

  • 8/9/2019 data link layer.ppt

    11/23

    Computer

    Networks

    11

    .r%m"#2#he pro&lem 'ith C%r%/ter /ou#tal%orithm

    is that the count can &e distorted &y a

    transmission error

    Data-Link Layer

    : 1 1 4 1

    Error

    .r%me 1

    C%r%/ters

    .r%me (wro#2)

    5 C%r%/ters

    .r%me

  • 8/9/2019 data link layer.ppt

    12/23

    Computer

    Networks

    1

    .r%m"#2!) #he second method uses in each frame

    st%rt %#& e#& spe/"%+ $,tes (.+%2 $,te)to

    %et around the pro&lem of resynchronisation

    after an error occurred- Fla% &ytes used as a delimiters

    Data-Link Layer

    .LA; 6e%&er P%,+o%& *"e+& Tr%"+er .LA;

    Frame delimited &y fla% &ytes

  • 8/9/2019 data link layer.ppt

    13/23

    FRAMING (2)

    (a)A frame delimited by flag bytes.

    (b)Four examples of byte sequences before and afterstuffing.

  • 8/9/2019 data link layer.ppt

    14/23

    FRAMING (3)

    Bit stuffing(a)The original data.

    (b)The data as they appear on the line.

    (c)The data as they are stored in receivers memory afterdestuffing.

  • 8/9/2019 data link layer.ppt

    15/23

    Computer

    Networks

    14

    .r%m"#2- pro$+em o//urs'ith this method 'hen

    &inary data are &ein% transmitted (t may

    easily happen that the *+%2 $,te

  • 8/9/2019 data link layer.ppt

    16/23

    Computer

    Networks

    15

    .r%m"#2- #he &yte-stuffin% scheme 'ith a sli%ht

    simplification is use& "# te PPP proto/o+=

    - ma3or &"s%&7%#t%2eof this framin%method is that it is closely tied to the use of 5-

    &it characters

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    17/23

    Computer

    Networks

    1>

    Error Co#tro+- 6rror Control is needed to make sure all

    frames are eventually &e+"7ere&to the

    net'ork layer at the destination and in the

    proper or&er=

    - #he techni4ue of %/k#ow+e&2me#tand

    retr%#sm"ss"o#is used to ensure relia&le

    delivery- #his can &e achieved &y usin% t"merand

    %ss"2#"#2 se?ue#/e #um$erfor each

    frame

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    18/23

    Computer

    Networks

    1:

    .+ow Co#tro+- Flo' Control is needed to deal 'ith the

    situation 'hen the sender is ru##"#2 o# %

    *%st /omputerand the receiver is ru##"#2

    o# % s+ow m%/"#e=

    - the sender keeps transmittin% the frames

    out at a "2er r%teuntil the receiver is

    completely sw%mpe& 7flooded)- t a certain point the receiver 'ill simply &e

    u#%$+e to /ope w"tthe frames as they

    arrive and 'ill start to +ose tem

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    19/23

    Computer

    Networks

    18

    .+ow Co#tro+- #here are t'o approaches for flo' control

    1) .ee&$%/k-$%se& *+ow /o#tro+ 'here the

    receiver sends &ack information to thesender %ivin% it permission to send more

    data

    !) R%te-$%se& *+ow /o#tro+ 'here there is arate limit at 'hich senders may transmit

    data 'ithout usin% feed&ack from the

    receiver

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    20/23

    Computer

    Networks

    9

    Error Dete/t"o# 3 Corre/t"o#Two $%s"/ str%te2"es to &e%+ w"t errors0

    1) Error-/orre/t"#2 /o&es includes enou%h

    redundant information 'ith each sent datato ena&le receiver to deduce 'hat the

    transmitted data must have &een

    )error-&ete/t"#2 /o&es includes only

    enou%h information to allo' the receiver todeduce that an error occurred &ut not

    'hich error and have it re4uest a

    retransmission

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    21/23

    Computer

    Networks

    1

    Error Dete/t"o# 3 Corre/t"o#- #he simplest error-detection scheme is a

    P%r"t, Ce/k

    - (n this scheme a sin%le parity &it is%ppe#&e&to the data

    - #he parity &it is chosen so that te

    #um$er o* 1&its in the code is e7e# (oro&&)=

    Data-Link Layer

  • 8/9/2019 data link layer.ppt

    22/23

    Computer

    Networks

    Data-Link Layer

    EDATA

    E@*(DATA)

    DATA

    EDATA

    E

  • 8/9/2019 data link layer.ppt

    23/23

    Computer

    Networks

    Error Dete/t"o# 3 Corre/t"o#- 6rror-detection and retransmission is

    efficient 'here error rate is lo' 7over

    copper 'ire or optical fi&er)

    - With 'ireless links 'here unaccepta&le

    delay caused &y repetition 6rror-correction

    is more suita&le

    Data-Link Layer