You are on page 1of 100

Computer Communication &

Networking (CCN)
Computer Networks 5th Edition
by Andrew S. Tanenbaum & David J
Wetherall
Syllabus
• Introduction : Uses of Computer Networks, Network Hardware, Reference Models, A comparison
of OSI/TCP IP Model, Network Standardization.
• The Physical Layer : The Maximum Data Rate of a Channel, Guided Transmission Media, Wireless
Transmission, Communication Satellites, Digital Modulation and Multiplexing
• The Data Link Layer : Data Link Layer Design Issues, Error Detection and Correction, Elementary
Data Link Protocols, Sliding Window Protocols
• The Medium Access Control : The Channel Allocation Problem, Multiple Access Protocols,
Ethernet, Wireless LANS, Broadband Wireless, Bluetooth
• The Network Layer : Network Layer Design Issues, Routing Algorithms(The Optimality Principle,
Shortest Path Algo, Flooding, Distance Vector Routing, Link State Routing), Quality of
Service(Application Requirements, Differentiated Services), Internetworking, The Network Layer in
the Internet(IP Addresses, Classful Addressing,Subnets,IPv4)
• The Transport Layer : The Transport service(Services provided to the upper layers, Transport
Service Primitives), Elements of Transport Protocols(Addressing,Connection Establishment,
Connection Release), Congestion Control(Desirable Bandwidth allocation,Max min
fairness),Internet Transport Protocols(Introduction to UDP,RPC), Internet Transport
Protocols(Introduction to TCP, TCP Service Model, The TCP Protocol, The TCP Segment Header,TCP
Connection Establishment, TCP Connection Release, TCP Connection Management Modeling, TCP
Sliding Window)
• The Application Layer : Domain Name System, The World Wide Web(Architectural Overview,Static
Web Pages,Dynamic web pages and web applications,HTTP, Mobile Web, Web Search)
Computer Network
• A computer network is a set of computers
interconnected together for the purpose of
sharing resources(or data transfer).
• “A collection of autonomous computers
interconnected by a single technology.”
The OSI Reference Model
The OSI Reference Model
• Protocol is a set of rules governing the
communication(format/meaning of messages
exchanged) between peer entities.
• Service is a set of primitive (operations) that a layer
provides to the layer above it.
• Protocol Data Unit(PDU) refers to the group of
information added or removed by a layer of the OSI
Model. Each layer uses the PDU to communicate and
exchange information, which can only be read by the
peer layer on the receiving device and is then handed
over to the next upper layer after stripping the header.
Chapter 4
The Medium Access Control
Sublayer
Types of links
• Point to point links :

• Broadcast links (Random access channel/Multi


access channel)
Medium Access Control Sublayer
(MAC)
• The protocols used to determine who goes next
on a multi-access channel belong to a sublayer of
Data Link Layer(DLL) called MAC.
• Channel Allocation Problem in MAC consists of:
1. Static Channel Allocation
2. Dynamic Channel Allocation
Static Channel Allocation
• If N users use FDM(Frequency division
multiplexing) then the frequency spectrum is
divided into N equal sized portions(each user
is given one portion).
• This technique works well for small and fixed
number of users.
• What if the number of users start increasing?
• For large and varying number of users??
Assumptions for Dynamic Channel
Allocation
1. Independent traffic : N stations, each one generates
frames.
2. Single Channel : All the stations can transmit and
receive frames through a single channel.
3. Observable Collisions : Two frames are sent
simultaneously, they overlap in time and resulting
signal is garbled away. All stations can detect a
collision & the collided frame is retransmitted again.
4. Continuous/Slotted time : Time can either be
continuous/discrete.
5. Carrier Sense/No Carrier Sense : Carrier sense helps a
station to know whether the channel is in use/not.
Multiple Access Protocols
• ALOHA uses ground based radio broadcasting for
users who are competing for the use of a single
shared channel.
• Contention Systems : Systems in which multiple
users share a common channel in a way that can
lead to conflicts are called contention systems.
• Two versions of ALOHA are:
1. Pure ALOHA
2. Slotted ALOHA
Multiple Access Protocols
• ALOHA uses ground based radio broadcasting for
users who are competing for the use of a single
shared channel.
• Contention Systems : Systems in which multiple
users share a common channel in a way that can
lead to conflicts are called contention systems.
• Two versions of ALOHA are:
1. Pure ALOHA
2. Slotted ALOHA
Pure ALOHA
• Users can transmit whenever they have data to be
sent.
• Whenever there is a collision, colliding frames will
be damaged.
• The sender then waits for a random period of time
and retransmits.
• If the waiting time is not random, same frame will
collide again and again.
• Throughput per frame time, S=Ge-2G where G is the
number of attempts per packet time.
• Throughput of pure ALOHA is 18%.
Pure ALOHA

• In pure ALOHA, frames are transmitted at


completely arbitrary times.
Pure ALOHA
Slotted ALOHA
• Time is divided into discrete intervals called
slots.
• A station can only send at the beginning of a
slot. This reduces the number of collisions.
• Throughput per frame time, S=Ge-G where G is
the number of attempts per packet time.
• Throughput of Slotted ALOHA is 37% (twice
that of pure aloha).
Pure ALOHA & Slotted ALOHA
Throughput versus offered traffic for ALOHA
systems.
Carrier Sense Multiple Access
Protocols (CSMA)
• Protocols in which stations listen for a carrier
and act accordingly are called Carrier Sense
Protocols (CSMA).
• Several versions of CSMA are:
1. Persistent CSMA(1-persistent)
2. Non Persistent CSMA
3. p-persistent CSMA
4. CSMA with Collision Detection(CSMA/CD)
Carrier Sense Multiple Access
Protocols (CSMA)
Persistent CSMA:
• The station that has data continuously senses the channel and
if found idle transmits a frame.
• If the channel is busy, it waits until the channel becomes idle
and then transmits the frame.
• In case of collision, it waits for random amount of time and
then retransmits again.
• The protocol is called 1-persistent CSMA because the station
transmits with a probability of 1.
• Persistent CSMA is greedy in nature since stations
continuously sense the channel inorder to seize it.
• Major drawbacks of this approach are propagation delay and
chances of collision are high.
Carrier Sense Multiple Access
Protocols (CSMA)
Non - Persistent CSMA:
• Whenever the station has the data, it senses the
channel and if found idle transmits a frame.
• If the channel is busy, it does not sense the channel
continuously in order to seize it, rather it waits for
random amount of time and then retransmits again.
• This approach is less greedy than the previous one.
• Although it reduces the number of collisions but it
reduces the efficiency of the network since the
channel may remain idle sometimes.
Carrier Sense Multiple Access
Protocols (CSMA)
p - Persistent CSMA:
• It applies to slotted channels only.
• Whenever the station has the data, it senses the channel
and if found idle transmits with a probability of p.
• With a probability of q=1-p, the station then waits for the
beginning of the next time slot.
• If the next slot is also idle, it either transmits or waits
again with the probabilities p or q.
• This process is repeated until the frame has been
transmitted by station or another station has begun
transmitting frame.
Carrier Sense Multiple Access
Protocols (CSMA)
CSMA with Collision Detection:
• One solution for two stations simultaneously
transmitting frames is to detect the collisions
and abruptly stop it. This saves bandwidth and
time.
• CSMA/CD uses a conceptual model which
consists of contention, transmission or idle
states.
Carrier Sense Multiple Access
Protocols (CSMA)

CSMA with Collision Detection(CSMA/CD)


Collision Free Protocols
• Although collisions do not occur with CSMA/CD once
a station has unambiguously captured the channel,
they still occur during the contention period.
• There are some protocols that resolve the
contention for the channel without any collisions at
all, not even during the contention period. These
protocols are known as Collision Free protocols.
• For all the collision free protocols, we assume that
there are exactly N stations, each programmed with
a unique address from 0 to N-1.
Collision Free Protocols
Some of the collision free protocols are:
• A bit Map Protocol
• Token Passing Protocol
• Binary Countdown Protocol
Collision Free Protocols
A Bit-Map Protocol:
• Since there are N stations, each contention
period consists of exactly N slots.

• Protocols like this in which the desire to


transmit is broadcast before the actual
transmission are called Reservation Protocols.
Collision Free Protocols
Token Passing :
• The token represents a permission to send.
• Any station having a token can transmit the frame.
• It lets every station transmit in a predefined order.
• If a station has a frame queued for transmission when it receives the
token, then it can send that frame before it passes the token to the
next station.
• Two types of token passing protocols:
1. Token Ring
2. Token Bus
• Frames are transmitted in the direction of the token.
• To stop the frame circulating indefinitely, some station needs to
remove it from the ring. This station may be either the one that
originally sent the frame or the station that was the intended
recipient.
Token Passing
Token Ring : Token Bus :

Note : Token bus is a network implementing


Token ring. the token ring protocol over a "virtual ring“.
Collision Free Protocols
A Binary Countdown Protocol:
• A basic bitmap protocol does not scale well to networks with
thousands of stations.
• A better solution is to use binary countdown protocol.
• A station wanting to use the channel now broadcasts its
address as a binary bit string, starting with a high order bit.
• All the addresses are assumed to be of the same length.
• The bits in each address position from different stations are
BOOLEAN ORed.
• As soon as a station sees a high order bit position that is 0 in
its address has been overwritten with a 1, it gives up.
• The winner is the station having the highest address.
• Higher numbered stations have higher priority as compared
to lower numbered stations.
Collision Free Protocols
• A Binary Countdown Protocol:
Limited Contention Protocols
• Two basic strategies for channel acquisition are : CSMA
and Collision Free Protocols
• Two important performance measures are:
1. Delay at low load
2. Channel efficiency at high load
• Its best to combine the best properties of contention
and collision free protocols by arriving at a new
protocol that used contention at low loads to provide
low delay, but used a collision free technique at high
load to provide good channel efficiency. Such
protocols are known as limited contention protocols.
Limited Contention Protocols
Two types of contention protocols:
• Symmetric : Each station acquires the channel with a probability of p,
with all stations having the same probability.
• Asymmetric : Each station acquires the channel with different
probabilities.
• Let us review the performance of symmetric channel.
• Assume that there are k stations and each station transmits with a
probability of p. All the other (k-1) stations defer, each with a
probability (1-p).
• Probability that some station transmits successfully is kp(1-p)k-1.
Optimal value of p is
Pr[success with optimal p] = [k-1/k]k-1
Best value of p is 1/k
Adaptive Tree Walk Protocols

The tree for eight stations


Wireless LAN Protocols
• Wireless communication has different
complications as compared to wired.
• A station may not be able to transmit frames
to/receive frames from other stations because of
the limited radio range.
• It leads to various complications like hidden and
exposed terminals.
• Nodes can’t detect collisions i.e. sense while
sending.
• Makes collisions expensive and need to be
avoided.
Hidden Terminal Problem
• Hidden terminals are the ones in which the
senders that cannot sense each other but
nonetheless collide at intended receiver.
• Ex: A and C are hidden terminals when sending
to B.

A wireless LAN. (a) A and C are hidden terminals when transmitting to B. (b)
B and C are exposed terminals when transmitting to A and D.
Exposed Terminal Problem
• Consider B is transmitting to A and C is transmitting to D,
if C senses the medium it will falsely conclude that it may
not send to D. Such a problem is known as exposed
terminal problem. We want a protocol that prevents this
kind of deferral from happening.
• It wastes bandwidth.
• Ex: B & C are exposed terminals

A wireless LAN. (a) A and C are hidden terminals when transmitting to B. (b)
B and C are exposed terminals when transmitting to A and D.
Multiple Access with Collision
Avoidance(MACA)
• Can multiple transmissions occur simultaneously if
they all have different destinations and these
destinations are out of range of one another??
• MACA protocol make it possible. It grants access for
A to send to B.
• First, A sends Request To Send(RTS) to B. This short
frame(30 bytes) contains the length of the data
frame that needs to be sent.
• B replies with Clear To Send(CTS) frame.
• The CTS frame contains the data length(Copied from
RTS).
• On receiving CTS frame, A begins its transmission.
Multiple Access with Collision
Avoidance(MACA)

The MACA protocol. (a) A sending an RTS to B. (b) B responding with a


CTS to A.
Ethernet
• Ethernet is the most ubiquitous kind of computer network in the
world.
• Two kinds of ethernet exists:
i.Classic Ethernet solves the multiple access problem by using
various techniques which we have studied previously.(3 to 10
Mbps)
ii.Switched Ethernet which uses devices like switches to connect
different computers.(100/1000/10,000 Mbps)
• Some of the networks are standardized under the names of IEEE
802 like:
i. Ethernet – IEEE 802.3
ii. Wireless LAN – IEEE 802.11
iii.Bluetooth – IEEE 802.15
iv.Token Bus – IEEE 802.4
v. Token Ring – IEEE 802.5
Classic Ethernet Physical Layer
• Classic Ethernet (also known as thick Ethernet)
snaked around the building as a single long cable to
which all the computers are attached. Initially
Ethernet ran at 3Mbps, then at 10Mbps (Also
known as DIX standard).

Architecture of classic Ethernet.


Ethernet
• Then came the Thin Ethernet, which was much
cheaper, easier to install and bent easily.
• Each version of ethernet has a maximum cable
length per segment over which signals will
propagate.
• To allow larger networks, multiple cables can be
connected by Repeaters.
• Repeaters are physical layer device that receives,
amplifies and retransmits the signals.
Classic Ethernet MAC Sublayer
Protocol

Frame formats. (a) Ethernet (DIX). (b) IEEE 802.3.


Classic Ethernet MAC Sublayer
Protocol
• The Preamble is a pattern of alternating ones and zeroes and ending with two
ones. When this pattern is received it is known that anything that comes after this
pattern is the actual frame.
• The last byte of the preamble(for IEEE 802.3 frame) is known as the Start of
Frame(SOF) delimiter(whose function is same as that of Preamble).
• Then comes the Source and Destination Addresses used for identifying the sender
and receiver of the frame.
• The Type field specifies that upper level protocol. Some of the most well known
ones are:
0x0800 – IP
0x0806 – ARP
0x86DD – IPv6
• The Length (for IEEE 802.3 frame) field is used to indicate how many bytes of data
are following this field before the Checksum.
• After that follow the actual payload(i.e. Data) which should be between 0 – 1500
bytes in size.
• There is a field called Pad(0 - 46 bytes) which adds zeroes to the data.
• In the end there is a Checksum field which is used to check the validity of the
frame. If the Checksum is incorrect then, the frame is dropped.
CSMA/CD with Binary Exponential
Backoff
• After i collisions, a random number between
0 to 2i-1 is chosen and that number of slots is
skipped.
• After 1st collision, each station waits either for 0 or
1 slot times at random before trying again.
• After 2nd collision, each station waits either for 0,1,2
or 3 slot times at random before trying again.
• After 16 collisions, it will report failure back to the
computer.
Hub & Switch

Working of a Hub
Hub & Switch

Working of a Switch
Switched Ethernet
• A hub is Layer 1 device which works like a repeater and looks like a
switch.
• Each station has a dedicated cable running to a central hub. A hub
simply connects all the attached wires electrically as if they were
soldered together.
• As more and more stations are added, each station gets a decreased
share of the fixed capacity. Eventually the LAN will saturate.

(a) Hub. (b) Switch.


Switched Ethernet
• One way to deal with the increased load is to use a switch.
• Switches only output frames to the ports for which it is
destined by checking the 48-bit MAC address(unique
machine address).
• When two hosts on the same network segment transmit
at the same time, the resulting digital signals will collide,
hence the term is known as collision domain.
• In a hub, all the stations are in the same collision domain
whereas in the switch they are in different collision
domains.
• So when using hub there are chances of collision but using
a switch there is no collision.
Switched Ethernet
Advantages of switch over a hub are:
• It increases the efficiency since there are no
collisions when using a switch.
• With a switch, multiple frames can be sent
simultaneously.
• When transmitting multiple frames to the same
output port at the same time, the switch must
have a buffering so that it can temporarily queue
an input frame until it is sent to the output port.
Switched Ethernet
• Promiscuous mode is a mode in which all the
frames are forwarded to each computer, not
just those addressed to it.
• From security aspect, traffic sent can be seen
by all the computers whereas when switch is
used the traffic is forwarded only to the ports
where it is destined.
Types of Cable
• Fiber Optics(Single-mode and Multimode)
• Twisted Pair[Unshielded(Cat 3 and Cat 5) and
Shielded]
(a) Category 3 (b) Category 5
Link Types
Simplex link
• Only one fixed direction at all times
• Ex: One Way street
Half-duplex link
• Both directions, but not at the same time
• Ex: Walkie-Talkie
Full-duplex link
• Used for transmission in both directions at once
• Ex: Mobile Phone
Modulation
Modulation schemes send bits as signals.
• Baseband Transmission
• Narrowband Transmission

Multiplexing
Multiplexing schemes share a channel among
users.
• Frequency Division Multiplexing(FDM)
• Time Division Multiplexing(TDM)
• Wavelength Division Multiplexing(WDM)
Ethernet
• In order to achieve speed greater than 10Mbps, various versions of
Ethernet came up like:
1. Fast Ethernet(100Mbps)
2. Gigabit Ethernet(1000Mbps)
3. 10-Gigabit Ethernet(10000Mbps)
• Several choices like:
1. Type of cable to be used (Twisted Pair/Fiber Optics)
2. Max segment length of cable (in meters/in kilometers)
3. Advantage of the cable being used
4. Encoding schemes to use(Manchester, Differential Manchester,
4B/5B, 8B/10B)
led to various types of Ethernet cabling.
Fast Ethernet
Name Cable Max. segment Advantages
100Base-T4 Twisted pair 100 m Uses category 3 UTP

Full duplex at 100 Mbps


100Base-TX Twisted pair 100 m
(Cat 5 UTP)

Full duplex at 100 Mbps;


100Base-FX Fiber optics 2000 m
long runs

Fast Ethernet Cabling

Note : The "100" in the media type designation refers to the transmission
speed of 100 Mbps, while the "BASE" refers to baseband signalling. The
letter following the dash ("T" or "F") refers to the physical medium that
carries the signal (twisted pair or fiber, respectively).
Gigabit Ethernet

Name Cable Max. segment Advantages

1000Base-SX Fiber optics 550 m Multimode fiber (50µ, 62.5µ)

Single (10µ) or multimode


1000Base-LX Fiber optics 5000 m
(50µ, 62.5µ)

1000Base-CX 2 Pairs of STP 25 m Shielded twisted pair

1000Base-T 4 Pairs of UTP 100 m Standard category 5 UTP

Gigabit Ethernet Cabling


10-Gigabit Ethernet
Name Cable Max. segment Advantages

10GBase-SR Fiber optics Up to 300 m Multimode fiber (0.85µ)

10GBase-LR Fiber optics 10 km Single-mode fiber (1.3µ)

10GBase-ER Fiber optics 40 km Single-mode fiber (1.5µ)

10GBase-CX4 4 Pairs of twinax 15 m Twinaxial copper

10GBase-T 4 Pairs of UTP 100 m Category 6a UTP

10-Gigabit Ethernet Cabling


Bluetooth (802.15)
• In 1994, the L.M. Ericsson company introduced
Bluetooth.
• The Bluetooth protocol lets devices like mobile
phones, laptops, keyboards, music systems and
watches find and connect with each other(called
pairing) and securely transfer data.
• The Bluetooth protocol operates at 2.4GHz in the
same unlicensed ISM frequency band where RF
protocols like ZigBee and WiFi also exist.
Bluetooth Architecture
• Bluetooth networks (commonly referred to as piconets) use a
master/slave model to control when and where devices can send
data.
• In this model, a single master device can be connected to up to seven
different slave devices. Any slave device in the piconet can only be
connected to a single master.
• The master can send data to any of its slaves and request data from
them as well. Slaves are only allowed to transmit to and receive from
their master. They can’t talk to other slaves in the piconet.
• An interconnected collection of piconets is known a scatternet.
• Bluetooth devices can also have user-friendly names given to them.
Bluetooth Architecture

Two piconets can be connected to form a scatternet.


Bluetooth Architecture
• Creating a Bluetooth connection between two devices is a multi-step process
involving three progressive states:
• Inquiry – If two Bluetooth devices know absolutely nothing about each other, one
must run an inquiry to try to discover the other. One device sends out the inquiry
request, and any device listening for such a request will respond with its address,
and possibly its name and other information.
• Connecting – It is the process of forming a connection between two Bluetooth
devices. Before this connection can be initiated, each device needs to know the
address of the other.
• Connection – After a device has completed connecting, it enters the connection
state. While connected, a device can either be in 4 different modes:
1. Active Mode – This is the regular connected mode, where the device is actively
transmitting or receiving data.
2. Sniff Mode – sniffing - is a process of listening for specific types of commands
that occur periodically. Sniffing is used for devices that must continuously be in
contact with the master. The Bluetooth sniff mode is used to reduce the power
consumption of the device as the receiver can be put into standby between sniff
cycles.
Bluetooth Architecture
3. Hold Mode – The Bluetooth hold mode is used to
release the device from actively communicating
with the master. This allows the devices to sleep
for short periods and allows the master control
device to discover or be discovered by other
Bluetooth devices that want to join other
piconets.
4. Park Mode – Parking - is the process
of temporarily deactivating a device to allow its
active member address to be removed (probably
re-assigned) and assigning communication
functions to remain inactive for extended periods
of time. When the master commands the slave to
park, the slave will periodically wake up and look
for a beacon signal from the master unit. If this
beacon signal contains the address of the parked
device, the device will reactivate and become part
of the piconet again.
Bluetooth Applications
Bluetooth was developed for 25 different
applications known as profiles. Various profiles are:
• Headset-Hands free profile
• Intercom Profile
• Portable music player – Headphone
• Keyboards-Mouse-Computers
• Mobile phone – Laptop
• Mobile phone (TV Remote) – Bluetooth enabled TV
Bluetooth Frame Structure

Typical Bluetooth data frame at (a) basic and (b) enhanced data rates.
Bluetooth Frame Structure
The bluetooth defines several frame formats, most important are shown in the
figure:
• Access Code(72 bits): It identifies the master so that the slaves can identify the
message coming for them.
• Header(54 bits):
1.Address(3 bit) defines the intended receiver of the frame.
2.Type(4 bit) defines whether it is a Synchronous Connection Oriented(SCO) or
Asynchronous Connection Less(ACL) frame.
3.Flow bit is set when the receivers buffer is full and cannot accept more data.
4.Acknowledgement Bit is set while piggybacking an ack onto a frame.
5.Sequence Bit is used to number the frames to detect retransmission.
Entire 18 bit header is repeated thrice.
• Guard/Sync(16 bits): It is used to switch to a faster data rate. The access code
and the header are carried at a basic rate and only the data portion is carried at
a faster rate.
• Data: For Basic bit rate(0-2744bits) and For Enhanced bit rate(0-8184bits).
• Trailer(2bit): Enhanced rate frames end with a short trailer.
Bluetooth Protocol Stack

The Bluetooth protocol architecture


Bluetooth Protocol Stack
• The bottom layer is the radio layer which deals with
radio transmissions and modulation.
• Then comes the link control(or baseband) layer
handles how the master controls the time slots and
how these slots are grouped into frames.
• The link manager handles the establishment of
logical channels between the devices, including the
power management, pairing, encryption and QoS.
• All these protocols lie below the host controller
interface line.
Bluetooth Protocol Stack
• Above this line comes the L2CAP(Logical Link Control
Adaptation Protocol) which converts variable length
messages into frames and provides reliability if needed.
• Many protocols use L2CAP like RFComm and Service
Discovery Protocol.
• Service Discovery Protocol is used to locate services
within the network.
• RFComm (Radio Frequency Communication) protocol
represents serial port number to connect keyboard,
mouse and modem like devices.
• The top most layer is where the applications are located.
• Profiles(Ex: Headset) in the protocol stack contain only
those protocols needed by that application.
Bluetooth Radio Layer
• All the nodes in a piconet hop frequencies
simultaneously, following a pseudorandom
hop sequence.
• But early versions of bluetooth and 802.11 led
to interference in transmissions.
• Using Adaptive frequency hopping technique
it was possible to avoid such interference.
Bluetooth Link Layers
• Link manager protocol sets up logical channels
called links to carry frames between master and
slave device. Before the link is used, a pairing
procedure is performed to make sure the two
devices are allowed to communicate.
• Old Pairing Technique: Devices are configured with
a 4-digit PIN. Ex: 0000 or 1234. This technique
provides very little security.
• New Pairing Technique: Allows users to confirm to
a passkey. More secure as users don’t need the
same passkey for different connection. All the
passkeys are device generated.
Bluetooth Link Layers
• After the pairing is done, link manager protocol sets
up the links. Two types of links exists:
• Synchronous Connection Oriented (SCO): It is used
for real-time data like telephone connection. Such a
link is allocated a fixed slot in each direction.
• A slave can have upto three SCO links with its
master. Each SCO link can transmit 64,000bps over
audio channel. Frames sent over SCO links are never
retransmitted and use FEC to increase reliability.
• Asynchronous Connection Less(ACL): It uses best
effort delivery mechanism. Frames can be lost and
need to be retransmitted. A slave can have only one
ACL link to its master.
Wireless LANs(802.11)
802.11 networks can be used in two modes:

802.11 architecture. (a) Infrastructure mode. (b) Ad-hoc mode.


802.11 Protocol Stack

Part of the 802.11 protocol stack.


802.11 Physical Layer
Each of the transmission techniques makes it
possible to send a MAC frame from one station to
another. They differ however, in the technology
used and the speeds achievable.
Name Technique Max. Bit Rate

802.11a OFDM, 5 GHz 54 Mbps

802.11b Spread spectrum, 2.4 GHz 11 Mbps

802.11g OFDM, 2.4 GHz 54 Mbps

802.11n OFDM with MIMO, 2.4/5 GHz 600 Mbps

Note: OFDM – Orthogonal Frequency Division Multiplexing


MIMO – MultipIe Input Multiple Output
802.11 MAC Sublayer
• 802.11 tries to avoid collisions with a protocol called
CSMA/CA(Carrier Sense Multiple Access with Collision
Avoidance) which is a combination of Ethernet’s CSMA/CD
and exponential back-off algorithm. Let’s see how it works…

Sending a frame with CSMA/CA.


802.11 MAC Sublayer
• Comparison with Ethernet:
1. Starting backoffs early help to avoid collision.
2. Acknowledgements are used to ensure that the
frame has been delivered successfully since
collisions cannot be detected.
• Since each station acts independently, this mode of
operation is known as Distributed Coordination
Function(DCF).
• Another mode of operation called Point
Coordination Function(PCF) in which access point
controls all the activities in the cell.
802.11 MAC Sublayer
• The transmission ranges of different stations are different as a result
problems like hidden terminal and exposed terminal can arise.
• To reduce ambiguities about which station is sending, 802.11 defines
channel sensing to consist of both physical sensing and virtual sensing.
• Physical Sensing simply checks to see if there is a valid signal.
• Virtual Sensing, each station keeps a logical record of when the channel
is in use by tracking the NAV(Network Allocation Vector).
• Each frame contains NAV field which says how long the frame will take
to complete.
• Stations overhearing this frame know that the channel will be busy for
the period given in the NAV field and defer to send.
• Ex: the NAV field contains the time needed to send an ACK.
• Comparing it with the RTS/CTS mechanism. There are four stations i.e.
A,B,C and D where A and B are in each other’s range. D is in the range of
B, and C is in the range of both A and B but not D.
802.11 MAC Sublayer

Virtual channel sensing using CSMA/CA.


802.11 MAC Sublayer
• RTS/CTS sounds good in theory but it is hardly
used due to following reasons:
1. For short frames, it is an overhead.
2. It does not solve the exposed terminal
problem(as compared to MACA).
802.11 MAC Sublayer
• CSMA/CA with physical and virtual sensing is the core of
802.11 protocols.
• Several mechanisms are used with it:
1. Lower transmission rates to increase the number of
successful transmissions(Slower rates use more robust
modulation).
2. It allows frames to be split into smaller pieces called
fragments.
• Each and every fragment is individually numbered and
acknowledged(using stop-and-wait protocol).
3. Next is power management which is very important when
using wireless devices.
• Power management needs attention so that the clients don’t
waste power when they do not have any information to send
or receive.
802.11 MAC Sublayer
• Beacon frames are periodically broadcast by the APs to advertise
their presence to the clients.
4. When the client enters into a power save mode(Ex: sleep
mode), the AP will buffer all the traffic intended for the client.
The client checks for the incoming traffic and wakes up every
beacon.
• The client checks for the traffic buffered at the AP and asks the
AP to send the messages buffered for it.
• After receiving the messages, it again goes to power saving
mode.
5. Another power saving mechanism is APSD(Automatic Power
Save Delivery).
• The AP buffers the frames and sends them to the client just after
the client sends frames to the AP.
• 802.11 provides Quality of Service depending on the different
kind of frames, their priority and their time intervals.
802.11 MAC Sublayer

Interframe spacing in 802.11.


802.11 MAC Sublayer
Five intervals are:
• DIFS(DCF Inter frame Spacing) : Any station can acquire the
channel for sending regular data frames. In case of a collision,
binary exponential back off may be applied.
• SIFS(Short Inter Frame Spacing) : It is the shortest interval
which is used for sending short frames like RTS, CTS and ACK.
• AIFS(Arbitration Inter Frame Spacing) : It includes two
different priority intervals like AIFS1 and AIFS2. AIFS1 is used
for sending high priority frames like voice whereas AIFS2 is
used for sending low priority frames like background traffic
that can differ until regular traffic.
• EIFS(Extended Inter Frame Spacing) : It is used to report a
station of an unknown/bad frame.
802.11 Frame Structure

Format of the 802.11 data frame.


802.11 Frame Structure
• 802.11 defines three different classes of frames i.e. data, control and management.
Different fields of the 802.11 data frame header are:
• Frame Control Field(2 bytes): It is made up of 11 subfields.
1. Protocol Version(2bit) : It is set to 00.
2. Type(2 bit): It can be either data, control or management frame type.
3. Subtype(4 bit): Can be like RTS/CTS.
4. To DS(1 bit) : Used to indicate that the frame is going to network connected to
AP.
5. From DS(1 bit): Used to indicate that the frame is coming from network
connected to AP.
6. More Fragments(1 bit): It is set which means more fragments will follow.
7. Retry(1 bit): It marks the retransmission of a frame sent earlier.
8. Power Management(1 bit): It indicates that the sender is going into a power
save mode.
9. More Data(1 bit): It indicates that the sender has additional frames for the
receiver.
10.Protected(1 bit): It indicates that the frame body has been encrypted for
security.
11.Order(1 bit): It tell that the receiver that higher layer expects the sequence of
frames to arrive strictly in order.
802.11 Frame Structure
• Duration(2 bytes): It tells how long the frame and its ack will occupy the
channel(NAV). It is in micro seconds.
• Address1(6 bytes): Receiver’s Address.
• Address2(6 bytes): Sender’s Address.
• Address3(6 bytes): Distant endpoint’s address(i.e. AP).
• Sequence(2 bytes): It is for numbering the frames so that duplicates can
be avoided.
• Data(0-2313 bytes):It contains payload upto 2312 bytes. It also
identifies the higher layer protocols to which payloads should be passed.
• Check Sequence(4 bytes): For error detection and correction.
Management frames have the same frame format as data frames except
that data portion includes a subtype field.
Control Frames are short and they have only Frame Control, Duration,
Address1 and Frame Check sequence fields(No data portion).
802.11 Services
802.11 defines a standard set of services:
• Association Service : It is used by mobile stations to connect themselves
to APs.
• Re-association : It allows a station to change its preferred AP. It is like
handover (Moving from one AP to another within same 802.11 network).
• Disassociate : A station may use this service before shutting down or
breaking relationship with an AP.
• Authenticate : Stations must authenticate before sending frames via the
AP. 802.11 provides security options like Open and WPA2. Authentication
is done after association.
• Distribution Service : Once the frame reaches the AP, the distribution
service determines how to route them.
• Integration Service : It handles any translation that is needed for a frame
to be sent outside the 802.11 LAN or for frames arriving into 802.11
network.
802.11 Services
• Data Delivery : This service lets the stations transmit and
receive data using various protocols described earlier.
• Privacy Service : It manages the details of encryption and
decryption.
• QOS Traffic Scheduling Service : It handles traffic with different
priorities.
• Transmit Power Control Service : It gives stations the
information they need to meet the regulatory limits on
transmit power that vary from region to region.
• Dynamic Frequency Selection Service : It gives the stations the
information they need to avoid transmitting on the frequencies
in the 5GHz band(used for radar in the proximity).
BROADBAND WIRELESS(802.16)
• The problem of running fiber or a coax cable
to millions of homes is very expensive. Hence
Broadband wireless was introduced.
• Erecting a big antenna on a hill just outside
the town is much easier and cheaper than
digging and laying various cables.
• Broadband wireless is also known as
WiMAX(Worldwide Interoperability for
Microwave Access).
802.16 Frame Format

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


802.16 Frame Format
• All the frames begin with a generic header followed by an optional payload
and an optional checksum(CRC).
• Payload is not needed in control frames Ex: A bandwidth request frame.
• EC bit tells whether the payload is encrypted or not.
• Type field specifies whether fragmentation are present or not.
• CI field indicates the presence or absence of the final checksum.
• EK field tells which of the encryption key is being used(if any).
• Length field gives the complete length of the frame including the header.
• Connection identifier tells which connection the frames belong to.
• Header CRC is the checksum over the entire header.
• Bytes Needed (16 bit) tells how much bandwidth is needed to carry the
specified number of bytes.
802.16 Architecture
802.16 Architecture
The base stations communicate with other
stations through a wireless air interface. Two
types of stations exist:
• Subscriber stations : They remain in fixed
location like broadband Internet access for
homes.
• Mobile Stations : They can receive service
while they are moving like dongle for a laptop.
802.16 Protocol Stack
802.16 Protocol Stack
• Physical layer deals with the transmission through popular
offerings like Fixed WiMAX and Mobile WiMAX.
• Both use OFDM but in different ways.
• The data link layer is divided into three sublayers :
1. Security Sublayer : It deals with privacy and security of
public networks. It manages encryption, decryption and
key management.
2. MAC Common Sublayer : It deals with channel
management and can schedule the downlink and uplink
channels very efficiently. It gives QoS guarantees for
services like telephony and multimedia.
3. Service Specific Convergence Sublayer : It provides an
interface to the network layer.

You might also like