Data Communication u4
Data Communication u4
unit4
Error Detection and Correction
• There are many reasons such as noise, cross-talk etc., which may help
data to get corrupted during transmission. The upper layers work on
some generalized view of network architecture and are not aware of
actual hardware data processing.Hence, the upper layers expect
error-free transmission between the systems. Most of the
applications would not function expectedly if they receive erroneous
data. Applications such as voice and video may not be that affected
and with some errors they may still function well.
• Data-link layer uses some error control mechanism to ensure that
frames (data bit streams) are transmitted with certain level of
accuracy. But to understand how errors is controlled, it is essential to
know what types of errors may occur
Types of Errors
• Error control mechanism may involve two possible ways:
• Error detection
• Error correction
• Error Detection
• Errors in the received frames are detected by means of Parity Check
and Cyclic Redundancy Check (CRC). In both cases, few extra bits are
sent along with actual data to confirm that bits received at other end
are same as they were sent. If the counter-check at receiver’ end fails,
the bits are considered corrupted
Parity Check
• One extra bit is sent along with the original bits to make number of 1s
either even in case of even parity, or odd in case of odd parity.
• The sender while creating a frame counts the number of 1s in it. For
example, if even parity is used and number of 1s is even then one bit with
value 0 is added. This way number of 1s remains even.If the number of 1s
is odd, to make it even a bit with value 1 is added
• Cyclic codes are special linear block codes with one extra property. In
a cyclic code, if a code word is cyclically shifted (rotated), the result is
another code word. For example, if 1011000 is a code word and we
cyclically left-shift, then 0110001 is also a code word.
• In this case, if we call the bits in the first word a0 to a6 and the bits in
the second word b0 to b6, we can shift the bits by using the following:
• Error detection - The sender and receiver, either both or any, must ascertain that there
is some error in the transit.
• Positive ACK - When the receiver receives a correct frame, it should acknowledge it.
• Negative ACK - When the receiver receives a damaged frame or a duplicate frame, it
sends a NACK back to the sender and the sender must retransmit the correct frame.
• Retransmission: The sender maintains a clock and sets a timeout period. If an
acknowledgement of a data-frame previously transmitted does not arrive before the
timeout the sender retransmits the frame, thinking that the frame or it’s
acknowledgement is lost in transit.
There are three types of techniques available which Data-link layer may deploy to control the errors
by Automatic Repeat Requests (ARQ):
• Stop-and-wait ARQ
• The following transition may occur in Stop-and-Wait ARQ:
• The sender maintains a timeout counter.
• When a frame is sent, the sender starts the timeout counter.
• If acknowledgement of frame comes in time, the sender transmits the
next frame in queue.
• If acknowledgement does not come in time, the sender assumes that
either the frame or its acknowledgement is lost in transit. Sender
retransmits the frame and starts the timeout counter.
• If a negative acknowledgement is received, the sender retransmits
the frame.
Go-Back-N ARQ
• Stop and wait ARQ mechanism does not utilize the resources at their
best.When the acknowledgement is received, the sender sits idle and
does nothing. In Go-Back-N ARQ method, both sender and receiver
maintain a window
• The sending-window size enables the sender to send multiple frames
without receiving the acknowledgement of the previous ones. The
receiving-window enables the receiver to receive multiple frames and
acknowledge them. The receiver keeps track of incoming frame’s
sequence number.
• When the sender sends all the frames in window, it checks up to what
sequence number it has received positive acknowledgement. If all
frames are positively acknowledged, the sender sends next set of
frames. If sender finds that it has received NACK or has not receive
any ACK for a particular frame, it retransmits all the frames after
which it does not receive any positive ACK
Selective Repeat ARQ
• In Go-back-N ARQ, it is assumed that the receiver does not have any
buffer space for its window size and has to process each frame as it
comes. This enforces the sender to retransmit all the frames which
are not acknowledged
• In Selective-Repeat ARQ, the receiver while keeping track of sequence
numbers, buffers the frames in memory and sends NACK for only
frame which is missing or damaged.
• The sender in this case, sends only packet for which NACK is received.
Data Link Layer Protocols
• Step 1 − If the data frames that arrive at the receiver side are faster than
they can be processed, the frames must be stored until their use.
• Step 2 − Generally, the receiver does not have enough storage space,
especially if it is receiving data from many sources. This may result in either
discarding of frames or denial of service.
• Step 3 − To prevent the receiver from becoming overwhelmed with frames,
the sender must slow down. There must be ACK from the receiver to the
sender.
• Step 4 − In this protocol the sender sends one frame, stops until it receives
confirmation from the receiver, and then sends the next frame.
• Step 5 − We still have unidirectional communication for data frames, but
auxiliary ACK frames travel from the other direction. We add flow control
to the previous protocol
Noisy Channels
• There are three types of requests for the noisy channels, which are as
follows −
Stop & wait Automatic Repeat Request.
Go-Back-N Automatic Repeat Request.
Selective Repeat Automatic Repeat Request.
• Noiseless channels are generally non-existent channels. We can
ignore the error or we need to add error control to our protocols.
Stop and Wait Automatic Repeat Request
• Step 1 − In a noisy channel, if a frame is damaged during transmission, the receiver will
detect with the help of the checksum.
• Step 2 − If a damaged frame is received, it will be discarded, and the transmitter will
retransmit the same frame after receiving a proper acknowledgement.
• Step 3 − If the acknowledgement frame gets lost and the data link layer on 'A' eventually
times out. Not having received an ACK, it assumes that its data frame was lost or
damaged and sends the frame containing packet 1 again. This duplicate frame also
arrives at the data link layer on 'B', thus part of the file will be duplicated and protocol is
said to be failed.
• Step 4 − To solve this problem, assign a sequence number in the header of the message.
• Step 5 − The receiver checks the sequence number to determine if the message is a
duplicate since only the message is transmitted at any time.
• Step 6 − The sending and receiving station needs only a 1-bit alternating sequence of '0'
or '1' to maintain the relationship of the transmitted message and its ACK/ NAK.
• Step 7 − A modulo-2 numbering scheme is used where the frames are alternatively
labelled with '0' or '1' and positive acknowledgements are of the form ACK 0 and ACK 1.
• Normal operation of Stop & Wait ARQ is given below −
• Stop & Wait ARQ with Lost frame is as follows −
High-level Data Link Control (HDLC)
The original Ethernet was created in 1976 at Xerox's Palo Alto Research Center (PARC).
Since then, it has gone through four generations:
a. Standard Ethernet (l0 Mbps),
b. Fast Ethernet (100 Mbps),
c. Gigabit Ethernet (l Gbps)
d. Ten-Gigabit Ethernet (l0 Gbps)
MAC Sublayer
In Standard Ethernet, the MAC sublayer governs the operation of the access method.
It also frames data received from the upper layer and passes them to the physical layer
The main parts of an Ethernet frame are
• Preamble − It is the starting field that provides alert and timing pulse
for transmission.
• Destination Address − It is a 6-byte field containing the physical
address of destination stations.
• Source Address − It is a 6-byte field containing the physical address of
the sending station.
• Length − It stores the number of bytes in the data field.
• Data and Padding − This carries the data from the upper layers.
• CRC − It contains error detection information.
Changes In The Standard
1. Bridged Ethernet
The first step in the Ethernet evolution was the division of a LAN by bridges.
Bridges have two effects on an Ethernet LAN: They raise the bandwidth and they separate collision domains.
In an unbridged Ethernet network, the total capacity (10 Mbps) is shared among all stations with a frame to send;
the stations share the bandwidth of the network. If only one station has frames to send, it benefits from the total capacity (10 Mbps
But if more than one station needs to use the network, the capacity is shared.
For example, if two stations have a lot of frames to send, they probably alternate in usage.
When one station is sending, the other one refrains from sending
• A bridge divides the network into two or more networks. Bandwidth-
wise, each network is independent. a network with 12 stations is
divided into two networks, each with 6 stations. Now each network
has a capacity of 10 Mbps. The 10-Mbps capacity in each segment is
now shared between 6 stations (actually 7 because the bridge acts as
a station in each segment), not 12 stations. In a network with a heavy
load, each station theoretically is offered 10/6 Mbps instead of 10/12
Mbps, assuming that the traffic is not going through the bridge
Separating Collision Domains
• The main fields of a frame of wireless LANs as laid down by IEEE 802.11 are
−
• Frame Control − It is a 2 bytes starting field composed of 11 subfields. It
contains control information of the frame.
• Duration − It is a 2-byte field that specifies the time period for which the
frame and its acknowledgment occupy the channel.
• Address fields − There are three 6-byte address fields containing addresses
of source, immediate destination, and final endpoint respectively.
• Sequence − It a 2 bytes field that stores the frame numbers.
• Data − This is a variable-sized field that carries the data from the upper
layers. The maximum size of the data field is 2312 bytes.
• Check Sequence − It is a 4-byte field containing error detection information
Bluetooth
• Bluetooth is universal for short-range wireless voice and data
communication. It is a Wireless Personal Area Network (WPAN)
technology and is used for exchanging data over smaller distances.
This technology was invented by Ericson in 1994. It operates in the
unlicensed, industrial, scientific, and medical (ISM) band from 2.4 GHz
to 2.485 GHz. Maximum devices that can be connected at the same
time are 7. Bluetooth ranges up to 10 meters. It provides data rates
up to 1 Mbps or 3 Mbps depending upon the version. The spreading
technique that it uses is FHSS (Frequency-hopping spread spectrum).
A Bluetooth network is called a piconet and a collection of
interconnected piconets is called scatternet
• What is Bluetooth?
• Bluetooth simply follows the principle of transmitting and receiving data using radio waves. It can
be paired with the other device which has also Bluetooth but it should be within the estimated
communication range to connect. When two devices start to share data, they form a network
called piconet which can further accommodate more than five devices.
• Points to remember for Bluetooth:
• Bluetooth Transmission capacity 720 kbps.
• Bluetooth is Wireless.
• Bluetooth is a Low-cost short-distance radio communications standard.
• Bluetooth is robust and flexible.
• Bluetooth is cable replacement technology that can be used to connect almost any device to any
other device.
• The basic architecture unit of Bluetooth is a piconet
• Types of Bluetooth
• Various types of Bluetooth are available in the market nowadays. Let us look at
them.
• In-Car Headset: One can make calls from the car speaker system without the use
of mobile phones.
• Stereo Headset: To listen to music in car or in music players at home.
• Webcam: One can link the camera with the help of Bluetooth with their laptop or
phone.
• Bluetooth-equipped Printer: The printer can be used when connected via
Bluetooth with mobile phone or laptop.
• Bluetooth Global Positioning System (GPS): To use GPS in cars, one can connect
their phone with car system via Bluetooth to fetch the directions of the address
• Advantage:
• It is a low-cost and easy-to-use device.
• It can also penetrate through walls.
• It creates an Ad-hoc connection immediately without any wires.
• It is used for voice and data transfer.
• Disadvantages:
• It can be hacked and hence, less secure.
• It has a slow data transfer rate: of 3 Mbps.
• It has a small range: 10 meters.
• Bluetooth communication does not support routing.
• The issues of handoffs have not been addressed
• Applications:
• It can be used in laptops, and in wireless PCs, printers.
• It can be used in wireless headsets, wireless PANs, and LANs.
• It can connect a digital camera wirelessly to a mobile phone.
• It can transfer data in terms of videos, songs, photographs, or files
from one cell phone to another cell phone or computer.
• It is used in the sectors of Medical health care, sports and fitness,
Military.