SNS COLLEGE OF TECHNOLOGY
Coimbatore-35.
An Autonomous Institution
Accredited by NBA – AICTE and Accredited by NAAC – UGC with ‘A+’ Grade
Approved by AICTE, New Delhi & Affiliated to Anna University, Chennai
COURSE NAME : 16IT301 COMPUTER NETWORKS
III YEAR/ V SEMESTER
UNIT – II INTERNETWORKING AND ROUTING
Topic: CSMA/CD,CDMA/CA
[Link]
Assistant Professor
Department of Computer Science and Engineering
Carrier Sense Multiple Access with Collision Detection
(CSMA/CD)
• 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 exponential.
• In fact, the window collision is simply doubled. From a packet is transmitted successfully, the
window will return to its original size.
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
2/13
/[Link], AP/CSE
• Again, this is what we do naturally in a meeting
room if many people speak exactly the same
time, they are realizing account immediately 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.
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
3/13
/[Link], AP/CSE
Frame format of CSMA/CD
The frame format specified by IEEE 802.3 standard contains following fields.
1. Preamble: It is seven bytes (56 bits) that provides bit synchronization. It consists of alternating Os and 1s. The purpose
is to provide alert and timing pulse.
2. Start Frame Delimiter (SFD): It is one byte field with unique pattern: 10 10 1011. It marks the beginning of frame.
3. Destination Address (DA): It is six byte field that contains physical address of packet's destination.
4. Source Address (SA): It is also a six byte field and contains the physical address of source or last device to forward
the packet (most recent router to receiver).
5. Length: This two byte field specifies the length or number of bytes in data field.
6. Data: It can be of 46 to 1500 bytes, depending upon the type of frame and the length of the information field.
7. Frame Check Sequence (FCS): This for byte field contains CRC for error detection.
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
4/13
/[Link], AP/CSE
CSMA/CD Procedure
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
5/13
/[Link], AP/CSE
Assessment -1
In CSMA/CD, What will happen in the following cases?
Case 1: if data-frame transmission succeeds?
Case 2: if data-frame transmission failed?
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
6/13
/[Link], AP/CSE
Carrier Sense Multiple Access with Collision Avoidance
(CSMA/CA)
CSMA/CA protocol is used in wireless networks because they cannot detect the
collision, so the only solution is collision avoidance.
CSMA/CA avoids the collisions using three basic techniques.
(i) Interframe space
(ii) Contention window
(iii) Acknowledgements
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
7/13
/[Link], AP/CSE
1. Interframe Space (IFS)
• Whenever the channel is found idle, the station does not transmit immediately. It
waits for a period of time called interframe space (IFS).
• When channel is sensed to be idle, it may be possible that same distant station may
have already started transmitting and the signal of that distant station has not yet
reached other stations.
• Therefore the purpose of IFS time is to allow this transmitted signal to reach other
stations.
• If after this IFS time, the channel is still idle, the station can send, but it still needs
to wait a time equal to contention time.
• IFS variable can also be used to define the priority of a station or a frame.
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
8/13
/[Link], AP/CSE
2. Contention Window
• Contention window is an amount of time divided into slots.
• A station that is ready to send chooses a random number of slots as its wait time.
• The number of slots in the window changes according to the binary exponential back-off
strategy. It means that it is set of one slot the first time and then doubles each time the station
cannot detect an idle channel after the IFS time.
• This is very similar to the p-persistent method except that a random outcome defines the
number of slots taken by the waiting station.
• In contention window the station needs to sense the channel after each time slot.
• If the station finds the channel busy, it does not restart the process. It just stops the timer &
restarts it when the channel is sensed as idle.
3. Acknowledgement
• Despite all the precautions, collisions may occur and destroy the data.
• The positive acknowledgment and the time-out timer can help guarantee that receiver has
received the frame.
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
9/13
/[Link], AP/CSE
CSMA/CA Procedure
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
10/13
/[Link], AP/CSE
Assessment -2
List the difference between CSMA/CA and CSMA/CD
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
11/13
/[Link], AP/CSE
References
• Larry L. Peterson, Bruce S. Davie, “Computer Networks: A systems approach”,
Fifth Edition, Morgan Kaufmann Publishers, 2011.
• Behrouz A. Forouzan, “Data communication and Networking”, Fourth Edition,
Tata McGraw – Hill, 2011.
• James F. Kurose, Keith W. Ross, “Computer Networking - A Top-Down
Approach Featuring the Internet”, Fifth Edition, Pearson Education, 2009
• Nader. F. Mir, “Computer and Communication Networks”, Pearson Prentice Hall
Publishers, 2010.
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
12/13
/[Link], AP/CSE
16IT301 -Computer Networks/Unit-II/CSMA/CD,CDMA/CA
13/13
/[Link], AP/CSE