3.1 MAC Protocol
3.1 MAC Protocol
network
• In Wireless Sensor Networks (WSNs), the Medium Access Control
(MAC) protocol is a set of guidelines that dictate how each node
should transmit data over the shared wireless medium. The primary
objective of the MAC protocol is to minimize the occurrence of idle
listening, over-hearing, and collisions of data packets. By efficiently
managing access to the wireless medium, the MAC protocol helps to
reduce energy consumption and optimize the use of network
resources.
MAC Protocol Categories
• Disadvantages:
• Sinkhole Attacks can cause a significant amount of damage to the WSN by
disrupting the network, stealing information, or causing the nodes to fail.
• The attacker node may need to use a significant amount of energy to advertise
itself as the shortest path, which can cause it to be detected by the legitimate
nodes.
• The WSN can be protected from Sinkhole Attacks by using secure routing
protocols that authenticate the nodes and verify the path before forwarding the
traffic.
Wireless DOS Attack on WiFi
• Dos attack is a denial-of-service attack which affects the server or a
website via sending a request of traffic and making it unreachable or
unavailable.This article will help you to know the working of a dos
attack on a Wifi.
What does a DOS Attack do?
• A Dos attack means to shut down a computer or the whole network,
making it unreachable to its users. It is accomplished by sending a
huge request traffic, or by sending some data that make the server
crash. Attackers mainly target web servers like media companies, e-
commerce websites, banking, etc. Most of the time, a dos attack
doesn’t result in loss of data.
There are 3 types of Dos attacks
• 1. Application-layer flood: In this type of attack, an attacker sends a
large number of requests on a server, which results in server crashes
and slow speeds of the network. In Application-layer flood requests
may vary within the range of thousands in a second to million, which
consume huge resources until the server crash or is unreachable to
the user.
• 2. Distributed Denial of Services Attacks: There is not much
difference between a Dos and DDoS attack. In this attack, not only
one computer sends requests but several computers are engaged in
sending requests to a specific target, making it disabled. These
computers have been hacked earlier and can be controlled by the
attacker.
• 3. Unintended Denial of Service Attacks: This type of attack is
wicked, i.e they are not nefarious. In this attack, websites are
overwhelmingly flooded with legitimate traffic to their destination
where the server is brought down completely.
Collision Avoidance in wireless networks-
We take a close look at so-called WiFi which is also known as IEEE standard 802.11
• Consider the situation depicted in the figure, where each of the four nodes
is able to send and receive signals that reach just the nodes to its
immediate left and right. For example, B can exchange frames with A and C
but it cannot reach D, while C can reach B and D but not A. (A and D’s reach
is not shown in the figure.) Suppose both A and C want to communicate
with B and so they each send it a frame. A and C are unaware of each other
since their signals do not carry that far. These two frames collide with each
other at B, but unlike an Ethernet, neither A nor C is aware of this collision.
A and C are said to be hidden nodes with respect to each other. According
to Wikipedia, the hidden node problem can be defined as “In wireless
networking, the hidden node problem or hidden terminal problem occurs
when a node is visible to a wireless access point (AP), but not to other
nodes communicating with that AP.”
Collision cannot be detected in hidden node
problem
• This is because the nodes A and C are out of range of each other(and so
cannot detect a collision while transmitting). Thus, Carrier sense multiple
access with collision detection (CSMA/CD) does not work, and collisions
occur. The data received by the access point is corrupted due to the
collision. To overcome the hidden node problem, RTS/CTS handshaking
(IEEE 802.11 RTS/CTS) is implemented in addition to the Carrier sense
multiple access with collision avoidance (CSMA/CA) scheme. A related
problem, called the exposed node problem, occurs under the following
stated circumstances: Suppose B is sending to A (as in the above Figure).
Node C is aware of this communication because it hears B’s transmission. It
would be a mistake for C to conclude that it cannot transmit to anyone just
because it can hear B’s transmission.
• For example, suppose C wants to transmit to node D. This is not a problem since
C’s transmission to D will not interfere with A’s ability to receive from B. We
address these problems by an algorithm known as Multiple Access with Collision
Avoidance (MACA). The sender and receiver exchange frames with each other
before transmitting data. This informs all nearby nodes that a transmission is
about to begin. Sender transmits Request to Send (RTS) frame to receiver. The
receiver then replies with clear to send (CTS) frame back to the sender. Any node
that receives CTS frame knows that it is close to the receiver, therefore, cannot
transmit a frame. Any node that receives the RTS frame but not the CTS frame
knows that is not close to the receiver to interfere with it, So it is free to transmit
data. Reference – Wikipedia This article is contributed by Nikhil Ranjan 10 and
Palak Jain. If you like GeeksforGeeks and would like to contribute, you can also
write an article using write.geeksforgeeks.org or mail your article to review-
[email protected]. See your article appearing on the GeeksforGeeks main
page and help other Geeks. Please write comments if you find anything incorrect,
or if you want to share more information about the topic discussed above.
Features of collision avoidance in wireless
networks include:
• Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA): This is a
protocol used in wireless networks to prevent data collisions. CSMA/CA ensures
that a device checks for the presence of other signals before transmitting data,
thus reducing the risk of collisions.
• Clear Channel Assessment (CCA): CCA is a mechanism used to determine
whether a wireless channel is clear or busy before transmitting data. This feature
helps to avoid collisions by ensuring that a device does not transmit data when
the channel is already in use.
• Request to Send (RTS) and Clear to Send (CTS): RTS and CTS are signals that are
sent between devices to reserve a channel for data transmission. These signals
help to prevent collisions by ensuring that only one device transmits data at a
time.
• Collision Detection: In cases where collisions do occur, collision detection helps
to reduce their impact by allowing the devices to detect and retransmit the data.
Features of collision avoidance in wireless
networks include:
• Backoff Algorithm: Backoff algorithm is a feature that ensures that devices wait for a
random period before attempting to retransmit data in the event of a collision. This
feature helps to reduce the risk of multiple devices attempting to transmit data
simultaneously, which could result in further collisions.
• Quality of Service (QoS): QoS is a mechanism that prioritizes traffic based on its
importance or urgency. By assigning different levels of priority to different types of
traffic, QoS can help prevent collisions by ensuring that important traffic gets transmitted
first, reducing the risk of collisions with less important traffic.
• Fragmentation: Fragmentation is the process of breaking up large packets of data into
smaller fragments before transmitting them. This helps to prevent collisions by reducing
the amount of time that any one device is transmitting data, allowing other devices to
access the channel more frequently.
• Power Control: Power control is a feature that adjusts the power level of a wireless
device based on its distance from the access point. By reducing the power level of
devices that are close to the access point, power control can help prevent collisions by
reducing the risk of interference with other devices on the network
Advantages of collision avoidance in wireless
networks:
• Improved network efficiency: Collision avoidance helps to reduce the
risk of data collisions, which can cause network congestion and slow
down data transmission. By ensuring that devices transmit data one
at a time, collision avoidance helps to improve network efficiency.
• Reduced data errors: Data collisions can lead to data errors and
packet loss. Collision avoidance helps to reduce these errors by
ensuring that data is transmitted in a controlled manner.
• Better network throughput: By reducing the risk of data collisions,
collision avoidance helps to increase network throughput, allowing
more data to be transmitted in a shorter period of time.
Disadvantages of collision avoidance in
wireless networks:
• Increased latency: Collision avoidance protocols like CSMA/CA introduce latency
into the network, as devices have to wait for their turn to transmit data. This can
lead to slower data transmission and increased response times.
• Network overhead: Collision avoidance protocols require additional signaling
between devices, which can increase network overhead and reduce overall
network efficiency.
• Limited scalability: Collision avoidance protocols like CSMA/CA may not scale
well in larger networks with many devices. As the number of devices increases,
the likelihood of collisions also increases, leading to decreased network
efficiency.
• Complexity: Implementing collision avoidance protocols can be complex and
require additional hardware and software resources. This can make it more
challenging to manage and troubleshoot network issues.
Difference between Deadlock Prevention and
Deadlock Avoidance
• Deadlock Prevention :
Deadlock prevention means to block at least one of the four
conditions required for deadlock to occur. If we are able to block any
one of them then deadlock can be prevented.
• The four conditions which need to be blocked are:-
• Mutual Exclusion
• Hold and Wait
• No Preemption
• Circular Wait
• Spooling and non-blocking synchronization algorithms are used to
prevent the above conditions.In deadlock prevention all the requests
are granted in a finite amount of time.
• 2. Deadlock Avoidance :
In Deadlock avoidance we have to anticipate deadlock before it really
occurs and ensure that the system does not go in unsafe state.It is
possible to avoid deadlock if resources are allocated carefully. For
deadlock avoidance we use Banker’s and Safety algorithm for
resource allocation purpose. In deadlock avoidance the maximum
number of resources of each type that will be needed are stated at
the beginning of the process.
Deadlock Avoidance in Distributed System
• Deadlocks are the fundamental problems in distributed systems. A
Deadlock is a situation where a set of processes are blocked as each
process in a Distributed system is holding some resources and that
acquired resources are needed by some other processes. In this
situation, a cycle arrives at a deadlock.
• Conditions of deadlock: A process in distributed systems uses
different resources in the following way.
• Request
• Use
• Releases
• That means, a process requests the resource and uses it in its
execution and after execution, it releases the resource.
• Methods for Handling Deadlock :
• There are four methods for handling Deadlock:
• Deadlock Prevention
• Deadlock Avoidance
• Deadlock Detection
• Deadlock Recovery
• Deadlock Avoidance:
• In Deadlock Avoidance, the system will be checked if it is in a safe
state or an unsafe state. Safe state is ensured when the request for
the resource by the process is permitted when there is no deadlock
found in the system. If there is deadlock found then the system will
be in an unsafe state.
• To avoid deadlocks the process should inform the system that how
many resources that a process should request for its execution. To
make that happen we use Algorithm.
• Step 1: Work and finish the 2 vectors of size m & n. Initialize work
with available and finish[i] = false
for i=1 to n , m=>#resources and n=>#processes.
• Step 2: Find an i such that both (i) finish[i] = false (ii) need(i) <= work ,
if no such i exists then go to Step 4.
• Step 3: Work = work + allocation
finish[i] = true
go to Step 2.
• Step 4: if finish[i] = true for all i then the system is in a safe state.