You are on page 1of 302

Unit-II

Data Link Layer

By,
Prof. Pradnya K. Bachhav
Syllabus
 Introduction, functions.
 Design Issues: Services to Network Layer, Framing.
 ARQ strategies: Error detection and correction, Parity Bits,
Hamming Codes (11/12-bits) and CRC.
 Flow Control Protocols: Unrestricted Simplex, Stop and Wa
it, Sliding Window Protocol.
 WAN Connectivity: PPP and HDLC.
 MAC Sub layer: Multiple Access Protocols: Pure and Slotte
d ALOHA, CSMA, WDMA, CSMA/CD, CSMA/CA, Binary E
xponential Back-off algorithm,
 Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n, I
EEE 802.15 and IEEE 802.16 Standards.
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Introduction & Functions of DLL
 The physical layer deals with the transmission of signals over different
transmission media

 A reliable and efficient communication between two adjacent machines


can be achieved via the data link layer

 This layer basically deals with frame formation, flow control, error
control, addressing and link management

 While sending data from source to destination errors may get


introduced.

 The data communication circuits have only a finite data rate and there
is non-zero propagation delay between the instant a bit is sent and the
instant at which it is received
Introduction & Functions of DLL
 These limitations affect the efficiency of data transfer
 The data link layer protocols used for communication take care of all these
problems
 Data link layer is the second layer in OSI reference model. It is above the
physical layer.
 As it is the second layer, it receives services from the physical layer and
provides services to the network layer.
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Data Link Layer Design Issues

 The data link layer is supposed to carry out many specified functions.

 For effective data communication between two directly (physically)


connected transmitting and receiving stations the data link layer has to carry
out a number of specific functions as show Fig
Data Link Layer Functions

1. Services provided to the network layer


 The data link layer provides a well defined service interface the network layer.

 The principle service is transferring data from the network layer on sending
machine to the network layer on destination machine. This transfer always
takes place via the DLL

2. Frame Synchronization
 The source machine sends data in the form of blocks called frames to the
destination machine.

 The starting and ending of each frame should be identified so that the frames
can be recognized by the destination machine.
Data Link Layer Functions

3. Flow Control
 The source machine must not send data frames at a rate faster than the
capacity of destination machine to accept them.

4. Error Control
 The errors introduced during transmission from source to destination
machines must be detected and corrected at the destination machine.

5. Addressing
 When many machines are connected together (LAN), the identity of the
individual machines must be specified while transmitting the data frames.
This is known as addressing,
Data Link Layer Functions

6. Control and data on same link


 The data and control information is combined in a frame and transmitted from
the source to destination machine.

 The destination machine must be able to separate out control information


from the data being the transmitted

7. Link Management
 The communication link between the source and destination is required to be
initiated, maintained and finally terminated for effective exchange of data.

 It requires coordination and co-operation among all the involved stations,


Protocols or procedures are required to be designed for the link management
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Data Link Layer Design Issues

Subtopics:

• Services Provided to the Network Layer


• Framing
• Error Control
• Flow Control
Services Provided to Network Layer

 Network layer is the layer above the data link layer in the OSI model. So it is
supposed to provide services to the network layer

 The main service to be provided is to transfer data from the network layer on
the sending machine to the network layer of the receiving machine.

 The virtual path followed for such a communication is shown in Fig.(a) It is


not the actual path.

 The actual path followed by the data from sending machine to destination is
shown in Fig.(b) which is via all the layers below the network layer, then the
physical medium, then layers 1, 2, 3 of receiving machine.

 However it is always easier to think that the communication is taking place


through the data link layers using data link layer protocol.
Services Provided to Network Layer
Types of Services Provided

1. Unacknowledged connectionless service

2. Acknowledged connectionless service

3. Acknowledged connection oriented service


1. Unacknowledged connectionless service

 In this type of service, the destination machine does not send back any
acknowledgement after receiving frames

 It is a connectionless service. So no connection is established before


communication or released after it is over. If a frame is lost due to
channel noise, then there are no attempts made to recover it.

 So this service is suitable only if the error rate is low. It is suitable for
real time traffic such as speech. This type of service is highly unreliable.

 This service provides the following functions –


1. Datagram service with no acknowledgment.

2. Error control

3. Flow control
2. Acknowledged connectionless service

 This is the next step to improve reliability. In this service, there are no
connections established for data transfer but for each frame received,
the receiver sends an acknowledgement to the sender.

 If a frame is not received within some specified time it is assumed to be


lost and the sender will retransmit it.

 This service is suitable for communication unreliable channels such as


wireless channels.
2. Acknowledged connection oriented service

 This is the most sophisticated one. The source and destination machines
establish a connection before transferring the data.

 A specific number is given to each frame being sent and the data link layer
guarantees that each transmitted frame is received

 All the frames are guaranteed to be received in the same order as the order of
transmission. Each received frame will be acknowledged individually by the
destination machine.

 The data transfer takes place by following three distinct phases given below:

1. Connection is established.

2. The data frames are actually transmitted.

3. The connection is released after completion of data transfer

E.g.: Satellite channel communication, Long-distance telephone communication, etc.


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 physical layer, data transmission involves synchronised transmission of bits
from the source to the destination. The data link layer packs these bits into frames.

 Data-link layer takes the packets from the Network Layer and encapsulates them
into frames. If the frame size becomes too large, then the packet may be divided
into small sized frames. Smaller sized frames makes flow control and error control
more efficient.

 Then, it sends each frame bit-by-bit on the hardware. At receiver’s end, data link
layer picks up signals from hardware and assembles them into frames.
Framing
 The bits to be transmitted is first broken into discrete frames at the data link layer.
In order to guarantee that the bit stream is error free, the checksum of each frame
is computed.

 When a frame is received, the data link there, re-computes the checksum.

 If it is different from the checksum present in the frame, then the data link layer
knows that an error has occurred.

 It then discards the bad frame and sends back a request for retransmission.

 Breaking the bit stream into frames is called as framing. One way of doing it is by
inserting time gaps between frames as shown in Fig.

 But practically this framing technique does not work satisfactorily, because
networks generally do not make any guarantees about the timing. So some other
methods are derived.
Parts of a Frame

A frame has the following parts −

• Frame Header − It contains the source and the destination


addresses of the frame.
• Payload field − It contains the message to be delivered.
• Trailer − It contains the error detection and error correction
bits.
• Flag − It marks the beginning and end of the frame.
Types of Framing
Fixed-sized Framing
 Here the size of the frame is fixed and so the frame length acts as
delimiter of the frame. Consequently, it does not require additional
boundary bits to identify the start and end of the frame.
Example − ATM cells.

Variable – Sized Framing


 Here, the size of each frame to be transmitted may be different. So
additional mechanisms are kept to mark the end of one frame and
the beginning of the next frame.
It is used in local area network
Framing Methods

1. Character count.

2. Flag bytes with byte stuffing.

3. Starting and ending flags, with bit stuffing

4. Physical layer coding violations.


Character Count Framing Method

⚫ It uses a field in the header to specify the number of bytes in the

frame.

⚫ Once the header information is being received it will be used to

determine end of the frame.

⚫ See figure in the next slide:

⚫ Trouble with this algorithm is that when the count is incorrectly

received the destination will get out of synch with transmission.

⚫ Destination may be able to detect that the frame is in error but it

does not have a means (in this algorithm) how to correct it.
Framing (1)
Abyte stream. (a)Without errors. (b)With one error.
Flag Bytes with Byte Stuffing Framing Method
⚫ This methods gets around the boundary detection of the frame by

having each appended by the frame start and frame end with
special bytes.

⚫ If they are the same (beginning and ending byte in the frame) they

are called flag byte.

⚫ In the next slide figure this byte is shown as FLAG.

⚫ If the actual data contains a byte that is identical to the FLAG

byte (e.g., picture, data stream, etc.) the convention that can be
used is to have escape character inserted just before the “FLAG”
character.
Framing (2)

⚫ Aframe delimited by flag bytes.


⚫ Four examples of byte sequences before and after byte stuffing.
Figure Byte stuffing and unstuffing

Byte stuffing is the process of adding 1 extra byte


whenever there is a flag or escape character in the text.
Flag Bits with Bit Stuffing Framing Method

⚫ This methods achieves the same thing as Byte Stuffing method by


using Bits (1) instead of Bytes (8 Bits).
⚫ It was developed for High-level Data Link Control (HDLC)
protocol.
⚫ Each frames begins and ends with a special bit pattern:
⚫ 01111110 or 0x7E <- Flag Byte
⚫ Whenever the sender’s data link layer encounters five
consecutive 1s in the data it automatically stuffs a 0 bit into the
outgoing bit stream.
⚫ USB uses bit stuffing.
Framing (3)

Bit stuffing. (a)The original data. (b)The data as they appear on


the line. (c)The data as they are stored in the receiver’s memory after destuffing.
Figure Bit stuffing and unstuffing

Bit stuffing is the process of adding one extra 0 whenever five


consecutive 1s follow a 0 in the data, so that the receiver does not
mistake the pattern 0111110 for a flag.
Physical layer coding violations

⚫ This method is only applicable to networks in which the encoding on the physical
medium contains some redundancy.
⚫ For example, some LANs encode 1 bit of data by using 2 physical bits.
⚫ Normally, a 1 bit is a high-low pair and a 0 bit is a low-high pair.
⚫ 11 or 00 are not used for data but are used for delimiting frames in some
protocols.
⚫ In this method Bit 1 is encoded into high-low (10) pair and Bit 0 is encoded into
low-high (01) pair shown in fig.
FLOW AND ERROR CONTROL

The most important responsibilities of the data link


layer are flow control and error control. Collectively,
these functions are known as data link control.

Topics discussed in this section:


Flow Control
Error Control
Error Control

⚫ Error control in the data link layer is based on automatic repeat


request, which is the retransmission of data
⚫ The usual way to ensure reliable delivery is to provide the sender
with some feedback about what is happening at the other end of the
line.
⚫ Typically, the protocol calls for the receiver to send back special
control frames.
⚫ If the sender receives a positive acknowledgement about a frame, it
knows the frame has arrived safely.
⚫ On the other hand, a negative acknowledgement means that
something has gone wrong, and the frame must be transmitted again
Error Control

⚫ After solving the marking of the frame with start and end the data

link layer has to handle eventual errors in transmission or detection.

⚫ Ensuring that all frames are delivered to the network layer at the

destination and in proper order.

⚫ Unacknowledged connectionless service: it is OK for the sender to

output frames regardless of its reception.


Error Control
⚫ Reliable connection-oriented service: it is NOT OK.

⚫ Reliable connection-oriented service usually will provide a sender

with some feedback about what is happening at the other end of


the line.
⚫ Receiver Sends Back Special Control Frames.

⚫ If the Sender Receives positive Acknowledgment it will know

that the frame has arrived safely.

⚫ Timer and Frame Sequence Number for the Sender is necessary to

handle the case when there is no response (positive or negative)


from the Receiver.
Flow Control

⚫ Another important design issue that occurs in the data link layer

(and higher layers as well) is what to do with a sender that


systematically wants to transmit frames faster than the receiver can
accept them.
⚫ Flow control refers to a set of procedures used to restrict the

amount of data that the sender can send before waiting for
acknowledgment.
⚫ To solve this problem feedback-based flow control and rate-based

flow control are used.


Flow Control

• Feedback-based flow control: the receiver sends back


information to the sender giving it permission to send
more data or at least telling the sender how the receiver is
doing.
• Rate-based flow control: the protocol has a built-in
mechanism that limits the rate at which senders may
transmit data, without using feedback from the receiver.
• Rate-based flow control is never used in the data link
layer.
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


ARQ Strategies

• Automatic repeat request (ARQ), also known as automatic


repeat query,
• Is an error-control method for data transmission that uses
acknowledgements (messages sent by the receiver indicating
that it has correctly received a packet) and timeouts (specified
periods of time allowed to elapse before an acknowledgment is
to be received) to achieve reliable data transmission over an
unreliable communication channel.
• If the sender does not receive an acknowledgment before the
timeout, it re-transmits the packet until it receives an
acknowledgment or exceeds a predefined number of
retransmissions.
Note

Data can be corrupted during


transmission.

Some applications require that


errors be detected and corrected.
INTRODUCTION

Let us first discuss some issues related, directly or


indirectly, to error detection and correction.

Topics discussed in this section:


Types of Errors
Redundancy
Detection Versus Correction
Forward Error Correction Versus Retransmission Coding
Modular Arithmetic
Introduction

⚫ Error transmissions are caused by Interference


⚫ Types of errors
⚫ Single-bit error
⚫ Only 1 bit of a given data unit is changed from 1 to 0 or from 0
to 1.
⚫ Burst error
⚫ 2 or more bits in the data unit changed from 1 to 0 or from 0 to
1.
⚫ Redundancy
⚫ The central concept in detecting or correcting error is
redundancy. To be able to detect or correct errors, we
need to send some extra bits with our data.
44
Figure Single-bit error

In a single-bit error, only 1 bit in the data


unit has changed.
Figure Burst error of length 8

A burst error means that 2 or more bits


in the data unit have changed.
Detection versus Correction
⚫ The correction of errors is more difficult than the
detection.
⚫ Error detection
⚫ Looking only to see if any error has occurred
⚫ The answer is a simple yes or no.
⚫ Error correction
⚫ Forward error correction
⚫ The process in which the receiver tries to guess the message by
using redundant bits.
⚫ Retransmission
⚫ The receiver detects the occurrence of an error and asks the
sender to resend the message.
Figure The structure of encoder and decoder

To detect or correct errors, we need to send extra


(redundant) bits with data.
XORing of two single bits or two words

In modulo-N arithmetic, we use only the integers in the


range 0 to N −1, inclusive.
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.

Topics discussed in this section:


Error Detection
Error Correction
Hamming Distance
Minimum Hamming Distance
Datawords and codewords in block coding

E.g. In this coding scheme, k = 4 and n = 5. As we saw, we have 2k =


16 datawords and 2n = 32 codewords. In this 16 out of 32 codewords
are used for message transfer and the rest are either used for other
purposes or unused.
Error Detection

Structure of encoder and decoder in error detection


Table (A): A code for error detection (Example 1)
Example: 1
• Let us assume that k = 2 and n = 3. Table A shows the list of datawords and
codewords. Later, we will see how to derive a codeword from a dataword.
• Assume the sender encodes the dataword 01 as 011 and sends it to the receiver.
Consider the following cases:

1. The receiver receives 011. It is a valid codeword. The receiver extracts the
dataword 01 from it.
2. The codeword is corrupted during transmission, and 111 is received. This is
not a valid codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is received. This is a
valid codeword. The receiver incorrectly extracts the dataword 00. Two
corrupted bits have made the error undetectable.
Note

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

Structure of encoder and decoder in error correction


Table (B) A code for error correction (Example 2)
Example: 2

• Let us add more redundant bits to Example 1 to see if the receiver


can correct an error without knowing what was actually sent.
• We add 3 redundant bits to the 2-bit dataword to make 5-bit
codewords. Table (B) shows the datawords and codewords.
• Assume the dataword is 01. The sender creates the codeword
01011.
• The codeword is corrupted during transmission, and 01001 is
received.
• First, the receiver finds that the received codeword is not in the
table. This means an error has occurred.
• The receiver, assuming that there is only 1 bit corrupted, uses the
following strategy to guess the correct dataword.
Example: 2 (continued)

1. 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.

2. By the same reasoning, the original codeword cannot be the third


or fourth one in the table.

3. 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.
Hamming Distance

Note

The Hamming distance between two words


is the number of differences between
corresponding bits.
Example: 3

Let us find the Hamming distance between two pairs of


words.

1. The Hamming distance d(000, 011) is 2 because

2. The Hamming distance d(10101, 11110) is 3 because


Hamming Distance

• It is used for error control


• Consider two code vectors (or code words) having the
same number of elements.
• Definition: The “Hamming Distance” between the two
code words is defined as the number of difference
between the corresponding bits Hamming distance
between 2 words x and y is denoted as d(x,y).
• E.g.
Code word 1 = 10101
Code word 2 = 11110
• Note that the bits 2,4 and 5 are different from each
other, hence Hamming distance is 3
Minimum Hamming Distance

Note

The minimum Hamming distance is the


smallest Hamming distance between
all possible pairs in a set of words.
Example: 4

Find the minimum Hamming distance of the coding


scheme in Table (A)
Solution
We first find all Hamming distances.

The dmin in this case is 2.


Example:5

Find the minimum Hamming distance of the coding


scheme in Table (B).
Solution
We first find all the Hamming distances.

The dmin in this case is 3.


Role of “dmin” in error detection and correction

• The error detection is always possible when the number of


transmission errors in a codeword is less than the minimum distance
dmin because then the erroneous word is not a codeword.
• But when the number of errors equals or exceeds dmin, the
erroneous codeword may correspond to another valid codeword and
errors cannot be detected.
• The error detection and correction capabilities of a coding
technique depend on the minimum distance dmin as shown in the
table.

Detect upto “s” errors per word dmin = s + 1


Correct upto “t” errors per word dmin = 2t + 1
Correct upto “t” errors and detect dmin = (t + s + 1)
s>t errors per word
Note

To guarantee the detection of up to s


errors in all cases, the minimum
Hamming distance in a block
code must be dmin = s + 1.
Example:6

The minimum Hamming distance for our first code


scheme (Table A) is 2. This code guarantees detection of
only a single error. For example, if the third codeword
(101) is sent and one error occurs, the received
codeword does not match any valid codeword. If two
errors occur, however, the received codeword may
match a valid codeword and the errors are not detected.
Example:7

Our second block code scheme (Table B) has dmin = 3.


This code can detect up to two errors. Again, we see that
when any of the valid codewords is sent, two errors
create a codeword which is not in the table of valid
codewords. The receiver cannot be fooled.

However, some combinations of three errors change a


valid codeword to another valid codeword. The receiver
accepts the received codeword and the errors are
undetected.
Figure Geometric concept for finding dmin in error detection
Figure Geometric concept for finding dmin in error correction
Note

To guarantee correction of up to t errors


in all cases, the minimum Hamming
distance in a block code
must be dmin = 2t + 1.
Example 8

A code scheme has a Hamming distance dmin = 4. What is


the error detection and correction capability of this
scheme?

Solution
This code guarantees the detection of up to three errors
(s = 3), but it can correct up to one error. In other words,
if this code is used for error correction, part of its
capability is wasted. Error correction codes need to have
an odd minimum distance (3, 5, 7, . . . ).
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.

Topics discussed in this section:


Minimum Distance for Linear Block Codes
Some Linear Block Codes
Hamming Code
Parity Check Code
Note

In a linear block code, the exclusive OR


(XOR) of any two valid codewords
creates another valid codeword.
Example 9

Let us see if the two codes we defined in Table A and Table


B belong to the class of linear block codes.

1. The scheme in Table A 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.
Example 9

2. The scheme in Table B is also a linear block code. We


can create all four codewords by XORing two other
codewords.
Example 10

In our first code (Table A), 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
B), the numbers of 1s in the nonzero codewords are 3,
3, and 4. So in this code we have dmin = 3.
Parity Check

Simple 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. As shown below:
1 0 0 1 0 0 1 1 0 0 1 0 0 1 1
Data bits Odd Parity

• The sender while creating a frame counts the numbers of 1s in it.


• If the number of 1s bits is odd, then parity bit 1 is appended and if the
number of 1s bits is even, then parity bit 0 is appended at the end of
the data unit.
• At the receiving end, the parity bit is calculated from received data
bits and compared with the received parity bit. This technique
generates the total number of 1s even, so it is known as even-parity
checking.
Table Simple parity-check code
Figure Encoder and decoder for simple parity-check code
Simple Parity Check - Disadvantage

Note

A simple parity-check code can detect


an odd number of errors.
Two-Dimensional Parity Check
• Performance can be improved by using Two-Dimensional parity
check which organizes the data in the form of table shown in fig.
• Parity check bits are computed for each row, which is equivalent
to the single-parity check.
• In Two-Dimensional Parity check, a block of bits is divided into rows,
and the redundant row of bits is added to the whole block.
• At the receiving end, the parity bits are compared with the parity bits
computed from the received data.

• 2 sets of parity bits generated known as


1. Longitudinal redundancy bits (LRC)
2. Vertical redundancy bits (VRC)
• LRC indicates the parity of rows and
VRC indicates the parity of columns
Longitudinal Redundancy Check(LRC)

• Longitudinal Redundancy Check (LRC) is also known as 2-D parity check.


• In this method, data which the user want so send is organized into tables of
rows and columns. Shown in Fig
• Meaning: A block of bit is divided into table or matrix of rows and columns. In
order to detect an error, a redundant bit is added to the whole block and this
block is transmitted to receiver.
• The receiver uses this redundant row to detect error
• After checking the data for errors, receiver accepts the data and discards the
redundant row of bits.
• Example: If a block of 32 bits is to be transmitted, it is divided into matrix of four
rows and eight columns which as shown in the following figure
Longitudinal Redundancy Check(LRC)

• In this matrix of bits, a parity bit (odd or even) is calculated for each column.
It means 32 bits data plus 8 redundant bits are transmitted to receiver.
• Whenever data reaches at the destination, receiver uses LRC to detect error
in data.
LRC Advantage
1. LRC is used to detect burst errors.
E.g. Suppose 32 bit data plus LRC that was being transmitted is hit by a burst error
of length 5 and some bits are corrupted as shown below

2. The LRC received by the destination does not match with newly corrupted LRC.
The destination comes to know that the data is erroneous, so it discards the data.
LRC Disadvantage
1. The main problem with LRC is that, it is not able to detect error if two bits in
a data unit are damaged and two bits in exactly the same position in other
data unit are also damaged.
E.g. If data 110011 010101 is changed to 010010110100

2. In this example 1st and 6th bit in one data unit is changed. Also the 1st and 6th bit
in second unit is changed.
Vertical Redundancy Check (VRC)or Parity Check

(1) Vertical Redundancy Check is also known as Parity Check.


(2) In this method, a redundant bit also called parity bit is added to each data unit.
This method includes even parity and odd parity. Shown in Fig. 2.11.6.
(3) Meaning: Even parity means the total number of 1s in data is to be even and
odd parity means the total number of 1s in data is to be odd.
(4) Example : If the source wants to transmit data unit 1100111using even parity to
the destination. The source will have to pass through Even Parity Generator.
(5) Parity generator will count number of 1s in data unit and will add parity bit. In
the above example, number of 1s in data unit is 5, parity generator appends a
parity bit 1 to this data unit making the total number of 1s even i.e. 6 which is clear
from below figure.
Vertical Redundancy Check (VRC)or Parity Check

(6) Data along with parity bit is then transmitted across the network. In this case,
11001111 will be transmitted.
(7) At the destination, this data is passed to parity checker at the destination. The
number of 1s in data is counted by parity checker.
(8) If the number of 1s count out to be odd, e.g. 5 or 7 then destination will come
to know that there is some error in the data. The receiver then rejects such an
erroneous data unit.
VRC Advantage & Disadvantage

Advantages:
1. VRC can detect all single bit error.
2. It can also detect burst errors but only in those cases where number of bits
changed is odd, i.e. 1, 3, 5, 7,.. etc.

Disadvantages:
1. The major disadvantage of using this method for error detection is that it is not
able to detect burst error if the number of bits changed is even, i.e. 2, 4, 6,
..etc.
Example: If the original data is 11001111. After adding VRC, data unit that will be
transmitted is 11001111. Suppose on the way 2 bits are changed as 01011111.
When this data will reach the destination, parity checker will count number of 1s in
data and that comes out to be even i.e. 8. So, in this case, parity is not changed, it
is still even. Destination will assume that there is no error in data even though data
is erroneous.
Drawbacks of 2D Parity Check

1. If two bits in one data unit are corrupted and two bits exactly or be the
same position in another data unit is also corrupted, then 2D Parity
checker will not be able to detect the error.
2. This technique cannot be used to detect the 4-bit errors or more in
some cases.
Drawbacks of 2D Parity Check-E.g.
Drawbacks of 2D Parity Check-E.g.
Hamming Code SPPU- May16, 5 Marks

• Hamming code is a block code that is capable of detecting up to


two simultaneous bit errors and correcting single-bit errors.
• It was developed by R.W. Hamming for error correction.
• In this coding method, the source encodes the message by
inserting redundant bits within the message.
• These redundant bits are extra bits that are generated and inserted
at specific positions in the message itself to enable error detection
and correction.
• When the destination receives this message, it performs
recalculations to detect errors and find the bit position that has
error.
Figure The structure of the encoder and decoder for a Hamming code

95
Hamming Code SPPU- May16, 5 Marks

• The number of redundant bits (r) can be calculated by satisfying


2r ≥ m + r + 1
• For example, if number of data bits (m) is 7 than number of check bits (r) is 4
24 ≥ 7 + 4 + 1
• The Hamming code uses parity bits to identify errors.
• A parity bit (0 or 1) is appended to a data bits to ensure that the total number
of 1’s in the data is even or odd.
• In even parity, total number of 1s in given set of bits should be even,
requires parity bit value = 1 if total number of 1s are odd, 0 otherwise.
• In odd parity, total number of 1s in given set of bits should be odd, requires
parity bit value = 0 if total number of 1s are odd, 1 otherwise.
Hamming Code SPPU- May16, 5 Marks

• In Hamming codes, the bits of the codeword are numbered consecutively,


starting with bit 1 at the right end i.e. least significant bit.
• The bit positions that are powers of 2 (1, 2, 4, 8, 16, etc.) are check/parity
bits, & rest (3, 5, 6, 7, 9, etc.) are filled up with the data bits.
• For example, consider the 7-bit dataword 1011001, with 4 check bits, then 11-
bit codeword takes the form,

Bit Number 11 10 9 8 7 6 5 4 3 2 1
Bit Value 1 0 1 R4 1 0 0 R3 1 R2 R1
Hamming Code SPPU- May16, 5 Marks

• The check/parity bit value can be set as 0 or 1 based on total number of 1s


required even or odd.
• For example, we check for even parity so if number of 1s in bit positions are
odd than check/parity bit = 1 else it is 0.
• r1 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the least significant position excluding 1 (3, 5, 7, 9, 11 and so
on) check one and skip one method

• r2 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 2 from right except 2 (3, 6, 7, 10, 11 and so on)
check two and skip two method

• r3 is the parity bit for all data bits in positions whose binary representation
includes a 1 in the position 3 from right except 4 (5-7, 12-15, 20-23 and so on)
check four and skip four method
Hamming Code SPPU- May16, 5 Marks

• The R1 bit is determined from bit positions 1,3,5,7,9,11


11 10 9 8 7 6 5 4 3 2 1
1 1 1 0 1 0

• Similarly, R2, R3 & R4 can be determined,


• The R2 bit is determined from bit positions 2,3,6,7,10,11
11 10 9 8 7 6 5 4 3 2 1
1 0 1 0 1 1

• The R3 bit is determined from bit positions 4,5,6,7


11 10 9 8 7 6 5 4 3 2 1
1 0 0 1

• The R4 bit is determined from bit positions 8,`9,10,11


11 10 9 8 7 6 5 4 3 2 1
1 0 1 0
Hamming Code SPPU- May16, 5 Marks

• Finally, the codeword that is transmitted is,

11 10 9 8 7 6 5 4 3 2 1
1 0 1 0 1 0 0 1 1 1 0

• When a codeword arrives, the receiver redoes the check/parity bit


computations including the values of the received check/parity bits, called
check results.
• For even parity, if each check result is 0 (1 for odd parity), the codeword is
accepted as valid.
• Otherwise, check results forms error syndrome that is used to give error bit
position & flipping the value (1 to 0 & vice versa) corrects the error.
Encoding a message by Hamming Code
• The procedure used by the sender to encode the message
encompasses the following steps −
• Step 1 − Calculation of the number of redundant bits.

• Step 2 − Positioning the redundant bits.

• Step 3 − Calculating the values of each redundant bit.

• Once the redundant bits are embedded within the message, this is
sent to the user.
Hamming Code Example-1

• Suppose following codeword is received with error at 6th bit,


11 10 9 8 7 6 5 4 3 2 1
1 0 1 0 1 1 0 1 1 1 0

• The check results are calculated including check/parity bits

11 10 9 8 7 6 5 4 3 2 1
1 1 1 0 1 0 = 0

11 10 9 8 7 6 5 4 3 2 1
1 0 1 1 1 1 = 1

11 10 9 8 7 6 5 4 3 2 1
1 1 0 1 = 1

11 10 9 8 7 6 5 4 3 2 1
1 0 1 0 = 0
Hamming Code Example-1

• From the check results, the error syndrome is formed by arranging it


right to left i.e.,
4 3 2 1
0 1 1 0

• The bits give the binary number as 0110 whose decimal representation is
6.
• Thus, the bit number 6 contains an error & to correct the error the 6th bit
is flipped from 1 to 0.
Hamming Code Example-2

• Assume we have received a 7-bit Hamming code which is


1011011
• the first step is to identify the bit position of the data & all the bit
positions which are powers of 2 are marked as parity bits (e.g.
1, 2, 4, 8, etc.). The following image will help in visualizing the
received hamming code of 7 bits.

• First, we need to detect whether there are any errors in this received
hamming code.
Hamming Code Example

• Step 1: For checking parity bit P1, use check one and skip
one method, which means, starting from P1 and then skip P2,
take D3 then skip P4 then take D5, and then skip D6 and take
D7, this way we will have the following bits,

• As we can observe the total number of bits are odd so we will


write the value of parity bit as P1 = 1. This means error is
there.
Hamming Code Example

• Step 2: Check for P2 but while checking for P2, we will use
check two and skip two method, which will give us the following
data bits. But remember since we are checking for P2, so we
have to start our count from P2 (P1 should not be considered).

• As we can observe that the number of 1's are even, then we


will write the value of P2 = 0. This means there is no error.
Hamming Code Example

• Step 3: Check for P4 but while checking for P4, we will use
check four and skip four method, which will give us the
following data bits. But remember since we are checking for P4,
so we have started our count from P4(P1 & P2 should not be
considered).

• As we can observe that the number of 1's are odd, then we will
write the value of P4 = 1. This means the error is there.

• So, from the above parity analysis, P1 & P4 are not equal to 0,
so we can clearly say that the received hamming code has
errors.
Hamming Code Example- Error Correction

• Since we found that received code has an error, so now we


must correct them. To correct the errors, use the following
steps:
• Now the error word E will be:

• Now we have to determine the decimal value of this error word


101 which is 5 (22 *1 + 21 * 0 + 20 *1 = 5).

• We get E = 5, which states that the error is in the fifth data bit.
To correct it, just invert the fifth data bit.

• So the correct data will be:


Hamming Code Example to solve

1. A data bit word 1001 is to be transmitted. Construct even


parity 7-bit hamming code.

2. A 7 bit hamming code is received as 1110010. What is the


correct code?
Checksum
• The term checksum means a group of check bits associated with a
message, regardless of how they are calculated, e.g. a group of parity
bits.
• The stronger checksums are based on a running sum of the data bits of
the message.
• It is usually placed at the end of the message, as the complement of the
sum function.
• This way, errors may be detected by summing the entire received code
word, both data bits and checksum.
• If the result comes out to be zero, no error has been detected.
• For example, a sender sends five 4-bit numbers with complement of the
sum of numbers, say (7,11,12,0,6,36), the receiver can add all the num
bers received (including the checksum).
• If the result is 0, it assumes no error; otherwise, there is an error.
Checksum
• Traditionally, the Internet has been using a 16-bit checksum, usually
implemented using one’s complement arithmetic.

• In this arithmetic, we can represent unsigned numbers between 0 and 2n - 1


using only n bits, if the number has more than n bits, the extra leftmost bits
need to be added to the n rightmost bits (wrapping).

• For example, the number 21 in binary 10101, can be wrapped into 4 bits by
adding leftmost bit to remaining 4 bits as 0101+1 = 0110 or 6.

• In one's complement arithmetic, a negative number can be represented by


inverting all bits (changing a 0 to a 1 and a 1 to a 0), or subtracting the
number from 2n - 1.

• For example, in 4 bits if 6 is 0110, then -6 is 1001 or (24-1) - 6 = 9 or 1001.


Checksum
– Steps at sender site (for checksum calculation)

 The message is divided into 16-bit words.

 The value of the checksum word is set to 0.

 All words including the checksum are added using one's complement addition.

 The sum is complemented and becomes the checksum.

 The checksum is sent with the data.

– Steps at receiver site (for error detection)

 The message (including checksum) is divided into 16-bit words.

 All words are added using one's complement addition.

 The sum is complemented and becomes the new checksum.

 If the value of checksum is 0, the message is accepted; otherwise, it is rejected


.
Cyclic Redundancy Code (CRC)

• The Cyclic Redundancy Check (CRC) is a category of cyclic codes, used

in networks such as LANs and WANs.

• Cyclic codes are special linear block codes with one extra property, 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.

• CRC are also known as a Polynomial Code, based on treating bit strings

as representations of polynomials with coefficients of 0 and 1 only..


Cyclic Redundancy Code (CRC)
• A k-bit dataword is regarded as the coefficient list for a polynomial with k
terms, ranging from xk-1 to x0.
• Such a polynomial is said to be of degree k-1.
• The high-order (leftmost) bit is the coefficient of xk-1, the next bit is the
coefficient of xk-2, and so on.
• For example, 1000011 has 7 bits and thus represents a seven-term
polynomial of degree 6 with coefficients 1, 0, 0, 0, 0, 1 and 1 as
Cyclic Redundancy Code (CRC)
– In Polynomial Code, the sender and receiver must agree upon a generator
polynomial, G(x), also called divisor.

– A good polynomial generator needs to have the following characteristics:


 It should have at least two terms to detect single bit errors i.e. both the high- and low
-order bits of the generator must be 1.

 The coefficient of the term x0 should be 1 to detect single bit errors.

 It should not divide xt+1, for t between 2 and n-1 (n - length of codeword) so all
isolated double errors can be detected.

 It should have the factor x+1 to be able to detect all odd-numbered errors.
Cyclic Redundancy Code (CRC)
 Standard Generator Polynomials
Cyclic Redundancy Code (CRC)
 CRC encoder and decoder
Cyclic Redundancy Code (CRC)
• In the encoder, the dataword has k bits (4 here); the codeword has n bits
(7 here).

• The size of the dataword is augmented by adding n-k (3 here) 0s to the


right-hand side of the word.

• The n-bit result is fed into the generator.

• The generator uses a divisor of size n-k+1 (4 here), predefined and


agreed upon.

• The generator divides the augmented dataword by the divisor (modulo-2


division).

• The quotient of the division is discarded and the remainder (r2 r1 r0) is
appended to the dataword to create the codeword.
Cyclic Redundancy Code (CRC)
• The decoder receives the possibly corrupted codeword.

• A copy of all n bits is fed to the checker which is a replica of the generator

• The remainder produced by the checker is a syndrome of n-k (3 here) bits,


which is fed to the decision logic analyzer.

• The analyzer has a simple function.

• If the syndrome bits are all 0s, the 4 leftmost bits of the codeword are
accepted as the dataword (interpreted as no error); otherwise, the 4 bits
are discarded (error).
Cyclic Redundancy Code (CRC)
 Division in CRC encoder
Cyclic Redundancy Code (CRC)
• The encoder takes the dataword and augments it with n-k number of 0s, then divides
the augmented dataword by the divisor.

• The process of modulo-2 binary division is the same as the division process for decimal
numbers.

• But, in this case addition and subtraction are the same using the XOR operation.

• In each step, a copy of the divisor is XORed with the 4 bits of the dividend.

• The result of the XOR operation (remainder) is 3 bits (in this case), which is used for the
next step after 1 extra bit is pulled down to make it 4 bits long.

• In this type of division if the leftmost bit of the dividend (or the part used in each step) is
0, the step cannot use the regular divisor; we need to use an all-0s divisor.

• When there are no bits left to pull down, we have a result. The 3-bit remainder forms the
check bits (r2, r1, and r0).

• They are appended to the dataword to create the codeword.


Cyclic Redundancy Code (CRC)
• Division in the CRC decoder for two cases
Cyclic Redundancy Code (CRC)
• The codeword can change during transmission.

• The decoder does the same division process as the encoder.

• The remainder of the division is the syndrome.

• If the syndrome is all 0s, there is no error; the dataword is separated fro
m the received codeword and accepted.

• Otherwise, everything is discarded.

• The left hand figure shows the value of syndrome when no error has occ
urred; the syndrome is 000.

• The right-hand part of the figure shows the case in which there is one si
ngle error & syndrome is not all 0s (it is 011).
CRC Example-1
CRC Example-2
CRC Example-3
CRC Example-4
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Elementary Data Link Protocols
Flow Control Protocols
• It is a set of procedures that tells the sender how much data it can be transmit
before the data overwhelms the receiver.
• The receiving device has limited speed and limited memory to store the data.
• Therefore, the receiving device must be able to inform the sending device to stop
the transmission temporarily before the limits are reached.
• It requires a buffer, a block of memory for storing the information until they are
processed.
• Two methods have been developed to control the flow of data.

 Stop-and-wait
 Sliding window
Stop-and-Wait
 Meaning : In the Stop-and-wait method, the sender waits for an
acknowledgement after every frame it sends.
 When acknowledgement is received, then only next frame is sent. The
process of alternately sending and waiting of a frame continues until the
sender transmits the EOT (End of transmission) frame.
Advantages
 The Stop-and-wait method is simple as each frame is checked and
acknowledged before the next, frame is sent.
Disadvantages
 Stop-and-wait technique is inefficient to use as each frame must travel
across all the way to the receiver and an acknowledgement travels all
the way before the next frame is sent
 Each frame sent and received uses the entire time needed to traverse
the link.
 Moreover, if two devices are distance apart, a lot of time is wasted
waiting for ACKs that leads to increase in total transmission time.
Sliding Window
• The Sliding Window is a method of flow control in which a sender can transmit the several
frames before getting an acknowledgement.
• In Sliding Window Control, multiple frames can be sent one after another due to which capacity
of the communication channel can be utilized efficiently.
• A single ACK acknowledge multiple frames.
• Sliding Window refers to imaginary boxes at both the sender and receiver end.
• The window can hold the frames at either end, and it provides the upper limit on the number of
frames that can be transmitted before the acknowledgement.
• Frames can be acknowledged even when the window is not completely filled.
• The window has a specific size in which they are numbered as modulo-n means that they are
numbered from 0 to n-1.
• Example : if n = 8, the frames are numbered from 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1
• The size of the window is represented as n-1. Therefore, maximum n-1 frames can be sent be
fore acknowledgement.
• When the receiver sends the ACK, it includes the number of the next frame that it wants to
receive.
• Example : To acknowledge the string of frames ending with frame number 4, the receiver will
send the ACK containing the number 5.
• When the sender sees the ACK with the number 5, it gets know that the frames from 0
through 4 have been received.
Sliding Window
(A) Sender Window:
• At the beginning of a transmission, the sender window contains n-1 frames, and
when they are sent out, the left boundary moves inward, shrinking the size of the
window.
• Example : if the size of the window is w if three frames are sent out, then the
number of frames left out in the sender window is w-3. Shown in Fig

This wall move to This wall move to


the right when a the right when a
frame is sent frame is sent

• Once the ACK has arrived, then the sender window expands to the number
which will be equal to the number of frames acknowledged by ACK.
• Example : The size of the window is 7, and if frames 0 through 4 have been
sent out and no acknowledgement has arrived, then the sender window contains
only two frames, i.e., 5 and 6.
• Now, if ACK has arrived with a number 4 which means that 0 through 3 frames
have arrived undamaged and the sender window is expanded to include the next
four frames. Therefore, the sender window contains six frames (5,6,7,0,1,2)
Sliding Window
(B) Sender Window:
• At the beginning of transmission, the receiver window does not contain n frames, but
it contains n-1 spaces for frames shown in Fig. When the new frame arrives, the size
of the window shrinks.

This wall move to This wall move to


the right when a the right when a
frame is sent frame is sent
• The receiver window does not represent the number of frames received, but it
represents the number of frames that can be received before an ACK is sent.
• Example : The size of the window is w, if three frames are received then the number of
spaces available in the window is (w-3).
• Once the acknowledgement is sent, the receiver window expands by the number
equal to the number of frames acknowledged.
• Suppose the size of the window is 7, means that the receiver window contains seven
spaces for seven frames. If the one frame is received, then the receiver window shrinks
and moves the boundary from 0 to 1.
• In this way, window shrinks one by one, so window now contains the six spaces. If fram
es from 0 through 4 have sent, then the window contains two spaces before an
acknowledgement is sent.
NOISELESS CHANNELS

Meaning: It is an error free channel. It combines framing


and flow control

Unrestricted Simplex Protocol


Stop-and-Wait Protocol
Unrestricted Simplex Protocol

• It has no error and flow control. In this protocol, data frames travel in unidirectional
way-from one sender to one receiver shown in Fig

• Sender keeps transmitting data and the receiver keeps receiving data
• Works with the assumption that buffer space available is infinite
• Another assumption is that, the transmission channel is noise free, so there won 't be
any change in data or loss of frames. Because of these unrealistic assumptions, this
protocol is also called 'utopia'
Unrestricted Simplex Protocol

• Once the frame is received at receiver, it will remove the header from frame and

send the data packet to network layer immediately .

• Therefore, receiver can never overwhelmed with incoming frames.

• As we can see, there are no sequence numbers for the data as well as no

acknowledgement number from the receiver side


Stop and Wait Protocol

• In the previous protocol, the unrealistic assumption that was made was the receiver's
buffer had infinite space. Because of this the receiver will never get flooded. However,
this assumption is not practically possible.
• If the sender sends data at a high rate the receiver might get flooded. For dealing with
this problem the simplex stop and wait protocol is developed. In this protocol, Flow
control is added. Shown in Fig
Stop and Wait Protocol

• In this protocol, the sender sends only one frame at a time and then waits for an

acknowledgment from receiver.

• Once the acknowledgement has been received by the sender then it sends the next

frame again.

• If sender receives NAK (negative ack) frame then it transmits the same frame again.

• In this protocol, we need half duplex link because channel is busy at a time for sending

and receiving.
Stop and Wait Protocol

Advantages:

1. Accuracy

Disadvantages:

1. Inefficient

2. Transmission process is slow

3. A lot of time is wasted waiting for ACKs


NOISY CHANNELS

Although the Stop-and-Wait Protocol gives us an idea of


how to add flow control to its predecessor, noiseless
channels are nonexistent. We discuss three protocols in this
section that use error control.

 Simplex Protocol
 Piggybacking
 Stop-and-Wait Automatic Repeat Request (ARQ)
 Go-Back-N ARQ
 Selective Repeat ARQ
Simplex Protocol

• Other assumption made for the simplex prot


ocol was that the transmission channel is
noise free.
• However, in practical cases, a channel may
be noisy because of which it may lose the
data frame on the way.
• If the frame gets lost in the middle, the
acknowledgement will not be received and
as a result the sender will just keep waiting
for the acknowledgement.
• To avoid this confusion, a timer is set at the
senders side.
• The timer is set to a specific time. If the
acknowledgement i. received within the
specified time, the next frame is sent and the
timer is reset
• This can be understood from Fig
Simplex Protocol

• To avoid confusion, every packet has a sequence number and there is


corresponding acknowledgment number.
• In some cases, the frame or sometimes even the acknowledgement m
ay be lost because of the noisy channel.
• Here, the timer times out and retransmission of the frame takes place as
shown in Fig

ACK Lost Packet Lost


Piggybacking

• Sending acknowledgment alone increases


the bandwidth requirements of the channel.
• But, sending the acknowledgement is also
equally necessary.
• Hence, instead of keeping a simplex
system (where data is transmitted only from
one side), the data can now be
transmitted from both the sides.
• When data is transferred from one side a
nd other side receives it, the other side
can send its data and the
acknowledgement together to save bandwidth
• This can be understood from Fig
• Hence, by using piggybacking technique
the channel bandwidth is used very effectively
Stop and Wait ARQ

• It adds simple error control to stop and wait protocol.


• Stop and Wait ARQ mainly implements Sliding Window Protocol concept
with Window Size one.
• Thus, it is also called as one bit sliding window protocol.

(I) Problems in Stop and Wait

1. Lost Data: If data frame is lost


and if sender does not receive any
type of acknowledgement from the
receiver with a specified time then it
resends the frame again. Shown in
Fig
Stop and Wait ARQ

2. Lost Acknowledgement: After receiving a frame by receiver it sends an


acknowledgement to the sender. If an acknowledgment frame is lost then again
sender doesn't receive it within a specified time and retransmits the frame again.
lf the receiver has already sent an acknowledgment of that frames there is confusion.
Shown in Fig:
Stop and Wait ARQ

3. Delayed Acknowledgement/Data : After timeout on sender side, a long delayed


acknowledgement might be wrongly considered as acknowledgement of some other
recent packet. Above 3 problems are resolved by Stop and Wait ARQ (Automatic Re
peat Request) that does both error control and flow control.
Stop and Wait ARQ

(II) Working: Sender A sends a data frame or packet with sequence number 0.
Receiver B, after receiving data frame, sends an acknowledgement with sequence
number 1 (sequence number of next expected data frame or packet). There is only
one bit sequence number that implies that both sender and receiver have buffer for
one frame or packet only.

(III) Solution to stop and wait:

Lost Data Lost Ack Delayed Ack


Stop and Wait ARQ

(i) Time Out: Sender sends the data and starts the timer. If the acknowledgement is
not received within the specified amount of time then the sender thinks that da
ta is lost and retransmits the data.
(ii) Sequence Number (Data-ACK):
• Since an ack frame can also be
corrupted and lost it needs sequence
numbers and redundancy bits.
• One field is adds to data and ack
frame to hold the sequence number
respectively.
• In stop and wait ARQ, we use
sequence number as 0,1, 0,1,0,1 etc
• It means if data frame 0 has arrived
safe and sound then receiver sends
an ack frame with sequence no. 1
(means frame 1 is expected next).
• If frame 1 has arrived safely then
receiver sends and ack
• frame 0 (means frame 0 expect).
Stop and Wait ARQ

Sequence number Combined solution if data and ack


(Solution to lost ack frame problem) frame lost and ack frame delayed
Stop and Wait ARQ - Disadvantage

(I) Inefficient
a. Stop and wait ARQ uses half duplex link. Therefore entire
bandwidth is used only for sending and receiving at a time.
b. If higher bandwidth and long delay appears then link
utilization is minimum and capacity of the link is waste. Thus, this
methods is inefficient

(II) No Pipelining
a. In this protocol, we need to wait for a frame to reach the
destination and be acknowledged before next frame can be used.
b. That is no pipelining is used. Thus, waiting time increased
GO-Back-n ARQ

In Go-Back-N ARQ protocol, if one frame is lost or damaged, then it


retransmits all the frames after which it does not receive the positive
ACK. Shown in Fig. Three possibilities can occur for retransmission :

(1) Damaged Frame:


• When the frame is damaged, then the
receiver sends a NAK frame.
• In the Fig., three frames have been
transmitted before an error discovered in
the third frame.
• In this case, ACK 2 has been returned
telling that the frames 0,1 have been
received successfully without any error.
• The receiver discovers the error in data 2
frame, so it returns the NAK 2 frame.
• The frame 3 is also discarded as it is
transmitted after the damaged frame.
Therefore, the sender retransmits the
frames 2,3.
GO-Back-n ARQ

(2) Lost Data Frame:


• In Sliding window protocols, data frames are sent sequentially.
• If any of the frames is lost, then the next frame arrives at the receiver is out of
sequence.
• The receiver checks the sequence number of each of the frame, discovers
the frame that has been skipped, and returns the NAK for the missing
frame.
• The sending device retransmits the frame indicated by NAK as well as the
frames transmitted after the lost frame

(3) Lost Acknowledgment:


• The sender can send as many frames as the windows allow before waiting for
any acknowledgement.
• Once the limit of the window is reached and the sender has no more frames
to send; he must wait for the acknowledgement.
• Problem : If the acknowledgement is lost, then the sender could wait forever.
• Solution: To avoid such situation, the sender is equipped with the timer that
starts counting whenever the window capacity is reached.
• If the acknowledgement has not been received within the time limit, then the
sender retransmits the frame since the last ACK.
Selective-Repeat ARQ

• Selective-Repeat ARQ technique is more efficient than Go-Back-n ARQ.


Shown in Fig.
• In this technique, only those frames are retransmitted for which negative
acknowledgement (NAK) has been received.

• The receiver storage buffer


keeps all the damaged frames on
hold until the frame in error is
correctly received.
• The receiver must have an
appropriate logic for
reinserting the frames in a
correct order
• The sender must consist of a
searching mechanism that
selects only the requested frame
for retransmission.
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


HDLC
High-level Data Link Control (HDLC) is a bit-oriented
protocol for communication over point-to-point and
multipoint links. It implements the ARQ mechanisms we
discussed in this chapter.

Topics discussed in this section: Configurations and


Transfer Modes Frames
Control Field

11.157
Figure Normal response mode

11.158
Figure Asynchronous balanced mode

11.159
Figure HDLCframes

11.160
Figure Control field format for the different frame types

11.161
POINT-TO-POINT PROTOCOL

Although HDLC is a general protocol that can be used


for both point-to-point and multipoint configurations,
one of the most common protocols for point-to-point
access is the Point-to-Point Protocol (PPP). PPP is a
byte-oriented protocol.

Topics discussed in this section:


Framing Transition Phases Multiplexing Multilink PPP

11.162
Figure PPP frame format

11.163
Note

PPP is a byte-oriented protocol using


byte stuffing with the escape byte
01111101.

11.164
Figure Transition phases

11.165
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Multiple access protocols

⚫ In LANs,Wi-Fi, satellite networks the access to the


shared media should be controlled.
⚫ If more than 2 nodes send at the same time →collision
⚫ All collided packets are lost → waste of bandwidth
⚫ Ideally, the MAC protocol for a broadcast channel with
the bit-rate R bps should satisfy:
⚫ if only 1 node is sending than the throughput is R
⚫ when M nodes have data to send than the throughput is R/M
⚫ decentralized protocol – no master
⚫ simple & inexpensive to implement
Static Channel Allocation in LANs and MANs

 Frequency Division Multiplexing (FDM) is an example of static channel


allocation where the bandwidth is divided among a number of N users.
 When there is only a small and constant number of users, each of
which has a heavy (buffered) load of traffic (e.g., carriers' switching
offices), FDM is a simple and efficient allocation mechanism.
 However, when the number of senders is large and continuously
varying or the traffic is bursty, FDM presents some problems.
1) when fewer than N users are currently interested in
communicating, a large piece of valuable spectrum will be wasted.
2) when more users wants to communicate, those who have not
been assigned a frequency will be denied permission.
3) even assuming that the number of users could somehow be
held constant at N, each user traffic usually changes dynamically
over time.
Dynamic Channel Allocation in LANs and MANs
Station Model: N independent stations (terminals) exists.

Single Channel Assumption: A single channel is available for all communication


(send and receive)

Collision Assumption: If two frames are transmitted simultaneously, they overlap


in time and the resulting signal is garbled (collision). no errors other than those
generated by collisions assumed to exist.

(a)Continuous Time: Frame transmission can begin at any instant.


(b)Slotted Time: Frame transmissions always begin at the start of a slot where the
time is divided into discrete slots.

(a)Carrier Sense: Stations can tell if the channel is in use before trying to use it.
(b)No Carrier Sense: Stations cannot sense the channel before trying to use it.
7
Multiple Access Protocols

ALOHA
Carrier Sense Multiple Access Protocols

Collision-Free Protocols

Limited-Contention Protocols
Wavelength Division Multiple Access

Protocols Wireless LAN Protocols


8
RANDOM ACCESS

In random access or contention methods, no station is superior to


another station and none is assigned the control over another. No
station permits, or does not permit, another station to send. At
each instance, a station that has data to send uses a procedure
defined by the protocol to make a decision on whether or not to
send.

Topics discussed in this section:


ALOHA
Carrier Sense Multiple Access
Carrier Sense Multiple Access with Collision Detection
Carrier Sense Multiple Access with Collision Avoidance

12.171
Taxonomy of Multiple-Access Protocols
ALOHA Network
Frames in Pure ALOHA
ALOHA Protocol
Example

The stations on a wireless ALOHA network are a maximum


of 600 km apart. If we assume that signals propagate at
3 × 108 m/s, we find
Tp = (600 × 105 ) / (3 × 108 ) = 2 ms.

Now we can find the value of TB for different values of


K.

⚫ When K= 1, TB  {0ms,2ms}
⚫ When K= 2, TB  {0ms,2ms,4ms,6ms}
ALOHA: Vulnerable Time
Example

A pure ALOHA network transmits 200-bit frames on a shared


channel of 200 kbps. What is the requirement to make this frame
collision-free?

Solution
Average frame transmission time Tfr is 200 bits/200 kbps or 1 ms. The
vulnerable time is 2 × 1 ms = 2 ms. This means no station should
send later than 1 ms before this station starts transmission and no
station should start sending during the one 1-ms period that this station
is sending.
ALOHA: Throughput

⚫ The throughput for pure ALOHA is

S = G × e−2G

where G is the average number of frames requested per


frame-time

⚫ The maximum throughput

⚫ Smax = 0.184 when G= 1/2


Example

A pure ALOHA network transmits 200-bit frames on a shared


channel of 200 kbps. What is the throughput if the system (all
stations together) produces
a. 1000 frames per second
b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−2 G or S = 0.135 (13.5 percent). This means
that the throughput is 1000 × 0.135 = 135 frames. Only
135 frames out of 1000 will probably survive.
12.180
Example (continued)
b. If the system creates 500 frames per second, this is
(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e −2G or S = 0.184 (18.4 percent). This
means that the throughput is 500 × 0.184 = 92 and that
only 92 frames out of 500 will probably survive. Note
that this is the maximum throughput case,
percentagewise.

c. If the system creates 250 frames per second, this is (1/4)


frame per millisecond. The load is (1/4). In this case
S = G × e −2G or S = 0.152 (15.2 percent). This means
that the throughput is 250 × 0.152 = 38. Only 38
frames out of 250 will probably survive.

12.181
Slotted ALOHA
Slotted ALOHA: Vulnerable Time
Slotted ALOHA: Throughput
⚫ The throughput for Slotted ALOHA is

S = G × e−G

where G is the average number of frames requested


per frame-time
⚫ The maximum throughput
⚫ Smax = 0.368 when G= 1
Example

A slotted ALOHA network transmits 200-bit frames on a shared


channel of 200 kbps. What is the throughput if the system (all
stations together) produces
a. 1000 frames per second
b. 500 frames per second
c. 250 frames per second.
Solution
The frame transmission time is 200/200 kbps or 1 ms.
a. If the system creates 1000 frames per second, this is 1
frame per millisecond. The load is 1. In this case
S = G× e−G or S = 0.368 (36.8 percent). This means
that the throughput is 1000 × 0.0368 = 368 frames.
Only 386 frames out of 1000 will probably survive.
Example (continued)

b. If the system creates 500 frames per second, this is


(1/2) frame per millisecond. The load is (1/2). In this
case S = G × e−G or S = 0.303 (30.3 percent). This
means that the throughput is 500 × 0.0303 = 151.
Only 151 frames out of 500 will probably survive.

c. If the system creates 250 frames per second, this is (1/4)


frame per millisecond. The load is (1/4). In this case
S = G × e −G or S = 0.195 (19.5 percent). This means
that the throughput is 250 × 0.195 = 49. Only 49
frames out of 250 will probably survive.
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


CSMA

⚫Carrier Sense Multiple Access


⚫"Listen before talk"
⚫Reduce the possibility of collision
⚫But cannot completely eliminate it
Persistence Methods
Persistence Methods
CSMA with Collision Detection
Carrier Sense Multiple Access with Collision
Detection Station monitors channel while sending
a frame

CSMA/CD can be in one of three states: contention,


transmission, or idle.
Figure Space/time model of the collision in CSMA
Figure 12.9 Vulnerable time in CSMA
Figure Collision of the first bit in CSMA/CD
Figure Collision and abortion in CSMA/CD
Example

A network using CSMA/CD has a bandwidth of 10 Mbps. If the


maximum propagation time (including the delays in the devices and
ignoring the time needed to send a jamming signal, as we see later) is
25.6 μs, what is the minimum size of the frame?

Solution
The frame transmission time is Tfr = 2 × Tp = 51.2 μs. This means, in
the worst case, a station needs to transmit for a period of 51.2 μs to
detect the collision. The minimum size of the frame is 10 Mbps ×
51.2 μs = 512 bits or 64 bytes. This is actually the minimum size of
the frame for Standard Ethernet.

12.196
Figure Energy level during transmission, idleness, or collision
CSMA/CD: Flow Diagram
CSMA/CA
⚫ Carrier Sense Multiple Access with Collision Avoidance
⚫ Used in a network where collision cannot be detected
⚫ E.g., wireless LAN

IFS – Interframe Space

In CSMA/CA, the IFS can also be used to define the priority of


a station or a frame.
Note

In CSMA/CA, if the station finds the


channel busy, it does not restart the timer of
the contention window;
it stops the timer and restarts it when the
channel becomes idle.
Figure Flow diagram for CSMA/CA
Wavelength Division Multiple Access Protocols

Wavelength division multiple access.


Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Binary Exponential Back -off algorithm,
⚫ Binary exponential backoff refers to a collision resolution

mechanism used in random access MAC protocols.


⚫ This algorithm is used in Ethernet (IEEE 802.3) wired LANs.

⚫ In Ethernet networks, this algorithm is commonly used to

schedule retransmissions after collisions.


⚫ After a collision, time is divided into discrete slots whose length

is equal to 2 τ, where τ is the maximum propagation delay in the


network.
Binary Exponential Back -off algorithm,
⚫ The reason for this choice is that 2 τ is the minimum amount of time a source

needs to listen to the channel to always detect a collision.


⚫ The stations involved in the collision randomly pick an integer from the set

{0,1}.
⚫ This set is called the contention window. If the sources collide again because

they picked the same integer, the contention window size is doubled and it
becomes {0,1,2,3}.
⚫ Now the sources involved in the second collision randomly pick an integer

from the set {0,1,2,3} and wait that number of slot times before trying again.
⚫ Before they try to transmit, they listen to the channel and transmit only if the

channel is idle. This causes the source which picked the smallest integer in
the contention window to succeed in transmitting its frame.
Binary Exponential Back -off algorithm,

⚫ 10 Mbps LAN with a maximum length of 2500 m and four


repeaters the round-trip time has been determined to be nearly
50
sec in the worst case.
⚫ Shortest allowed frame must take at least this long to transmit.
⚫ At 10 Mbps a bit takes 100 nsec
⚫ 500 bits (numbit = 10 Mbps X 100 nsec) rounded up to 512
bits = 64 bytes.
Binary Exponential Back -off algorithm,

Collision detection can take as long as 2Tp.


Binary exponential backoff algo
How the randomization is done when collision occurs :

•After a collision, time is divided into discrete slot ,the slot time
has been set to 512bits i.e. round trip propagation time on the
other.
•After the first collision each station waits either 0 or 1 time slot.
•If both station picks the same random number they collide
again.
•After the second collision each one can picks either 0,1,2 or 3 at
random.
•In general after ith collision a random number between 0 and 2i-
1 is chosen.
•Maximum 16 collision are allowed after that it reports as failure
Outline

Introduction, functions

Design Issues: Services to Network Layer, Framing, Error & Flow Control

ARQ Strategies: Error Detection & Correction, Parity bits, Hamming Code & CRC

Flow Control Protocols: Unrestricted Simplex, Stop and Wait, Sliding Window Protocol

WAN Connectivity: PPP and HDLC.

MAC Sub layer: Multiple Access Protocols: Pure and Slotted ALOHA

CSMA, WDMA, CSMA/CD, CSMA/CA

Binary Exponential Back-off algorithm

Introduction to Ethernet IEEE 802.3, IEEE 802.11 a/b/g/n

IEEE 802.15 and IEEE 802.16 Standards.


Ethernet Cabling
The most common kinds of Ethernet cabling.
Ethernet Cabling (2)

Three kinds of Ethernet cabling.


(a) 10Base5, (b) 10Base2, (c) 10Base-T.
Ethernet Cabling (3)
Cable topologies.
(a) Linear, (b) Spine, (c)Tree, (d) Segmented.
Frame formats. (a) Ethernet (DIX).
(b) IEEE 802.3.
Ethernet Frame Format description
1. Preamble – 8 bytes
⚫ 7x 10101010 and 10101011 <- Start of Frame
Delimiter (802.3).
⚫ The Manchester encoding of this pattern produces
10-MHz wave for 6.4 sec – used for
synchronization.
⚫ The last two bits indicate the start of the frame.
2. Two addresses each 6 bytes – destination + source
⚫ First bit of the destination address is 0 for ordinary addresses
and 1 for group addresses.
⚫ Group address allow multiple destinations to listen to a single
address –
Multicasting.
⚫ Special address consisting of all 1 is reserved for broadcasting.
Ethernet Frame Format description

3. Type or Length field.


⚫ Depending whether the frame is Ethernet or IEEE
802.3
⚫ Ethernet uses a Type field to tell the receiver what
to do with the frame.
⚫ Multiple network-layer protocols may be in use at
the same time on the same machine. So when
Ethernet frame arrives, the operating system has to
know which one to hand the frame to.The Type
field specifies which process to give the frame to.
E.g. 0x0800 indicates the frame contains IPv4
packet.
Ethernet Frame Format description
⚫ Length of the field could be carried as well.
⚫ Ethernet length was determined by looking inside the
data – a layer violation.
⚫ Added another header for the Logical Link Control
(LLC) protocol within the data. It uses 8 bytes to convey
the 2 bytes of protocol type information.
⚫ Rule: Any number greater than 0x600 can be interpreted
a Type otherwise is considered to be Length.
Ethernet Frame Format description

4. Data Field
⚫ Up to 1500 bytes.
⚫ Minimum frame length – valid frames must be at
least 64 bytes long – from destination address to
checksum.
⚫ If data portion is less than 46 bytes the Pad field is
used to
fill out the frame to the minimum size.
⚫ Minimum filed length is also serves one very
important role – prevents the sender to complete
transmission before the first bit arrives at the
destination.
Fast Ethernet

The original fast Ethernet cabling.


Fast Ethernet 802.3u(2)
⚫ 100 Base-T4 :
• signaling speed is 25MHz ie 25% faster than standard Ether’s
20MHz
• So to achieve necessary bandwidth 4 twisted pair are required
• Of the 4 twisted pair, one is always to the hub , one is from
hub and other two are switchable to current transmission
direction
• Manchester encoding is not used instead scheme 8B/6T is
used
b) 100 Base-TX :
• Signaling speed is 125MHz
• Only two twisted pair are used , one to the hub and one
Fast Ethernet 802.3u(3)
c) 100 Base- FX :
• Uses two stands of multimode fiber , one for each direction
• It is full duplex 100Mbps in each direction
• The distance between station and hub can be 2km
Gigabit Ethernet

⚫ After the standard for Fast Ethernet was adopted the work for
yet even faster standard started: Gigabit Ethernet
⚫ Goals:
⚫ Increase performance ten fold over Fast Ethernet.
⚫ Maintain compatibility with both Classical and Fast
Ethernet.
⚫ Unacknowledged datagram service with both unicast and
broadcast.
⚫ Use the same 48-bit addressing scheme already in use,
⚫ Maintain the same frame format including minimum and
maximum
sizes.
Gigabit Ethernet (3)

Gigabit Ethernet cabling.


Gigabit Ethernet (4)
⚫ Gigabit support both copper and fiber cabling
⚫ Signaling at 1Gbps over fiber means that light source has to be
turned on and off in under 1nsec
⚫ LED’s can not operate at this speed so lasers are used
⚫ Three fiber diameters are permitted : 10,50 and 62.5 microns
⚫ Two wavelengths are permitted : 0.85 and 1.3 microns
⚫ On fiber new encoding scheme 8B/10B is used ie each 8bits is
encoded as 10 bits on fiber
⚫ 1024 possible code words for each input is possible so two rules
are available to make the decision
1> No codeword have more than 4 identical bits in a row 2> No
codeword may have more than six 0s or six 1s
LAN/WLAN World

• Limitations because of
physical, hard-wired
infrastructure

• Flexibility
• Portability
• Mobility
• Ease of Installation
LAN Vs WLAN

1.LAN refers to a wired network while WLAN is used to refer to


a wireless network.

2.LAN is commonly used in fixed networks while WLAN is


common in areas where computers are moved quite often.

3.WLAN is more convenient to users compared to LAN.

4.LAN is much faster compared to WLAN.

5.LAN is more secure compared to WLAN.


What is WLAN?

A wireless local area network (WLAN) is a


wireless computer network that links two or more
devices using a wireless distribution method
within a limited area such as a home, school,
computer laboratory, or office building.

This gives users the ability to move around within a


local coverage area and still be connected to the
network, and can provide a connection to the
wider Internet.
AP AP
IEEE 802.11 Architecture Components
Access point (AP): A station that provides
access to the DS.

Basic service set (BSS): A set of stations


controlled by a single AP.

Distribution system (DS): A system used to


interconnect a set of BSSs to create an ESS.

Extended service set (ESS):Two or more BSS


interconnected by DS
IEEE 802.11 Architecture Components
– Access Point

In a wireless local area network (WLAN), an access


point is a station that transmits and receives data.

An access point connects users to other users within


the network and also can serve as the point of
interconnection between the WLAN and a fixed wire
network.

Each access point can serve multiple users within a


defined network area; as people move beyond the
range of one access point, they are automatically
IEEE 802.11 Architecture Components
BSS & ESS
• Provides the basic building-block
The basic of an
service set 802.11 wireless LAN.
• In infrastructure mode, a
(BSS) single access point (AP) together
with all associated stations
(STAs) is called a BSS

An • Is a set of connected BSSs.


extended • Access points in an ESSare connected
by a distribution system.
service set • Each ESShas an ID called the SSID
(ESS)
Wireless LANs: Adv & Disadv
• Flexible deployment
• Minimal wiring difficulties
• More robust against disasters (earthquake etc)
• Historic buildings, conferences, trade shows,…
Advantages • User mobility
• Voice and data services
• Scalable architecture
• Plug-and-Play architecture

• Low bandwidth compared to wired networks (1-10 Mbit/s)


• Security
• Interference
Disadvantages • Power consumption
• Speed
• Inconsistent connections
Wireless Networks- Categories

Infrastructure
based

WLAN
types/Categories

Ad-hoc
Wireless LANs network Types (Categ
ories)

Figure (a)Wireless networking with a base station.


(b)Ad hoc networking.

66 Networks:Wireless LANs
Wireless LAN Applications
Medical
Professionals(Healthcares)
Conducting everyday business

Education

Temporary Situations Airlines

Security Staff Emergency

Centers
IEEE 802.11 Wireless LAN Standard
IEEE developed the first intern
ationally recognized wireless L
AN standard – IEEE 802.11 in
1997

Scope of IEEE 802.11 is limited to


Physical and Data Link Layers.
Physical Media of 802.11 Standard
Frequency- • Operating in 2.4 GHz ISM band
hopping • Lower cost, power consumption
spread • Most tolerant to signal interference
spectrum
• Operating in 2.4 GHz ISM band
Direct- • Supports higher data rates
sequence • More range than FH or IR physical layers
spread
spectrum • Lowest cost
Infrared • Lowest range compared to spread spectrum
• Doesn’t penetrate walls, so no eavesdropping
What is meant by Spread Spectrum

Spread spectrum is a form of wireless communications


in which the frequency of the transmitted
signal is varied.This results in a much greater
bandwidth than the signal (Bss >> B)

This technique decreases the potential


interference to other receivers while
achieving privacy.

Two types of Spread Spectrum- FHSS and


WLAN Problem:- The hidden terminal
problem.
WLAN -Hidden Terminal Problem

A B C

⚫ Hidden terminals
⚫ Aand C cannot hear each other.
⚫ Asends to B, C cannot receiveA.
⚫ C wants to send to B, C senses a“free” medium (CS fails)
⚫ Collision occurs at B.
⚫ Acannot receive the collision (CD fails).
⚫ Ais “hidden” for C.
WLAN Problem : exposed terminal problem.
WLAN Problem- Solution

MAC Layer
IEEE 802.11 Medium Access Control

MAC layer covers three functional


areas:

Reliable data delivery

Access
Security control
Reliable Data Delivery
Loss of frames due to
• noise, interference, and propagation effects

Frame exchange protocol

• Source station transmits data


• Destination responds with acknowledgment (ACK)
• If source doesn’t receiveACK, it retransmits frame

Four frame exchange for enhanced reliability

• Source issues request to send (RTS)


• Destination responds with clear to send (CTS)
• Source transmits data
• Destination responds withACK
802.11 MAC layer
⚫ The 802.11 standard specifies a common medium
access control (MAC) Layer.
⚫ In general, the MAC Layer manages and maintains
communications between 802.11
⚫ Before transmitting frames, a station must first gain
access to the medium.
⚫ The 802.11 standard defines two forms of medium
access
1. Distributed Coordination Function (DCF)
2. Point Coordination Function (PCF).
802.11 MAC layer
⚫ DCF is mandatory and based on the CSMA/CA
protocol.
⚫ With DCF, 802.11 stations contend for access and
attempt to send frames when there is no other station
transmitting.
⚫ If another station is sending a frame, stations are polite
and wait until the channel is free.
⚫ If the channel is in use, the station must wait a random
period of time before attempting to access the medium
again.
⚫ This ensures that multiple stations wanting to send data
don't transmit at the same time.
Access Control
Asynchronous Time bounded Inter-frame
data service service (PCF) spacing
(DCF) (IFS)

CSMA/CA
Polling DIFS

RTS/CTS PIFS

SIFS
CSMA/CD vs. CSMA/CA

 CSMA/CD (Collision detection)


 For wire communication
 No control BEFORE transmission
 Generates collisions
 Collision Detection-How?
 CSMA/CA (Collision Avoidance)
 For wireless communication
 Collision avoidance BEFORE transmission
 Why avoidance on wireless?
 Difference in energy/power for transmit & receive
 Difficult to distinguish between incoming weak signals,
noise, and effects of own transmission
RTS/CTS (Request To Send/Clear To Send)

RTS
A B C
CTS CTS

⚫ 802.11 avoids the problem of hidden terminals


⚫ Aand C want to send to B
⚫ Asends RTS to B
⚫ Bsends CTS toA
⚫ C “overhears”CTS from B
⚫ C waits for duration ofA’s transmission
The 802.11 MAC Sublayer Protocol

The use of virtual channel sensing using CSMA/CA.


The 802.11 MAC Sublayer Protocol

Interframe spacing in 802.11


802.11 Architecture and Protocol Stack

Part of the 802.11 protocol stack.


802.11 Frame Structure

Format of the 802.11 data frame


Frame Control field
⚫ ProtocolVersion:
zero for 802.11 standard

⚫ Type= frame type:


data, management, control

⚫ Subtype = frame sub-type:

⚫ ToDS:
When bit is set indicate that destination frame is for DS

⚫ FromDS:
When bit is set indicate frame coming from DS
Frame Control field
⚫ Retry:
Set in case of retransmission frame

⚫ More fragments:
Set when frame is followed by other fragment

⚫ Power Management
bit set when station go Power Save mode (PS)

⚫ More Data:
When set means that AP have more buffered data for a station in Power
Save mode
Frame Control field
⚫ WEP:
When set indicate that in the Frame Body field there
are datas need to processed by WEP algorithm.

⚫ Order:
When set indicate restrictions for transmission
IEEE 802.11 standards

IEEE802.11 b
IEEE 802.11 a
IEEE 802.11 g
IEEE 802.11 n
IEEE 802.11 ac
IEEE 802.11 ad
IEEE 802.11 b
Frequency = 2.4 GHz (ISM band)

Maximum Speed =11 Mbps Range =

about 38meters(Varies) Encoding

Scheme = DSSS

Modulation Technique= BPSK(1

Mbps), DQPSK(2 Mbps), CCK(5.5

Mbps,11Mbps)
IEEE802.11 b

• lowest cost;
Pros o • signal range is good and
not easily obstructed
f 802.1
1b
• slowest maximum
speed;
• home appliances may
Cons interfere on the
unregulated frequency
of 802. band

11b
IEEE 802.11 standards

IEEE802.11 b
IEEE802.11 a
IEEE 802.11 g
IEEE 802.11 n
IEEE 802.11 ac
IEEE 802.11 ad
IEEE802.11 a

Frequency = 5 GHz

Maximum Speed = 54
Mbps

Range = about 35
meters(Varies)

Encoding Scheme =
OFDM
IEEE802.11 a-
Orthogonal Frequency Division Multiplexing(OFDM
)

OFDM a digital multi-


carrier modulation method.Alarge number of
closely-spaced orthogonal sub-carriers are used
to carry data.

OFDM is popular for wideband


communications today by way of low-cost
digital signal
processing components
IEEE 802.11a Advantages
Ultra-high spectrum efficiency
•5 GHz band is 300 MHz (vs. 83.5 MHz @ 2.4 GHz)
•More data can travel over a smaller amount of
bandwidth
High speed
•Up to 54 Mbps

Less interference
•Fewer products using the frequency
• 2.4 GHz band shared by cordless phones, microwave
ovens, Bluetooth, and WLANs
IEEE 802.11a Disadvantages
Standards and Interoperability
• Standard not accepted worldwide
• Not compatible or interoperable with 802.11b
Legal issues
• License-free spectrum in 5 GHz band not available worldwide

Market
• There is limited interest for 5 GHz adoption

Cost
• 2.4 GHz will still has >40% cost advantage

Power consumption
• Higher data rates and increased signal require more power
• OFDM is less power-efficient than DSSS
IEEE 802.11a Applications
Building-to-building connections

Video, audio conferencing/streaming


video, and audio

Large file transfers, such as engineering


CAD drawings

Faster Web access and browsing


IEEE 802.11 standards

IEEE802.11 b
IEEE802.11 a
IEEE802.11 g
IEEE 802.11 n
IEEE 802.11 ac
IEEE 802.11 ad
IEEE 802.11 g
Frequency= 2.4 GHz

Maximum Speed = 54 Mbps

Range = about 38 meters(Varies)

Encoding Scheme = OFDM

Backward compatibility with 802.11 b devices


IEEE 802.11 g- Pros & Cons

Pros Cons

fast maximum costs more than


speed 802.11b

appliances may
signal range is
interfere on the
good and not unregulated
easily obstructed signal frequency
802.11g Advantages
Provides higher speeds and higher capacity requirements for
applicatio
ns

Leverages Worldwide spectrum availability in 2.4 GHz

Less costly than 5 GHz alternatives

Provides easy migration for current users of 802.11b WLANs


•Delivers backward support for existing 802.11b products

Provides path to even higher speeds in the future


IEEE 802.11 standards

IEEE802.11 b
IEEE802.11 a
IEEE802.11 g
IEEE802.11 n
IEEE 802.11 ac
IEEE 802.11 ad
IEEE 802.11 n

Frequency = 5 GHz,2.4 GHz


Modulation = OFDM

Addition of MIMO (Multiple Input Multiple Output)

Speed = 54 Mbit/s to 600


Mbit/s
Range = about 70

meters(Varies) Encoding

Scheme = OFDM
IEEE 802.11 n
Multiple Input Multiple Output(MIMO)
In radio, Multiple-input and
Multiple-output is used of
multiple antennas at both the
transmitter and receiver to improve
communicationperformance.
IEEE 802.11 n- Pros & Cons

Pros Cons
fastest maximum speed and
best signal range; standard is not yet finalized;

more resistant to signal


interference from costs more than 802.11g;
outside sources

the use of multiple


signals may greatly
interfere with nearby
802.11b/g based
networks.
IEEE 802.11 standards

IEEE802.11 b
IEEE802.11 a
IEEE802.11 g
IEEE802.11 n
IEEE802.11 ac
IEEE 802.11 ad

273
IEEE 802.11ac

Frequency = 5 GHz
Modulation = OFDM

Addition of MIMO (Multi User-Multiple Input Multiple Output)

Speed = 433.3 Mbit/s per spatial stream, 1.3 Gbit/s total


IEEE 802.11ac - Features
Extended channel binding

More MIMO spatial streams

Multiple STAs, each with one or more antennas, transmit or


receive independent data streams simultaneously

Modulation- 256-QAM

Beamforming with standardized sounding and feedback for


compatibility
between vendors
IEEE 802.11ac Applications

Highly interactive video gaming, video conferencing,

High definition video streaming and

Many more applications that need data at


rates that push the boundaries of exiting Wi-
Fi systems.
IEEE 802.11 standards

IEEE802.11 b
IEEE802.11 a
IEEE802.11 g
IEEE802.11 n
IEEE802.11 ac
IEEE802.11 ad
IEEE 802.11 ad

Frequency = 60GHz

Speed = 7Gbps

AntennaTechnology = Uses Beamforming

Modulation = OFDM
Comparison between Differen
t IEEE 802.11 Standards
Bluetooth Architecture
Two piconets can be connected to form a scatternet.
Bluetooth Architecture(2)

⚫ Piconet consist of a master node and up to seven active


slaves within a distance of 10 meters
⚫ In addition to seven active slave nodes , there can be up
to 255 parked nodes in the net
⚫ All communication is between master/slave. slave-
/slave communication is not possible
⚫ Multiple piconets can exist in the same room and can
even be connected via a bridge node.
⚫ Interconnected collection of piconets is called as
scatternet.
The Bluetooth Protocol Stack
The 802.15 version of the Bluetooth protocol architecture.
: Core System Protocols
:
⚫ Radio (RF) protocol : Specifies details of the air interface, the use of
frequency hopping, modulation scheme, and transmit power.

⚫ Baseband protocol : Concerned with connection establishment


within a Piconet, addressing, packet format, timing, and power
control.

⚫ Link Manager protocol (LMP) : Responsible for link setup between


Bluetooth devices and ongoing link management.

⚫ Logical link control and adaptation protocol (L2CAP)


L2CAP provides both connectionless and connection-oriented services.

⚫ Service discovery protocol (SDP) : Device information, services,


and the characteristics of the services can be queried to enable the
establishment of a connection between two or more Bluetooth
devices
: Additional Protocols
:
⚫ RF COMM : It provides connections to multiple devices by relying on
L2CAP to handle multiplexing over single connection

⚫ Wireless access protocol (WAP): It supports the limited display size


and resolution typically found on mobile devices by providing special
formats for Web pages

⚫ Object exchange protocol (OBEX): OBEX is a protocol designed to


allow a variety of devices to exchange data simply and spontaneously.

⚫ Telephony control protocol : Bluetooth's Telephony Control protocol


Specification (TCS) defines how telephone calls should be sent across a
Bluetooth link

⚫ Point-to-point protocol (PPP): The point-to-point protocol is an


Internet standard protocol for transporting IP datagram over a point-
to-point link
: Comparison between various Technologie
s:
: Applications of Bluetooth :

⚫ Wireless control of and communication between a mobile phone and a


hands free headset.This was one of the earliest applications to become
popular.
⚫ Wireless communication with pc input and output devices, the most
common being the mouse, keyboard and printer.
⚫ Transfer of files, contact details, calendar
appointments, and reminders
between devices with obex.
⚫ In 2004 released cars like toyota prius & lexus ls 430 have hands free
call system.
⚫ Sending small advertisements from bluetooth-enabled advertising
hoardings to
other, discoverable, bluetooth devices.
⚫ In game consoles like sony's playstation 3 and psp go, use
bluetooth for their respective wireless controllers.
Applications

•Dial-up internet access on personal computers or PDAs using a data-capable


mobile phone as a wireless modem.
•Personal security application on mobile phones for prevention of theft or loss of
items.
•In Real-time location systems (RTLS). Digital Pulse Oximetry System Toshiba
Washer & Dryer.
The Bluetooth Frame Structure
Atypical Bluetooth data frame.
Access Code
72 bits
Access Payload
Header
code

⚫Address of piconet master.

289
Packet Header
54 bits

Access Header Payload


code

Purpose
⚫ Addressing (3) Max 7 active slaves
⚫ Packet type (4) 16 packet types (some unused)
⚫ Flow control (1)
⚫ 1-bitARQ (1) Broadcast packets are not ACKed
⚫ Sequencing (1) For filtering retransmitted packets
⚫ HEC (8) Verify header integrity

290
WIMAX / IEEE 802.16
Wimax networks refer to broadband wireless networks that are
based on the IEEE 802.16 standard, which ensures compatibility
and interoperability between broadband wireless access
equipment .

The IEEE 802.16 standards define how wireless traffics move


between subscriber equipment and core networks.
WiMAX was designed for the transmission of multimedia
services (voice, Internet, email, games and others) at high data
rates.

Source: SHASHI JAKKU


WIMAX
 WiMAX uses radio microwave technology to provide wireless
internet service to computers and other devices that are equipped
with WiMAX compatible chips for example PDA’s, cell phones etc.
 It works more or less like cellular network technology.
 The theoretical range of WiMAX is up to 30 miles and achieves
data rates up to 75 Mbps
 WiMAX operates in similar manner as Wi-Fi but with two very
convincing differences as compared to Wi-Fi, these are :
o Data rate
o Data range
FEATURES
 Use microwave for the wireless transfer of data.
 Specifies a frequency band in the range between 2 GHz to 66 GHz.
 For high speed wireless networking.
 Basically, Wimax is a wireless internet service that is capable of
covering a wide geographical area by serving hundreds of users at a
very low cost.
 Uses OFDM ,good for multipath environments.
 It includes TDD and FDD duplexing support.
 Flexible channel sizes (3.5 MHz,5 MHz,10MHz)
 An easy and fast system to install.
 Leading to low installation cost, when compared to fiber ,cable or
DSL deployments.
802.16 STANDARDS HISTORY
IEEE 802.16 (2001)
•Original fixed wireless broadband air Interface for
802.16 10 – 66 GHz.
(Dec 2001) •Connection-oriented, TDM/TDMA MAC
•Targeted for Line-of-sight only
802.16c •Point-to-Multi-Point applications
(2002)

802.16a IEEE 802.16a (January 2003)


•Extension for 2-11 GHz
(Jan 2003) •Targeted for non-line-of-sight,
IEEE 802.16c (2002)
•Point-to-Multi-Point applications “LAST MILE”
Represents a 10 to 66 GHz
broadband access.
system profile that standardizes
more details of the technology.
802.16d IEEE 802.16d (Oct 2004)
(802.16-2004) • Combines both IEEE 802.16 and 802.16a
(Oct 2004) • Some modifications to the MAC and PHY

802.16e IEEE 802.16e (2005)


(802.16-2005) • MAC/PHY Enhancements to support subscribers
(Dec 2005) moving at vehicular speeds.
802.16 STANDARDS
IEEE 802.16 IEEE 802.16 IEEE 802.16e
a/802.16d
Completed Dec 2001 Oct 2004 Dec 2005

Spectrum 10 - 66 GHz 2 – 11 GHz 2 - 6GHz

Application Backhaul Wireless DSL and Mobile Internet


Backhaul
Channel Conditions Line of Sight Only Non-Line of Sight Non-Line of Sight

Bit Rate 32 – 134 Mbps Up to 75 Mbps Up to 15 Mbps

Modulation QPSK,16QAM and 6 OFDM ,QPSK,16QA


4QAM M, OFDMA
64QAM

Channel Bandwidths 20,25 and 28 MHz 1.5 and 20 MHZ Same as 802.16d
THE 802.16 PROTOCOL STACK
THE 802.16 PHYSICAL LAYER
Encoding/decoding of
signals
Preamble

generation/removal Bit

transmission/reception

converts frames into

signals Modulation
THE 802.16 MAC LAYER

provide an interface between the transport layers and


physical layer.

The MAC layer takes packets from the upper layer


and organizes them into MAC protocol data units
(MPDUs) .

The 802.16 MAC is designed for point-to-multipoint


(PMP) applications and is based on collision sense
multiple access with collision avoidance
(CSMA/CA).
THE WIMAX MAC
The WiMAX MAC comprises three sublayers

Convergence ATM, Ethernet,


sublayer Internet Protocol

MAC Common Packing,


part sublayer Fragmentation,
ARQ, QoS

Security Autentication,
sublayer Key Exchange,
Privacy (encrypt.)
802.16 Frame Structure

(a) A generic frame. (b) A bandwidth request frame.


THE 802.16 FRAME STRUCTURE
 HT(Header type): For generic frame,HT=0
 EC (Encryption control)
o 0 = Payload is not encrypted or payload is not included.
o 1 = Payload is encrypted.
 Type : This field identifies the frame type
,whether packing and fragmentation is present.
 CI (CRC indicator)
o 1 = CRC is included .
o 0 = No CRC is included.
 EKS (Encryption key sequence) : Which encryption key is used.
 Length: Complete length of the frame including header.
 Connection ID: Which connection this frame belongs to.
 Header CRC: Header check sequence. An 8-bit field used to detect errors in
the header.Header check-sum using 100000111.
 ESF(Extended subheader) ESF=0 ,absent:ESF=1.present
References
⚫ www.csie.cgu.edu.tw/~jhchen/course/CommSys/ch12.ppt
⚫ https://www.slideshare.net/kashyapshah11/bluetooth-10369
755
⚫ my.fit.edu/~vkepuska/ece4561/Chapter4-MediumAccessControlSublayer
.pptx
⚫ www.csie.cgu.edu.tw/~jhchen/course/WN/802.16Overview.
ppt
⚫ http://webhome.csc.uvic.ca/~wkui/Courses/networks/Notes.
html

You might also like