Unit 3 - DCN
Unit 3 - DCN
UNIT:3
Error Detection and Correction [14 Marks]
3.1 Framing:
The data link layer needs to pack bits into frames, so that each frame is distinguishable from
another.
Our postal system practices a type of framing. The simple act of inserting a letter into an
envelope separates one piece of information from another; the envelope serves as the delimiter.
Framing in the data link layer separates a message from one source to a destination, or from
other messages to other destinations, by adding a sender address and a destination address.
The destination address defines where the packet is to go; the sender address helps the
recipient acknowledge the receipt.
Types of Framing:
Fixed size framing is simple and efficient as all frames are of the same size.
Fixed size framing also makes it easier to manage network resources, as it ensures that each
frame take up the same amount of bandwidth.
In fixed-size framing, there is no need for defining the boundaries of the frames; the size itself
can be used as a delimiter. An example of this type of framing is the ATM wide-area network,
which uses frames of fixed size called cells.
In variable-size framing the dividing data into frame can have a different in size. In variable-
size framing, we need a way to define the end of the frame and the beginning of the next.
Example of variable size framing is Local Area Network(LAN)
Mrs.S.S.Kadam
Page 1
DCN
b)bit-oriented approach.
Character-oriented framing was popular when only text was exchanged by the data link
layers.
The flag could be selected to be any character not used for text communication.
Now, however, we send other types of information such as graphs, audio, and video. Any
pattern used for the flag could also be part of the information.
If this happens, the receiver, when it encounters this pattern in the middle of the data,
thinks it has reached the end of the frame.
To fix this problem, a bytestuffing strategy was added to character-oriented framing.
Byte stuffing (or character stuffing): In this 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 byte before the data are given to the network
layer. This technique is called byte stuffing or character stuffing. Thus, a framing flag
byte can be distinguished from one in the data by the absence or presence of an escape
byte before it. Of course, the next question is: What happens if an escape byte occurs in
the middle of the data? The answer is that it, too, is stuffed with an escape byte. Thus,
any single escape byte is part of an escape sequence, whereas a doubled one indicates that
a single escape occurred naturally in the data.
Mrs.S.S.Kadam
Page 2
DCN
3.2 Error:
Error is condition when the receiver’s information does not match the sender’s
Types of Error:
If the signal is carrying binary data there can be two types of errors: Single-Bit errors and burst
errors. This is shown in fig 3.2.In a single-bit error a bit value of 0 changes to 1 or vice versa. In
a burst error, multiple bits of a binary value are changed
As we mentioned in a single-bit errors, a single bit of the data unit changes. Thus effectively,
either a 0 bit changes to 1, or a 1 bit changes to 0. Single-bit errors are more likely in the case of
parallel transmission because it is possible that one of the eight wires carrying the bits has
become noise resulting into corruption of a single bit for each byte. This can happen in the case
of a parallel transmission between the CPU and memory inside a computer. In case of serial
transmission the duration of noise is usually longer than that of a single bit. Hence the chances of
corrupting only a single bit are less. In contrast a burst changes at least two bits during data
transmission because of errors. Note that burst errors can change any two or more bits in a
transmission. These bits need not necessarily be adjacent bits. Burst errors are more likely in
serial transmission, because the duration of noise is longer, which causes multiple bits to be
corrupted
Redundancy bits:
Redundancy bits involve transmission of extra bits along with the data the data bits. These extra
bits actually do not contain any data or information. It is also called redundant bit or parity bits.
Mrs.S.S.Kadam
Page 3
DCN
1. Parity Check
2. Checksum
For example consider a message string 1100011 that needs to be transmitted. Let us assume the
even parity scheme. The following will now happen.
1) The sender examines this message string and notes that the number of bits containing a value
1 in this message string is 4. Therefore it adds an extra 0 to the end of this message. This extra
bit is called parity bit. This is done by the hardware itself, which is why it is very fast.
2) The sender sends the original bits 1100011 and the additional parity bit 0 together to the
receiver.
3) The receiver separates the parity bit from the original bits and it also examines the original
bits.Its sees the original bits as 1100011, and notes that the number of 1s in the message is four
i.e. even.
4) The receiver now computes the parity bit again and compares this computed parity bit with the
0 parity bit received from the sender, it notes that are equal and accepts the bit string as correct.
This is also done by the hardware itself. The process shown in the fig 3.3 In contrast, if the
original message was 1010100 the number of 1s in the message would have been three (old), and
therefore, the parity bit would contain a 1. There is one problem with this scheme. This scheme
can only catch a single bit error. If two bits reverse, this scheme will fail. For instance, if the first
two bits in the bit stream shown in fig 3.3 change, we will get a stream 0000011, yielding a
parity bit of 0 again, fooling us!
Mrs.S.S.Kadam
Page 4
DCN
Clearly, parity checking can detect single bit errors. However if multiple bits of a message are
changed due to an error (burst), parity checking would not work. Better schemes are required to
trap burst errors.
Mrs.S.S.Kadam
Page 5
DCN
Example
Mrs.S.S.Kadam
Page 6
DCN
Data Checksum
Example 2:
Mrs.S.S.Kadam
Page 7
DCN
Example:
Sender Side
Data word:100100
Key:1101 or generator polynomial:x3+x2+1 1x3+ax2+0x+1 => 1101
Mrs.S.S.Kadam
Page 8
DCN
Receiver Side:
Receiver performs division operation on codewords using same CRC divisior. If the
remainder contains all zero the data bits are accepted, otherwise it is considered as there
some data corrupted and is therefore rejected.
Mrs.S.S.Kadam
Page 9
DCN
Mrs.S.S.Kadam
Page 10
DCN
2. Lost Acknowledgement
Assume the sender sends the data, which is also received by the receiver. The receiver sends an
acknowledgment after receiving the packet. In this situation, the acknowledgment is lost in the
network. The sender does not send the next data packet because it does not receive
acknowledgement, under the stop and wait protocol, the next packet cannot be transmitted until
the preceding packet’s acknowledgment is received.
2.Go-Back-N ARQ: The sender can send multiple packets within a window before waiting for
acknowledgements, and if an error occurs, all unacknowledged packets within the window are
retransmitted.
The Go-Back-N (GBN) protocol is a sliding window protocol used in networking for reliable data
transmission. It is part of the Automatic Repeat reQuest (ARQ) protocols, which ensure that data is
correctly received and that any lost or corrupted packets are retransmitted.
Example:
Consider the diagram given below. We have sender window size of 4. Now the sender has sent the
packets 0, 1, 2 and 3. After acknowledging the packets 0 and 1, receiver is now expecting packet 2
Mrs.S.S.Kadam
Page 11
DCN
and sender window has also slided to further transmit the packets 4 and 5. Now suppose the packet
2 is lost in the network, Receiver will discard all the packets which sender has transmitted after
packet 2 as it is expecting sequence number of 2.
On the sender side for every packet send there is a time out timer which will expire for packet
number 2. Now from the last transmitted packet 5 sender will go back to the packet number 2 in the
current window and transmit all the packets till packet number 5. That’s why it is called Go Back
N. Go back means sender has to go back N places from the last transmitted packet in the
unacknowledged window and not from the point where the packet is lost.
Mrs.S.S.Kadam
Page 12
DCN
Example:
Explanation
Step 2 − Without waiting for acknowledgement from the receiver another frame, Frame1 is sent
by sender by setting the timer for it.
Step 3 − In the same way frame2 is also sent to the receiver by setting the timer without waiting
for previous acknowledgement.
Step 4 − Whenever sender receives the ACK0 from receiver, within the frame 0 timer then it is
closed and sent to the next frame, frame 3.
Step 5 − whenever the sender receives the ACK1 from the receiver, within the frame 1 timer
then it is closed and sent to the next frame, frame 4.
Step 6 − If the sender doesn’t receive the ACK2 from the receiver within the time slot, it
declares timeout for frame 2 and resends the frame 2 again, because it thought the frame2 may be
lost or damaged.
Mrs.S.S.Kadam
Page 13
DCN
2r≥ m+r+1
2. All the bit positions that are a power of 2 marked as a parity bits( 1,2,4,8)
r8 R4 r2 r1 r1=1,3,5,7,9……
23 22 21 20 r2=2,3,6,7,10,11….
1 0 0 0 1 r4=4-7,12-15,20-23…….
2 0 0 1 0
3 0 0 1 1 Like wise
4 0 1 0 0 r8=8-15,24-31,40-47,…..
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
10 1 0 1 0
11 1 0 1 1
Mrs.S.S.Kadam
Page 14
DCN
a) r1=covers all the bits positions whose binary representation includes a 1 in the
least significant position (1,3,5,7,…..)
b) r2=covers all the bits positions whose binary representation includes a 1 in the
second position from the least significant position (2,3,6,7,10,11…..)
c) r4=covers all the bits positions whose binary representation includes a 1 in the
third position from the least significant position (4-7, 12-15, 20-23…….)
d) r8= covers all the bits positions whose binary representation includes a 1 in the
fourth position from the least significant position (8-15, 24-31, 40-47,…..)
set a parity bit 1 if the total number of 1’s in the positions it checks is odd.
set parity bit 0 if the total number of 1’s in the position it check is even.
Receiver Side:
1.Take codeword and Write the bit positions starting from 1(binary form)
2.calculate parity bit by using even parity or odd parity(depending upon which method used by
sender)
But if you find it contradictory, just put parity bit=1 or else parity bit=0
If all parity bits are 0 means no error, But if any one of the parity bit is 1 then, arrange all parity
bit one by one like r4,r2,r1 which is in binary form then convert it into decimal number. This
decimal number means bit position where error is present.
1 0 1 1
D7 D6 D5 r4 D3 r2 r1
Mrs.S.S.Kadam
Page 15
DCN
r1,3,5,7= r1,1,1,1
To find the redundant bit r1, we check for even parity. Since the total number of 1’s in all the
bit positions corresponding to r1 is an odd number. So, the value of r1 (parity bit’s value) = 1.
r1=1
r2 bit is calculated using parity check at all the bits positions whose binary representation
includes a 1 in the second position from the least significant bit. r2: bits 2,3,6,7,10,11
r2,3,6,7=r2,1,0,1
To find the redundant bit r2, we check for even parity. Since the total number of 1’s in all
the bit positions corresponding to r2 is even the value of r2(parity bit’s value)=0
r2=0
r4 bit is calculated using parity check at all the bits positions whose binary representation
includes a 1 in the third position from the least significant bit. r4: bits 4, 5, 6, 7
r4,5,6,7=r4,1,0,1
To find the redundant bit r4, we check for even parity. Since the total number of 1’s in all
the bit positions corresponding to R4 is even so the value of r4(parity bit’s value) = 0
r4=0
Thus, the data transferred is:
1 0 1 0 1 0 1
D7 D6 D5 r4 D3 r2 r1
1 1 1 0 1 0 1
D7 D6 D5 r4 D3 r2 r1
For all the parity bits we will check the number of 1’s in their respective bit positions.
For r1: bits 1, 3, 5, 7, 9, 11.
Mrs.S.S.Kadam
Page 16
DCN
r1,3,5,7= 1,1,1,1
We can see that the number of 1’s in these bit positions are 4 and that’s even so we get a 0
for this.
r1=0
We can see that the number of 1’s in these bit positions are 3 and that’s odd so we get a 1
for this.
r2=1
We can see that the number of 1’s in these bit positions are 3 and that’s odd so we get a 1
for this.
r4=1
r4 r2 r1=(110)2 =(6)10
The bits give the binary number 110 whose decimal representation is 6. Thus, bit 6
contains an error. To correct the error the 6th bit is changed from 1 to 0.
1 0 1 0 1 0 1
D7 D6 D5 r4 D3 r2 r1
Mrs.S.S.Kadam
Page 17
DCN
Example 2:
Suppose the data to be transmitted is 1011001 from sender to receiver.
To find the redundant bit R1, we check for even parity. Since the total number of 1’s in
all the bit positions corresponding to R1 is an even number. So, the value of R1 (parity
bit’s value) = 0.
R1=0
R2 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the second position from the least significant bit. R2: bits
2,3,6,7,10,11
R2 ,3,6,7,10,11=r2,1,0,1,0,1
To find the redundant bit R2, we check for even parity. Since the total number of 1’s in
all the bit positions corresponding to R2 is odd the value of R2(parity bit’s value)=1
R2=1
R4 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the third position from the least significant bit. R4: bits 4,
5, 6, 7
R4,5, 6,7=R4,0,0,1
To find the redundant bit R4, we check for even parity. Since the total number of 1’s in
all the bit positions corresponding to R4 is odd so the value of R4(parity bit’s value) =
1
Mrs.S.S.Kadam
Page 18
DCN
R4=1
R8 bit is calculated using parity check at all the bits positions whose binary
representation includes a 1 in the fourth position from the least significant bit. R8: bit
8,9,10,11
R8,9,10,11=R8,1,0,1
To find the redundant bit R8, we check for even parity. Since the total number of 1’s in
all the bit positions corresponding to R8 is an even number the value of R8(parity bit’s
value)=0.
R8=0
1 0 1 0 1 1 0 1 1 1 0
D11 D10 R9 D8 D7 D6 D5 R4 D3 R2 R1
For all the parity bits we will check the number of 1’s in their respective bit positions.
For R1: bits 1, 3, 5, 7, 9, 11.
R1,3,5,7,9,11=r1,1,0,1,1,1
We can see that the number of 1’s in these bit positions are 4 and that’s even so we get a 0
for this.
R1=0
We can see that the number of 1’s in these bit positions are 5 and that’s odd so we get a 1
for this.
R2=1
Mrs.S.S.Kadam
Page 19
DCN
We can see that the number of 1’s in these bit positions are 3 and that’s odd so we get a 1
for this.
R4=1
We can see that the number of 1’s in these bit positions are 2 and that’s even so we get a 0
for this.
R8=0
R8 R4 R2 R1=(0110)2 =(6)10
The bits give the binary number 0110 whose decimal representation is 6. Thus, bit 6 contains
an error. To correct the error the 6th bit is changed from 1 to 0.
1 0 1 0 1 0 0 1 1 1 0
D11 D10 R9 D8 D7 D6 D5 R4 D3 R2 R1
Mrs.S.S.Kadam
Page 20
DCN
A Wireless LAN is a group of computers or other devices that form a network based on radio
transmission (rather than wired connection).WLAN are wireless computer network that are uses
high frequency radio wave instead of cable for connecting the devices within a limited area
forming LAN.
IEEE 802.11
IEEE has defined the specification for a wireless LAN, called IEEE 802.11, which covers the
physical and data link layers. But before discussing these layers, we describe the architecture of
the protocol in general.
Architecture
The standard defines two kinds of services: the basic service set (BSS) and the extended
service set (ESS).
Basic Service Set
IEEE 802.11 defines the basic service set (BSS) as the building block of a wireless LAN. A
basic service set is made of stationary or mobile wireless stations and a possible central base
station, known as the access point (AP). Figure 3.6 shows two sets in this standard. The BSS
without an AP is a stand-alone network and cannot send data to other BSSs. It is what is called
an ad hoc architecture. In this architecture, stations can form a network without the need of an
AP; they can locate each other and agree to be part of a BSS. A BSS with an AP is sometimes
referred to as an infrastructure network.
Mrs.S.S.Kadam
Page 21
DCN
When BSSs are connected, we have what is called an infrastructure network. In this network, the
stations within reach of one another can communicate without the use of an AP. However,
communication between two stations in two different BSSs usually occurs via two APs. The idea
is similar to communication in a cellular network if we consider each BSS to be a cell and each
AP to be a base station. Note that a mobile station can belong to more than one BSS at the same
time.
Station Types
IEEE 802.11 defines three types of stations based on their mobility in a wireless LAN:
no-transition, BSS-transition, and ESS-transition.
No-Transition Mobility A station with no-transition mobility is either stationary (not moving)
or moving only inside a BSS.
BSS-Transition Mobility A station with BSS-transition mobility can move from one BSS to
another, but the movement is confined inside one ESS.
ESS-Transition Mobility A station with ESS-transition mobility can move from one ESS to
another. However, IEEE 802.11 does not guarantee that communication is continuous during the
move.
Mrs.S.S.Kadam
Page 22
DCN
The Wi-Fi Alliance created a naming system to aid the general public in differentiating between
different versions of IEEE 802.11.
IEEE 802.11:
This is the original standard created in 1997 but currently defunct. The version supports a
maximum connection speed of 1Mbps. Unfortunately, devices using this version are no longer
produced and don’t work on today’s equipment.
IEEE 802.11a:
This second version was developed in 1999 and works on a 5GHz Wi-Fi band. The version was
released hoping that it will encounter less interference, especially since most devices then used
the 2.4GHz band. Nonetheless, IEEE 802.11a is faster, with maximum data rates of 1.5Mbps to
54Mbps.
IEEE 802.11b:
This version was also developed in 1999 but used the typical unregulated radio signaling
frequency of the 2.4GHz band. It comes with a maximum speed of 11Mbps, and it is the version
that increased Wi-Fi’s popularity. Most vendors preferred using these frequencies due to low
production costs. Unfortunately, its unregulated nature means that IEEE 802.11b can face
interference from cordless phones, ovens, and all other devices using the 2.4GHz range.
IEEE 802.11g:
This 2003 sequel improved the maximum data rates of 54Mbps while maintaining the reliable
2.4GHz band usage, which explains its widespread adoption. Also called Wi-Fi 3, this standard
combines the good features of IEEE 802.11b and IEEE 802.11a. As such, it is compatible with
backward technologies, meaning that 802.11b APs can work with IEEE 802.11g adapters.
IEEE 802.11n:
The IEEE 802.11n, otherwise called Wireless N or Wi-Fi 4, was developed to improve the
bandwidth rates provided by IEEE 802.11g. This standard uses several antennas and wireless
signals, popularly known as MIMO technology, contrary to the one used by IEEE 802.11g.
802.11n was ratified by industry standards in 2009, enabling it to provide maximum network
bandwidths of 600Mbps. It also offers a better Wi-Fi range compared to previous standards since
it has a higher signal intensity. The only drawback of this standard is that it is more expensive
than IEEE 802.11g.
Mrs.S.S.Kadam
Page 23
DCN
Fig: Piconet
A piconet is the type of connection that is formed between upto 8 Bluetooth-enabled devices
such as mobile, laptop, speaker, mouse, keyboard or PDAs over a short range of 10m radius.
Network ranges from two to eight connected devices. When network is established, one device
takes the role of the master while all other devices acts as slaves. The master node is the primary
station that manages the small network. The slave stations are secondary stations that are
synchronized with the primary station. Communication can take place between a master node
and a slave node in either one-to-one or one-to-many manner. However, no direct
communication takes place between slaves
Mrs.S.S.Kadam
Page 24
DCN
Scatternet
Fig: Scatternet
Mrs.S.S.Kadam
Page 25
DCN
2G ‐ Second Generation
Cell phones received their first major upgrade when they went from 1G to 2G. The main
difference between the two mobile telephone systems (1G and 2G), is that the radio signals used
by 1G network are analog, while 2G networks are digital. Main motive of this generation was to
provide secure and reliable communication channel. It implemented the concept of CDMA and
GSM. Provided small data service like sms and mms. Second generation 2G cellular telecom
networks were commercially launched in 1991. During 2G Cellular phones are used for data also
along with voice. The advance in technology from 1G to 2G introduced many of the fundamental
services that we still use today, such as
• SMS
• internal roaming
• conference calls
• call hold and
• billing based on services e.g. charges based on long distance calls and real time billing.
The max speed of 2G with General Packet Radio Service (GPRS) is 50 Kbps or 1 Mbps with
Enhanced Data
Rates for GSM Evolution (EDGE).
3G ‐ Third Generation
This generation set the standards for most of the wireless technology we have come to know and
love. Web browsing, email, video downloading, picture sharing and other smartphone
technology were introduced in the third generation. Introduced commercially in 2001, the goals
set out for third generation mobile communication were to facilitate greater voice and data
capacity, support a wider range of applications, and increase data transmission at a lower cost.
3G has Multimedia services support along with streaming are more popular. In 3G, Universal
access and portability across different device types are made possible (Telephones, PDA's, etc.).
3G increased the efficiency of frequency spectrum by improving how audio is compressed
during a call, so more simultaneous calls can happen in the same frequency range. 3G
technology is capable of allowing internet speeds that can reach 7 Mbps, but this speed is
unrealistic and is often approximately 2 to 3 Mbps.
People felt that the speeds reached by 3G technology were better, but that speed and access could
still be improved regarding the internet and mobile devices. This encouraged the development of
4G technology, the 4th generation of mobile communication standard.
4G ‐ Fourth Generation
4G is a very different technology as compared to 3G and was made possible practically only
because of the advancements in the technology in the last 10 years. Its purpose is to provide high
speed, high quality and high capacity to users while improving security and lower the cost of
voice and data services, multimedia and internet over IP. Potential and current applications
Mrs.S.S.Kadam
Page 26
DCN
include;
• mobile web access
• IP telephony
• gaming services
• high‐definition mobile TV
• video conferencing
• 3D television, and
• cloud computing
The development of 4G technology provided two main benefits, increased upload and download
speeds and reduced latency. 4G technology is approximately five times (and sometimes more)
faster than 3G technology. This meant that the speed at which files could be downloaded was
significantly increased. This increase in speed meant that files could be downloaded in a much
faster time. Typically, with 3G technology, a 2GB file could take approximately 30 minutes to
download. However, with 4G technology that download time could be potentially cut to
approximately 3–4 minutes. This significantly improved the experience of mobile devices
and internet usage for the user.
5G ‐ Fifth Generation
5G is a generation currently under development, that's intended to improve on 4G. 5G promises
significantly faster data rates, higher connection density, much lower latency, among other
improvements. Some of the plans for 5G include device‐to‐device communication, better battery
consumption, and improved overall wireless coverage.
5G technology is set to dramatically affect the use of mobile internet. In order to provide 5G
access there is a major restructure occurring on parts of the radio network that is used to transmit
data. This restructure is reported to allow data to be transmitted approximately 100 times faster.
The development from 3G to 4G technology and further developments into 5G technology will
enable a number of advancements. These may include:
• greater speed in internet access
• faster loading speeds of applications, such as maps
• the ability to have multiple people in video conferencing calls
• more effective location services to allow for real‐time updates, such as traffic andweather
• the ability to stream high‐definition (HD)
Mrs.S.S.Kadam
Page 27