CSMA /CD
Carrier Sense Multiple Access / Collision Detection
The Carrier Sense Multiple Access (CSMA) with Collision Detection (CD) protocol is used to manage access to a shared Ethernet medium.
CSMA/CD is for shared medium (such as a bus) only!!! Most modern Ethernet networks use dedicated media and switches - so they do not use CSMA/CD !!
If the medium is dedicated (not shared), then there is a separate twisted pair and a separate switch port for each station - and there is no need for CSMA/CD ad therefore no need for a MAC layer !!! CSMA/CD is defined by the MAC layer, which is the lower half of the Data-Link Layer 2 (the top half is the LLC (Logical Link Control) layer..
CSMA/CD Send Frame Algorithm
Step 1: Before a Ethernet device sends a frame on the
Ethernet cable, it listens to find if another device is already
transmitting a frame (CS - Carrier Sense). Any station on the LAN
can send a frame if the medium is available (MA - Multiple Access).
Step 2: Once the device finds that other devices are not
transmitting any frame, it starts transmitting the frame.
If two devices detects that the Ethernet cable is free at the same time, then
both will start transmitting the frames
(Multiple Access). This will result in collision.
Step 3: The Ethernet devices while transmitting the frames, also listen for the collision. (CD - Collision Detect).
Step 4: If they detect a collision, both the devices stop sending the frame (back off) and send a "jam signal" to notify all other stations that a collision has occurred. If any of these stations were preparing to send - they will receive the jam signal and will initiate a "back off" period of time before trying.
Step 5: The stations retry the transmission after a random time-out period.
This process is repeated untill the frame is transmitted successfully, or until 16 attempts have failed. The frame is discarded after the 16th retry, and it is up to the higher Layer protocols such as IP, to decide whether to retry any more..
Receive Frame Algorithm
For receive, the heart of the CSMA/CD algorithm is not really used, since the frame has made it to the interface, and there is no need for Collision detection. If a late collision has occurred but part of the frame makes it, the receiving station will usually detect a problem, either by the frame size or the CRC check. Basically, the frame will be checked for integrity, and if the test fails, the frame is discarded. It is up to the higher layer protocols, such as TCP/IP, to notify the sending station that the frame did not make it, and to issue a request for re-transmission.

Collision
A condition where two devices detect that the network is idle and end up trying to send packets at exactly the same time. (within 1 round-trip delay) Since only one device can transmit at a time, both devices must back off and attempt to retransmit again.
CSMA/CD is designed to handle collisions with a re-transmit. The retransmission algorithm requires each device to wait a random amount of time, so the two are very likely to retry at different times, and thus the second one will sense that the network is busy and wait until the packet is finished. If the two devices retry at the same time (or almost the same time) they will collide again, and the process repeats until either the packet finally makes it onto the network without collisions, or 16 consecutive collision occur and the packet is aborted.
Jam
This is part of the CSMA/CD algorithm, that tells all stations that a collision has occured, and to hold off transmitting for a short time, called the backoff time, which is a random number. When a workstation detects a collision during transmission of a frame - none of the other stations are aware that the collision has occurred. So the station transmits a 32 to 48-bit jam signal so all other stations will see the collision also. When a repeater detects a collision on one port, it puts out a jam on all other ports, causing a collision to occur on those lines that are transmitting, and causing any non-transmitting stations to wait to transmit.
Interestingly enough, the actual format of jam is unspecified in the 802.3 specifications. Most manufacturers have used alternating 1s and 0s as jam, which is displayed as 0x5 (0101) or 0xA (1010) depending on when the jam is captured in the data stream.
Retransmission
When a collision is detected, the station sends a jam signal and then waits for a randome backoff time, and then retransmits the frame. It will retry n attempts, where n is a user-defined number. If all attempts fail, it will report this to the LLC layer, which will then decide whether to retry another n times, or report that the link is down.
Jabber
A blanket term for a device that is behaving improperly in terms of
electrical signaling on a network. In Ethernet this is Very Bad,
because Ethernet uses electrical signal levels to determine whether the network
is available for transmission. A jabbering device can cause the entire network
to halt because all other devices think it is busy.