UNIT-2 Computer Networks - 1
UNIT-2 Computer Networks - 1
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
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,
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.
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).
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.
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.
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.
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.
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
1) Character count;
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
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.
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.
Each frame begins and ends with a special bit pattern, 0111110 (in fact,
a flag byte).
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.
11 or 00 are not used for data but are used for delimiting frames in some
protocols.
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.
•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.