Data Link layer
Fig-Multiple Access Mechanisms
• Developed in 1970 for Radio LAN
• A station is allowed to send whenever it has frame to send
• Length of frame is fixed
• There is possibility of collision of frames from different stations, as channel is shared.
• When frame is sent station wait for ack
• If ack does not arrive, after timeout it retransmit the frame.
• In slotted Aloha length of packet is fixed
• Time is divided into slots and every station can transmit only at beginning of time slot
• If station missing beginning of a slot then it has to wait until beginning of next time slot
• Central clock or station informs all other station about start of each time slot.
The throughput for Slotted ALOHA is
S = G × e−G
where G is the average number of frames requested per frame-time
The maximum throughput
Smax = 0.368 when G= 1
• It is based on principal “sense before transmit “or “listen before talk”
• If channel sensed idle: transmit entire frame
• If channel sensed busy, defer transmission
• The chance of collision can be reduced if senses medium before transmit.
• CSMA can reduce collision but cannot eliminate it.
There Are Three Different Type of CSMA Protocols:
(i) I-persistent CSMA
(ii) Non- Persistent CSMA
(iii) p-persistent CSMA
(i) I-persistent CSMA:
• In this method, station that wants to transmit data continuously senses the channel to check whether the channel is idle or busy.
• If the channel is busy, the station waits until it becomes idle.
• When the station detects an idle-channel, it immediately transmits the frame with probability 1. Hence it is called I-persistent CSMA.
• This method has the highest chance of collision because two or more stations may find channel to be idle at the same time and transmit their frames.
• When the collision occurs, the stations wait a random amount of time and start allover again.
Drawback of I-persistent:
The propagation delay time greatly affects this protocol. Let us suppose, just after the station I begins its transmission, station 2 also became ready to send its data and senses the channel. If the station I signal has not yet reached station 2, station 2 will sense the channel to be idle and will begin its transmission. This will result in collision.
Even if propagation delay time is zero, collision will still occur. If two stations became .ready in the middle of third station’s transmission, both stations will wait until the transmission of first station ends and then both will begin their transmission exactly simultaneously. This will also result in collision.
(ii) Non-persistent CSMA:
• In this scheme, if a station wants to transmit a frame and it finds that the channel is busy (some other station is transmitting) then it will wait for fixed interval oftime.
• After this time, it again checks the status of the channel and if the channel is.free it will transmit.
• A station that has a frame to send senses the channel.
• If the channel is idle, it sends immediately.
• If the channel is busy, it waits a random amount of time and then senses the channel again.
• In non-persistent CSMA the station does not continuously sense the channel for the purpose of capturing it when it detects the end of previous transmission.
Advantage of non-persistent:
It reduces the chance of collision because the stations wait a random amount of time. It is unlikely that two or more stations will wait for same amount of time and will retransmit at the same time.
Disadvantage of non-persistent:
It reduces the efficiency of network because the channel remains idle when there may be stations with frames to send. This is due to the fact that the stations wait a random amount of time after the collision.
(iii) p-persistent CSMA:
• This method is used when channel has time slots such that the time slot duration is equal to or greater than the maximum propagation delay time.
• Whenever a station becomes ready to send, it senses the channel.
• If channel is busy, station waits until next slot.
• If channel is idle, it transmits with a probability p.
• With the probability q=l-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 probabilities p and q.
• This process is repeated till either frame has been transmitted or another station has begun transmitting. In case of the transmission by another station, the station acts as though a collision has occurred and it waits a random amount of time and starts again.
Advantage of p-persistent:
It reduces the chance of collision and improves the efficiency of the network.
To reduce the impact of collisions on the network performance, Ethernet uses an algorithm called CSMA with Collision Detection (CSMA / CD): CSMA/CD is a protocol in which the station senses the carrier or channel before transmitting frame just as in persistent and non-persistent CSMA. If the channel is busy, the station waits. it listens at the same time on communication media to ensure that there is no collision with a packet sent by another station. In a collision, the issuer immediately cancel the sending of the package. This allows to limit the duration of collisions: we do not waste time to send a packet complete if it detects a collision. After a collision, the transmitter waits again silence and again, he continued his hold for a random number; but this time the random number is nearly double the previous one: it is this called back-off (that is to say, the “decline”) exponential. In fact, the window collision is simply doubled (unless it has already reached a maximum). From a packet is transmitted successfully, the window will return to its original size.
Again, this is what we do naturally in a meeting room if many people speak exactly the same time, they are realizing account immediately (as they listen at the same time they speak), and they interrupt without completing their sentence. After a while, one of them speaks again. If a new collision occurs, the two are interrupted again and tend to wait a little longer before speaking again
• The station that has a ready frame sets the back off parameter to zero.
• Then it senses the line using one of the persistent strategies.
• If then sends the frame. If there is no collision for a period corresponding to one complete frame, then the transmission is successful.
• Otherwise the station sends the jam signal to inform the other stations about the collision.
• The station then increments the back off time and waits for a random back off time and sends the frame again.
• If the back off has reached its limit then the station aborts the transmission.
• CSMA/CD is used for the traditional Ethernet.
• CSMA/CD is an important protocol. IEEE 802.3 (Ethernet) is an example of CSMNCD. It is an international standard.
• The MAC sublayer protocol does not guarantee reliable delivery. Even in absence of collision the receiver may not have copied the frame correctly.