{"id":526,"date":"2012-03-02T20:07:04","date_gmt":"2012-03-02T20:07:04","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=526"},"modified":"2012-03-02T20:07:04","modified_gmt":"2012-03-02T20:07:04","slug":"carrier-sense-multiple-access-collision-detect-csmacd-explained","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=526","title":{"rendered":"Carrier Sense Multiple Access Collision Detect (CSMA\/CD) Explained"},"content":{"rendered":"<p>First thing is first: save  yourself some trouble and remember that carrier sense multiple access  collision detect is best referred to as simply CSMA\/CD. We\u2019ve heard some  ridiculously long terms before, but CSMA\/CD takes the cake.<\/p>\n<p>Jokes aside, this media-access mechanism is what  keeps networks running. If two or more computers transmit data at the  same time, we get data collision. And thus, no data is sent or received.  Luckily we have CSMA\/CD for both preventing and controlling collisions.  The question is: how do you create a sense of order when an entire  network of computers wants to constantly transmit data?<\/p>\n<h3><strong>Simplex, Half-Duplex, and Full-Duplex Operation<\/strong><\/h3>\n<p>Before we get into CSMA\/CD in particular, we need  to review who is vulnerable to collisions. Some types of data  transmission are virtually invulnerable to collisions- while others are  somewhat lacking in this defense.<\/p>\n<p>Simplex transmission is, well- simple. It is a  connection in which data will always flow in one direction, and will not  suffer collisions as a result. Since data flows in one direction, this  is poor for mutual communication- so we likely won\u2019t see simplex  operation in everyday networks. You do, however, come into contact with  simplex transmissions more than you think. Your cable company sends  video in a one-way data transmission to your television set.<\/p>\n<p>Half-duplex transmission allows both devices to  communicate. However, note that in the above diagram that data is only  being sent from one device at a time. Half-Duplex operation is where  almost all collisions will take place: since each device may not know  the other is transmitting. If this occurs, the data collides over the  line and the data is corrupted.<\/p>\n<p>For a practical example, we could make reference to  phones. If you try to call someone who is using the phone line, you  will more than likely get a busy tone and not get a connection to the  person. This is the same principle; although with computers we will get a  destructive loss in data, as compared to a busy tone the phone would  provide.<\/p>\n<p>Full-duplex operation is much like half-duplex,  only devices can send and receive data at the same time. Virtually no  collisions take place on a full-duplex transmission. Perhaps a bigger  benefit is the increase in overall throughput- since we are sending and  receiving on two different channels, we just theoretically doubled our  data transfer rate.<\/p>\n<p>It is important to note that even with full-duplex  transmission it is possible to get collisions. Most notably, this will  occur when a full-duplex transmission is configured for a network that  operates under a hub. If we were to replace that hub with a switch, we  could actually eliminate the collisions. (This is because switches use  microsegmentation to forward data only to computers who need it, while  hubs forward incoming data to all computers connected to it. Thus, the  fault lies within the collision-prone characteristics of the hub.)<\/p>\n<h3><strong>CSMA\/CD: What\u2019s in a Name?<\/strong><\/h3>\n<p>First let\u2019s take a look at what CS (carrier sense)  is in CSMA\/CD. Carrier sense is the ability of a network interface card  (NIC) to check the network for any communication. Obviously if there is  data being transmitted over the network, the NIC should not attempt to  transmit data. If there is no traffic on the network, the NIC will then  attempt to transmit the data. However, we can\u2019t be sure that data isn\u2019t  in the process of being sent by other computers- so this is one possible  beginning of a collision.<\/p>\n<p>The MA (multiple access) part of CSMA\/CD tells us  that there will be multiple devices using the same network. This, of  course, means collisions are more than possible. It also tells us that  in the ring topology, no collision will ever occur since only one  computer uses the media at a given time. Lastly, you can bet that even  if you are using wireless, you\u2019ll be victim to collisions since multiple  computers are using the same medium.<\/p>\n<p>The CD (collision detect) part of CSMA\/CD states  that we need a method for detecting a collision. After all, we need to  tell other computers to hold off on transmissions until the problem is  sorted. Collisions can be spotted since they are generally higher in  signal amplitude than normal signals. If we do indeed spot a collision, a  jamming signal is sent to all computers and a back-off algorithm is  observed.  This algorithm simply tells computers not to  transmit new data for a random amount of time. When transmission is  again ready, the devices involved in the collision do not have priority.<\/p>\n<p>From the above information, we can deduce two  things about CSMA\/CD. First, it is a nondeterministic approach- meaning  first come first served. It\u2019s an all out brawl for who gets to transmit  data- as compared to the deterministic approach of the ring topology.  Second, if you haven\u2019t already noticed, CSMA\/CD was built for the  collision environment. (You won\u2019t see it in practical use on a ring  topology.)<\/p>\n<h4>The Collision Detection and Solution Process<\/h4>\n<ul>\n<hr \/>\n<li><strong>1 &#8211;<\/strong> A collision is detected.<\/li>\n<li><strong>2 &#8211;<\/strong> Devices involved in the collision keep  transmitting for a short period of time, to make sure all devices on the  network see the collision (also referred to as the jamming signal)<\/li>\n<li><strong>3 \u2013 <\/strong>Each device sees the jamming signal, and  invokes the back-off algorithm. Each device will have a random timer  that determines when it can transmit again.<\/li>\n<li><strong>4 &#8211;<\/strong> When the back-off timer expires, devices are  free to transmit data again. Devices involved in the collision earlier  do not have priority to transmit data.<\/li>\n<hr \/>\n<\/ul>\n<h3><strong>Closing Comments<\/strong><\/h3>\n<p>Cisco exams like to cover the CSMA\/CD topic, so be  sure to keep it in mind when studying for exam day. Keep in mind CSMA\/CD  is a first come, first serve approach (and deterministic as a result).  Cisco puts an emphasis on the back-off algorithm and jam signal process  as well. Lastly, be on the lookout for tricks. Keep in mind that even  under full-duplex operation, a network operating under a hub will not  take advantage of the collision-free properties of full-duplex.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First thing is first: save yourself some trouble and remember that carrier sense multiple access collision detect is best referred to as simply CSMA\/CD. We\u2019ve heard some ridiculously long terms before, but CSMA\/CD takes the cake. Jokes aside, this media-access mechanism is what keeps networks running. If two or more computers transmit data at the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-526","post","type-post","status-publish","format-standard","hentry","category-networking-stuff"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=526"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/526\/revisions"}],"predecessor-version":[{"id":527,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/526\/revisions\/527"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=526"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=526"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}