0% found this document useful (0 votes)
18 views

UNIT-2 Computer Networks - 1

The document discusses the data link layer and the services it provides. The data link layer is responsible for framing data and transmitting frames between devices over a physical network. It provides various services like connection-oriented and connectionless services with and without acknowledgment. The data link layer frames data and there are different types of framing approaches used.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

UNIT-2 Computer Networks - 1

The document discusses the data link layer and the services it provides. The data link layer is responsible for framing data and transmitting frames between devices over a physical network. It provides various services like connection-oriented and connectionless services with and without acknowledgment. The data link layer frames data and there are different types of framing approaches used.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

UNIT-2

THE DATA LINK LAYER

Services provided by Data Link Layer

Data Link Layer is generally representing protocol layer in program that is


simply used to handle and control the transmission of data between source
and destination machines. It is simply responsible for exchange of frames
among nodes or machines over physical network media. This layer is often
closest and nearest to Physical Layer (Hardware).
Data Link Layer is basically second layer of seven-layer Open System
Interconnection(OSI) reference model of computer networking and lies just
above Physical Layer.
This layer usually provides and gives data reliability and provides various
tools to establish, maintain, and also release data link connections between
network nodes. It is responsible for receiving and getting data bits usually
from Physical Layer and also then converting these bits into groups, known
as data link frames so that it can be transmitted further. It is also responsible
to handle errors that might arise due to transmission of bits.
Service Provided to Network Layer :

The important and essential function of Data Link Layer is to provide an


interface to Network Layer. Network Layer is third layer of seven-layer OSI
reference model and is present just above Data Link Layer.
The main aim of Data Link Layer is to transmit data frames they have
received to destination machine so that these data frames can be handed
over to network layer of destination machine. At the network layer, these
data frames are basically addressed and routed.
This process is shown in diagram :
1. Actual Communication :
In this communication, physical medium is present through which Data Link
Layer simply transmits data frames. The actual path is Network Layer -> Data
link layer -> Physical Layer on sending machine, then to physical media and
after that to Physical Layer -> Data link layer -> Network Layer on receiving
machine.
2. Virtual Communication :
In this communication, no physical medium is present for Data Link Layer to
transmit data. It can be only be visualized and imagined that two Data Link
Layers are communicating with each other with the help of or using data link
protocol.

Types of Services provided by Data Link Layer :


The Data link layer generally provides or offers three types of services as
given below :

1. Unacknowledged Connectionless Service


2. Acknowledged Connectionless Service
3. Acknowledged Connection-Oriented Service
1. Unacknowledged Connectionless Service :
Unacknowledged connectionless service simply provides datagram
styles delivery without any error, issue, or flow control. In this
service, source machine generally transmits independent frames to
destination machine without having destination machine to
acknowledge these frames.
This service is called as connectionless service because there is no
connection established among sending or source machine and
destination or receiving machine before data transfer or release
after data transfer.
In Data Link Layer, if anyhow frame is lost due to noise, there will be
no attempt made just to detect or determine loss or recovery from
it. This simply means that there will be no error or flow control. An
example can be Ethernet.
2. Acknowledged Connectionless Service :
This service simply provides acknowledged connectionless service
i.e. packet delivery is simply acknowledged, with help of stop and
wait for protocol.
In this service, each frame that is transmitted by Data Link Layer is
simply acknowledged individually and then sender usually knows
whether or not these transmitted data frames received safely. There
is no logical connection established and each frame that is
transmitted is acknowledged individually.
This mode simply provides means by which user of data link can just
send or transfer data and request return of data at the same time. It
also uses particular time period that if it has passed frame without
getting acknowledgment, then it will resend data frame on time
period.
This service is more reliable than unacknowledged connectionless
service. This service is generally useful over several unreliable
channels, like wireless systems, Wi-Fi services, etc.
3. Acknowledged Connection-Oriented Service :
In this type of service, connection is established first among sender
and receiver or source and destination before data is transferred.
Then data is transferred or transmitted along with this established
connection. In this service, each of frames that are transmitted is
provided individual numbers first, so as to confirm and guarantee
that each of frames is received only once that too in an appropriate
order and sequence.
Framing in Data Link Layer

In the Physical layer , data transmission involves synchronised transmission of


bits from the source to the destination. The data link layer packs these bits
into frames.
Data-link layer takes the packets from the Network Layer and encapsulates
them into frames. If the frame size becomes too large, then the packet may
be divided into small sized frames. Smaller sized frames makes flow control
and error control more efficient.

Then, it sends each frame bit-by-bit on the hardware. At receiver's end, data
link layer picks up signals from hardware and assembles them into frames.

Parts of a Frame

A frame has the following parts −

 Frame Header − It contains the source and the destination addresses of


the frame.
 Payload field − It contains the message to be delivered.
 Trailer − It contains the error detection and error correction bits.
 Flag − It marks the beginning and end of the frame.
Types of Framing in Data Link Layer

There are two types of framing in the data link layer. The frame can be of
fastened or variable size. founded on the size, the following are the types of
framing in data link layers in computer networks,

1. Fixed Size Framing

In this Fixed-size framing, the size of the frame is always fixed that's why
frame length acts as the delimiter of the frame. And it also doesn't require
additional boundaries to identify the start and end of the frame. For example-
This kind of framing in the Data Link Layer is used in ATMs and wide area
networks(WAN). They use frames of fastened size known as cells.

2. Variable Size Framing

The size of the frame is variable during this form of framing. In variable-size
framing, we are in need of a way to outline the tip of the frame and also the
starting of the succeeding frame. This can be utilized in local area
networks(LAN).

There are 2 different methods to define the frame boundaries, such as length
field and finish delimiters.

Length field–To confirm the length of the field, a length field is used. It is
utilized in Ethernet (1EEE 802.3).

End Delimiter–To confirm the size of the frame, a pattern is worn as a


delimiter. This methodology is worn in the token ring. In short, it is referred to
as ED. Two different methods are used to avoid this condition if the pattern
happens within the message. Character Oriented Approach Bit Oriented
Approach

Framing Approaches in Computer Network

Talking about Framing Approaches in computer networking, there are three 3-


different kind of approaches to Framing in the Data link layer:

1. Bit-Oriented Framing

Most protocols use a special 8-bit pattern flag 01111110 as a result of the
delimiter to stipulate the beginning and so the end of the frame. Bit stuffing is
completed at the sender end and bit removal at the receiver end.

If we have a tendency to get a zero(0) after 5 1s. we have a tendency to tend


to still stuff a zero(0). The receiver will remove the zero. Bit stuffing is in
addition said as bit stuffing.
2. Byte-Oriented Framing

Byte stuffing is one of the methods of adding an additional byte once there is
a flag or escape character within the text. Take an illustration of byte stuffing
as appears in the given diagram.

The sender sends the frame by adding three additional ESC bits and therefore
the destination machine receives the frame and it removes the extra bits to
convert the frame into an identical message.

 Binary Synchronous Communication Protocol (BISYNC) This is a lookout


approach. The frame format outlined is given in the below figure,
besides the bits.
SYN: The Special starting character(SYN),
SOH: The Start of the Header(SOH), STX: The start of text
character(STX),ETX: The end of text character(ETX)

The STX and ETX look after the data part of the portion. To circumvent the
framing in data link layer error problem in this approach, we have introduced
Byte Stuffing. This can be used once the frames comprise characters. A byte is
stuffed within the message to differentiate from the delimiter.

 Digital Data Communication Message Protocol (DDCMP): A new count


field is introduced during this protocol. The frame format outlined is
given in the below figure, in conjunction with the bits.

One risk with this approach is that if transmission error corrupts the count
field, then the tip of the frame won't be detected by the receiver properly.

 Point-to-Point Protocol(PPP): It is an information link layer protocol. It's a


large space network protocol that runs over network links. This protocol
is especially employed in broadband communication that deals with high
speed and significant hundreds. The frame format outlined is given
within the below figure, at the side of the bits. The bit design of the flag
is 01111110. The address field is set to about 11111111 just in case of
broadcast. The control value is set to be a sustained value of 11000000.
The protocol includes one or two bytes that outline the type of data
within the payload section. The payload carries the data. The topmost
length of the particular field is 1500 bytes. The checksum field is worn
for error detection.

3. Clock Based Framing

This framing in the data link layer is basically used for Optical Networks like
SONET. In this approach, a sequence of monotonous pulses maintains an
everlasting bit rate and keeps the digital bits oriented within the data stream.

Methods of Framing

There are four different methods of framing as listed below –

1) Character count;

2) Flag bytes with byte stuffing;

3) Starting and ending flags, with bit stuffing;

4) Physical layer coding violations.

1. Character Count

 This framing method uses a field in the header to specify the number of
characters in the frame.

 When the data link layer at the destination sees the character count, it
knows how many characters follow and hence where the end of the
frame is.

 The trouble with this algorithm is that the count can be garbled by a
transmission error.
2. Flag Byte with Character Stuffing

 This method gets around the problem of resynchronization after an


error by having each frame start and end with special bytes.

 The starting and ending Flag Bytes are same in recent years.

 If the receiver ever loses synchronization, it can just search for the flag
byte to find the end of the current frame.

 2 consecutive flag bytes indicate the end of one frame and start of next
one.
 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.

 A major disadvantage of using this framing method is that it is closely


tied to the use of 8-bit characters.

 Not all character code use 8-bit characters.

 For example, UNICODE uses 16-bit characters.

 As networks developed, the disadvantages of embedding the character


code length in the framing mechanism became more and more obvious,
so a new technique had to be developed to allow arbitrary sized
characters.

3. Starting and Ending Flags, with Bit Stuffing

 The new technique allows data frames to contain an arbitrary number of


bits and allows character codes with an arbitrary number of bits per
character.

 Each frame begins and ends with a special bit pattern, 0111110 (in fact,
a flag byte).

 Whenever the sender’s data link layer encounters five consecutive 1s in


the data, it automatically stuffs a 0 bit into the outgoing bit stream.

4. Encoding Violations
 This method is only applicable to networks in which the encoding on the
physical medium contains some redundancy.

 For example, some LANs encode 1 bit of data by using 2 physical bits.

 Normally,a1bitisahigh-lowpairanda0bitisa low-high pair.

 11 or 00 are not used for data but are used for delimiting frames in some
protocols.

Advantages of Framing in Data Link Layer

 Framing in Data links is used incessantly within the method of time-


division multiplexing.
 Framing in the data link layer facilitates a type to the sender for
transmission of a class of valid bits to a receiver.
 Frames are used continuously in the process of time-division
multiplexing.
 It facilitates a form to the sender for transmitting a group of valid bits to
a receiver.
 Frames also contain headers that include information such as error-
checking codes.
 A-frame relay, token ring, ethernet, and other types of data link layer
methods have their frame structures.
 Frames allow the data to be divided into multiple recoverable parts that
can be inspected further for corrupt

Error Control (1/1)

 The usual way to ensure reliable delivery is to provide the sender with
some feedback about what is happening at the other end of the line.

 Typically, the protocol calls for the receiver to send back special control
frames.

 If the sender receives a positive acknowledgement about a frame, it


knows the frame has arrived safely.
 On the other hand, a negative acknowledgement means that something
has gone wrong, and the frame must be transmitted again.

 Flow Control (1/2)

 •Another important design issue that occurs in the data link layer (and
higher layers as well) is what to do with a sender that systematically
wants to transmit frames faster than the receiver can accept them.

 •To solve this problem feedback-based flow control and rate-based flow
control are used.

 Feedback-based flow control: the receiver sends back information to the


sender giving it permission to send more data or at least telling the
sender how the receiver is doing.

 •Rate-based flow control: the protocol has a built-in mechanism that


limits the rate at which senders may transmit data, without using
feedback from the receiver.

 •Rate-based flow control is never used in the data link layer.

You might also like