Computer Networks_Unit III
Computer Networks_Unit III
Elementary Data Link Protocols - Sliding Window Protocols - Data Link Layer
in the Internet - Medium Access Layer - Channel Allocation Problem - Multiple Access
Protocols - Bluetooth
The protocols are normally implemented in software by using one of the common
programming languages.
1. Simplex Protocol
It is very simple. The sender sends a sequence of frames without even thinking about
the receiver. Data are transmitted in one direction only. Both sender & receiver always ready.
Processing time can be ignored. Infinite buffer space is available. And best of all, the
communication channel between the data link layers never damages or loses frames. This
thoroughly unrealistic protocol, which we will nickname ‘‘Utopia,’’. The utopia protocol is
unrealistic because it does not handle either flow control or error correction.
1
Figure 3.2: Simplex Protocol
2. Stop-and-wait Protocol
The sender sends one frame and waits for feedback from the receiver. When the ACK
arrives, the sender sends the next frame. It is Stop-and-Wait Protocol because the sender
sends one frame, stops until it receives confirmation from the receiver (okay to go ahead),
and then sends the next frame. It have unidirectional communication for data frames, but
auxiliary ACK frames (simple tokens of acknowledgment) travel from the other direction. It
add flow control to our previous protocol.
2
To detect and correct corrupted frames, we need to add redundancy bits to our data
frame. When the frame arrives at the receiver site, it is checked and if it is corrupted, it is
silently discarded. The detection of errors in this protocol is manifested by the silence of the
receiver. Lost frames are more difficult to handle than corrupted ones. In the previous
protocols, there was no way to identify a frame. The received frame could be the correct one,
or a duplicate, or a frame out of order. The solution is to number the frames. When the
receiver receives a data frame that is out of order, this means that frames were either lost or
duplicated.
The lost frames need to be resent in this protocol. If the receiver does not respond
when there is an error, how can the sender know which frame to resend? To remedy this
problem, the sender keeps a copy of the sent frame. At the same time, it starts a timer. If the
timer expires and there is no ACK for the sent frame, the frame is resent, the copy is held,
and the timer is restarted. Since the protocol uses the stop-and-wait mechanism, there is only
one specific frame that needs an ACK. Error correction in Stop-and-Wait ARQ is done by
keeping a copy of the sent frame and retransmitting of the frame when the timer expires.
If the system data frames are 1000 bits in length, what is the utilization percentage of
the link?
For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-
Wait ARQ wastes the capacity of the link.
3
Figure 3.4: Stop-and-Wait Automatic Repeat Request
To improve the efficiency of transmission (filling the pipe), multiple frames must be
in transition while waiting for acknowledgment. In other words, we need to let more than one
frame be outstanding to keep the channel busy while the sender is waiting for
acknowledgment. The first is called Go-Back-N Automatic Repeat.
4
Figure 3.5: Go-Back-N Automatic Repeat Request
Sender window
The sender window at any time divides the possible sequence numbers into four
regions.
The first region, from the far left to the left wall of the window, defines the sequence
numbers belonging to frames that are already acknowledged. The sender does not
worry about these frames and keeps no copies of them.
The second region, colored in Figure (a), defines the range of sequence numbers
belonging to the frames that are sent and have an unknown status. The sender needs to
wait to find out if these frames have been received or were lost. We call these
outstanding frames.
The third range, white in the figure, defines the range of sequence numbers for frames
that can be sent; however, the corresponding data packets have not yet been received
from the network layer.
Finally, the fourth region defines sequence numbers that cannot be used until the
window slides The send window is an abstract concept defining an imaginary box of
size 2m − 1 with three variables: Sf, Sn, and S size.
The variable Sf defines the sequence number of the first (oldest) outstanding frame.
The variable Sn holds the sequence number that will be assigned to the next frame to
be sent. Finally, the variable S size defines the size of the window.
Figure (b) shows how a send window can slide one or more slots to the right when an
acknowledgment arrives from the other end.
The acknowledgments in this protocol are cumulative, meaning that more than one
frame can be acknowledged by an ACK frame.
5
In Figure, frames 0, I, and 2 are acknowledged, so the window has slide to the right
three slots. Note that the value of Sf is 3 because frame 3 is now the first outstanding
frame.
The send window can slide one or more slots when a valid acknowledgment arrives.
The sequence numbers to the left of the window belong to the frames already received
and acknowledged; the sequence numbers to the right of this window define the
frames that cannot be received.
Any received frame with a sequence number in these two regions is discarded.
Only a frame with a sequence number matching the value of Rn is accepted and
acknowledged.
The receive window also slides, but only one slot at a time.
When a correct frame is received (and a frame is received only one at a time), the
window slides.( see below figure for receiving window)
The receive window is an abstract concept defining an imaginary box of size 1 with
one single variable Rn.
The window slides when a correct frame has arrived; sliding occurs one slot at a time
Timers
• Although there can be a timer for each frame that is sent, in our protocol we use only
one. The reason is that the timer for the first outstanding frame always expires first;
we send all outstanding frames when this timer expires.
6
Acknowledgment
The receiver sends a positive acknowledgment if a frame has arrived safe and sound
and in order. If a frame is damaged or is received out of order, the receiver is silent
and will discard all subsequent frames until it receives the one it is expecting.
The silence of the receiver causes the timer of the unacknowledged frame at the
sender side to expire. This, in turn, causes the sender to go back and resend all frames,
beginning with the one with the expired timer. The receiver does not have to
acknowledge each frame received. It can send one cumulative acknowledgment for
several frames.
Resending a Frame
When the timer expires, the sender resends all outstanding frames. For example,
suppose the sender has already sent frame 6, but the timer for frame 3 expires.
This means that frame 3 has not been acknowledged; the sender goes back and sends
frames 3,4,5, and 6 again. That is why the protocol is called Go-Back-N ARQ. Below
figure is an example(if ack lost ) of a case where the forward channel is reliable, but
the reverse is not. No data frames are lost, but some ACKs are delayed and one is lost.
The example also shows how cumulative acknowledgments can help if
acknowledgments are delayed or lost
Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the
send window is 1.
7
Figure 3.8: Resending a Frame
In Go-Back-N ARQ, The receiver keeps track of only one variable, and there is no
need to buffer out-of- order frames; they are simply discarded. However, this protocol is very
inefficient for a noisy link. In a noisy link a frame has a higher probability of damage, which
means the resending of multiple frames. This resending uses up the bandwidth and slows
down the transmission. For noisy links, there is another mechanism that does not resend N
frames when just one frame is damaged; only the damaged frame is resent. This mechanism
is called Selective Repeat ARQ. It is more efficient for noisy links, but the processing at the
receiver is more complex.
Sender Window
8
Figure 3.9: Sender Window
Receiver window
The receiver window in Selective Repeat is totally different from the one in Go Back-
N. First, the size of the receive window is the same as the size of the send window
(2m-1).
The Selective Repeat Protocol allows as many frames as the size of the receiver
window to arrive out of order and be kept until there is a set of in order frames to be
delivered to the network layer. Because the sizes of the send window and receive
window are the same, all the frames in the send frame can arrive out of order and be
stored until they can be delivered.
However the receiver never delivers packets out of order to the network layer.
Above Figure shows the receive window. Those slots inside the window that are
colored define frames that have arrived out of order and are waiting for their
neighbors to arrive before delivery to the network layer.
In Selective Repeat ARQ, the size of the sender and receiver window must be at most
one-half of 2m
9
Flow Diagram
Piggybacking
10
In any broadcast network, the key issue is how to determine who gets to use the
channel when there is competition for it.
To make this point clearer, consider a conference call in which six people, on six
different telephones, are all connected so that each one can hear and talk to all the
others. It is very likely that when one of them stops speaking, two or more will start
talking at once, leading to chaos. When only a single channel is available, determining
who should go next is much harder.
The protocols used to determine who goes next on a multi-access channel belong to a
sub-layer of the data link layer called the MAC (Medium Access Control) sub-layer.
The data link protocols found on point-to-point lines in the Internet in two common
situations. The first situation is when packets are sent over SONET optical fiber links in
wide-area networks. These links are widely used, for example, to connect routers in the
different locations of an ISP’s network. The second situation is for ADSL links running on
the local loop of the telephone network at the edge of the Internet. These links connect
millions of individuals and businesses to the Internet.
The Internet needs point-to-point links for these uses, as well as dial-up modems,
leased lines, and cable modems, and so on. A standard protocol called PPP(Point-to-Point
Protocol) is used to send packets over these links. PPP is defined in RFC 1661 and further
elaborated in RFC 1662 and other RFCs (Simpson, 1994a, 1994b). SONET and ADSL links
both apply PPP, but in different ways.
SONET, which we covered in Sec. 2.6.4, is the physical layer protocol that is most
commonly used over the wide-area optical fiber links that make up the backbone of
communications networks, including the telephone system. It provides a bit stream that runs
at a well-defined rate, for example 2.4 Gbps for an OC-48 link.This bit stream is organized as
fixed-size byte payloads that recur every 125 μsec,whether or not there is user data to send.
To carry packets across these links, some framing mechanism is needed to distinguish
occasional packets from the continuous bitstream in which they are transported. PPP runs on
IP routers to provide this mechanism, as shown in Fig. 3-23.
11
3.4 MEDIUM ACCESS CONTROL SUBLAYER
The central theme is how to allocate a single broadcast channel among competing
users. There are 2 types of Channel allocation.
The traditional way of allocating a single channel, eg. a telephone line, among
multiple competing users is Frequency Division Multiplexing (FDM).
If there are N users, the bandwidth is divided into N equal-sized portions, each user
being assigned one portion. Since each user has a private frequency band, there is no
interference between users. When there are only a small and constant number of
users, each of which has a heavy load of traffic, FDM is a simple and efficient
allocation mechanism.
When the number of senders is large and continuously varying or the traffic is bursty,
FDM presents some problems.
If the spectrum is cut up into N regions and fewer than N users are currently interested
in communicating, a large piece of valuable spectrum will be wasted. If more than N
users want to communicate, some of them will be denied permission for lack of
bandwidth, even if some of the users who have been assigned a frequency band hardly
ever transmit or receive anything.
Even assuming that the number of users could somehow be held constant at N,
dividing the single available channel into static sub-channels is inherently inefficient.
The basic problem is that when some users are quiescent, their bandwidth is simply
lost. They are not using it, and no one else is allowed to use it either.
The poor performance of static FDM can easily be seen from a simple queuing theory
calculation.
Let us start with the mean time delay, T, for a channel of capacity C bps, with an
arrival rate of F frames/sec, each frame having a length drawn from an exponential
probability density function with mean 1/μ bits/frame.
With these parameters the arrival rate is F frames/sec and the service rate is μC
frames/sec. From queuing theory it can be shown that for Poisson arrival and service
times.
T=1/(μC-F) ------------------(i)
12
For example, if C is 100 Mbps, the mean frame length, 1/μ, is 10,000 bits, and the
frame arrival rate, F, is 5000 frames/sec, then T = 200 μsec.
Note that if we ignored the queuing delay and just asked how long it takes to send a
10,000 bit frame on a 100-Mbps network, we would get the (incorrect) answer of 100
μsec.
That result only holds when there is no contention for the channel.
Now let us divide the single channel into N independent sub-channels, each with
capacity C/N bps. The mean input rate on each of the sub-channels will now be F/N.
Re-computing T we get, Equation (ii)
TFDM = 1/(μ(C/N) – (F/N) = N/(μC-F) =NT ---------------------(ii)
The mean delay using FDM is N times worse than if all the frames were somehow
magically arranged orderly in a big central queue.
Precisely the same arguments that apply to FDM also apply to time division
multiplexing (TDM). Each user is statically allocated every Nth time slot.
If a user does not use the allocated slot, it just lies fallow. The same holds if we split
up the networks physically. Using our previous example again, if we were to replace
the 100-Mbps networks with 10 networks of 10 Mbps each and statically allocate
each user to one of them, the mean delay would jump from 200 μsec to 2 msec
1. Independent Traffic.
The model consists of N independent stations (e.g., computers, telephones), each with
a program or user that generates frames for transmission.
The expected number of frames generated in an interval of length Δt is λΔt, where λ is
a constant (the arrival rate of new frames).
Once a frame has been generated, the station is blocked and does nothing until the
frame has been successfully transmitted.
2. Single Channel.
13
The stations are assumed to be equally capable, though protocols may assign them
different roles (e.g., priorities).
3. Observable Collisions.
If two frames are transmitted simultaneously, they overlap in time and the resulting
signal is garbled. This event is called a collision. All stations can detect that a
collision has occurred. A collided frame must be transmitted again later. No errors
other than those generated by collisions occur.
Time may be assumed continuous, in which case frame transmission can begin at any
instant. Alternatively, time may be slotted or divided into discrete intervals (called
slots). Frame transmissions must then begin at the start of a slot. A slot may contain 0,
1, or more frames, corresponding to an idle slot, a successful transmission, or a
collision, respectively.
With the carrier sense assumption, stations can tell if the channel is in use before
trying to use it. No station will attempt to use the channel while it is sensed as busy.
If there is no carrier sense, stations cannot sense the channel before trying to use it.
They just go ahead and transmit. Only later can they determine whether the
transmission was successful.
14
Figure 3.12: Data Link Layer
A. RANDOM ACCESS
1. ALOHA
i. Pure ALOHA
The original ALOHA protocol is called pure ALOHA. This is a simple, but elegant
protocol. 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. Below Figure shows an example of frame collisions in pure
ALOHA.
15
Figure 3.14: Pure ALOHA
In pure ALOHA, the stations transmit frames whenever they have data to send. When
two or more stations transmit simultaneously, there is collision and the frames are destroyed.
In pure ALOHA, whenever any station transmits a frame, it expects the acknowledgement
from the receiver. If acknowledgement is not received within specified time, the station
assumes that the frame (or acknowledgement) has been destroyed. If the frame is destroyed
because of collision the station waits for a random amount of time and sends it again. This
waiting time must be random otherwise same frames will collide again and again. Therefore
pure ALOHA dictates that when time-out period passes, each station must wait for a random
amount of time before resending its frame. This randomness will help avoid more collisions.
Vulnerable time
Let us find the length of time, the vulnerable time, in which there is a possibility of
collision. We assume that the stations send fixed length frames with each frame taking
Tfr S to send.
Station A sends a frame at time t. Now imagine station B has already sent a frame
between t – T fr and t.
16
This leads to a collision between the frames from station A and station B. The end of
B's frame collides with the beginning of A's frame. On the other hand, suppose that
station C sends a frame between t and t + Tfr. Here, there is a collision between
frames from station A and station C. The beginning of C's frame collides with the end
of A's frame.
Looking at Figure, we see that the vulnerable time, during which a collision may
occur in pure ALOHA, is 2 times the frame transmission time.
This is so because there is no rule that defines when the station can send. A station
may send soon after another station has started or soon before another station has
finished.
In slotted ALOHA we divide the time into slots of Tfr s and force the station to send
only at the beginning of the time slot. Figure 3 shows an example of
Because a station is allowed to send only at the beginning of the synchronized time
slot, if a station misses this moment, it must wait until the beginning of the next time
slot.
17
This means that the station which started at the beginning of this slot has already
finished sending its frame. Of course, there is still the possibility of collision if two
stations try to send at the beginning of the same time slot.
Below fig shows that the vulnerable time for slotted ALOHA is one-half that of pure
ALOHA.
The throughput for slotted ALOHA is S = G × e−G . The maximum throughput S max
= 0.368 when G = 1.
To minimize the chance of collision and, therefore, increase the performance, the
CSMA method was developed. The chance of collision can be reduced if a station senses the
medium before trying to use it. Carrier sense multiple access (CSMA) requires that each
18
station first listen to the medium (or check the state of the medium) before sending. In other
words, CSMA is based on the principle "sense before transmit" or "listen before talk." CSMA
can reduce the possibility of collision, but it cannot eliminate it. The reason for this is shown
in below Figure.
At time tI' station B senses the medium and finds it idle, so it sends a frame.
At time t2 (t2> tI)' station C senses the medium and finds it idle because, at this time,
the first bits from station B have not reached station C. Station C also sends a frame.
i. Vulnerable Time
This is the time needed for a signal to propagate from one end of the medium to the
other.
When a station sends a frame, and any other station tries to send a frame during this
time, a collision will result. But if the first bit of the frame reaches the end of the
medium, every station will already have heard the bit and will refrain from sending.
19
Figure 3.19: Vulnerable Time
1. 1-Persistent: In this method, after the station finds the line idle, it sends its frame
immediately (with probability 1). This method has the highest chance of collision
because two or more stations may find the line idle and send their frames
immediately.
2. Non-persistent: a station that has a frame to send senses the line. If the line is idle,
it sends immediately. If the line is not idle, it waits a random amount of time and then
20
senses the line again. This approach reduces the chance of collision because it is
unlikely that two or more stations will wait the same amount of time and retry to send
simultaneously. However, this method reduces the efficiency of the network because
the medium remains idle when there may be stations with frames to send.
3. p-Persistent: This is used if the channel has time slots with a slot duration equal to
or greater than the maximum propagation time. The p-persistent approach combines
the advantages of the other two strategies. It reduces the chance of collision and
improves efficiency
In this method, after the station finds the line idle it follows these steps:
2.With probability q = 1 - p, the station waits for the beginning of the next time slot and
checks the line gain.
b. If the line is busy, it acts as though a collision has occurred and uses the backoff procedure.
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
21
frame is sent again. To better understand CSMA/CD, let us look at the first bits transmitted
by the two stations involved in the collision. Although each station continues to send bits in
the frame until it detects the collision, we show what happens as the first bits collide. In
below Figure, stations A and C are involved in the collision.
At time t 1, station A has executed its persistence procedure and starts sending the bits
of its frame.
At time t2, station C has not yet sensed the first bit sent by A. Station C executes its
persistence procedure and starts sending the bits in its frame, which propagate both to
the left and to the right.
collision occurs sometime after time t2.Station C detects a collision at time t3 when it
receives the first bit of A's frame.
Station C immediately (or after a short time, but we assume immediately) aborts
transmission. Station A detects collision at time t4 when it receives the first bit of C's
frame; it also immediately aborts transmission.
Looking at the figure, we see that A transmits for the duration t4 - tl; C transmits for
the duration t3 - t2.
For CSMAlCD to work, we need a restriction on the frame size. Before sending the
last bit of the frame, the sending station must detect a collision, if any, and abort the
transmission.
22
This is so because the station, once the entire frame is sent, does not keep a copy of
the frame and does not monitor the line for collision detection.
Therefore, the frame transmission time T fr must be at least two times the maximum
propagation time Tp. To understand the reason, let us think about the worst-case
scenario.
If the two stations involved in a collision are the maximum distance apart, the signal
from the first takes time Tp to reach the second, and the Effect of the collision takes
another time Tp to reach the first. So the requirement is that the first station must still
be transmitting after 2Tp
The first difference is the addition of the persistence process. We need to sense the
channel before we start sending the frame by using one of the persistence processes
The second difference is the frame transmission. In ALOHA, we first transmit the
entire frame and then wait for an acknowledgment. In CSMA/CD, transmission and
collision detection is a continuous process. We do not send the entire frame and then
look for a collision. The station transmits and receives continuously and
simultaneously.
The third difference is the sending of a short jamming signal that enforces the
collision in case other stations have not yet sensed the collision.
23
network. Collisions are avoided through the use of CSMA/CA's three strategies: the inter
frame space, the contention window, and acknowledgments, as shown in Figure
First, collisions are avoided by deferring transmission even if the channel is found
idle. When an idle channel is found, the station does not send immediately. It waits for a
period of time called the inter frame space or IFS. Even though the channel may appear idle
when it is sensed, a distant station may have already started transmitting. The distant station's
signal has not yet reached this station. The IFS time allows the front of the transmitted signal
by the distant station to reach this station. If after the IFS time the channel is still idle, the
station can send, but it still needs to wait a time equal to the contention time. The IFS variable
can also be used to prioritize stations or frame types. For example, a station that is assigned
shorter IFS has a higher priority. In CSMA/CA, the IFS can also be used to define the priority
of a station or a frame.
The contention window is an amount of time divided into slots. A station that is ready
to send chooses a random number of slots as its wait time. The number of slots in the window
changes according to the binary exponential back-off strategy. This means that it is set to one
slot the first time and then doubles each time the station cannot detect an idle channel after
the IFS time. This is very similar to the p-persistent method except that a random outcome
defines the number of slots taken by the waiting station. One interesting point about the
contention window is that the station needs to sense the channel after each time slot.
However, if the station finds the channel busy, it does not restart the process; it just
stops the timer and restarts it when the channel is sensed as idle. This gives priority to the
station with the longest waiting time. In CSMA/CA, if the station finds the channel busy, it
24
does not restart the timer of the contention window; it stops the timer and restarts it when the
channel becomes idle.
Acknowledgment
With all these precautions, there still may be a collision resulting in destroyed data. In
addition, the data may be corrupted during the transmission.
The positive acknowledgment and the time-out timer can help guarantee that the
receiver has received the frame.
The station ready to transmit, senses the line by using one of the persistent strategies.
As soon as it finds the line to be idle, the station waits for an IFS (Inter frame space)
amount of time.
If then waits for some random time and sends the frame.
After sending the frame, it sets a timer and waits for the acknowledgement from the
receiver.
25
If the acknowledgement is received before expiry of the timer, then the transmission
is successful.
But if the transmitting station does not receive the expected acknowledgement before
the timer expiry then it increments the back off parameter, waits for the back off time
and re senses the line.
5. Collision-Free Protocols
Almost collisions can be avoided in CSMA/CD. They can still occur during the
contention period. The collision during contention period adversely affects the system
performance, this happens when the cable is long and length of packet are short. This
problem becomes serious as fiber optics network come into use. Here we shall discuss some
protocols that resolve the collision during the contention period.
1. Bit-map Protocol
2. Binary Countdown
Pure and slotted Aloha, CSMA and CSMA/CD are Contention based Protocols:
Try-if collide-Retry
No guarantee of performance
What happen if the network load is high?
Bit map protocol is collision free Protocol in In bitmap protocol method, each
contention period consists of exactly N slots. if any station has to send frame, then it
transmits a 1 bit in the respective slot. For example if station 2 has a frame to send, it
transmits a 1 bit during the second slot.
In general Station 1 Announce the fact that it has a frame questions by inserting a 1
bit into slot 1. In this way, each station has complete knowledge of which station wishes to
transmit. There will never be any collisions because everyone agrees on who goes next.
26
Protocols like this in which the desire to transmit is broadcasting for the actual transmission
are called Reservation Protocols.
For analyzing the performance of this protocol, We will measure time in units of the
contention bits slot, with a data frame consisting of d time units. Under low load conditions,
the bitmap will simply be repeated over and over, for lack of data frames.All the stations have
something to send all the time at high load, the N bit contention period is prorated over N
frames, yielding an overhead of only 1 bit per frame.
Generally, high numbered stations have to wait for half a scan before starting to
transmit low numbered stations have to wait for half a scan(N/2 bit slots) before starting to
transmit, low numbered stations have to wait on an average 1.5 N slots.
2. Binary Countdown:
Binary countdown protocol is used to overcome the overhead 1 bit per binary station.
In binary countdown, binary station addresses are used. A station wanting to use the channel
broadcast its address as binary bit string starting with the high order bit. All addresses are
assumed of the same length. Here, we will see the example to illustrate the working of the
binary countdown.
In this method, different station addresses are ORed together who decide the priority
of transmitting. If these stations 0001, 1001, 1100, 1011 all are trying to seize the channel for
transmission. All the station at first broadcast their most significant address bit that is 0, 1, 1,
1 respectively. The most significant bits are ORed together. Station 0001 see the 1MSB in
another station addresses and knows that a higher numbered station is competing for the
channel, so it gives up for the current round.
27
Other three stations 1001, 1100, 1011 continue. The next bit is 1 at station 1100, swiss
station 1011 and 1001 give up. Then station 110 starts transmitting a frame, after which
another bidding cycle starts.
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.
Advantages
Partition the group of station and limit the contention for each slot.
Under light load, everyone can try for each slot like aloha
28
Under heavy load, only a group can try for each slot
How do we do it:
For Example:
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
Slot-6: H* (all nodes under node 6 can try to send), H sends.
3.5 BLUETOOTH
29
Features of Bluetooth
Bluetooth technology was released in 1999 as Bluetooth 1.0, by Special Interest Group
(SIG) who continues to manage it.
It was initially standardized as IEEE 802.15.1.
Mobile computing devices and accessories are connected wirelessly by Bluetooth using
short-range, low-power, inexpensive radios.
UHF radio waves within the range of 2.400 to 2.485 GHz are using for data
communications.
A PAN or a piconet can be created by Bluetooth within a 10 m radius.
Presently, 2 to 8 devices may be connected.
Bluetooth protocols allow devices within the range to find Bluetooth devices and connect
with them. This is called pairing. Once, the devices are paired, they can transfer data
securely.
Bluetooth has lower power consumption and lower implementation costs than Wi-Fi.
However, the range and transmission speeds are typically lower than Wi-Fi.
The lower power requirements make it less susceptible to interference with other wireless
devices in the same 2.4GHz bandwidth.
Bluetooth version 3.0 and higher versions can deliver a data rate of 24 Mbps. The Bluetooth
version 4.0 came in 2010. It is characterized by low energy consumption, multivendor
interoperability, the economy of implementation, and greater range.
i. Bluetooth Architecture
The basic unit of a Bluetooth system is a piconet, which consists of a master node and
up to seven active slave nodes within a distance of 10 meters. Multiple piconets can exist in
the same (large) room and can even be connected via a bridge node that takes part in multiple
piconets,as in Fig. 4-34. An interconnected collection of piconets is called a scatternet.
In addition to the seven active slave nodes in a piconet, there can be up to 255 parked
nodes in the net. These are devices that the master has switched to a lowpower state to reduce
the drain on their batteries. In parked state, a device cannotdo anything except respond to an
activation or beacon signal from the master. Two intermediate power states, hold and sniff,
also exist, but these will not concern us here.
30
The reason for the master/slave design is that the designers intended to facilitate the
implementation of complete Bluetooth chips for under $5. The consequence of this decision
is that the slaves are fairly dumb, basically just doing whatever the master tells them to do. At
its heart, a piconet is a centralized TDM system, with the master controlling the clock and
determining which device gets to communicate in which time slot. All communication is
between the master and a slave; direct slave-slave communication is not possible.
The Bluetooth spec defines specific supported applications, with different stacks for
each application. There are over 25 applications, which are called profiles.
Six of the profiles are for audio and video. For example, the headset and handsfree
profiles both provide voice communication between a headset and its base station.
Some profiles are used as building blocks for other profiles. The generic access
profile provides a way to establish and maintain secure links between the master and slaves.
31
The bottom layer is the radio layer, it deals with radio transmission and modulation.
The link control layer deals with how the master controls time slots, and how time
slots are grouped into frames. “The link manager handles the establishment of logical
channels between devices”.
The link manager is below the host-controller interface line. Generally, protocols
beneath the line are implemented on the Bluetooth chip, and protocols above the line are
implemented on the Bluetooth device.
“The service discovery protocol is used to locate services within the network. The
RFcomm (Radio Frequency communication) protocol emulates the standard serial port found
on PCs for connecting the keyboard, mouse, and modem, among other devices”.
The top layer is the application layer. In the figure, profiles are represented as
vertical boxes because they define a slice of the protocol stack. They may omit protcols that
aren’t needed by the profile, for example profiles might skip L2CAP if they only send a
steady stream of audio samples.
“The radio layer moves the bits from master to slave, or vice versa”.
“The radio layer is a low-power system with a range of 10 meters operating in the
same 2.4-GHz ISM band as 802.11”. The band is divided into 79 1MHz channels.
Bluetooth adapts its hop sequence to exclude channels on which there are other RF
signals. This is called adaptive frequency hopping.
There are “three forms of modulation are used to send bits on a channel. The basic
scheme is to use frequency shift keying to send a 1-bit symbol every microsecond, giving a
32
gross data rate of 1 Mb/s. Enhanced rates were introduced with the 2.0 version of Bluetooth.
These rates use phase shift keying to send either 2 or 3 bits per symbol, for gross data rates of
2 or 3 Mb/s. The enhanced rates are only used in the data portion of frames”.
The link control (baseband) layer turns bit streams into frames.
In its simplest form, the master in each piconet defines a series of 625-μsec time slots.
The master gets half the slots, the slave gets the other half. Master transmission starts in the
even slots, slave transmission starts in the odd slots.
A frame can be 1, 3, or 5 slots long. Each frame has a 126-bit overhead for an access
code and header, as well as a 250-60-μsec settling time. The frame payload can be encrypted
with a key chosen when the master and slave connect. Hops can only occur between frames,
not during a frame.
The link manager sets up channels (links) to carry frames between a master and a
slave device that have discovered each other. The devices follow a pairing procedure before
the link is used. The simple secure pairing method allows users to confirm both devices are
displaying the same passkey, or to manually enter a passkey from one device into another.
Devices with limited input output like headphones can’t use this method.
When pairing is complete, the link manager sets up the links. There are two main
kinds of link:
SCO is used for real-time data, like telephone connection. An SCO link is allocated a
fixed slot in each direction. Each SCO link can transmit one 64,000-b/s PCM audio channel,
and a slave can have up to three SCO links with its master. Frames sent over SCO are never
retransmitted.
An ACL link is used for packet-switched data available at irregular intervals. ACL
frames can be lost, and may need to be retransmitted. A slave can only have one SCO link to
its master.
33
“The data sent over ACL links come from the L2CAP layer”. The L2CAP has three
main functions:
1. Accepts packets (up to 64KB) from higher layers and breaks them into frames for
transmission, the frames are reassembled at the receiving end.
The Bluetooth standard defines several frame formats. The two frames that are
studied in this section are typical Bluetooth frames at basic and enhanced data rates.
Figure 3.31: Typical Bluetooth data frame at basic and enhanced rates
The first field is an access code that usually identifies the master. Next is a 54-bit
header that contains several fields. The Address field identifies which of the active devices
the frame is intended for. The Type field 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.
The Flow bit (F) is set by a slave when its buffer is full and it can’t receive any more
data. The Acknowledgement bit (A) adds an ACK to the frame, The Sequence bit (S) is used
to number frames, to enable retransmission. Since the protocol is stop-and-wait, 1 bit is
enough to number frames adequately.
34
160, or 240 bits of actual payload. The rest are used for error correction. In the 80-bit version,
the bits are repeated three times for redundancy.
35