Unit 2 Class Notes
Unit 2 Class Notes
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.1
Learning Objectives
To introduce the design issues of data link
layer.
To discuss different error control methods
and flow control protocols
To discuss protocols of medium access
control sublayer
To discuss Ethernet and Wireless Lan’s s
To discuss Bluetooth
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.2
Position of the data-link layer
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.3
Data Link Layer Duties
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.4
LLC and MAC Sublayers
MAC sub layer is required if there is no dedicated link present then multiple
stations can access the channel simultaneously. Hence multiple access
protocols are required to decrease collision and avoid crosstalk.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.5
Topics
Error Detection and Correction
Data Link Control and Protocols
Multiple Access
Local Area Networks
Wireless LANs
Switching
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.6
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.7
Learning Objectives
To introduce the types of errors.
To discuss different error detection
methods.
To discuss parity check, CRC and
checksum.
To discuss different error detection
methods.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.8
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.9
Types of Error
Single-Bit Error
Burst Error
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.10
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.11
Single-Bit Error
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.12
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.13
Burst Error of Length 5
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.14
Detection
Redundancy
Parity Check
Checksum
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.15
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.16
Redundancy
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.17
Detection Methods
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.18
Even-Parity Concept
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.19
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.20
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.21
Cont ….
Let Sender sends data 10110, to make it even parity sender send the
data 10110 1
Thus, errors in more than one bit cannot be detected with single
parity bit.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.22
Two-Dimensional Parity
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.23
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.24
Cont ….
Let Sender sends data 11001100 and 10101100.
11001100 0
10101100 0
01100000 0
If first bit and second from last bits in each of them is changed,
making the data units as 01001110 and 00101110.
01001110 0
00101110 0
01100000 0
The receiver will accept this data
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.25
Cont ….
Note:
If two bits in one data unit are damaged and two bits
in exactly same position in another data unit are also
damaged, the 2-D Parity check checker will not detect
an error.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.26
Checksum
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.27
Cont ….
Note:
•All sections are added using one’s complement to get the sum.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.28
Cont ….
Note:
•All sections are added using one’s complement to get the sum.
•If the result is zero, the data are accepted: otherwise, rejected.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.29
Cont ….
Sender Receiver
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.30
Cont ….
Suppose the following block of 16 bits is to be sent using a
checksum of 8 bits.
10101001 00111001
The numbers are added using one’s complement
10101001
00111001
------------
Sum 11100010
Checksum 00011101
The pattern sent is 10101001 00111001 00011101
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.31
Cont ….
Now suppose the receiver receives the pattern sent and there is no
error.
10101001 00111001 00011101
When the receiver adds the three sections, it will get all 1s, which,
after complementing, is all 0s and shows that there is no error.
10101001
00111001
00011101
Sum 11111111
Complement 00000000 means that the pattern is
OK.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.32
Cont ….
Now suppose there is a burst error of length 5 that affects 4 bits.
10101111 11111001 00011101
When the receiver adds the three sections, it gets
10101111
11111001
00011101
Partial Sum 1 11000101
Carry 1
Sum 11000110
Complement 00111001 the pattern is corrupted.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.33
Cont ….
The checksum detects all errors on odd number of bits.
It detects most errors on even no of bits.
But, If one or more bits of a segment is damaged and the bits of
opposite value at same position in second segment is also
damaged, then the sum of the column is not changed, and
receiver will not detect the error.
Sender Receiver
11001100 10101100
10101100 11001100
Add 01111000 Add 01111000
Add carry 1 Add carry 1
Sum= 01111001 Sum= 01111001
Check sum 10000110 Check sum 10000110
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.34
CRC Generator and Checker
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.35
Binary Division in a CRC
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.36
Binary division in CRC checker
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.37
A polynomial
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.38
A Polynomial Representing a Divisor
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.39
A Polynomial Representing a Divisor
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.40
A Polynomial Representing a Divisor
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.41
CRC Performance
• CRC is a very effective error detection technique.
• If the divisor is chosen according to the previously
mentioned rules, its performance can be
summarized as follows:
CRC can detect all single-bit errors
CRC can detect all double-bit errors
CRC can detect any odd number of errors
CRC can detect all burst errors of less than the degree of
the polynomial.
CRC detects most of the larger burst errors with a high
probability.
For example, CRC-12 detects 99.97% of errors with a
length 12 or more.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.42
Error Correction
• The techniques that we have discussed so far can
detect errors, but do not correct them.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.43
Error Correction
• Error-correcting codes are more sophisticated than
error detecting codes and require more redundant
bits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.44
Error Correction: Signal Bit Error Correction
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.46
Positions of Redundancy Bits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.47
Positions of Redundancy Bits
• The number of redundant bits can be calculated
using the following formula:
2r >= m+r+1 Where m= data bit and r=redundant bit
https://www.geeksforgeeks.org/hamming-code-in-computer-network/
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.49
Positions of Parity Bits
• R2 bit is calculated using parity check at all the bits
positions whose binary representation includes a 1
in the second position from the least significant bit.
https://www.geeksforgeeks.org/hamming-code-in-computer-network/
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.50
Positions of Parity Bits
• R4 bit is calculated using parity check at all the bits
positions whose binary representation includes a 1
in the third position from the least significant bit. R4:
bits 4, 5, 6, 7
https://www.geeksforgeeks.org/hamming-code-in-computer-network/
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.51
Positions of Parity Bits
• R8 bit is calculated using parity check at all the bits
positions whose binary representation includes a 1
in the fourth position from the least significant bit.
R8: bit 8,9,10,11
https://www.geeksforgeeks.org/hamming-code-in-computer-network/
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.52
Redundancy Bits Calculation
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.53
Example of Redundancy
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.54
Error Detection using Hamming
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.55
Conclusion
• Errors can be single bit or burst errors
• Three common redundancy methods are
parity check, CRC and checksum
• Errors can be corrected by retransmission
• Hamming code is error correction through
retransmission
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.56
Topic
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.57
Learning Objectives
To introduce the protocols for error and
flow control.
To discuss Stop and wait, Go back N and
selective repear ARQ
To discuss concept of piggybacking and
pipelining
To discuss HDLC protocol and its various
frames
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.58
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.59
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.60
Cont ….
Error Control Techniques
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.61
Cont ….
Error
Control
Noiseless Noisy
Channel Channel
Stop and
Simplest Sliding Window ARQ
Wait
Selected
Go-Back-N
Repeat
ARQ
ARQ
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.62
Stop-and-Wait
• Sender:
• Send one data packet at a time.
• Send the next packet only after
receiving acknowledgement for the
previous.
• Receiver:
• Send acknowledgement after
receiving and consuming a data
packet.
• After consuming packet
acknowledgement need to be sent
(Flow Control)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.63
Stop-and-Wait: Problems
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.64
Stop-and-Wait: Problems
• Delayed Acknowledgement/Data:
After a timeout on the sender side, a long-delayed
acknowledgement might be wrongly considered as
acknowledgement of some other recent packet.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.65
Automatic Repeat Request
• Automatic Repeat Request
• The most common techniques for error correction
are based on some or all the following principles.
Error detection
Positive acknowledgement
Retransmission after time-out
Negative acknowledgement and retransmission
• Collectively these mechanisms are all referred to as
Automatic Repeat Request (ARQ)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.66
Stop-and-Wait ARQ
• Sender A sends a data frame or
packet with sequence number
0.
• Receiver B, after receiving the
data frame, sends an
acknowledgement with
sequence number 1 (the
sequence number of the next
expected data frame or packet)
• There is only a one-bit
sequence number that implies
that both sender and receiver
have a buffer for one frame or
packet only.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.67
Cont ….
In Stop-and-Wait ARQ, which is simplest among all protocols,
the sender (say station A) transmits a frame and then waits till it
receives positive acknowledgement (ACK) or negative
acknowledgement (NACK) from the receiver (say station B).
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.68
Stop-and-Wait ARQ, Lost ACK
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.69
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.70
Stop-and-Wait , Delayed ACK
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.71
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.72
Cont ….
• The Stop and Wait ARQ solves the main three problems
but may cause big performance issues as the sender
always waits for acknowledgement even if it has the
next packet ready to send.
• Stop and Wait ARQ may work fine where propagation
delay is very less for example LAN connections
• But, performs badly for distant connections like satellite
connections.
• Poor Bandwidth Utilization
• One Frame at a time
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.73
Piggy Backing
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.74
Cont ….
What is piggybacking? What is its advantage?
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.75
Cont ….
• Advantages of piggybacking :
Better use of available channel bandwidth. This happens
because an acknowledgment frame needs not to be sent
separately.
Usage cost reduction
Improves latency of data transfer
• Disadvantages of piggybacking :
The disadvantage of piggybacking is the additional
complexity.
If the data link layer waits long before transmitting the
acknowledgment (block the ACK for some time), the frame
will rebroadcast.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.76
Sliding Window ARQ
9 8 7 6 5 4 3 2 1 0
Sender Receiver
Window Size = 4
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.78
Sliding Window ARQ
9 8 7 6 5 4 3 2 1 0
Sender Receiver
Window Size = 4
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.79
Sliding Window ARQ
9 8 7 6 5 4 3 2 1 0
Sender Receiver
Sequence no-0
Sequence no-1
Sequence no-3
Sequence no-0
Sequence no-1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.80
Go-Back-N
• The most popular ARQ protocol is the go-back-N ARQ, where
the sender sends the frames continuously without waiting for
acknowledgement.
• That is why it is also called as continuous ARQ. As the receiver
receives the frames, it keeps on sending ACKs or a NACK, in
case a frame is incorrectly received.
• When the sender receives a NACK, it retransmits the frame in
error plus all the succeeding frames as shown in Fig..
• Hence, the name of the protocol is go-back-N ARQ. If a frame is
lost, the receiver sends NAK after receiving the next frame
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.81
Go-Back-N , Normal Operation
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.82
Go-Back-N , Lost Frame
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.83
Go-Back-N : Sender Window Size
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.85
Selective Repeat
• The selective-repetitive ARQ scheme retransmits only those for
which NAKs are received or for which timer has expired, this is
shown in the Fig
• This is the most efficient among the ARQ schemes, but the
sender must be more complex so that it can send out-of-order
frames.
• The receiver also must have storage space to store the post-NAK
frames and processing power to reinsert frames in proper
sequence.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.86
Selective Repeat
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.87
Selective Repeat , Lost Frame
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.88
Cont ….
Note:
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.89
Selective Repeat
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.90
Selective Repeat
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.91
TOPIC
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.92
Switching
• When there are many devices, it is necessary to develop
suitable mechanism for communication between any two
devices.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.93
Switching
• The end devices that wish to communicate with each other
are called stations. The switching devices are called nodes.
Some nodes connect to other nodes and some are to
connected to some stations.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.94
Circuit Switching
• Communication via circuit switching implies that there is a
dedicated communication path between the two stations.
• The path is a connected through a sequence of links
between network nodes.
• On each physical link, a logical channel is dedicated to the
connection.
• Circuit switching is commonly used technique in telephony,
where the caller sends a special message with the address
of the callee (i.e. by dialing a number) to state its
destination.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.95
Circuit Switching
It involved the following three distinct steps:
Data transfer:
Transfer data is from the source to the destination.
The data may be analog or digital, depending on the nature of the
network.
The connection is generally full-duplex.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.96
Circuit Switching
Circuit disconnect:
Terminate connection at the end of data transfer.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.97
Message Switching
• In this switching method, a different strategy is used, where
instead of establishing a dedicated physical line between the
sender and the receiver, the message is sent to the nearest
directly connected switching node.
• This node stores the message, checks for errors, selects the
best available route and forwards the message to the next
intermediate node.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.98
Message Switching
The line becomes free again for other messages, while the
process is being continued in some other nodes.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.99
Message Switching
Temporary storage of message reduces traffic congestion to
some extent.
Last of all, since the destination host need not be active when
the message is sent, message switching techniques
improve global communications.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.100
Message Switching
Each network node receives and stores the message
Determines the next leg of the route, and
Queues the message to go out on that link.
Advantages:
Line efficiency is greater (sharing of links).
Data rate conversion is possible.
Even under heavy traffic, packets are accepted, possibly with a
greater delay in delivery.
Message priorities can be used, to satisfy the requirements, if any.
Disadvantages:
Message of large size monopolizes the link and storage
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.101
Packet Switching
The basic approach is not much different from message
switching. It is also based on the same ‘store-and-
forward’ approach. However, to overcome the
limitations of message switching, messages are divided
into subsets of equal length called packets.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.102
Packet Switching
Main difference between Packet switching and Circuit
Switching is that the communication lines are not
dedicated to passing messages from the source to the
destination.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.103
Packet Switching
Main difference between Packet switching and Circuit
Switching is that the communication lines are not
dedicated to passing messages from the source to the
destination.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.104
Packet Switching
There are two basic approaches commonly used to
packet Switching: virtual-circuit packet switching and
datagram packet switching.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.105
Packet Switching
There are two basic approaches commonly used to
packet Switching: virtual-circuit packet switching and
datagram packet switching.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.106
Packet Switching
An initial setup phase is used to set up a route between
the intermediate nodes for all the packets passed during
the session between the two end nodes.
In each intermediate node, an entry is registered in a
table to indicate the route for the connection that has
been set up.
Thus, packets passed through this route, can have short
headers, containing only a virtual circuit identifier (VCI),
and not their destination.
Each intermediate node passes the packets according
to the information that was stored in it, in the setup
phase.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.107
Packet Switching
Datagram Packet Switching Networks
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.108
Packet Switching
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.109
Packet Switching
• Due to the nature of this method, the packets can reach the
destination in a different order than they were sent, thus
they must be sorted at the destination to form the original
message.
• This approach is time consuming since every router has to
decide where to send each packet.
• The main implementation of Datagram Switching network is
the Internet, which uses the IP network protocol.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.110
Packet Switching
Advantages :
Call setup phase is avoided (for transmission of a few packets,
datagram will be faster).
Because it is more primitive, it is more flexible.
Congestion/failed link can be avoided (more reliable).
Problems:
Packets may be delivered out of order.
If a node crashes momentarily, all of its queued packets are lost.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.111
Switching
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.112
Channel Allocation Problem
• Channel allocation is a process in which a single
channel is divided and allotted to multiple users in
order to carry user specific tasks.
• If there are N number of users and channel is
divided into N equal-sized sub channels, Each user
is assigned one portion.
• When multiple users use a shared network and
want to access the same network. Then channel
allocation problem in computer networks occurs.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.113
Channel Allocation Problem
• To allocate the same channel between multiple
users, different Channel Allocation Techniques are
used.
Static channel allocation
Dynamic Channel Allocation
Hybrid Channel Allocation
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.114
Static Channel Allocation
• It is the classical or traditional approach of
allocating a single channel
• Frequency Division Multiplexing (FDM) or Time
Division Multiplexing is used.
• If there are N users, the bandwidth is divided into N
equal sized portions.
• Each user is assigned one portion.
• No interface between users
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.115
Dynamic Channel Allocation
• The technique in which channels are not
permanently allocated to the users is called
dynamic channel allocation.
• The allocation depends upon the traffic.
• This technique optimizes bandwidth usage and
provides fast data transmission.
• There are two approaches
Centralized dynamic channel allocation
Distributed dynamic channel allocation
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.116
Assumptions in Dynamic Channel Allocation
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.119
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.
• The decision to send data depends on the state of the medium
(busy or idle).
• In random access method, each station has the right to the
medium without being controlled by any other station.
• However, if more than one station tries to send, there is an
access conflict- collision- and the frames will be either
destroyed and modified.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.120
Random Access
• Followings are the major concern to implement the
random access protocols
When can a station access the medium?
If the channel is busy, what will station do?
How can a station decide the success or failure of the
transmission?
What can be done if there is access conflict?
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.121
ALOHA Network
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.122
ALOHA Network
• The ALOHA scheme was invented by Abramson in
1970 for a packet radio network connecting remote
stations to a central computer and various data
terminals at the campus of the university of Hawaii.
• It was designed for a radio (Wireless LAN) , but it
can be used on any shared medium.
• Users are allowed random access of the central
computer through a common radio frequency band
f1 and the computer centre broadcasts all received
signals on a different frequency band f2.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.123
ALOHA network
Pure ALOHA
• The original ALOHA protocol is called pure ALOHA.
• The idea is that each station sends a frame whenever it
has a frame to send.
• However, since there is only one channel to share, there
is the possibility of collision between frames from different
stations.
• If one bit of a frame coexists on the channel with one bit
from another frame, there is collision, and both will be
destroyed.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.124
ALOHA Network
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.125
ALOHA Network
• The pure ALOHA protocol relies on acknowledgment from
the receiver.
• When a station sends a frame, it expects the receiver to
send an acknowledgement .
• If the acknowledgment does not arrive after a time-out
period, the station assumes that the frame has been
destroyed and resends the frame.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.126
ALOHA network
• A collision involves two or more stations.
If all these stations try to resend their frames
after the time-out, the frame will collide again.
Pure ALOHA dictates that when the time-out
period passes, each station waits a random
amount of time before resending its frame.
The randomness will help avoid more collisions.
We call this time the back-off time.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.127
Procedure for ALOHA protocol
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.128
ALOHA Network
Slotted ALOHA
In slotted ALOHA, we divide the time into slots and force the
station to send only at the beginning of the time slot.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.129
Pure Aloha Vs Slotted Aloha
Pure Aloha Slotted Aloha
In this aloha, any station can transmit In this, any station can transmit the
the data at any time. data at the beginning of any time slot.
In this, The time is continuous and not In this, The time is discrete and
globally synchronized. globally synchronized.
Vulnerable time for pure aloha = 2 x Tt Vulnerable time for Slotted aloha = Tt
In Pure Aloha, Probability of In Slotted Aloha, Probability of
successful transmission of data successful transmission of data
packet= G x e-2G , where G is number packet= G x e-G , where G is number
of stations wants to transmit in Tt slot of stations wants to transmit in Tt slot
In pure aloha, Maximum efficiency= In slotted aloha, Maximum efficiency=
18.4% 36.8%
Slotted aloha reduces the number of
Pure aloha doesn’t reduces the
collisions to half and doubles the
number of collisions to half.
efficiency of pure aloha.
https://www.geeksforgeeks.org/differences-between-pure-and-slotted-aloha/
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.130
CSMA
• CSMA: Carrier Sense Multiple Access
• The poor efficiency of the ALOHA scheme can be
attributed to the fact that a node start transmission
without paying any attention to what others are
doing.
• Carrier Sense multiple access requires that each
station first check the state of the medium before
sending.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.131
CSMA
• In this scheme, a node having data to transmit first
listens to the medium to check whether another
transmission is in progress or not.
• The node starts sending only when the channel is
free, that is there is no carrier.
• That is why the scheme is also known as listen-
before-talk.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.132
Collision in CSMA
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.133
Persistence strategies
• There are three variations of this basic scheme as outlined
below.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.134
Behavior of three persistant methods
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.135
Persistence strategies
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.136
Persistence Strategies
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.137
CSMA/CD
• The CSMA method does not specify the procedure
following a collision.
• Carrier sense multiple access with collision detection
(CSMA/CD) augments the algorithm to handle the collision.
• In this method, a station monitors the medium after it sends
a frame to see if the transmission was successful.
• If so, the station is finished..
• If, however, there is a collision, the frame is sent again.
• CSMA/CD does not use an 'acknowledgment' system. It
checks for successful and unsuccessful transmissions
through collision signals.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.138
CSMA/CD
• CSMA/CD protocol can be considered as a refinement over
the CSMA scheme.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.139
CSMA/CD
• This wastage of channel capacity can be reduced if the
nodes continue to monitor the channel while transmitting a
packet and immediately cease transmission when collision
is detected.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.140
CSMA/CD
On top of the CSMA, the following rules are added to convert
it into CSMA/CD:
(ii) After transmitting the jamming signal, the node waits for a
random amount of time and then transmission is resumed.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.141
CSMA/CD
• The random delay ensures that the nodes, which were
involved in the collision are not likely to have a collision at
the time of retransmissions.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.142
CSMA/CD
Collision of the first bit in CSMA/CD
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.143
CSMA/CD
Collision and abortion in CSMA/CD
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.144
CSMA/CD procedure
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.145
CSMA/CA procedure
• Carrier sense multiple access with collision avoidance
(CSMA/CA) is CSMA with procedures that avoid a collision.
• In CSMA/CA, the IFS ( interframe space) can also be used
to define the priority of a station or a frame.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.146
Timing in CSMA/CA
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.147
CSMA/CA procedure
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.148
Comparison
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.150
Collision Free Protocols
• Contention Free Protocols
Bit-Map Method
Binary Countdown
Token Passing
Adaptive tree walk method
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.151
Bit-Map Method
• Bit map protocol is collision free Protocol in bitmap
protocol method, each contention period consists of
exactly N slots.
• If node 0 has a frame to send, it transmit a 1 bit
during the first slot.
• No other node is allowed to transmit during this
period.
• Next node 1 gets a chance to transmit 1 bit if it has
something to send, regardless of what node 0 had
transmitted.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.152
Bit-Map Method
• In general node j may declare the fact that it has a
frame to send by inserting a 1 into slot j.
• Hence after all nodes have passed, each node has
complete knowledge of who wants to send a frame.
• Now, they begin transmitting in numerical order.
• Since everyone knows who is transmitting and
when, there could never be any collision.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.153
Bit-Map Method
https://www.geeksforgeeks.org/collision-free-protocols-in-computer-network/
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.154
Bit-Map Method
• Disadvantage:
• It is inefficiency during low load.
• If a node has to transmit and no other node needs
to do so, even then it has to wait for the bitmap to
finish.
• Hence the bitmap will be repeated over and over
again if very few nodes want to send wasting
valuable bandwidth.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.155
Token Passing
• The bit-map protocol is that it lets every station
transmit a frame in turn in a predefined order.
• The same thing can be accomplished through
passing a small message called a token from one
station to the next in the same predefined order.
• The token represents permission to send.
• A node can send the frame, once it receives the
token. After transmission, it passes the token to the
next node.
• If a node don’t have the frame to send, it simply
passes the token.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.156
Token Passing
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.157
Token Passing
• Note that we do not need a physical ring to
implement token passing.
• The channel connecting the stations might instead
be a single long bus.
• This protocol is called token bus.
• Even when demand is light, a station wishing to
transmit must wait for the token, increasing
latency.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.158
Binary Countdown
• All nodes are assigned with binary address.
• All addresses are assumed of the same length.
• A station wanting to use the channel broadcast its
address as binary bit string starting with the high
order bit.
• When any node sees the higher bit than itself, it
gives up.
• If two or more nodes have the same higher bit, then
next higher bit is sent.
• This process continues until any one of them wins.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.159
Binary Countdown
• .
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.160
Binary Countdown
• The problem with this protocol is that the nodes
with higher address always wins.
• Hence this creates a priority which is highly unfair
and hence undesirable.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.161
Limited Contention Protocols
• Collision based protocols (pure and slotted ALOHA,
CSMA/CD) are good when the network load is low.
• Collision free protocols (bitmap, binary Countdown) are
good when load is high.
• Limited contention protocol combines advantages of
two-
Behave like the ALOHA scheme under light load
Behave like the bitmap scheme under heavy load.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.162
Adaptive Tree Walk Protocol
• Initially all the nodes are allowed to try to acquire
the channel.
• If it is able to acquire the channel, it sends its
frame.
• If there is collision, then the nodes are divided into
two equal groups and only one of these groups
compete for slot 1.
• If one of its member acquires the channel, then the
next slot is reserved for the other group.
• if there is a collision then that group is again
subdivided, and the same process is followed.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.163
Adaptive Tree Walk Protocol
• Slot-0: C*, E*, F*, H* (all nodes
under node 0 can try which are
going to send), conflict
• Slot-1: C* (all nodes under node
1can try}, C sends
• Slot-2: E*, F*, H*(all nodes
under node 2 can try}, conflict
• Slot-3: E*, F* (all nodes under
node 5 can try to send), conflict
• Slot-4: E* (all nodes under E can
try), E sends
• Slot-5: F* (all nodes under F can
try), F sends
https://www.geeksforgeeks.org/collision-free-protocols- • Slot-6: H* (all nodes under node
in-computer-network/ 6 can try to send), H sends.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.164
Topic
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.165
Learning Objectives
To introduce the three generation of
ethernet
To describe the different stages in these
three generations
Traditional Ethernet
Fast Ethernet
Gigabit Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.166
Learning Objectives
• Ethernet is the most widely used LAN technology,
which is defined under IEEE standards 802.3.
• The reason behind its wide usability is Ethernet is
easy to understand, implement, maintain, and
allows low-cost network implementation.
• Ethernet operates in two layers of the OSI model,
Physical Layer, and Data Link Layer.
• In order to handle collision, the Access control
mechanism used in Ethernet is 1-persistent
CSMA/CD.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.167
Traditional Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.168
Three generations of Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.169
Physical layer
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.170
PLS
• The PLS ( Physical Layer Signaling) encodes and
decodes the data.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.171
AUI
• The attachment unit interface is a specification that
defines interface between PLS and MAU.
• This is designed to provide the facility to connect
the PLS to different MAU. This makes PLS to be
medium independent.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.172
MAU (transceiver)
• Medium Attachment Unit (MAU) is medium
dependent.
• It creates the appropriate signal for each particular
medium.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.173
Ethernet MAC Sublayer Protocol
• Preamble :
Ethernet frame starts with 7-Bytes Preamble.
It indicates the receiver that frame is coming and allow the receiver to
lock onto the data stream before the actual frame begins.
• Start of frame delimiter (SFD):
This is a 1-Byte field which is always set to 10101011.
SFD indicates that upcoming bits are starting of the frame, which is
the destination address.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.174
Ethernet MAC Sublayer Protocol
• Source Address :
This is a 6-Byte field which contains the MAC address of source
machine.
As Source Address is always an individual address (Unicast), the least
significant bit of first byte is always 0.
• Length:
Length is a 2-Byte field, which indicates the length of entire Ethernet
frame. This 16-bit field can hold the length value between 0 to 65534,
but length cannot be larger than 1500 because of some own limitations
of Ethernet.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.175
Ethernet MAC Sublayer Protocol
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.176
Ethernet MAC Sublayer Protocol
• Data:
This is the place where actual data is inserted, also known as Payload.
Both IP header and data will be inserted here if Internet Protocol is
used over Ethernet.
The maximum data present may be as long as 1500 Bytes.
In case data length is less than minimum length i.e. 46 bytes, then
padding 0’s is added to meet the minimum possible length.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.177
Ethernet MAC Sublayer Protocol
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.178
Minimum and maximum length
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.179
Categories of traditional Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.180
Categories of traditional Ethernet
• Ethernet cables likewise are manufactured to any of
several standard specifications.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.181
10Base5 : Thick Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.182
10Base2:Thin Ethernet or Cheapernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.184
10Base-FL: Fiber Link Ethernet
• Uses the star topology to connect stations to hub.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.185
Bridged Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.186
Bridged Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.187
Switched Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.188
Switched Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.189
Full-duplex switched Ethernet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.190
Fast Ethernet
• In the mid-1990s, Fast Ethernet technology matured and
met its design goals of
• increasing the performance of traditional Ethernet while
avoiding the need to completely re-cable existing
Ethernet networks.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.191
Gigabit Ethernet
• Whereas Fast Ethernet improved traditional Ethernet from
10 Megabit to 100 Megabit speed,
• Gigabit Ethernet boasts the same order-of-magnitude
improvement over Fast Ethernet by offering speeds of
1000 Megabits (1 Gigabit).
• Gigabit Ethernet was first made to travel over optical and
copper cabling, but the 1000Base-T standard successfully
supports it as well.
• 1000Base-T uses Category 5 cabling similar to 100 Mbps
Ethernet, although achieving gigabit speed requires the
use of additional wire pairs.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.192
Topic
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.193
IEEE 802.11
Architecture
Physical Layer
MAC Layer
Addressing Mechanism
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.194
Wireless LANs
Some of the advantages are mentioned below :
• Availability of low-cost portable equipment: Due to the
technology enhancements, the equipment cost that are
required for WLAN set-up have reduced a lot.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.196
Wireless LANs
Reduced cost of ownership: While the initial cost of wireless
LAN can be higher than the cost of wired LAN hardware, it is
envisaged that the overall installation expenses and life cycle costs
can be significantly lower. Long-term cost-benefits are greater in
dynamic environment requiring frequent moves and changes.
Scalability: Wireless LAN can be configured in a variety of
topologies to meet the users need and can be easily scaled to cover
a large area with thousands of users roaming within it.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.197
IEEE 802.11 Architecture
IEEE has defined the specifications for a Wireless LAN,
called IEEE 802.11, which covers the physical and data link
layers.
The standard defines two kinds of services :
•BSS (Basic Service Set)
•ESS (Extended Service Set)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.198
BSSs
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.199
IEEE 802.11 Architecture
BSS
• IEEE 802.11defines the BSS as the building block of a
wireless LAN.
• A basic service set is made of stationary or mobile wireless
stations and an optional central base station, known as the
access point (AP).
• BSS without an AP is stand alone network and can not send
data to other BSSs.
• It is called an ad-hoc network architecture.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.200
IEEE 802.11 Architecture
• In this architecture, stations can form a network without the
need of an AP.
• They can locate one another and agree to be part of a BSS.
• A BSS with an AP is sometimes referred to as an
infrastructure network.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.201
ESS
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.202
IEEE 802.11 Architecture
ESS
• An ESS is made up of two or more BSSs with APs.
• In this case, the BSSs are connected through a
distribution system, which is usually a wired LAN.
• The distribution system connects the APs in the BSSs.
• IEEE 802.11 des not restrict the distribution system; it
can be any IEEE LAN such as Ethernet.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.203
IEEE 802.11 Architecture
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.204
ESS
• When BSSs are connected, the stations within reach of one
another can communicate without the use of an AP.
• However, communication between two stations in two
different BSSs usually occurs via two APs.
• The idea is similar to communication in a cellular network if
we consider each BSS to be cell.
• Each AP to be a base station.
• Note that a mobile station can belong to more than one BSS
at the same time.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.205
Station Types
IEEE 802.11, defines three types of satations based on their
mobility in a wireless Lan
•No-transition – A station with no-transition mobility is either
stationary or moving only inside a BSS
•BSS-transition – A station with BSS-transition mobility can
move from one BSS to another, but the movement is confined
inside one ESS.
•ESS-transition – A station with ESS-transition mobility can
move from one ESS to another.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.206
MAC layers in IEEE 802.11 standard
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.207
Physical Layer Specifications
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.208
FHSS
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.209
DSSS
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.211
DSSS
Data
Spreading code
Pseudo Number
Transmitted
Signal
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.212
OFDM
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.215
HR-DSSS
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.217
MAC layers in IEEE 802.11 standard
Contention Normal
Restricted to Free Delivery Delivery
Infrastructure
Network
PCF
DCF
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.218
MAC layers in IEEE 802.11 standard
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.219
MAC layers in IEEE 802.11 standard
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.220
MAC layers in IEEE 802.11 standard
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.221
PCF
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.222
CSMA/CA flowchart
DIFS: Distributed Inter Frame Space
SIFS: Short Inter Frame Space
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.223
CSMA/CA Process
1. Before sending a frame, the source station senses the
medium by checking the energy level at the carrier
frequency.
a. The channel use a persistence strategy with back-off
until the channel is idle.
b. After the station is found to be idle, the station waits
for a period of time called distribution interframe
space (DIFS); then the station sends a control frame
called the request to send (RTS).
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.224
CSMA/CA Process
2. After receiving the RTS and waiting a period of time
called the short interframe space (SIFS) , the destination
sends a control frame, called the clear to send (CTS), to
the source station. This control frame indicates that the
destination station is ready to receive data.
3. The source station sends data after waiting an amount of
time equal to SIFS.
4. The destination station, after waiting an amount of time
equal to SIFS, sends an ACK to show that the frame has
been received.
5. ACK is needed in this protocol because the station does
not have any means to check for the successful arrival of
its data at the destination.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.225
CSMA/CA Process
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.226
NAV
• When a station send a RTS frame, it includes the duration of
time that it needs to occupy the channel.
• The stations that are affected by this transmission create a
time called a network allocation vector (NAV) that shows how
much time must pass before these stations are allowed to
check the channel for idleness.
• Each time a station accesses the system and sends an RTS
frame, other stations start their NAV.
• In other words, each station, before sensing the physical
medium to see if it is idle, first checks its NAV to see if it has
expired.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.227
CSMA/CA and NAV
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.228
Frame Format
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.229
Frame format
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.230
Subfields in FC field
Field Explanation
Rsvd Reserved.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.231
Control Frames
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.232
Cont ….
Subtype Meaning
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.233
Cont ….
Destination Source
0 0 BSS ID N/A
station station
Architecture
Radio Layer
Baseband Layer
L2CAP Layer
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.238
Bluetooth
There are two types of topology for Bluetooth
– Piconet
– Scatternet.
The Piconet is a small ad hoc network of devices (normally 8
stations) as shown in Fig. It has the following features:
• One is called Master and the others are called Slaves
• All slave stations synchronizes their clocks with the
master
• Possible communication - One-to-one or one-to-many
• Each piconet has a unique hopping pattern/ID
• Each master can connect to 7 simultaneous or 200+
inactive (parked) slaves per piconet.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.239
Piconet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.240
Scatternet
• By making one slave as master of another Piconet,
Scatternet is formed by combining several
Piconets. Key features of the scatternet topology
are mentioned below:
A Scatternet is the linking of multiple co-located piconets
through the sharing of common master or slave devices.
A device can be both a master and a slave.
Radios are symmetric (same radio can be master or
slave).
High capacity system, each piconet has maximum
capacity (720 Kbps)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.241
Scatternet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.242
Bluetooth Layers
Implemented on the Bluetooth device that hosts the chip
HCI: Host
Controller
Interface
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.243
Bluetooth Layers: Radio
• The Radio layer defines the requirements for a
Bluetooth transceiver operating in the 2.4 GHz ISM
band.
• Bluetooth devices are low-power and have a range
of 10 m.
• Bluetooth uses the frequency-hopping spread
spectrum (FHSS) method.
• To transform bits to a signal, Bluetooth uses a
sophisticated version of FSK, called GFSK (FSK
with Gaussian bandwidth filtering).
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.244
Bluetooth Layers: Radio
• GFSK has a carrier frequency.
• Bit 1 is represented by a frequency deviation above
the carrier;
• Bit 0 is represented by a frequency deviation below
the carrier.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.245
Bluetooth Layers: Baseband
• The baseband layer is roughly equivalent to the
MAC sublayer in LANs.
• The primary and secondary stations communicate
with each other using time slots.
• The access method is TDD-TDMA (time-division
duplex TDMA).
TDD-TDMA is a kind of half-duplex communication in
which the sender and receiver send and receive data, but
not at the same time.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.246
Bluetooth Layers: Baseband
• There can be two type of communication in
Bluetooth.
Single-Secondary Communication
If the piconet has only one secondary (Slave)
Multiple-Secondary Communication
if there is more than one secondary in the piconet
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.247
Bluetooth Layers: Baseband
• Single-Secondary Communication: If the piconet
has only one secondary, the TDMA operation is
very simple.
• The primary uses even-numbered slots (0,2,4, . .);
the secondary uses odd-numbered slots (1,3,5, . .).
• In slot 0, the primary sends, and the secondary
receives;
• In slot 1, the secondary sends and the primary
receives. The cycle is repeated.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.248
Bluetooth Layers: Baseband
259 μs is needed for hopping and control mechanisms. This means that a
one-slot frame can last only 625 − 259, or 366 μs.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.249
Bluetooth Layers: Baseband
• Multiple-Secondary Communication : if there is
more than one secondary in the piconet.
The primary (Master) uses the even-numbered slots
A Secondary (Slave) sends in the next odd-numbered
slot, if the packet in the previous slot was addressed to it.
All secondaries listen on even-numbered slots, but only
one secondary sends in any odd-numbered slot
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.250
Bluetooth Layers: Baseband
• In slot 0, the primary sends a
frame to secondary 1.
• In slot 1, only secondary 1
sends a frame to the primary
because the previous frame
was addressed to secondary 1;
other secondaries are silent.
• In slot 2, the primary sends a
frame to secondary 2.
• In slot 3, only secondary 2
sends a frame to the primary
because the previous frame
was addressed to secondary 2;
other secondaries are silent.
Multiple Secondary Communication • The cycle continues.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.251
Bluetooth Layers: Baseband
• There are two types of Links can be created
between a primary and a secondary.
Synchronous Connection-oriented (SCO) Link
Used when avoiding latency (delay in data delivery) is more
important than integrity (error-free delivery).
In an SCO link, a physical link is created between the
primary and a secondary by reserving specific slots at
regular intervals.
If a packet is damaged, it is never retransmitted.
SCO is used for real-time audio where avoiding delay is all-
important.
Data Rate: 64 kbps
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.252
Bluetooth Layers: Baseband
• There are two types of Links can be created
between a primary and a secondary.
Asynchronous Connectionless Link (ACL)
Used when data integrity is more important than avoiding
latency.
if a payload encapsulated in the frame is corrupted, it is
retransmitted.
Data rate: 721 kbps
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.253
Bluetooth Layers: Baseband
• Frame Format
One-slot, Three-slot, Or Five Slot Frames.
One Slot:
In one-slot frame exchange, 259 μs is needed for hopping and
control mechanisms. This means that a one-slot frame can last
only 625 − 259, or 366 μs.
Three Slot:
A three-slot frame occupies three slots.
Only one hop number is used, three hop numbers are
consumed.
Since 259 μs is used for hopping, the length of the frame is 3 ×
625 − 259 = 1616 μs or 1616 bits.
Five Slot: Only one hop number is used, five numbers are
consumed. Length of the frame is 5 × 625 − 259 = 2866 bits
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.254
Bluetooth Layers: Baseband
• Frame Format (Three Slot)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.255
Bluetooth Layers: Baseband
Access Contains synchronization bits and the identifier of the primary to
code distinguish the frame of one piconet from that of another.
This 54-bit field is a repeated 18-bit pattern
Address The 3-bit address subfield can define up to seven
secondaries
Type. Identifies the frame type (ACL, SCO, poll, or null), the
type of error correction used in the data field, and how
many slots long the frame is.
Header F When set (1), it indicates that thedevice is unable to
receive more frames
A 1-bit subfield is for acknowledgment. Bluetooth uses
Stop-and-Wait ARQ
S This 1-bit subfield holds a sequence numbering
HEC The 8-bit header error correction subfield is a checksum
to detect errors
Payload This subfield can be 0 to 2740 bits long. It contains data or control
information coming from the upper layers.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.256
Bluetooth Layers: L2CAP
• Link Manager:
The link manager handles the establishment of logical
channels between devices, including power
management, pairing and encryption.
Link Manager Protocol is used to take care of all services
for Link manager.
It lies below the host controller interface.
• Host Controller Interface (HCI) :
HCI provides a command interface for the controller and
the link manager.
It discovers the other Bluetooth devices that are within
the coverage radius.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.257
Bluetooth Layers: L2CAP
• The Logical Link Control and Adaptation Protocol,
or L2CAP (L2 here means LL), is roughly
equivalent to the LLC sublayer in LANs.
• It is used for data exchange on an ACL link;
• SCO channels do not use L2CAP.
• L2CAP provides following services
Multiplexing
At the sender site, it accepts data from one of the upper-
layer protocols, frames them, and delivers them to the
baseband layer.
At the receiver site, it accepts a frame from the baseband
layer, extracts the data, and delivers them to the
appropriate protocol layer.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.258
Bluetooth Layers: L2CAP
Segmentation and Reassembly
The L2CAP divides these large packets into segments and
adds extra information to define the location of the
segments in the original packet.
The L2CAP segments the packets at the source and
reassembles them at the destination.
QoS (Quality-of-Service)
Bluetooth allows the stations to define a quality-of-service
level.
Bluetooth defaults to what is called best-effort service; it will
do its best under the circumstances.
Group Management
L2CAP is to allow devices to create a type of logical
addressing between themselves like multicasting.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.259
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.260
WiFi
• Wi-Fi is based on the IEEE 802.11 family of
standards, which are commonly used for local area
networking of devices and Internet access.
• The different versions of Wi-Fi are specified by
various IEEE 802.11 protocol standards
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.261
WiFi
Maximum Radio
IEEE
Generation Linkrate Adopted Frequency Modulation
Standard
(Mbit/s) (GHz)
Wi-Fi 6E 802.11ax 600 to 9608 2020 6 MIMO-OFDM
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.263
WiFi: 5 GHz
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.265
WiFi: Common Terms
• SSID (Service Set Identifier): Name of your wireless
network, also known as Network ID.
• SSIDs can be up to 32
alphanumeric characters long.
• They are also case-sensitive.
• The SSID can be changed in the software
configuration pages for your wireless modem
• Users can assign more than one SSID to an
access point.
• Using multiple SSIDs allows users to access
different networks, each with different policies
and functions.
• The two networks might use the same physical
infrastructure, but they would have two
different SSIDs
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.266
WiFi: Hotspot
• Hotspot: A hotspot is a physical location where
people can access the Internet, typically using Wi-
Fi.
• Mobile hotspot: A mobile hotspot (sometimes called
a portable hotspot) is a hotspot that’s just that—
mobile.
• Tethering:
Sharing of a mobile device's Internet connection with
other connected computers.
Connection of a mobile device with other devices can be
done over wireless LAN (Wi-Fi), over Bluetooth or by
physical connection using a cable, for example USB.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.267
WiFi: Hotspot
• Access point (wireless access point): A wireless
access point (WAP) is a networking device that
allows a Wi-Fi compliant device to connect to a
wired network.
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.268
Conclusion
• Medium Access control can be random
access, controlled or channelised.
• In CSMA station must listen to the
medium first
• CSMA/CD is CSMA with post collision
procedure
• CSMA/CA is CSMA with procedure that
avoids collision
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.269
Summary
• Medium Access control can be random
acess, controlled or channelised.
• In CSMA station must listen to the
medium first
• CSMA/CD is CSMA with post collision
procedure
• CSMA/CA is CSMA with procedure that
avoids collision
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.270
Review Questions (OBJ)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.271
Review Questions (OBJ)
9. In
Selective Repeat ARQ, if 5 is the number of bits for the
sequence number, then the maximum size of the send window
must be _____
A) 15
B) 16
C) 31
D) 1
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.275
Review Questions (Short)
1. What is advantage of controlled access over random
access?
2. How do two persistence strategies differ?
3. What is purpose of Jam signal in CSMA/CD?
4. Why is token passing a controlled access procedure?
5. Compare and contrast Go Back N and Selective repeat
6. Define piggybacking and its usefulness
7. What is access method used in wireless lans?
8. Find the checksum of the following bi sequence. Assume 8-
bit segment size
10010011 10010011 1001100 01001101
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.276
Review Questions (Short)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.277
Review Questions (Long)
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.278
Recommended reading
© Bharati Vidyapeeth’s Institute of Computer Applications and Management, New Delhi-63 by Dr. Arpita U1.279