Unit 2 Whole

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

MAC protocols

Medium Access Control (MAC) protocols is the first


protocol layer above the Physical Layer (PHY)
and consequently MAC protocols are heavily influenced by
its properties. The fundamental task of
any MAC protocol

Fundamentals of (wireless) MAC protocols

Nodes in an Ad-hoc wireless network share a common


broadcast radio channel. Since the radio spectrum is limited,
the bandwidth available for communication in such
networks is also limited. Access to this shared medium
should be controlled in such a manner that all nodes receive
a fair share of the available bandwidth, and that the
bandwidth is utilized efficiently. Characteristics of the
wireless medium are completely different from wired
medium. So a different set of protocols is required for
controlling access to the shared medium in such networks.
This is achieved by using Medium Access Control (MAC)
protocol.
Requirements and design constraints for wireless MAC protocols

If two nodes are out of reach, they cannot hear each other. This
gives rise to the well-known hidden-terminal/exposed-terminal
problems. The hidden-terminal problem occurs specifically
for the class of Carrier Sense MultipleAccess (CSMA) protocols,
where a node senses the medium before starting to transmit a
packet.
If the medium is found to be busy, the node defers its packet to
avoid a collision and a subsequent
retransmission. Consider the example in Figure 5.1. Here, we have
three nodes A, B, and C that
are arranged such that A and B are in mutual range, B and C are in
mutual range, but A and C
cannot hear each other. Assume that A starts to transmit a packet to
B and some time later node C
also decides to start a packet transmission. A carrier-sensing
operation by C shows an idle medium
sinceC cannot hear A’s signals. When C starts its packet, the signals
collide at B and both packets
are useless. Using simple CSMA in a hidden-terminal scenario thus
leads to needless collisions.
In the exposed-terminal scenario

Exposed Terminal Problem:

In wireless networks, when a node is prevented from sending packets to other


nodes because of a neighboring transmitter is known as the exposed node
problem.
Consider the below wireless network having four nodes labeled A, B, C, and D,
where the two receivers are out of range of each other, yet the two transmitters
(B, C) in the middle are in range of each other. Here, if a transmission between A
and B is taking place, node C is prevented from transmitting to D as it concludes
after carrier sense that it will interfere with the transmission by its neighbor node
B. However note that node D could still receive the transmission of C without
interference because it is out of range from B. Therefore, implementing directional
antenna at a physical layer in each node could reduce the probability of signal
interference, because the signal is propagated in a narrow band.

The exposed terminal analogy is described as follows:

 B sends to A, C wants to send to another terminal D not A or B


 C senses the carrier and detects that the carrier is busy.
 C postpones its transmission until it detects the medium as being idle
again
 But A is outside radio range of C, waiting is not necessary
 C is “exposed” to B
C’s transmission and bandwidth is wasted. Using simple CSMA in an exposed terminal scenariothus
leads to needless waiting.
Two solutions to the hidden-terminal and exposed-terminal problems are busy-tone solutionsand the
RTS/CTS handshake used
Multiple Access Collision Avoidance for Wireless
A Media Access Protocol for Wireless LANs is based on MACA Protocol.
MACA Protocol:
When a node wants to transmit a data packet, it first transmit a RTS (Request To Send) frame.
The receiver node, on receiving the RTS packet, if it is ready to receive the data packet,
transmits a CTS (Clear to Send) packet.
Once the sender receives the CTS packet without any error, it starts transmitting the data
packet.
If a packet transmitted by a node is lost, the node uses the Binary Exponential Back-off (BEB)
algorithm to back-off a random interval of time before retrying. The problem is solved by
MACAW.

MACA EXAMPLES:
1. MACA avoids the problem of hidden terminals
 A and C want to send to B
 A sends RTS first
 C waits after receiving CTS from B

2. MACA avoids the problem of exposed terminals


 B wants to send to A, C to another terminal
 Now C does not have to wait for it cannot receive
CTS from A

WSNs, the balance of requirements is different from traditional (wireless) networks.


Additional requirements come up, first and foremost, the need to conserve energy

Reasons for unnecessary waste in energy:


In wsn nodes share common channel.to avoid collision MAC protocol provide access to channels in
MAC sublayer.

Collisions collisions incur useless receive costs at the destination node, useless transmit costs at the
source node, and the prospect to expend further energy upon packet retransmission. Hence,
collisions should be avoided, either by design (fixed assignment/TDMA or demand assignment
protocols)

Overhearing Unicast frames have one source and one destination node.and it send to another node.

Idle listening A node being in idle state is ready to receive a packet but is not currently
receivingAnything
Over emmiting:

Node send data when receiving node not ready to accept data.
.

Bluetooth
Bluetooth specification details the entire protocol stack. Bluetooth employs
Radio Frequency (RF) for communication. It makes use of frequency
modulation to generate radio waves in the ISM band.

Piconets and Scatternets


Bluetooth enabled electronic devices connect and communicate wirelessly through
shortrange devices known as Piconets. Bluetooth devices exist in small ad-hoc
configurations with the ability to act either as master or slave the specification
allows a mechanism for master and slave to switch their roles. Point to point
configuration with one master and one slave is the simplest configuration.

When more than two Bluetooth devices communicate with one another, this is
called a PICONET. A Piconet can contain up to seven slaves clustered around a
single master. The device that initializes establishment of the Piconet becomes
the master.

The master is responsible for transmission control by dividing the network into a
series of time slots amongst the network members, as a part of time division
multiplexing scheme which is shown below.
he features of Piconets are as follows −

 Within a Piconet, the timing of various devices and the frequency hopping
sequence of individual devices is determined by the clock and unique 48-
bit address of master.

 Each device can communicate simultaneously with up to seven other devices


within a single Piconet.

 Each device can communicate with several piconets simultaneously.

 Piconets are established dynamically and automatically as Bluetooth enabled


devices enter and leave piconets.

 There is no direct connection between the slaves and all the connections are
essentially master-to-slave or slave-to-master.

 Slaves are allowed to transmit once these have been polled by the master.

 Transmission starts in the slave-to-master time slot immediately following


a polling packet from the master.

 A device can be a member of two or more piconets, jumping from one


piconet to another by adjusting the transmission regime-timing and
frequency hopping sequence dictated by the master device of the second
piconet.

 It can be a slave in one piconet and master in another. It however cannot


be a master in more than once piconet.

 Devices resident in adjacent piconets provide a bridge to support inner-


piconet connections, allowing assemblies of linked piconets to form a
physically extensible communication infrastructure known as Scatternet.

 Classification of MAC protocols:


 1)schedule based
 2)random access based

 1)Scheduling Based MAC Protocols During the initialization phase, scheduling based schemes
assign collision-free links between neighboring nodes. However, links may be allocated as
frequency division multiplexing (FDM) bands, time division multiplexing (TDM) slots, or code
division multiple access (CDMA) based spread spectrum codes. Due to the complexities that
incurred with FDMA and CDMA schemes, therefore, WSNs prefer TDMA schemes as
scheduling methods to reduce the incurred complexity. In TDMA schemes, the system time is
divided into slots. These slots are then assigned to all the neighboring nodes. However, the
schedule controls the participant authorization on the resources with regular time. The
schedule is typically regulated by a central authority; as well it can be fixed or computed on
demand (or a hybrid). On other hand, a node does not need any contention with its
neighbors, since it can only access its allocated time slot.
 2)random access protocol single radio channel is shared among all nodes and they allocate on
demand.
 No protocol reserve channel.
 Each node access channel for random period of time.

 No node have priority over another node to reserve channel

Scheduling Based MAC Protocol.


LEACH is Scheduling Based MAC Protocols

◾ LEACH stands for Low-Energy Adaptive Clustering Hierarchy


◾ It is clustering protocol which reduces dissipation of energy in sensor network.

◾ This WSN is considered to be a dynamic clustering method

◾ LEACH has two phases

Problem in wsn:

◾ The reason we need network protocol such as LEACH is due to the fact that a node in the
network is no longer useful when its battery dies

◾ This protocol allows us to choose out the lifespan of the nodes, allowing it to do only the
minimum work it needs to transmit data

The Cluster-Head

◾ The LEACH Network is made up of nodes, some of which are called cluster-heads
 The job of the cluster-head is to collect data from their surrounding nodes and pass
it on to the base station

 LEACH is dynamic because the job of cluster-head rotates

LEACH’s Two Phases

◾ The LEACH network has two phases: the set-up phase and the steady-state

 The Set-Up Phase

▪ Where cluster-heads are chosen.

▪ In set up phase each node randomly selects number between 0 and 1.

▪ If this number is smaller than threshold for node ‘n’.

▪ Cluster-heads can be chosen randomly based on this algorithm


▪ If n < T(n), then that node becomes a cluster-head

▪ The algorithm is designed so that each node becomes a cluster-head at least


once

 The Steady-State

▪ The cluster-head is maintained

▪ When data is transmitted between nodes

▪ The goal of these protocol is to increase the life of the network


▪ The changes between the LEACH algorithm and the LEACH-C deterministic
algorithm alone is proven to increase the FND (First Node Dies) lifetime by
30% and the HND (Half Node Dies) lifetime by 20%

Advantages:

1) cluster head directly communicate with base station in single hop

2)support data aggregation.

3)as compared with other clustering protocol Leach life time is more

DisAdvantages:

1) only suitable for homogeneous type of wireless network.

2) no peer to peer communication amoung the nodes of the cluster

Data dissemination and gathering


The way that data and queries are forwarded between the base station and the location
where the target phenomena are observed is an important aspect and a basic
feature of WSNs. A simple approach to accomplishing this task is for each sensor
node to exchange data directly with the base station. A single-hop-based approach,
however, is costly, as nodes that are farther away from the base station may deplete
their energy reserves quickly, thereby severely limiting the lifetime of the network.
This is the case particularly where the wireless sensors are deployed to cover a large
geographical region or where the wireless sensors are mobile and may move away
from the base station
Multihop data and query forwarding

WSN Routing Techniques


The design of routing protocols for WSNs must consider the power and resourcelimitations of the
network nodes, the time-varying quality of the wireless channel,
and the possibility for packet loss and delay. To address these design requirements,
several routing strategies for WSNs have been proposed. One class of routing protocols
adopts a flat network architecture in which all nodes are considered peers. A
flat network architecture has several advantages, including minimal overhead to
maintain the infrastructure and the potential for the discovery of multiple routes
between communicating nodes for fault tolerance.

Flooding and Its Variants


Flooding is a common technique frequently used for path discovery and information
dissemination in wired and wireless ad hoc networks. The routing strategy is

simple and does not rely on costly network topology maintenance and complex
route discovery algorithms. Flooding uses a reactive approach whereby each
node receiving a data or control packet sends the packet to all its neighbors.
After transmission, a packet follows all possible paths.

Unless the network is disconnected,


the packet will eventually reach its destination. Furthermore, as the network
topology changes, the packet transmitted follows the new routes
The Transmission Control Protocol (TCP) is one of the most important
protocols of Internet Protocols suite. It is most widely used protocol for data
transmission in communication network such as internet.

Features
 TCP is reliable protocol. That is, the receiver always sends either positive or
negative acknowledgement about the data packet to the sender, so that the
sender always has bright clue about whether the data packet is reached the
destination or it needs to resend it.

 TCP ensures that the data reaches intended destination in the same order it
was sent.

 TCP is connection oriented. TCP requires that connection between two


remote points be established before sending actual data.

 TCP provides error-checking and recovery mechanism.

 TCP provides end-to-end communication.

 TCP provides flow control and quality of service.

 TCP operates in Client/Server point-to-point mode.


 TCP provides full duplex server, i.e. it can perform roles of both receiver and
sender.
The various TCP services provided by the TCP to the application layer are as follows:
 Process-to-Process Communication –
TCP provides process to process communication, i.e, the transfer of data takes place
between individual processes executing on end systems. This is done using port
numbers or port addresses. Port numbers are 16 bit long that help identify which
process is sending or receiving data on a host.
 Stream oriented –
This means that the data is sent and received as a stream of bytes(unlike UDP or IP
that divides the bits into datagrams or packets). However, the network layer, that
provides service for the TCP, sends packets of information not streams of bytes.
Hence, TCP groups a nuber of bytes together into a segment and adds a header to
each of these segments and then delivers these segments to the network layer. At the
network layer, each of these segments are encapsulated in an IP packet for
transmission. The TCP header has information that is required for control purpose
which will be duscussed along with the segment structure.
 Full duplex service –
This means that the communication can take place in both directions at the same
time.
 Connection oriented service –
Unlike UDP, TCP provides connection oriented service. It defines 3 different phases:
o Connection establishment
o Data transfer
o Connection termination
(IMP: This is a logical connection, not physical)
 Reliability –
TCP is reliable as it uses checksum for error detection, attempts to recover lost or
corrupted packets by re-transmission, acknowledgement policy and timers. It uses
features like byte number and sequence number and acknowledgement number so as
to ensure reliability. Also, it uses congestion control mechanisms.
 Multiplexing –
TCP does multiplexing and de-multiplexing at the sender and receiver ends
respectively as a number of logical connections can be established between port
numbers over a physical connection.

TCP connection establishment

A TCP connection is established by using a three-way handshake. The connection


establishment phase uses the sequence number, the acknowledgment numberand
the SYN flag. When a TCP connection is established, the two communicating hosts negotiate
the initial sequence number to be used in both directions of the connection. For this, each TCP
entity maintains a 32 bits counter, which is supposed to be incremented by one at least every
4 microseconds and after each connection establishment [3]. When a client host wants to open
a TCP connection with a server host, it creates a TCP segment with :

 the SYN flag set


 the sequence number set to the current value of the 32 bits counter of the client
host’s TCP entity

Upon reception of this segment (which is often called a SYN segment), the server host replies
with a segment containing :

 the SYN flag set


 the sequence number set to the current value of the 32 bits counter of the
server host’s TCP entity
 the ACK flag set
 the acknowledgment number set to the sequence number of the
received SYN segment incremented by 1 (mod232)(mod232). When a TCP
entity sends a segment having x+1 as acknowledgment number, this indicates
that it has received all data up to and including sequence number x and that it
is expecting data having sequence number x+1. As the SYN flag was set in a
segment having sequence number x, this implies that setting the SYN flag in a
segment consumes one sequence number.

This segment is often called a SYN+ACK segment. The acknowledgment confirms to the client
that the server has correctly received the SYN segment. The sequence number of
the SYN+ACK segment is used by the server host to verify that the client has received the
segment. Upon reception of the SYN+ACKsegment, the client host replies with a segment
containing :

 the ACK flag set


 the acknowledgment number set to the sequence number of the
received SYN+ACK segment incremented by 1 (mod232)(mod232)

At this point, the TCP connection is open and both the client and the server are allowed to
send TCP segments containing data. This is illustrated in the figure below.
Establishment of a TCP connection

The User Datagram Protocol (UDP) is simplest Transport Layer communication


protocol available of the TCP/IP protocol suite. It involves minimum amount of
communication mechanism. UDP is said to be an unreliable transport protocol but
it uses IP services which provides best effort delivery mechanism.
Features
 UDP is used when acknowledgement of data does not hold any significance.

 UDP is good protocol for data flowing in one direction.

 UDP is simple and suitable for query based communications.

 UDP is not connection oriented.

 UDP does not provide congestion control mechanism.

 UDP does not guarantee ordered delivery of data.

 UDP is stateless.

 UDP is suitable protocol for streaming applications such as VoIP, multimedia


streaming.

UDP Operation:
The different operations of UDP are as follows:

Connectionless Services:

UDP provides a connectionless service. This means that each user datagram sent
by UDP is an independent datagram. There is no relationship between the
different user datagrams even if they are coming from the same source process
and going to the same destination program. The user datagrams are not
numbered. Also, there is no connection establishment and no connection
termination. This means that each user datagram can travel on a different path.

Flow and Error Control:

UDP is a very simple, unreliable transport protocol. There is no flow control and
hence no window mechanism. The receiver may overflow with incoming
messages. There is no error control mechanism in UDP except for the checksum.
The lack of flow control and error control means that the process using UDP
should provide these mechanisms.

Encapsulation and Decapsulation:

To send a message from one process to another, the UDP protocol encapsulates
and decapsulates messages in an IP datagram.

Queuing:

In UDP, queues are associated with ports. Consider the following figure
At the client site:

When a process starts, it requests a port number from the operating system.
Some implementations create both an incoming and an outgoing queue
associated with each process. Other implementations create only an incoming
queue associated with each process. The queues opened by the client are, in
most cases, identified by ephemeral port numbers. The queues function as long
as the process is running. When the process terminates, the queues are
destroyed.

The client process can send messages to the outgoing queue by using the source
port number specified in the request. UDP removes the messages one by one
and, after adding the UDP header, delivers them to IP. An outgoing queue can
overflow. If this happens, the operating system can ask the client process to wait
before sending any more messages.
At the server site, the mechanism of creating queues is different. In its simplest
form, a server asks for incoming and outgoing queues, using its well-known port,
when it starts running. The queues remain open as long as the server is
running.
Mobile ip
Mobile IP is a communication protocol (created by extending Internet Protocol, IP) that allows the users to
move from one network to another with the same IP address. It ensures that the communication will
continue without the user’s sessions or connections being dropped.

Terminologies:
Mobile Node (MN)
is the hand-held communication device that the user carries e.g. Cell phone.
Home Network is a network to which the mobile node originally belongs as per its assigned IP address
(home address).
Home Agent (HA)
is a router in-home network to which the mobile node was originally connected
Home Address
is the permanent IP address assigned to the mobile node (within its home network).
Foreign Network
is the current network to which the mobile node is visiting (away from its home network).
Foreign Agent (FA)
is a router in a foreign network to which the mobile node is currently connected. The packets from the home
agent are sent to the foreign agent which delivers them to the mobile node.
Correspondent Node (CN)
is a device on the internet communicating to the mobile node.
Care-of Address (COA)
is the temporary address used by a mobile node while it is moving away from its home network.
Foreign agent COA,
the COA could be located at the FA, i.e., the COA is an IP address of the FA. The FA is the tunnel end-
point and forwards packets to the MN. Many MN using the FA can share this COA as a common COA.
Co-located COA,
the COA is co-located if the MN temporarily acquired an additional IP address which acts as COA. This
address is now topologically correct, and the tunnel endpoint is at the MN. Co-located addresses can be
acquired using services such as DHCP.
Network integration
Agent Advertisement
 HA and FA periodically send advertisement messages into their
subnets
 MN reads a COA from the FA advertisement messages
Registration (always limited lifetime!)
 MN signals COA to the HA via the FA, HA acknowledges
 Messeges need to be secured by authentication
Advertisement
 HA advertises the MN IP address (as for fixed systems)
 routers adjust their entries, (HA responsible for a long time)
 All packets to MN are sent to HA

Encapsulation
Optimization of packet forwarding
Triangular Routing
 sender sends all packets via HA to MN
 Triangular routes longer, higher latency and network load
“Solutions”
 HA informs a sender about the location of MN
 sender learns current location of MN
 direct tunneling to this location
 big security problems!
Change of FA
 packets on-the-fly during the change can be lost
 new FA informs old FA to avoid packet loss
 old FA forwards remaining packets to new FA
 Update also enables old FA to release resources for MN

Mobile IP and IPv6

Mobile IP was developed for IPv4, but IPv6 simplifies the protocols
 security is integrated, not add-on, authentication of registration included
 COA can be assigned via auto-configuration (DHCPv6 is one candidate)
 every node has address autoconfiguration
 no need for a separate FA, all routers perform router advertisement
 MN can signal a sender directly the COA, without HA
 „soft“ hand-over, i.e. without packet loss supported
 MN sends the new COA to its old router
 old router encapsulates all packets for MN, forwards them to new COA
 authentication is always granted

Problems with mobile IP

Security
 FA typically belongs to another organization
 authentication with FA problematic
 patent and export restrictions
Firewalls
 Firewalls filter based on IP addresses
 FA encapsulates packets from MN
 Home firewalls rejects packet from MN (unless reverse tunneling)
 MN can no longer send packets back to home network
QoS, etc..
Security, firewalls, QoS etc. are topics of current research and discussions!

You might also like