Docsity

Error detection and error correction, Slides of Computer Networks

Partial preview of the text

Download Error detection and error correction and more Slides Computer Networks in PDF only on Docsity!

DATA LINK LAYER

DATA LINK LAYER

Deals with the algorithms for achieving

reliable, efficient communication between two

adjacent machines at the data link layer.

Adjacent means that the two machines are

Connected by a communication channel that

acts conceptually like a wire.

  • LIMITATION:- HARDWARE PROPAGATION DELAY.

ERRORS ETC.

Data Link Layer

Data Link Layer

Design Issues

Design Issues

1. PROVIDING A WELL-DEFINED

SERVICE INTERFACE TO THE NETWORK

LAYER.

2. DEALING WITH TRANSMISSION

ERRORS.

3. REGULATING THE FLOW OF DATA SO

THAT SLOW RECEIVERS ARE NOT

Data Link Layer

Data Link Layer

Design Issues

Design Issues

Frame management forms the

heart of what the data link layer

does.

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

The principal service is transferring data from the

network layer on the source machine to the

network layer on the destination machine.

On the source machine is an entity, call it a

process, in the network layer that hands some bits

to the data link layer for transmission to the

destination.

The job of the data link layer is to transmit the bits

to the destination machine so they can be handed

over to the network layer there

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

The data link layer can be designed to offer

various services. The actual services offered

can vary from system to system. Three

reasonable possibilities that are commonly

provided are

  1. Unacknowledged connectionless service.
  2. Acknowledged connectionless service.
  3. Acknowledged connection-oriented service.

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

1. Unacknowledged connectionless service.

Service consists of source machine send

independent frames to the destination machine

without having the destination machine

acknowledge them.

No logical connection is established beforehand or

released afterward.

If a frame is lost due to noise on the line, no

attempt is made to detect the loss or recover

from it in the data link layer.

This class of service is Appropriate when the error

rate is very low so that recovery is left to higher

layers. It is also appropriate for real-time traffic,

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

2. Acknowledged connectionless service.

Acknowledgements in the data link layer is just an

optimization, never a requirement.

The network layer can always send a packet and

wait for it to be acknowledged.

If the acknowledgement is not forthcoming before

the timer expires, the sender can just send the

entire message

again.

If the average packet is broken up into, say, 10

frames, and 20 percent of all frames are lost, it may

take a very long time for the packet to get through.

If individual frames are acknowledged and

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

3. Acknowledged connection-oriented service

With this service, the source and destination

machines establish a connection before any data are

transferred.

data link layer guarantees that each frame sent is

indeed received. Also, it guarantees that each frame

is received exactly once and that all frames are

received in the right order.

With connectionless service, in contrast, it is

conceivable that a lost acknowledgement causes a

packet to be sent several times and thus received

several times.

Connection-oriented service, in contrast, provides

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

3. Acknowledged connection-oriented service

When connection-oriented service is used, transfers

go through three distinct phases.

In the first phase, the connection is established by

having both sides initialize variables and counters

needed to keep track of which frames have been

received and which ones have not.

In the second phase, one or more frames are

actually transmitted.

In the third and final phase, the connection is

released, freeing up the variables, buffers, and other

resources used to maintain the connection.

Data Link Layer Design Issues:

Services Provided to the Network

Services Provided to the Network

Layer

Layer

3. Acknowledged connection-oriented service

When connection-oriented service is used, transfers

go through three distinct phases.

In the first phase, the connection is established by

having both sides initialize variables and counters

needed to keep track of which frames have been

received and which ones have not.

In the second phase, one or more frames are

actually transmitted.

In the third and final phase, the connection is

released, freeing up the variables, buffers, and other

resources used to maintain the connection.

Data Link Layer Design Issues:

FRAMING

FRAMING

To provide service to the network layer, the

data link layer must use the service provided

to it by the physical layer.

The number of bits received may be less

than, equal to, or more than the number of

bits transmitted (ERRORNEOUS).

Data link layer to detect and, if necessary,

correct.

data link layer to break the bit stream up

into discrete frames and compute the

checksum for each frame.

Data Link Layer Design Issues:

FRAMING

FRAMING

One way to achieve this framing is to insert

time gaps between frames, much like the

spaces between words in ordinary text.

It is possible these gaps might be squeezed

out or other gaps might be inserted during

transmission.

Since it is too risky to count on timing to

mark the start and end of each frame, other

Data Link Layer Design Issues:

FRAMING

FRAMING

METHODS FOR FRAMING:-

  1. Character count.

A character stream. (a) Without errors. (b) With one

error

The trouble with this algorithm is that the count can

be garbled by a transmission error. For example,

if the character count of 5 in the second frame of

Fig. becomes a 7, the destination will get out of

synchronization and will be unable to locate the

start of the next frame.

Data Link Layer Design Issues:

FRAMING

FRAMING

METHODS FOR FRAMING:-

  1. Flag bytes with byte stuffing.

A serious problem occurs with this method when

binary data, such as object programs or floating-

point numbers,

are being transmitted. It may easily happen that the

flag byte's bit pattern occurs in the data. This

situation will

usually interfere with the framing.

One way to solve this problem is to have the

sender's data link layer insert a special escape

byte (ESC) just before each ''accidental'' flag

byte in the data.