UNIT - 2 - Sem Answers
UNIT - 2 - Sem Answers
Framing
• The data link layer encapsulates each data packet from the network layer into
frames that are then transmitted.
A frame has three parts, namely –
• Frame Header
• Payload field that contains the data packet from network layer
• Trailer
• The usual approach is for the data link layer to break up the bit stream into
discrete frames, compute a short token called a checksum for each frame, and
include the checksum in the frame when it is transmitted.
• When a frame arrives at the destination, the checksum is recomputed. If the
newly computed checksum is different from the one contained in the frame, the
data link layer knows that an error has occurred and takes steps to deal with it
(e.g., discarding the bad frame and possibly also sending back an error report).
• Breaking up the bit stream into frames is in four methods:
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.
1. Byte count.
• This method is rarely used and is generally required to count total number of
bytes that are present in frame. This is be done by using field in header. Byte
count method ensures data link layer at the receiver or destination about total
number of bytes that follow, and about where the frame ends.
• There is disadvantage also of using this method i.e., if anyhow character count
is disturbed or distorted by an error occurring during transmission, then
destination or receiver might lose synchronization. The destination or receiver
might also be not able to locate or identify beginning of next frame.
2. Flag bytes with byte stuffing.
• The second framing method gets around the problem of resynchronization after
an error by having each frame start and end with special bytes.
• Often the same byte, called a flag byte, is used as both the starting and ending
delimiter.
• Two consecutive flag bytes indicate the end of one frame and the start of the
next.
• Thus, if the receiver ever loses synchronization it can just search for two flag
bytes to find the end of the current frame and the start of the next frame
• However, there is a still a problem we have to solve. It may happen that the flag
byte occurs in the data, especially when binary data such as photographs or
songs are being transmitted.
• 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.
• The data link layer on the receiving end removes the escape bytes before giving
the data to the network layer. This technique is called byte stuffing.
• Of course, the next question is: what happens if an escape byte occurs in the
middle of MKK the data? The answer is that it, too, is stuffed with an escape byte.
Error Control
The issues it caters to with respect to error control are –
• Dealing with transmission errors
• Sending acknowledgement frames in reliable connections
• Retransmitting lost frames
• Identifying duplicate frames and deleting them
• Controlling access to shared channels in case of broadcasting
Flow Control
• The data link layer regulates flow control so that a fast sender does not drown a
slow receiver. When the sender sends frames at very high speeds, a slow
receiver may not be able to handle it. There will be frame losses even if the
transmission is error-free.
The two common approaches for flow control are –
• 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.
2. Explain about the services provided by the Data link layer.
A. Framing
• The data link layer encapsulates each data packet from the network layer into
frames that are then transmitted.
A frame has three parts, namely –
• Frame Header
• Payload field that contains the data packet from network layer
• Trailer
• The usual approach is for the data link layer to break up the bit stream into
discrete frames, compute a short token called a checksum for each frame, and
include the checksum in the frame when it is transmitted.
• When a frame arrives at the destination, the checksum is recomputed. If the
newly computed checksum is different from the one contained in the frame, the
data link layer knows that an error has occurred and takes steps to deal with it
(e.g., discarding the bad frame and possibly also sending back an error report).
• Breaking up the bit stream into frames is in four methods:
1. Byte count.
2. Flag bytes with byte stuffing.
3. Flag bits with bit stuffing.
4. Physical layer coding violations.
1. Byte count.
• This method is rarely used and is generally required to count total number of
bytes that are present in frame. This is be done by using field in header. Byte
count method ensures data link layer at the receiver or destination about total
number of bytes that follow, and about where the frame ends.
• There is disadvantage also of using this method i.e., if anyhow character count
is disturbed or distorted by an error occurring during transmission, then
destination or receiver might lose synchronization. The destination or receiver
might also be not able to locate or identify beginning of next frame.
2. Flag bytes with byte stuffing.
• The second framing method gets around the problem of resynchronization after
an error by having each frame start and end with special bytes.
• Often the same byte, called a flag byte, is used as both the starting and ending
delimiter.
• Two consecutive flag bytes indicate the end of one frame and the start of the
next.
• Thus, if the receiver ever loses synchronization it can just search for two flag
bytes to find the end of the current frame and the start of the next frame
• However, there is a still a problem we have to solve. It may happen that the flag
byte occurs in the data, especially when binary data such as photographs or
songs are being transmitted.
• 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.
• The data link layer on the receiving end removes the escape bytes before giving
the data to the network layer. This technique is called byte stuffing.
• Of course, the next question is: what happens if an escape byte occurs in the
middle of MKK the data? The answer is that it, too, is stuffed with an escape byte.
3. Flag bits with bit stuffing.
• Framing can be also be done at the bit level, so frames can contain an
arbitrary number of bits made up of units of any size. It was developed for the
once very popular HDLC (Highlevel Data Link Control) protocol.
• Each frame begins and ends with a special bit pattern, 01111110 or 0x7E in
hexadecimal.
• This pattern is 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.
• Bit stuffing is very essential part of transmission process in network and
communication protocol. It is also required in USB.
• Encoding violation is method that is used only for network in which encoding
on physical medium includes some sort of redundancy i.e., use of more than one
graphical or visual structure to simply encode or represent one variable of data.
2. Error Control
The issues it caters to with respect to error control are –
• Dealing with transmission errors
• Sending acknowledgement frames in reliable connections
• Retransmitting lost frames
• Identifying duplicate frames and deleting them
• Controlling access to shared channels in case of broadcasting.
Flow Control
• The data link layer regulates flow control so that a fast sender does not drown a
slow receiver. When the sender sends frames at very high speeds, a slow
receiver may not be able to handle it. There will be frame losses even if the
transmission is error-free.
The two common approaches for flow control are –
• 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.
4. Checksum
• In checksum error detection scheme, the data is divided into k segments each
of m bits.
• In the sender’s end the segments are added using 1’s complement arithmetic
to get the sum.
• The sum is complemented to get the checksum.
• The checksum segment is sent along with the data segments.
• At the receiver’s end, all received segments are added using 1’s complement
arithmetic to get the sum.
• The sum is complemented.
• If the result is zero, the received data is accepted; otherwise discarded.
2. Flow Control: While flow control is generally associated with the transport
layer (e.g., TCP), the MAC sub-layer can also implement mechanisms for
controlling the flow of data between devices. For example, it may pause or slow
down transmission if the receiving device is overwhelmed.
Binary Countdown
• This protocol overcomes the overhead of 1 bit per station of the bit – map
protocol. Here, binary addresses of equal lengths are assigned to each station. For
example, if there are 6 stations, they may be assigned the binary addresses 001,
010, 011, 100, 101 and 110. All stations wanting to communicate broadcast their
addresses. The station with higher address gets the higher priority for
transmitting.
9. Identify the working principle of Bluetooth and develop a neat
sketch to depict its Protocol Stack.
A. • Bluetooth is a low cost, low power, short range wireless technology
for data and audio communication.
• Bluetooth was first proposed by ‘Ericsson’ in 1994.
• Bluetooth operates at 2.4GHz of the Radio Frequency spectrum
and uses the Frequency Hopping Spread Spectrum (FHSS) technique
for communication.
• Literally it supports a data rate of up to 1Mbps to 24Mbps (and a
range of approximately 30 to 100 feet (Depending on the Bluetooth
version – v1.2 supports datarate up to 1Mbps, v2.0 + EDR ‘Enhanced
Data Rate’ supports datarate up to 3Mbps, v3.0 + HS ‘High Speed’
and v4.0 supports datarate up to 24Mbps)) for data communication.
• Bluetooth communication has two essential parts; a physical link
part and a protocol part.
• The physical link is responsible for the physical transmission of
data between devices supporting Bluetooth communication and
protocol part is responsible for defining the rules of communication.
• The physical link works on the Wireless principle making use of
Radio Frequency waves for communication.
• Bluetooth enabled devices essentially contain a Bluetooth wireless
radio for the transmission and reception of data.
• The rules governing the Bluetooth communication is implemented
in the ‘Bluetooth protocol stack’.
• The Bluetooth communication IC holds the stack. Each Bluetooth
device will have a 48 bit unique identification number.
• Bluetooth communication follows packet based data transfer.
Bluetooth supports point-to-point (device to device) and point-to-
multipoint (device to multiple device broadcasting) wireless
communication.
• The point-to-point communication follows the master slave
relationship. A Bluetooth device can function as either master or
slave.
• When a network is formed with one Bluetooth device as master
and more than one device as slaves, it is called a Piconet. A Piconet
supports a maximum of seven slave devices.
• Bluetooth is the favourite choice for short range data
communication in handheld embedded devices like cell phones
• Bluetooth Low Energy (BLE)/Bluetooth Smart is a latest addition
to the Bluetooth technology. BLE allows devices to use much less
power compared to the standard Bluetooth connections, while
offering most of the connectivity of Bluetooth and maintaining a
similar communication range.
• Bluetooth 4.2 specification enables IoT support through Low-
power IP connectivity