I am confused about collisions in CSMA/CD Ethernet. When would a jam signal be sent? Why are jam signals sent? If two simultaneous packet transmissions interfere with each other, the two transmitting nodes can know that the voltage is oversized so they can end their transmissions and then transmit a 32 bit jam signal, but why? Can someone write all the events one by one in time sequence?
1 Answer
First, beware that modern switched Ethernet LANs are not CSMA/CD anymore. CSMA/CD was a technique that applied to 10mbit/sec and 100mbit/sec Ethernets that used hubs, not switches. And honestly there were never many 100BASE-TX hubs around; everyone went to switches around that time. The Gigabit Ethernet (1000BASE-T) spec requires switches; there's no such thing as a GigE hub.
On modern switched Ethernets, you don't have a shared medium anymore. When you're plugged into a switch, the "collision domain" is only between you and your switch port. And if you're in full duplex mode, which is almost always true with switches, then you don't have any possibility of collision at all. If you can't have a collision, you'll never detect a collision, so you'll never have reason to transmit a jam signal.
So back in the days of hubs (and shared cables like thinnet/cheapernet/10BASE-2 coax and thicknet 10BASE-5), here's how it worked:
Imagine you have a large 10BASE-T LAN with lots of hubs and max length cable runs, maxing out the "repeater rule" of maximum 4 repeaters (hubs) between any two devices on the LAN. Due to signal propagation delays across the hubs, it can take the IEEE spec maximum of 232 bit-times for a signal transmitted from Host A to reach the furthest host on the network (Host B).
Now imagine Host A begins transmitting a frame, and by bad luck, Host B, way at the other end of the network, 232 bit-times away, begins transmitting a frame just 231 bit-times after Host A started transmitting. Because of propagation delays on the network, Host B didn't know that Host A was already 231 bits into its transmission when Host B sent the first bit of its preamble. Now Host B will detect this collision within the first, say, 32 bits of Host B's transmission, which could be about 232 to 264 bit-times sooner than Host A will detect it. If Host B happened to detect it on the first bit of transmission, and just stopped transmitting the moment it detected this collision, then it might not have stayed on the medium long enough for Host A to also detect it and realize that a collision occurred (you can't guarantee that the receiver will detect the collision on the very first bit of the collision). That would then mean that Host A would not know to do the right collision-handling procedure. So rather than just stop transmitting, Host B transmits the Jam signal so that it stays on the medium long enough to make sure Host A realizes that a collision occurred.
This is also the reason that Ethernet frames have a minimum length of 64 Bytes. This guarantees that Host A stays on the medium long enough that a collision can be detected all the way on the other side of the network, and the Jam signal from Host B can make its way all the way back across the network, so that Host A is still on the medium when the Jam signal comes through, so it is able to realize that someone collided with its transmission.
-
Is csma/cd not required in full duplex connections? if yes, then why? Agreed that sending and receiving is done in two sparate cables, so there will be no collision if a device is sending and receiving at the same time. But what if a device receives data from two sources at the same time? Then there will be collision right?– AshwinJul 22, 2012 at 8:41
-
2@Ashwin The switch would have to buffer one of the two frames it was receiving simultaneously (on two separate ports, so no collision) and the send one before the other to the destination host.– SpiffJul 22, 2012 at 14:56
-
Does this mean that in full duplex, switched Ethernet networks a Ethernet frame no longer needs to be at least 64 bytes? Secondly, if the gigabit Ethernet is full duplex, is there even a minimum frame size for gigabit Ethernet?– user376151Nov 10, 2014 at 17:05
-
1@GeorgeRobinson The IEEE did not remove the 64 byte minimum frame size requirement even though it does not serve as much of a purpose on switched Ethernet as it did on old half duplex hub-based networks.– SpiffNov 10, 2014 at 17:30