Module 2
Module 2
ASSISTANT PROFESSOR
DEPARTMENT OF ECE, SSIT-TUMKUR
COMPUTER COMMUNICATION NETWORKS – EC6TH3
MODULE -2
TOPICS
Media Access Control: Introduction. Random Access: ALOHA, CSMA, CSMA/CD,
CSMA/CA. Controlled Access: Reservation, Polling, Token Passing. Channelization:
FDMA, TDMA, CDMA.
Wired and Wireless LANs: Ethernet: Ethernet Protocol: IEEE 802, Ethernet
Evolution, Standard Ethernet: Characteristics, Efficiency.
INTRODUCTION:
▪ When nodes use shared-medium, we need multiple-access protocol to coordinate
access to medium.
▪ Analogy:
▪ This problem is similar to the rules of speaking in an assembly.
▪ We need to ensure
→ Each people has right to speak.
→ Two people do not speak at the same time
→ Two people do not interrupt each other (i.e. Collision Avoidance)
▪ Many protocols have been designed to handle access to a shared-link (Figure 12.1).
▪ These protocols belong to a sublayer in the data-link layer called Media Access
Control (MAC).
Pure ALOHA
In Figure 12.4,
▪ If station B sends a frame between t-Tfr and t, this leads to a collision between
the frames from station A and station B.
▪ If station C sends a frame between t and t+Tfr, this leads to a collision between
the frames from station A and station C.
Throughput :
Example 4.1
Example 4.2
SLOTTED ALOHA
▪ Slotted ALOHA was invented to improve the efficiency of pure ALOHA.
▪ The time is divided into time-slots of Tfr seconds (Figure 12.5).
▪ The stations are allowed to send only at the beginning of the time-slot.
▪ If a station misses the time-slot, the station must wait until the beginning of the next
time-slot.
▪ If 2 stations try to resend at beginning of the same time-slot, the frames will collide
again (Fig 12.6).
Throughput
▪ The average number of successful transmissions is given by
Example 4.3
CSMA
▪ CSMA was developed to minimize the chance of collision and, therefore, increase the
performance.
▪ CSMA is based on the principle “sense before transmit” or “listen before talk.”
▪ Here is how it works:
▪ Each station checks the state of the medium: idle or busy.
i) If the medium is idle, the station sends the data.
ii) If the medium is busy, the station defers sending.
▪ CSMA can reduce the possibility of collision, but it cannot eliminate it.
Vulnerable Time
▪ The vulnerable time is the propagation time Tp (Figure 12.8).
▪ The propagation time is the time needed for a signal to propagate from one end of
the medium to theother.
▪ Collision occurs when
→ a station sends a frame, and
→ other station also sends a frame during propagation time
▪ If the first bit of the frame reaches the end of the medium, every station will refrain
from sending.
Persistence Methods
1-Persistent
▪ Before sending a frame, a station senses the line (Figure 12.10a).
i) If the line is idle, the station sends immediately (with probability = 1).
ii) If the line is busy, the station continues sensing the line.
▪ This method has the highest chance of collision because 2 or more stations:
→ may find the line idle and
→ send the frames immediately.
Non-Persistent
▪ Before sending a frame, a station senses the line (Figure 12.10b).
i) If the line is idle, the station sends immediately.
ii) If the line is busy, the station waits a random amount of time and then senses
the line again.
▪ This method reduces the chance of collision because 2 or more stations:
→ will not wait for the same amount of time and
→ will not retry to send simultaneously.
P-Persistent
▪ This method is used if the channel has time-slots with a slot-duration equal to or
greater than themaximum propagation time (Figure 12.10c).
▪ Advantages:
✓ It combines the advantages of the other 2 methods.
✓ It reduces the chance of collision and improves efficiency.
▪ After the station finds the line idle, it follows these steps:
i) With probability p, the station sends the frame.
ii) With probability q=1-p, the station waits for the beginning of the next time-slot
and checksthe line again.
iii) If line is idle, it goes to step 1.
▪ If line is busy, it assumes that collision has occurred and uses the back off procedure.
CSMA/CD
Throughput :
▪ The throughput of CSMA/CD is greater than pure or slotted ALOHA.
▪ The maximum throughput is based on
→ different value of G
→ persistence method used (non-persistent, 1-persistent, or p-persistent) and
→ ‘p‟ value in the p-persistent method.
▪ For 1-persistent method, the maximum throughput is 50% when G =1.
▪ For non-persistent method, the maximum throughput is 90% when G is between 3
and 8.
Example 4.4
CSMA/CA
▪ Here is how it works (Figure 12.15):
1) A station needs to be able to receive while transmitting to detect a collision.
i) When there is no collision, the station receives one signal: its own signal.
ii) When there is a collision, the station receives 2 signals:Its own signal and Signal
transmitted by a second station.
2) To distinguish b/w these 2 cases, the received signals in these 2 cases must be
different.
2) Contention Window
▪ The contention-window is an amount of time divided into time-slots.
▪ A ready-station chooses a random-number of slots as its wait time.
▪ In the window, the number of slots changes according to the binary exponential back-
off strategy.
▪ For example: At first time, number of slots is set to one slot and
Then, number of slots is doubled each time if the station cannot detect an idle
channel.
3) Acknowledgment
▪ There may be a collision resulting in destroyed-data.
▪ In addition, the data may be corrupted during the transmission.
▪ To help guarantee that the receiver has received the frame, we can use
i) Positive acknowledgment and
ii) Time-out timer
Reservation
▪ Before sending data, each station needs to make a reservation of the medium.
▪ Time is divided into intervals.
▪ In each interval, a reservation-frame precedes the data-frames.
▪ If no. of stations = N, then there are N reservation mini-slots in the reservation-
frame.
▪ Each mini-slot belongs to a station.
▪ When a station wants to send a data-frame, it makes a reservation in its own
minislot.
▪ The stations that have made reservations can send their data-frames.
1)Select
▪ If the primary wants to send data, it tells the secondary to get ready to receive; this is
called select function.
▪ The primary
→ alerts the secondary about upcoming transmission by sending select frame
(SEL)
→ then waits for an acknowledgment (ACK) from secondary
→ then sends the data frame and
→ finally waits for an acknowledgment (ACK) from the secondary.
2)Poll
▪ If the primary wants to receive data, it asks the secondaries if they have anything to
send; this is called poll function.
▪ When the first secondary is approached, it responds either
→ with a NAK frame if it has no data to send or with data-frame if it has data to
send.
i)If the response is negative (NAK frame), then the primary polls the next secondary in
the same manner.
ii)When the response is positive (a data-frame), the primary
→ reads the frame and returns an acknowledgment (ACK frame).
Token Passing
▪ In a network, the stations are organized in a ring fashion i.e. for each station; there is
a predecessor and a successor.
I. The predecessor is the station which is logically before the station in the
ring.
II. The successor is the station which is after the station in the ring.
▪ The current station is the one that is accessing the channel now.
▪ A token is a special packet that circulates through the ring.
▪ Here is how it works:
✓ A station can send the data only if it has the token.
✓ When a station wants to send the data, it waits until it receives the token from its
predecessor.
✓ Then, the station holds the token and sends its data.
✓ When the station finishes sending the data, the station
→ releases the token & passes the token to the successor.
CHANNELIZATION PROTOCOLS
▪ Channelization is a multiple-access method.
▪ The available bandwidth of a link is shared b/w different stations in time, frequency,
or through code.
▪ Three channelization protocols:
1) FDMA (Frequency Division Multiple Access)
2) TDMA (Time Division Multiple Access) and
3) CDMA (Code Division Multiple Access)
FDMA
▪ The available bandwidth is divided into frequency-bands (Figure 12.21).
▪ Each band is reserved for a specific station.
▪ Each station can send the data in the allocated band.
▪ Each station also uses a bandpass filter to confine the transmitter frequencies.
▪ To prevent interferences, small guard bands are used to separate the allocated
bands from oneanother.
TDMA
▪ The stations share the bandwidth of the channel in time (Figure 12.22).
▪ Each time-slot is reserved for a specific station.
▪ Each station can send the data in the allocated time-slot.
CDMA
▪ CDMA simply means communication with different codes.
▪ CDMA differs from FDMA because
→ only one channel occupies the entire bandwidth of the link.
▪ CDMA differs from TDMA because
→ all stations can send data simultaneously; there is no timesharing.
Implementation
▪ Let us assume we have four stations 1, 2, 3, and 4 connected to the same channel.
▪ The data from station-1 are d1, from station-2 are d2, and so on.
▪ The code assigned to the first station is c1, to the second is c2, and so on.
▪ We assume that the assigned codes have 2 properties.
i. If we multiply each code by another, we get 0.
ii. If we multiply each code by itself, we get 4 (the number of stations).
Wired LANs :
IEEE Project 802 :
STANDARD ETHERNET
▪ The original Ethernet technology with data-rate of 10 Mbps are referred to as the
Standard Ethernet.
Characteristics
▪ Ethernet provides a connectionless service. Thus, each frame sent is independent of
another frame.
▪ Ethernet has no connection establishment or connection termination phases.
▪ The sender sends a frame whenever it has it.
▪ The receiver may or may not be ready for receiving the frame.
▪ The sender may overload the receiver with frames, which may result in dropping
frames.
i) If a frame drops, the sender will not know about it.
ii) If a frame is corrupted during transmission, the receiver drops the frame.
▪ Since IP is also connectionless, it will also not know about frame drops.
i) If the transport layer is UDP (connectionless protocol), the frame is lost.
ii) If the transport layer is TCP, the sender-TCP does not receive acknowledgment
for its segment and sends it again.
▪ Ethernet is also unreliable like IP and UDP.
ETHERNET FRAME FORMAT :
1) Preamble
▪ This field contains 7 bytes (56 bits) of alternating 0s and 1s.
▪ This field
→ alerts the receiving-system to the coming frame and
→ enables the receiving-system to synchronize its input timing.
▪ The preamble is actually added at the physical-layer and is not (formally) part of
the frame.
6) Data
▪ This field carries data encapsulated from the upper-layer protocols.
▪ Minimum data size = 46 bytes, Maximum data size = 1500 bytes.
7) CRC
▪ This field contains error detection information such as a CRC-32.
ADDRESSING
▪ In an Ethernet-network, each station has its own NIC (6-byte = 48 bits).
▪ The NIC provides the station with a 6-byte physical-address (or Ethernet-address).
▪ For example, the following shows an Ethernet MAC address:
Example 4.8
Example 4.9
Example 4.10
Implementation
▪ The Standard-Ethernet defines several physical-layer implementations (Table 13.1).
INTRODUCTION OF WIRELESS-LANS
▪ It is also referred to as IEEE 802.11 protocol
▪ Channel – Air (2.4GHz to 5HHz)
▪ At 2.4 GHz we have 3 channels & at 5GHz we have 23 channels, these channels are
are non-overlapping with a width of 20MHz.
1) Medium :
▪ In a wireless LAN, the medium is air, the signal is generally broadcast.
▪ When hosts in a wireless LAN communicate with each other, they are sharing the
same medium (multiple access).
2) Hosts :
▪ In a wired LAN, a host is always connected to its network at a point with a fixed
link layer address related to its network interface card (NIC).
▪ Of course, a host can move from one point in the Internet to another point, In this
case, its link-layer address remains the same, but its network-layer address will
change.
▪ In a wireless LAN, a host is not physically connected to the network; it can move
freely and can use the services provided by the network.
Characteristics
1) Attenuation
▪ The strength of electromagnetic signals decreases rapidly because the signal
disperses in all directions; only a small portion of it reaches the receiver.
▪ The situation becomes worse with mobile senders that operate on batteries and
normally have smallpower supplies.
2) Interference
▪ Another issue is that a receiver may receive signals not only from the intended
sender, but also fromother senders if they are using the same frequency band.
3) Multipath Propagation
▪ A receiver may receive more than one signal from the same sender because
electromagnetic waves can be reflected back from obstacles such as walls, the
ground, or objects.
▪ The result is that the receiver receives some signals at different phases (because
they travel differentpaths). This makes the signal less recognizable.
4) Error
▪ Error detection is more serious issues in a wireless network than in a wired network.
i) If SNR is high, it means that the signal is stronger than the noise
(unwanted signal), so wemay be able to convert the signal to actual data.
ii) When SNR is low, it means that the signal is corrupted by the noise and
the data cannot berecovered.
IEEE 802.11 Architecture
▪ The standard defines 2 kinds of services:
1) Basic service set (BSS) and
2) Extended service set (ESS).
BSS
▪ IEEE 802.11 defines the basic service set (BSS) as the building block of a wireless-
LAN.
▪ A basic service set is made of (Figure 15.4):
→ stationary or mobile wireless stations and
→ optional central base station, known as the access point (AP).
2) Infrastructure Network
▪ A BSS with an AP is referred to as an infrastructure network.
ESS
▪ The ESS is made up of 2 or more BSSs with APs (Figure 15.5).
▪ 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 does not restrict the distribution-system;The distribution-system can be
any IEEE LAN such as an Ethernet.
▪ The ESS uses 2 types of stations:
1) Mobile Stations are normal stations inside a BSS.
2) Stationary Stations are AP stations that are part of a wired LAN.
▪ When BSSs are connected, the stations within reach of one another can
communicate without theuse of an AP.
▪ However, communication between two stations in two different BSSs usually occurs
via two APs.
MAC Sublayer
▪ IEEE 802.11 defines 2 MAC sublayers:
1) Distributed coordination function (DCF) &
2) Point coordination function (PCF).
DCF
▪ One of the 2 protocols defined by IEEE at the MAC sublayer is called the
distributed coordinationfunction (DCF).
▪ DCF uses CSMA/CA as the access method.
Network Allocation Vector
▪ When a station sends an RTS frame, it includes the duration of time that it needs
to occupy the channel (NAV à Network Allocation Vector).
▪ The stations that are affected by this transmission create a timer called a NAV.
▪ NAV shows how much time must pass before these stations are allowed to check
the
2)D
▪ In all frame types except one, this field defines the duration of the transmission
that is used to set the value of NAV.
▪ In one control frame, this field defines the ID of the frame.
3) Addresses
▪ There are four address fields, each 6 bytes long.
▪ . The meaning of each address field depends on the value of the To DS and From
DS subfields.
4) Sequence Control
▪ This field defines the sequence number of the frame to be used in flow
control.
5) Frame Body
▪ This field contains information based on the type and the subtype defined in
the FC field.
▪ This field can be between 0 and 2312 bytes.
▪
6)FCS
▪ The FCS contains a CRC-32 error detection sequence.
Frame Types
▪ A wireless-LAN defined by IEEE 802.11 has three categories of frames:
▪ 1.management frames, 2.control frames, and 3.data-frames.
▪ Management Frames: Management frames are used for the initial communication
between stations and access points.
▪ Control Frames: Control frames are used for accessing the channel and
acknowledging frames (Figure 15.10).
Control Frames
▪ Control frames are used for accessing the channel and acknowledging frames (Figure
15.10).
▪ For control frames the value of the type field is 01; the values of the subtype fields
for frames are shown in the table 14.2.
Data Frames
▪ Data-frames are used for carrying data and control information.
BLUETOOTH:
Introduction :
▪ Bluetooth is a wireless-LAN technology designed to connect devices of different
functions such as telephones, notebooks, computers, cameras, printers, coffee
makers, and so on.
▪ A Bluetooth LAN is an adhoc network. This means the network is formed
spontaneously.
▪ The devices
→ find each other and make a network called a piconet (Usually, devices are
called gadgets)
Applications :
▪ Bluetooth technology has several applications.
▪ Peripheral devices such as a wireless mouse/keyboard can communicate with the
computer.
▪ In a small health care center, monitoring-devices can communicate with sensor-
devices.
▪ Home security devices can connect different sensors to the main security
controller.
▪ Conference attendees can synchronize their laptop computers at a conference.
BLUETOOTH ARCHITECTURE :
▪ Today, Bluetooth technology is the implementation of a protocol defined by the
IEEE 802.15 standard.
▪ Bluetooth defines 2 types of networks: 1) Piconet and 2) Scatternet.
PICONET:
SCATTERNET :
▪ Assume that station B is sending data to station A. In the middle of this transmission,
station C also has data to send to station A.
▪ However, station C is out of B’s range and transmissions from B cannot reach C.
Therefore C thinks the medium is free. Station C sends its data to A, which results in
a collision at A because this station is receiving data from both B and C.
▪ In this case, we say that stations B and C are hidden from each other with respect to
A. Hidden stations can reduce the capacity of the network because of the possibility
of collision.
QUESTION BANK :
1) List the characteristics of Wireless LANs
2) Explain CSMA/CD working with the help of flow chart
3) Explain CSMA/CA working with the help of flow chart
4) What is Controlled access ? Explain different control access methods.
5) A Slotted ALOHA networks transmit 200-bit frame on a shared channel of 200
Kbps. Find the throughput, if the system produces i)1000 frames per second ii) 500
frames per second iii) 250 frames per second
6) Explain the Ethernet frame format of standard Ethernet.
7) Illustrate the working of Code Division Multiple access(CDMA) with an example.
8) Explain CSMA/CD working with the help of flow chart
9) Explain Pure ALOHA & Slotted ALOHA protocols
10) Explain Bluetooth architecture
11) Describe the MAC layers in IEEE 802.11 standard.
12) With a neat sketch explain BSS & ESS
13) Write a note on Piconet & Scatternet in Bluetooth.
14) Explain 1-persistant, non-persistant and p-persistant methods of CSMA.