0% found this document useful (0 votes)
83 views45 pages

Module3 CN 15.10.2022

The document discusses error detection and correction in computer networks. It describes different types of errors like single-bit errors and burst errors. It then explains various techniques for error detection and correction including redundancy, detection vs correction, forward error correction vs retransmission, block coding, and linear block coding. Block coding adds redundant bits to data words to create codewords. By checking if a received codeword is valid, errors can be detected. With more redundant bits, some errors can also be corrected by finding the closest valid codeword.

Uploaded by

Melio Duzz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
83 views45 pages

Module3 CN 15.10.2022

The document discusses error detection and correction in computer networks. It describes different types of errors like single-bit errors and burst errors. It then explains various techniques for error detection and correction including redundancy, detection vs correction, forward error correction vs retransmission, block coding, and linear block coding. Block coding adds redundant bits to data words to create codewords. By checking if a received codeword is valid, errors can be detected. With more redundant bits, some errors can also be corrected by finding the closest valid codeword.

Uploaded by

Melio Duzz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Syllabus:

Data link layer: Error Detection and Correction, Framing, flow and error control,
Protocols – Noiseless channels (Simplest, Stop and Wait) and Noisy channels (Stop and
Wait and Piggy Backing). Multiple Access Protocols. Random Access-ALOHA, CSMA.
Wired LANs-IEEE standards, wireless LANs-Bluetooth, Cellular Telephony

Data link Layer functions include data link control and medium access control

Data link control functions include framing, flow and error control, and
software implemented protocols that provide smooth and reliable transmission of
frames between nodes.

Error Detection and Correction

Networks must be able to transfer data from one device to another with acceptable
accuracy. For most applications, a system must guarantee that the data received are
identical to the data transmitted. Data can be corrupted during transmission. Some
applications require that errors be detected and corrected.

Types of Errors

Whenever bits flow from one point to another, they are subject to unpredictable changes
because of interference. This interference can change the shape of the signal. In a
single-bit error, a 0 is changed to a 1 or a 1 to a 0. In a burst error, multiple bits are
changed.

Single-Bit Error

Dr.Dhanya Job S5_BCA[2018-2021] Page 1


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The term single-bit error means that only 1 bit of a given data unit (such as a byte,
character, or packet) is changed from 1 to 0 or from 0 to 1.

Single-bit errors are the least likely type of error in serial data transmission.

Burst Error

The term burst error means that 2 or more bits in the data unit have changed from 1 to 0
or from 0 to 1. Figure shows the effect of a burst error on a data unit. In this case,
0100010001000011 were sent, but 0101110101100011 were received.

Burst error does not mean that the errors occur in consecutive bits. The length of the
burst is measured from the first corrupted bit to the last corrupted bit. Some bits in
between

may not have been corrupted.

Redundancy

The central concept in detecting or correcting errors is redundancy. To be able to


detect or correct errors, we need to send some extra bits with our data. These
redundant bits are added by the sender and removed by the receiver. Their presence
allows the receiver to detect or correct corrupted bits.

Detection versus Correction

Detection

Dr.Dhanya Job S5_BCA[2018-2021] Page 2


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The correction of errors is more difficult than the detection. In error detection, we are
looking only to see if any error has occurred. The answer is a simple yes or no. We are
not even interested in the number of errors. A single-bit error is the same for us as a
burst error.

Correction : In error correction, we need to know the exact number of bits that are
corrupted and their location in the message. The number of the errors and the size of
the message are important factors.

Forward Error Correction versus Retransmission

There are two main methods of error correction.

Forward error correction is the process in which the receiver tries to guess the
message by using redundant bits. This is possible, if the number of errors is small.

Correction by retransmission: is a technique in which the receiver detects the


occurrence of an error and asks the sender to resend the message. Resending is
repeated until a message arrives that the receiver believes is error-free (usually, not all
errors can be detected).

Coding
Redundancy is achieved through various coding schemes. The sender adds redundant
bits through a process that creates a relationship between the redundant bits and the
actual data bits. The receiver checks the relationships between the two sets of bits to
detect or correct the errors.

We can divide coding schemes into two broad categories: block coding and convolution
coding.

Arithmetic in Coding

In modulo-N arithmetic, we use only the integers in the range 0 to N −1, inclusive.
Figure showing XORing of two single bits or two words

Dr.Dhanya Job S5_BCA[2018-2021] Page 3


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

BLOCK CODING

In block coding, we divide our message into blocks, each of k bits, called datawords.
We add r redundant bits to each block to make the length n = k + r. The resulting n-bit
blocks are called codewords.
We have a set of datawords, each of size k, and a set of codewords, each of size of n.
With k bits, we can create a combination of 2 datawords; with n bits, we can create a
combination of 2 codewords. Since n > k, the number of possible codewords is larger
than the number of possible datawords.
The block coding process is one-to-one; the same dataword is always encoded as the
same codeword. This means that we have 2 - 2 codewords that are not used.

Error Detection

If the following two conditions are met, the receiver can detect a change in the original
codeword.

Dr.Dhanya Job S5_BCA[2018-2021] Page 4


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

1. The receiver has (or can find) a list of valid codewords.


2. The original codeword has changed to an invalid one.
Figure shows the role of block coding in error detection.

The sender creates codewords out of data words by using a generator that applies the
rules and procedures of encoding. Each codeword sent to the receiver may change
during transmission. If the received codeword is the same as one of the valid
codewords, the word is accepted; the corresponding dataword is extracted for use. If
the received codeword is not valid, it is discarded. However, if the codeword is
corrupted during transmission but the received word still matches a valid codeword, the
error remains undetected. This type of coding can detect only single errors. Two or
more errors may remain undetected.

Example: Let us assume that k =2 and n =3. Table 10.1 shows the list of datawords
and codewords.

Assume the sender encodes the dataword 01 as 011 and sends it to the receiver.
Consider the following cases:

Dr.Dhanya Job S5_BCA[2018-2021] Page 5


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

 The receiver receives 011. It is a valid codeword. The receiver extracts the
dataword 01 from it.
 The codeword is corrupted during transmission, and 111 is received (the leftmost
bit is corrupted).This is not a valid codeword and is discarded.
 The codeword is corrupted during transmission, and 000 is received (the right
two bits are corrupted). This is a valid codeword. The receiver incorrectly extracts
the dataword 00. Two corrupted bits have made the error undetectable.

An error-detecting code can detect only the types of errors for which it is
designed; other types of errors may remain undetected.

Error Correction

Error correction is much more difficult than error detection. In error detection, the
receiver needs to know only that the received codeword is invalid; in error correction the
receiver needs to find (or guess) the original codeword sent. We can say that we need
more redundant bits for error correction than for error detection.

Example:

Assume the dataword is 01. The sender consults the table (or uses an algorithm) to
create the codeword 01011. The codeword is corrupted during transmission, and 01001
is received (error in the second bit from the right). First, the receiver finds that the
received codeword is not in the table.

Dr.Dhanya Job S5_BCA[2018-2021] Page 6


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

This means an error has occurred. (Detection must come before correction.) The
receiver, assuming that there is only 1 bit corrupted, uses the following strategy to
guess the correct dataword.

 Comparing the received codeword with the first codeword in the table (01001
versus 00000), the receiver decides that the first codeword is not the one that
was
 sent because there are two different bits.
 By the same reasoning, the original codeword cannot be the third or fourth one in
the table.
 The original codeword must be the second one in the table because this is the
only one that differs from the received codeword by 1 bit. The receiver replaces
01001 with 01011 and consults the table to find the dataword 01.

LINEAR BLOCK CODES

Almost all block codes used today belong to a subset called linear block codes.

A linear block code is a code in which the exclusive OR (addition modulo-2) of two
valid codewords creates another valid codeword.

The scheme in Table 10.1 is a linear block code because the result of XORing any
codeword with any other codeword is a valid codeword. For example, the XORing of the second
and third codewords creates the fourth one.

The scheme in Table 10.2 is also a linear block code. We can create all four codewords
by XORing two other codewords.

Dr.Dhanya Job S5_BCA[2018-2021] Page 7


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Minimum Distance for Linear Block Codes

The minimum Hamming distance for Linear Block Codes is the number of 1s in the
nonzero valid codeword with the smallest number of 1s.

In our first code (Table 10.1), the numbers of 1s in the nonzero codewords are 2, 2, and 2. So
the minimum Hamming distance is dmin = 2. In our second code (Table 10.2), the numbers of 1s
in the nonzero codewords are 3, 3, and 4. So in this code we have dmin = 3.

Some Linear Block Codes


1. Simple Parity-Check Code
In this code, a k-bit dataword is changed to an n-bit codeword where n = k + 1. The
extra bit, called the parity bit, is selected to make the total number of 1s in the
codeword even. The minimum Hamming distance for this category is dmin =2, which
means that the code is a single-bit error-detecting code; it cannot correct any
error.

Table 10.1 is a parity-check code with k = 2 and n =3. Example: a parity-check code
with k= 4 and n =5.

Encoder and Decoder for parity check

Dr.Dhanya Job S5_BCA[2018-2021] Page 8


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The encoder uses a generator that takes a copy of a 4-bit dataword (a0, a1 a2 a3) and

generates a parity bit r0. The dataword


bits and the parity bit create the 5-bit codeword. The parity bit that is added makes the
number of 1s in the codeword even.
If the number of 1s is even, parity bit is 0; if the number of 1s is odd, the parity bit is 1. In
both cases, the total number o
f 1s in the codeword is even. It is got by adding all the bits of dataword.

The sender sends the codeword which may be corrupted during transmission. The
receiver receives a 5-bit word. The checker at the receiver will add all 5 bits. The result,
which is called the syndrome, is just 1 bit.

The syndrome is 0 when the number of 1s in received codeword is even; else it is 1.

Dr.Dhanya Job S5_BCA[2018-2021] Page 9


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Assume the sender sends the dataword 1011. The codeword created from this
dataword is 1011

1, which is sent to the receiver.

 No error occurs; the received codeword is 10111. The syndrome is 0. The


dataword 1011 is created.
 One single-bit error changes a 1.The received codeword is 10011. The syndrome
is 1. No dataword is created.
 The simple parity-check decoder cannot detect an even number of errors. The
errors cancel each other out and give the syndrome a value of 0.
This shows that the simple parity check, guaranteed to detect one single
error, can also find any odd number of errors.
CYCLIC CODES

We can create cyclic codes to correct errors. In this section, we simply discuss a category of cyclic codes
called the cyclic redundancy check (CRC) that is used in networks such as LANs and WANs.

Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a
codeword is cyclically shifted (rotated), the result is another codeword. For example, if
1011000 is a codeword and we cyclically left-shift, then 0110001 is also a codeword.

Dr.Dhanya Job S5_BCA[2018-2021] Page 10


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Dr.Dhanya Job S5_BCA[2018-2021] Page 11


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Framing

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.

Frames can be of fixed or variable size.

Fixed-Size Framing

Dr.Dhanya Job S5_BCA[2018-2021] Page 12


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Frames can be of fixed or variable size. 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 is the ATM wide-area network, which uses frames of fixed size called cells.

ATM: Asynchronous Transfer Mode (connection oriented, high-speed network


technology that is used in both LAN and WAN over optical fiber and operates upto
gigabit speed.

Variable-Size Framing

Variable-size framing is prevalent in local area networks.

Two approaches were used for this purpose:

a) Character-oriented approach:

Fig. A frame in character oriented protocol

In a character-oriented protocol, data to be carried are 8-bit characters from a coding


system such as ASCII. It also contains

 Header :- which normally carries the source and destination addresses and other
control information.
 Trailer :- which carries error detection or error correction redundant bits, are also
multiples of 8 bits. To separate one frame from the next.
 Flag :- An 8 bit(1 byte) is added at the beginning and the end of a frame.

Character-oriented framing was popular when only text was exchanged by the data link
layers. The flag could be selected to be any characters that are not used for text
communication.

Any pattern used for the flag could not be a 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.

Dr.Dhanya Job S5_BCA[2018-2021] Page 13


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

To fix this problem, a byte-stuffing strategy was added to character-oriented framing.


In byte stuffing (or character stuffing), a special byte is added to the data section of
the frame when there is a character with the same pattern as the flag. The data section
is stuffed with an extra byte. This byte is usually called the escape character (ESC),
which has a predefined bit pattern. Whenever the receiver encounters the ESC
character, it removes it from the data section and treats the next character as data, not
a delimiting flag.

b) Bit-oriented approach:

In a bit-oriented protocol, the data section of a frame is a sequence of bits to be


interpreted by the upper layer. Most protocols use a special 8-bit pattern flag 01111110
as the delimiter to define the beginning and the end of the frame, as shown in Figure C.

Fig C. A frame in Bit-Oriented Protocol

if the flag pattern appears in the data, we have to inform the receiver that this is not the
end of the frame. This is done by stuffing 1 single bit (instead of 1 byte) to prevent the
pattern from looking like a flag. The strategy is called bit stuffing.

In bit stuffing, if a 0 and five consecutive I bits are encountered, an extra 0 is added.
This extra stuffed bit is eventually removed from the data by the receiver.

Figure D sh

ows bit stuffing at the sender and bit removal at the receiver. Note that even if we have
a 0 after five 1s, we still stuff a 0. The 0 will be removed by the receiver.

Dr.Dhanya Job S5_BCA[2018-2021] Page 14


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Fig. D. Bit stuffing and unstuffing.

The real flag 01111110 is not stuffed by the sender and is recognized by the receiver.

FLOW AND ERROR CONTROL

The most important responsibilities of the datalink layer are flow control and error
control. Collectively, these functions are known as data link control.

Flow Control:

 Any receiving device has a limited speed at which it can process incoming data
and a limited amount of memory in which to store incoming data.

The flow of data must not be allowed to overwhelm the receiver.

 The receiver must be able to tell the sender to halt transmission until it is once
again able to receive.
 Flow control refers to a set of procedures used to restrict the amount of data that
the sender can send before waiting for acknowledgement.
 Each receiving device has a block of memory, called a buffer, reserved for
storing incoming data until they are processed. If the buffer begins to fill up, the
receiver must be able to tell the sender to halt transmission until it is once again
able to receive.

Error Control:

Dr.Dhanya Job S5_BCA[2018-2021] Page 15


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

 Errors occur due to noises in the channel.


 Error control is both error detection & error correction.
 It allows the receiver to tell the sender of any frames lost or damaged in
transmission and coordinates the retransmission of those frames by the sender.
 Error control in the data link layer is based on automatic repeat request, (ARQ)
which is the retransmission of data.

PROTOCOLS: The protocols in the data link layer are classified as:-

A) Noiseless channels:

i) Simplest protocol:

Assumptions in this protocol are:

 Data transfer is unidirectional.


 Both sender & receiver network layers are always ready.
 Processi
 ng time can be ignored.
 Infinite buffer space is available.
 Frames are never damaged or lost.

Design :

Dr.Dhanya Job S5_BCA[2018-2021] Page 16


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

There is no need for flow control in this scheme. The data link layer at the sender site
gets data from its network layer, makes a frame out of the data, and sends it. The
datalink layer at the receiver site receives a frame from its physical layer, extracts data
from the frame, and delivers the data to its network layer. The data link layers use the
services provided by their physical layers (such as signaling, multiplexing, and so on)
for the physical transmission of bits. Fig E. Flow diagram to illustrate simplest protocol

ii) Stop - & - Wait Protocol:

Assumptions in this protocol are:

 Data transfer is unidirectional.


 Both sender & receiver network layers are always ready.
 Receiver doesn’t have enough storage space.
 Receiver is slower than sender in processing.
 Frames are never damaged or lost.

Design :-

We can see the traffic on the forward channel (from sender to receiver) and the reverse
channel. At any time, there is either one data frame on the forward channel or one ACK
frame on the reverse channel. We therefore need a half-duplex link.

Dr.Dhanya Job S5_BCA[2018-2021] Page 17


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Fig G. Flow diagram to illustrate stop and wait protocol

Noisy channels:-

i) Stop - & - Wait Automatic Repeat Request (ARQ):

 Adds a simple error control mechanism to the Stop-&-Wait protocol.


 Error detection & retransmission is used for error control.
 Sending device keeps a copy of the last frame transmitted until
acknowledgement for that frame is received.
 Data frames uses Sequence numbers, to avoid duplication of frames.
 For a m bit field range of sequence numbers is from 0 to 2m−1
 ACK frame uses Acknowledgement number, & always announces the
sequence number of the next frame expected.
 Timers are used in case of loss of ACK frames.

Design :

Dr.Dhanya Job S5_BCA[2018-2021] Page 18


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The sending device keeps a copy of the last frame transmitted until it receives an
acknowledgment for that frame. A data frames uses a seqNo (sequence number); an
ACK frame uses an ackNo(acknowledgment number). The sender has a control
variable, which we call Sn (sender, next frame to send), that holds the sequence
number for the next frame to be sent (0 or 1).

The receiver has a control variable, which we call Rn (receiver, next frame
expected),that holds the number of the next frame expected. When a frame is sent, the
value of Sn is incremented (modulo-2), which means if it is 0, it becomes 1 and vice
versa.

When a frame is received, the value of Rn is incremented (modulo-2), which means if it


is 0, it becomes 1 and vice versa. Variable Sn points to the slot that matches the
sequence number of the frame that has been sent, but not acknowledged; Rn points to
the slot that matches the sequence number of the expected frame.

Flow Diagram: Normal operation

Flow Diagram: Lost Frame

Dr.Dhanya Job S5_BCA[2018-2021] Page 19


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Flow Diagram: Lost ACK Frame

Figure 11.11 shows an example of Stop-and-Wait ARQ. Frame 0 is sent and


acknowledged. Frame 1 is lost and resent after the time-out. The resent frame 1 is
acknowledged and the timer stops. Frame 0 is sent and acknowledged, but the
acknowledgment is lost. The sender has no idea if the frame or the acknowledgment is
lost, so after the time-out, it resends frame 0, which is acknowledged.

Dr.Dhanya Job S5_BCA[2018-2021] Page 20


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

A task is often begun before the previous task has ended. This is known as pipelining.
There is no pipelining in Stop-and-Wait ARQ because we need to wait for a frame to
reach the destination and be acknowledged before the next frame can be sent.

Disadvantages of Stop and Wait ARQ

• In stop-and-wait, at any point in time, there is only one frame that is sent and
waiting to be acknowledged.
• This is not a good use of transmission medium.
• To improve efficiency, multiple frames should be in transition while waiting for
ACK.
• Two protocol use the above concept,
– Go-Back-N ARQ
– Selective Repeat ARQ

PIGGYBACKING

Dr.Dhanya Job S5_BCA[2018-2021] Page 21


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The three protocols Stop and Wait ,Go-Back-N ARQ Selective Repeat ARQ are all
unidirectional: data frames flow in only one direction although control information such
as ACK and NAK frames can travel in the other direction. In real life, data frames are
normally flowing in both directions: from node A to node B and from node B to node A.
This means that the control information also needs to flow in both directions.

A technique called piggybacking is used to improve the efficiency of the bidirectional


protocols. When a frame is carrying data from A to B, it can also carry control
information about arrived (or lost) frames from B; when a frame is carrying data from B
to A, it can also carry control information about the arrived (or lost) frames from A.

Multiple Access Protocols


The Data Link Layer is responsible for transmission of data between two nodes. Its
main functions are-

Dr.Dhanya Job S5_BCA[2018-2021] Page 22


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

 Data Link Control


 Multiple Access Control

Data Link control


The data link control is responsible for reliable transmission of message over transmission
channel by using techniques like framing, error control and flow control.

Multiple Access Control

If there is a dedicated link between the sender and the receiver then data link control
layer is sufficient, however if there is no dedicated link present then multiple stations
can access the channel simultaneously. Hence multiple access protocols are required
to decrease collision and avoid crosstalk. For example, in a classroom full of students,
when a teacher asks a question and all the students (or stations) start answering
simultaneously (send data at same time) then a lot of chaos is created (data overlap or
data lost) then it is the job of the teacher (multiple access protocols) to manage the
students and make them answer one at a time.
Thus, protocols are required for sharing data on non-dedicated channels. Multiple
access protocols can be subdivided further as –

1. Random Access Protocol: In this, all stations have same superiority that is no
station has more priority than another station. Any station can send data depending on
medium’s state (idle or busy). It has two features:

1. There is no fixed time for sending data

2. There is no fixed sequence of stations sending data

The Random access protocols are further subdivided as:

(a) ALOHA – It was designed for wireless LAN but is also applicable for shared
medium. In this, multiple stations can transmit data at the same time and can hence
lead to collision and data being garbled.

Dr.Dhanya Job S5_BCA[2018-2021] Page 23


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Pure Aloha:
The original ALOHA protocol is called pure ALOHA. Each station sends a frame
whenever it has a frame to send. Since there is only one channel to share, there is the
possibility of collision between frames from different stations. The following figure shows
an example of frame collisions in pure ALOHA.

Only two frames survive: frame 1.1 from station 1 and frame 3.2 from station 3. We
need to mention that even if one bit of a frame coexists on the channel with one bit from
another frame, there is a collision and both will be destroyed.

When a station sends data it waits for an acknowledgement. If the acknowledgment


does not arrive after a time-out period, the station assumes that the frame (or the
acknowledgment) has been destroyed andresendstheframe.
A collision involves two or more stations. If all these stations try to resend their frames
after the time-out, the frames will collide again.
Pure ALOHA says that when the time-out period passes, each station waits a random
amount of time before resending its frame. The randomness will help to avoid more
collisions. We call this time the Back off time TB.
Pure ALOHA has a second method to prevent congesting the channel with
Retransmitted frames. After a maximum number of retransmission attempts Kmax a
station must give up and try later.

Dr.Dhanya Job S5_BCA[2018-2021] Page 24


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The time-out period is twice the amount of time required to send a frame between the
two most widely separated stations (2 x Tp). The back-off time TB is a random value
that normally depends on K (the number of attempted unsuccessful transmissions).

One common formula is the binary exponential back-off to calculate back off time. In
this method, for each retransmission, a multiplier in the range 0 to 2K - 1 is randomly
chosen and multiplied by Tp (maximum propagation time) or TFR (the average time
required to send out a frame) to find TB. Note that in this procedure, the range of the
random numbers increases after each collision. The value of Kmax is usually chosen as
15.

Vulnerable time: The length of time, the vulnerable time, in which there is a possibility
of collision. We assume that the stations send fixed-length frames with each frame
taking Tfr S to send.

Dr.Dhanya Job S5_BCA[2018-2021] Page 25


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

The end of B's frame collides with the beginning of A's frame. The beginning of C's
frame collides with the end of A's frame.

Throughput : The average number of successful transmissions for pure ALOHA is S =


G x e-2G. Where G the average number of frames generated by the system during
one frame transmission time. The maximum throughput Smax is 0.184, for G = 1.

Slotted ALOHA
Pure ALOHA has a vulnerable time of 2 x T FR. Because there is no rule that defines
when the station can send. A station may send soon after another station has started or
soon before another station has finished. Slotted ALOHA was invented to improve the
efficiency of pure ALOHA.
In slotted ALOHA we divide the time into slots of T fr s and force the station to send only
at the beginning of the time slot. The following figure shows an example of frame
collisions in slotted ALOHA.

Because a station is allowed to send only at the beginning of the synchronized time slot,
if a station misses this moment, it must wait until the beginning of the next time slot.
This means that the station which started at the beginning of this slot has already

Dr.Dhanya Job S5_BCA[2018-2021] Page 26


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

finished sending its frame. But, there is the possibility of collision if two stations try to
send at the beginning of the same time slot. But the vulnerable time is now reduced to
one-half, equal to Tfr.  The following figure shows the situation.

Throughput: The average number of successful transmissions for slotted ALOHA is S =


G x e-G.
The maximum throughput Smax is 0.368, when G = 1.

Carrier Sense Multiple Access (CSMA)

To minimize the chance of collision and to, increase performance the CSMA method
was developed. The chance of collision can be reduced if a station senses a medium
before trying to use it.

Carrier sense multiple access (CSMA) requires that each station first listen to the
medium (or check the state of the medium before sending. CSMA is based on the
principle "sense before transmit" or "listen before talk." It cannot eliminate collision.

Vulnerable Time
The vulnerable time for CSMA is the propagation time Tp . This is the time needed for a
signal to propagate from one end of the medium to the other.
When a station sends a frame, and any other station tries to send a frame during this
time, a collision will result. But if the first bit of the frame reaches the end of the medium,
every station will already have heard the bit and will refrain from sending.

Dr.Dhanya Job S5_BCA[2018-2021] Page 27


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

PERSISTENCE METHODS
What should a station do if the channel is busy? What should a station do if the channel
is idle? Three methods have been used:
 the 1-persistent method,
 the non persistent method, and
 the p-persistent method.
Figure 12.10 shows the behavior of three persistence methods when a station finds a
channel busy.

1-Persistent: The 1-persistent method is simple and straightforward. In this


method after the station finds the line idle, it sends its frame immediately (with

Dr.Dhanya Job S5_BCA[2018-2021] Page 28


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

probability 1). This method has the highest chance of collision because two or more
stations may find the line idle and send their frames immediately.

Non persistent: In the Non persistent method, a station that has a frame to send
senses the line. If the line is idle, it sends immediately. If the line is not idle it waits
random amount of time and then senses the line again, the non persistent approach
reduces the chance of collision because there is less chance that two or more
stations will wait the same amount of time and retry to send simultaneously. But, this
method reduces the efficiency of the network because the medium remains idle
when there may be stations with frames to send.

P-Persistent method is used if the channel has time slots with slot duration equal to
or greater than the maximum propagation time. The p-persistent approach combines
the advantages of the other two methods; it reduces the chance of collision and
improves efficiency. In this method after the station finds the line idle it follows these
steps:

1. With probability p, the station sends its frame.

2. With probability q =1 - p. the station waits for the beginning of the next time slot
and checks the line again.

a. If the line is idle. It goes to step 1.

b. If the line is busy. It acts as though a collision has occurred and uses the back off
procedure.

CSMA/CD (Carrier Sense Multiple Access/Collision Detection)

If a collision is detected during transmission of a packet, the node immediately stops


transmission and it transmits jamming signal for a brief duration to ensure that all
stations know that collision has occurred.

After transmitting the jamming signal, the node waits for a random amount of time and
then transmission is resumed. The random delay ensures that the nodes, which were
involved in the collision, are not likely to have a collision at the time of retransmissions.

Dr.Dhanya Job S5_BCA[2018-2021] Page 29


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

To achieve stability in the back off scheme, a technique known as binary exponential
back off is used. A node will attempt to transmit repeatedly in the face of repeated
collisions, but after each collision, the mean value of the random delay is doubled. After
15 retries (excluding the original try), the unlucky packet is discarded and the node
reports an error. A flowchart representing the binary exponential back off algorithm is
given in Fig. 5.2.11.

CSMA/CA(Carrier Sense Multiple Access/Collision Avoidance )


CSMA/CA protocol is used in wireless networks because they cannot detect the
collision so the only solution is collision avoidance.

• CSMA/CA avoids the collisions using three basic techniques.

(i) Interframe space

(ii) Contention window

Dr.Dhanya Job S5_BCA[2018-2021] Page 30


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

(iii) Acknowledgements

1. Interframe Space (IFS)

• Whenever the channel is found idle, the station does not transmit immediately. It waits
for a period of time called interframe space (IFS).

• When channel is sensed to be idle, it may be possible that same distant station may
have already started transmitting and the signal of that distant station has not yet
reached other stations.

• Therefore the purpose of IFS time is to allow this transmitted signal to reach other
stations.

• If after this IFS time, the channel is still idle, the station can send, but it still needs to
wait a time equal to contention time.

• IFS variable can also be used to define the priority of a station or a frame.

2. Contention Window 

• Contention window is an amount of time divided into slots.

• A station that is ready to send chooses a random number of slots as its wait time.

• The number of slots in the window changes according to the binary exponential back-
off strategy. It means that it is set of one slot the first time and then doubles each time
the station cannot detect an idle channel after the IFS time.

• This is very similar to the p-persistent method except that a random outcome defines
the number of slots taken by the waiting station.

• In contention window the station needs to sense the channel after each time slot.

• If the station finds the channel busy, it does not restart the process. It just stops the
timer & restarts it when the channel is sensed as idle.

3. Acknowledgement  

• Despite all the precautions, collisions may occur and destroy the data.

Dr.Dhanya Job S5_BCA[2018-2021] Page 31


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

• The positive acknowledgment and the time-out timer can help guarantee that receiver
has received the frame.

CSMA/CA Procedure:

 • The channel needs to be sensed before and after the IFS. The channel also needs to
be sensed during the contention time. For each time slot of the contention window, the
channel is sensed. If it is found idle, the timer continues; if the channel is found busy,
the timer is stopped and continues after the timer becomes idle again.

Wireless LAN ----Bluetooth

It is a wireless LAN technology designed to connect devices of different functions such


as telephones, notebooks, computers, cameras, printers, coffee makers, and so on. A
Bluetooth LAN is an ad hoc network, which means that the network is formed
spontaneously.

Bluetooth Architecture 

Bluetooth architecture defines two types of networks:

1. Piconet

2. Scattemet

Dr.Dhanya Job S5_BCA[2018-2021] Page 32


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

1. Piconet

• Piconet is a Bluetooth network that consists of one primary (master) node and seven
active secondary (slave) nodes.

• Thus, piconet can have upto eight active nodes (1 master and 7 slaves) or stations
within the distance of 10 meters.

• The communication between the primary and the secondary can be one-to-one or
one-to-many.

• All communication is between master and a slave. Salve-slave communication is not


possible.

• In addition to seven active slave station, a piconet can have up to 255 parked nodes.
These parked nodes are secondary or slave stations and cannot take part in
communication until it is moved from parked state to active state.

2. Scatternet 

• Scatternet is formed by combining various piconets.

• A slave in one piconet can act as a master or primary in other piconet.

• Such a station or node can receive messages from the master in the first piconet and
deliver the message to its slaves in other piconet where it is acting as master. This node
is also called bridge slave.

• Thus a station can be a member of two piconets.

• A station cannot be a master in two piconets.

Dr.Dhanya Job S5_BCA[2018-2021] Page 33


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Bluetooth devices

Bluetooth device has a built in short range radio transmitter. The current data rate is 1
Mbps with 2.4 GHZ bandwidth.

Bluetooth layers and Protocol Stack

• Bluetooth standard has many protocols that are organized into different layers.

• The layer structure of Bluetooth does not follow OS1 model, TCP/IP model or any
other known model.

• The different layers and Bluetooth protocol architecture.

Radio Layer

• The Bluetooth radio layer corresponds to the physical layer of OSI model.

• It deals with radio transmission and modulation.

• The radio layer moves data from master to slave or vice versa.

• It is a low power system that uses 2.4 GHz ISM band in a range of 10 meters.

Dr.Dhanya Job S5_BCA[2018-2021] Page 34


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

•Bluetooth uses the Frequency Hopping Spread Spectrum (FHSS) method in the
physical layer to avoid interference from other devices or networks.

• Bluetooth hops 1600 times per second, i.e. each device changes its modulation
frequency 1600 times per second.

Baseband Layer 

• Baseband layer is equivalent to the MAC sublayer in LANs.

• Bluetooth uses a form of TDMA called TDD-TDMA (time division duplex TDMA).

• Master and slave stations communicate with each other using time slots.

• The master in each piconet defines the time slot of 625 µsec.

• In TDD- TDMA, communication is half duplex in which receiver can send and receive
data but not at the same time.

• If the piconet has only no slave; the master uses even numbered slots (0, 2, 4 ...) and
the slave uses odd-numbered slots (1, 3, 5, ....). Both master and slave communicate in
half duplex mode. In slot 0, master sends & secondary receives; in slot 1, secondary
sends and primary receives.(single secondary communication)

• If piconet has more than one slave, the master uses even numbered slots. The slave
sends in the next odd-numbered slot if the packet in the previous slot was addressed to
it.

• In Baseband layer, two types of links can be created between a master and slave.
These are:

1. Asynchronous Connection-less (ACL)

• It is used for packet switched data that is available at irregular intervals.

• ACL delivers traffic on a best effort basis. Frames can be lost & may have to be
retransmitted.

• A slave can have only one ACL link to its master.

• Thus ACL link is used where correct delivery is preferred over fast delivery.

Dr.Dhanya Job S5_BCA[2018-2021] Page 35


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

• The ACL can achieve a maximum data rate of 721 kbps by using one, three or more
slots.

2. Synchronous Connection Oriented (SCO)

• sco is used for real time data such as sound. It is used where fast delivery is preferred
over accurate delivery.

• In a sco link, a physical link is created between the master and slave by reserving
specific slots at regular intervals.

• Damaged packet; are not retransmitted over sco links.

• A slave can have three sco links with the master and can send data at 64 Kbps.

Logical Link, Control Adaptation Protocol Layer (L2CAP)

• The logical unit link control adaptation protocol is equivalent to logical link control
sublayer of LAN.

• The ACL link uses L2CAP for data exchange but sco channel does not use it.

• The various function of L2CAP is:

1. Segmentation and reassembly

• L2CAP receives the packets of upto 64 KB from upper layers and divides them into
frames for transmission.

• It adds extra information to define the location of frame in the original packet.

• The L2CAP reassembles the frame into packets again at the destination.

2. Multiplexing

• L2CAP performs multiplexing at sender side and demultiplexing at receiver side.

• At the sender site, it accepts data from one of the upper layer protocols frames them
and deliver them to the Baseband layer.

• At the receiver site, it accepts a frame from the baseband layer, extracts the data, and
delivers them to the appropriate protocol1ayer.

3. Quality of Service (QOS)

Dr.Dhanya Job S5_BCA[2018-2021] Page 36


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

• L2CAP handles quality of service requirements, both when links are established and
during normal operation.

• It also enables the devices to negotiate the maximum payload size during connection
establishment.

4. Group Management

It allows devices to create a type of logical addressing between themselves. I.e. To or


three secondary devices can be part of a multicast group to receive data from the
primary.

Bluetooth Frame Format

The various fields of blue tooth frame format are:

1. Access Code: It is 72 bit field that contains synchronization bits. It identifies the
master.

2. Header: This is 54-bit field which contain 18 bit pattern.

The header field contains following subfields:

(i) Address: This 3 bit field can define upto seven slaves (1 to 7). If the address is zero,
it is used for broadcast communication from primary to all secondaries.

(ii)Type: This 4 bit field identifies the type of data coming from upper layers.

(iii) F: This flow bit is used for flow control. When set to 1, it means the device is unable
to receive more frames.

Dr.Dhanya Job S5_BCA[2018-2021] Page 37


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

(iv) A: This bit is used for acknowledgement. Bluetooth uses stop and wait ARQ.

(v) S: This bit contains a sequence number of the frame to detect retransmission.

(vi) HEC : This 8 bit field contains checksum to detect errors in 18 bit header section.

3. Payload: This field can be 0 to 2744 bits long. It contains data or control information
coming from upper layers.

CELLULAR TELEPHONY

Cellular telephony is a system-level concept, which replaces a single high power


transmitter with a large number of low-power transmitters for communication between
any two devices over a large geographic area.

Primary goal of the cellular telephone network is to provide wireless communication


between two moving devices, called mobile stations or between one mobile unit and a
stationary unit, commonly referred to as land-line unit.

To accommodate a large number of users over a large geographic area, the cellular
telephone system uses a large number of low-power wireless transmitters to create
cells. Variable power levels allow cells to be sized according to subscriber density and
demand within a particular region. As mobile users travel from cell to cell, their
conversations are handed off between cells.

Channels (frequencies) used in one cell can be reused in another cell some distance
away, which allows communication by a large number stations using a limited number
of radio frequencies. The basic concept of reuse allows a fixed number of channels to
serve an arbitrarily large number of users.

Cellular Telephone System

A cellular system comprises the following basic components:


 Mobile Stations (MS): Mobile handsets, which is used by an user to
communicate with another user
 Cell: Each cellular service area is divided into small regions called cell (5 to 20

Dr.Dhanya Job S5_BCA[2018-2021] Page 38


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Km)
 Base Stations (BS): Each cell contains an antenna, which is controlled by a
small office.

 Mobile Switching Center (MSC): Each base station is controlled by a


switching office, called mobile switching center

Figure 5.9.1 Schematic diagram of a cellular telephone system

Frequency Reuse Principle

Frequency reusing is the concept of using the same radio frequencies within a given
area, that are separated by considerable distance, with minimal interference, to
establish communication.
Frequency reuse offers the following benefits −

 Allows communications within cell on a given frequency


 Limits escaping power to adjacent cells
 Allows re-use of frequencies in nearby cells
 Uses same frequency for multiple conversations
 10 to 50 frequencies per cell
For example, when N cells are using the same number of frequencies and K be the
total number of frequencies used in systems. Then each cell frequency is calculated
by using the formulae K/N.

Dr.Dhanya Job S5_BCA[2018-2021] Page 39


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Figure 5.9.2 (a) Cells showing reuse factor of 4 (b) Cells showing reuse factor of 7

Transmitting and Receiving

Transmitting involves the following steps:


 A caller enters a 10-digit code (phone number) and presses the send button.
 The MS scans the band to select a free channel and sends a strong signal
to send the number entered.
 The BS relays the number to the MSC.

 The MSC in turn dispatches the request to all the base stations in the
cellular system.
 The Mobile Identification Number (MIN) is then broadcast over all the
forward control channels throughout the cellular system. It is known as
paging.
 The MS responds by identifying itself over the reverse control channel.
 The BS relays the acknowledgement sent by the mobile and informs the
MSC about the handshake.
 The MSC assigns an unused voice channel to the call & call is established.

Receiving involves the following steps:


 All the idle mobile stations continuously listens to the paging signal to
detect messages directed at them.
 When a call is placed to a mobile station, a packet is sent to the callee’s
home MSC to find out where it is.
 A packet is sent to the base station in its current cell, which then sends a
broadcast on the paging channel.
 The callee MS responds on the control channel.
 In response, a voice channel is assigned and ringing starts at the MS.

Mobility Management

A MS is assigned a home network, commonly known as location area. When an MS


Dr.Dhanya Job S5_BCA[2018-2021] Page 40
COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

migrates out of its current BS into the footprint of another, a procedure is performed
to maintain service continuity, known as Handoff management. An agent in the home
network, called home agent, keeps track of the current location of the MS. The
procedure to keep track of the user’s current location is referred to as Location
management. Handoff management and location management together are referred
to as Mobility management.
Handoff: At any instant, each mobile station is logically in a cell and under the control
of the cell’s base station. When a mobile station moves out of a cell, the base station
notices the MS’s signal fading away and requests all the neighbouring BSs to report
the strength they are receiving. The BS then transfers ownership to the cell getting
the strongest signal and the MSC changes the channel carrying the call. The process
is called handoff.
There are two types of handoff; Hard Handoff and Soft Handoff.
In a hard handoff, which was used in the early systems, a MS communicates with
one BS. As a MS moves from cell A to cell B, the communication between the MS
and base station of cell A is first broken before communication is started between the
MS and the base station of B. As a consequence, the transition is not smooth.

For smooth transition from one cell (say A) to another (say B), an MS continues to
talk to both A and B. As the MS moves from cell A to cell B, at some point the
communication is broken with the old base station of cell A. This is known as soft
handoff.

Roaming: Two fundamental operations are associated with Location Management;


location update and paging. When a Mobile Station (MS) enters a new Location Area,
it performs a location updating procedure by making an association between the
foreign agent and the home agent. One of the BSs, in the newly visited Location Area

Dr.Dhanya Job S5_BCA[2018-2021] Page 41


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

is informed and the home directory of the MS is updated with its current location.
When the home agent receives a message destined for the MS, it forwards the
message to the MS via the foreign agent. An authentication process is performed
before forwarding the message.

First Generation System

It was designed for voice communication. One example is Advanced Mobile Phone
System (AMPS) used in North America. An AMP is an analog cellular phone system.

It uses 800 MHz ISM band and two separate analog channels; forward and reverse
analog channels. The band between 824 to 849 MHz is used for reverse
communication from MS to BS. The band between 869 to 894 MHz is used for forward
communication from BS to MS. Each band is divided in to 832 30-KHz channels as
shown in Fig. 5.9.8. As each location area is shared by two service providers, each
provider can have 416 channels, out of which 21 are used for control. AMPS uses
Frequency Division Multiple Access (FDMA) to divide each 25-MHz band into 30-KHz
channels as shown in Fig. 5.9.9.

Figure 5.9.9 FDMA medium access control technique used in AMPS

Dr.Dhanya Job S5_BCA[2018-2021] Page 42


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

Second Generation

The first generation cellular network was developed for analog voice communication.
To provide better voice quality, the second generation was developed for digitized
voice communication. Three major systems were evolved, as shown in Fig. 5.9.10.

Figure 5.9.10 FDMA medium access control technique used in AMPS

D-AMPS: D-AMPS is essentially a digital version of AMPS and it is backward


compatible with AMPS. It uses the same bands and channels and uses the frequency
reuse factor of 1/7. 25 frames per second each of 1994 bits, divided in 6 slots shared
by three channels. Each slot has 324 bits-159 data, 64 control, 101 error-correction
bits as shown in Fig. 5.9.11. As shown in the figure, it uses both TDMA and FDMA
medium access control techniques.

Figure 5.9.11 D-MPS

GSM: The Global System for Mobile (GSM) communication is a European standard
developed to replace the first generation technology. It uses two bands for duplex
communication. Each voice channel is digitized and compressed to a 13Kbps digital

Dr.Dhanya Job S5_BCA[2018-2021] Page 43


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

signal. Each slot carries 156.25 bits, 8 slots are multiplexed together creating a FDM
frame, 26 frames are combined to form a multiframe, as shown in Fig. 5.9.12. For
medium access control, GSM combines both TDMA and FDMA. There is large
amount of overhead in TDMA, 114 bits are generated by adding extra bits for error
correction. Because of complex error correction, it allows a reuse factor as low as
1/3.

Figure 5.9.12 Multiframe components

IS-95: IS-95 is based on CDMA/DSSS and FDMA medium access control technique.
It uses the forward and backward transmissions.

Third Generation

Goals of the third generation (3G) technologies are mentioned below:


 Allow both digital data and voice communication.
 To facilitate universal personnel communication.
 Listen music, watch movie, access internet, video
conference, etc. Criteria for 3G Technologies are:
 Voice quality: Same as present PSTN network.
 Data rate: 144Kbps (car), 384 (pedestrians) and 2Mbps (stationary).
 Support for packet-switched and circuit-switched data services.
 Bandwidth of 2 MHz.
 Interface to the internet.
ITU developed a blueprint called Internet Mobile Communication for year 2000
(IMT- 2000). All five Radio Interfaces adopted by IMT-2000 evolved from the

Dr.Dhanya Job S5_BCA[2018-2021] Page 44


COMPUTER NETWORKS MODULE 3 BCA SEMESTER V

second generation technologies as shown in Fig. 5.9.15.

Figure 5.9.15 Third generation cellular technologies

Dr.Dhanya Job S5_BCA[2018-2021] Page 45

You might also like