2

As far as I understand, CSMA/CD is an access method to place Ethernet frames on the wires in computer networks.

I read everywhere that switches are not using this access method because they are full-duplex (but they can use CSMA/CD in case of a device would be half-duplex). And I understand this, collisions are impossible so no CD is needed, there's no need to do Carrier Sense because there's only one device sending on the same wires,...

But if ethernet switches, on a full duplex segment, do not use CSMA/CD, what is the access method? They just put the frames on the cable?

Is there any RFC that describe this?

Thanks for your help.

6

As far as I understand, CSMA/CD is an access method to place Ethernet frames on the wires in computer networks.

Not quite. CSMA/CD is a method (algorithm) for gaining access to media in a multi-access environment. The original Ethernet was half-duplex, meaning all stations used the same channel (circuit) for sending and receiving. CSMA/CD is used to prevent two stations from sending at the same time on the one common channel (i.e., collisions).

With full duplex switching, there is effectively only two stations on a segment-- the host and the switch -- and each station has a separate channel for sending and receiving, so there's no chance of a collision.

But if Ethernet switches, on a full duplex segment, do not use CSMA/CD, what is the access method? They just put the frames on the cable?

Yes, there is no need to sense carrier because there is only one sender on the circuit

Is there any RFC that describe this?

Ethernet is defined in IEEE standard 802.3

| improve this answer | |
  • More specifically, full-duplex mode is described in 802.3 Annex 4A Simplified full duplex media access control. ;-) – Zac67 Apr 8 at 18:48
3

You seem to understand CSMA/CD quite well - but before describing how things work in a switched environment, I'd like to break it down for other readers who might not know.

CSMA/CD stands for

  1. Carrier Sense
  2. Multiple Access
  3. with Collision Detection

When multiple devices are all sharing a network cable, usually only one at a time can transmit. This used to be very common in Ethernet networks where a network cable would run along each side of a building, with many workstations tapped in to it. This is the "Multiple Access" part of the term.

Think of a bunch of people in a meeting, or a group of friends at a party. One person talks at a time, while everyone else listens. How do we (as people) do this? You listen briefly to make sure no-one else is talking. If the room is quiet, you start talking. Listening for other people talking is "Carrier Sensing"

Sometimes, someone else (who also verified that the room was quiet) starts talking at the same time as you. This is a "collision". Because you are still listening while talking, you realise what is happening (you detected the collision). Sometimes once person realises before the other, and they stop talking while the other continues. Sometimes both people detect the collision, and they both stop talking.

Network interfaces do the same. When they want to transmit, they first check to see if the line is quiet by trying to sense some other device's carrier signal. If the line is quite they start transmitting - while still monitoring the line to make sure that they "hear" what they are "saying". If they detect a collision, they stop, wait a little bit, and then start listening for a quiet time again. To reduce the chances of a collision happening again and again, each device waits ("backs off") a random amount of time.

Hubs

Hubs allow you to connect multiple network cables together. Sometime this is to extend the usable length of the cable, sometimes to make the cabling layout easier, sometime other reasons. Sometimes each cable connected to the hub has multiple devices on it, sometime each device has its own dedicated cable to the hub.

One way or another, though, the signals present on any cable are instantly repeated by the hub on all other cables. So we still have a case that only one device on the entire network can talk at a time. We say that even with hubs, we still only have one "collision domain" - and we still need CSMA/CD.

Switches

When switches are used (as they are in most modern Ethernet networks), a few things are different:

  1. Each cable connected to a switch is not directly connected to all the others. This means that a device talking on one cable does not interfere with a device talking on a different cable. Each cable is its own collision domain.

  2. Very often, each cable connected to a switch is only connected to one other device. Each device has its own dedicated cable and its own port on the switch. This is particularly true in networks using "UTP" cabling (most Ethernet networks today). You can only connect two devices to a UTP cable, and the switch is one.

  3. Also very often, the cable involved actually consist of two "channels". in "modern" UTP (as opposed to the older coaxial cables we used decades ago), there is a set of wires for the switch to transmit on, and a separate set of wires for the other device to transmit on. So even the switch and the terminal cannot collide with each other. This is called "full-duplex".

  4. The switch has memory (RAM). When you transmit a frame, it can be stored in memory until the switch's software is ready to forward it to another cable or cables. So two devices on different cables can transmit at the same time, and the switch will buffer each transmission until it can be sent on. (Incidentally, the switch doesn't have to wait until it has received your whole frame before it starts forwarding it.)

  5. Possibly the biggest advantage of switches: They know which devices are on which cables. (They work this out dynamically and automatically - you don't have to configure this information.). So, if device A (on cable 1) is transmitting a frame to a device B (on cable 2), the switch will only forward that frame to cable 2. None of the other cables will be affected. This means that a device on cable 3 could be transmitting to a device on cable 4 at exactly the same time. And a device on cable 5 could be transmitting to another device on cable 5 at the same time as both of the previous, without affecting any other cable on the network at all.

And finally - the answer

The upshot of all of this is that if your device is the only device on a full-duplex cable connected to a switch - it can transmit whenever it wants to. It has exclusive access to a pair of wires for its transmissions, and it lives alone in a private collision domain. As you said "it just puts the frame on the cable."

It is up to the switch to decide which cable (or cables) to forward the frame to, and to buffer the frame for each destination cable until that cable is ready. The only time a collision-like event happens, is when the switch is already forwarding some other frame to that cable, and your frame has to sits in the switch's buffer a little bit longer.

| improve this answer | |
  • 2
    "in modern UTP, there is a pair of wires for the switch to transmit on, and a separate pair of wires for the other device to transmit on." Actually, that is in "old" ethernet (10Base-T and 100Base-TX). Modern ethernet (1000Base-T and 10GBase-T) uses all four pairs for both sending and receiving. – Ron Maupin Apr 9 at 1:58
  • Thanks Gavin Lock for your answer. So there's no control access method on the switch. It is up to the switch to decide when sending bits and "he" knows when the cables are idle because "he" controls his own ports. – regi00 Apr 9 at 6:15
  • @RonMaupin, when I think of "old" Ethernet I think of the 50Ω coaxial cable with BNC connectors that used to be the staple of Ethernet networks. With one core and one shield, that cable only had 1 pair of copper that could be used by all connected devices for both Tx and Rx. (I will edit a better word choice into point 3.) – Gavin Lock Apr 9 at 7:03
  • @regi00 - for most switches today, yes, exactly. The only "control access" exists within the switches software, and it's not visible to the outside world. I say "most" because there are still some switches for coaxial cable in use today. Switches and other devices using Ethernet on coax still need to use CSMA/CD because they share only one pair of copper, and therefore still need to work out who gets to talk on it at any one time. – Gavin Lock Apr 9 at 7:23
  • ... although I should probably mention that each coax cable is its own collision domain. A device busy transmitting on cable 1 blocks other devices on cable 1 (including that port on the switch), and while the switch forwards that data to the destination device on cable 2, it blocks other devices on cable 2 - but during that time the cables connected to the other ports on the switch are not affected. – Gavin Lock Apr 9 at 7:30
1

In order to be able to read the destination MAC address and then make a decision on which port(s) the packet needs to be sent to, the switch needs to be able to buffer the incoming packets.

Of course, there are lots of clever ways designed to minimize this buffering to maximize the throughput of the switch ports. But these ways are all internal to the switch, so every manufacturer can do whatever they think best, as long as the behavior external to the switch stays within the specifications.

So basically, when a full-duplex switch receives a packet that needs to go from Port A to Port B, but Port B is busy, the switch can just append the packet to the end of the queue of outgoing packets for Port B within the buffer if there is enough free space. If there is not enough space in the buffer, it will have to drop the packet.

This is all Layer-2 and below stuff, so the specification authority on this is not the RFCs, but the various IEEE 802.* specifications on Ethernet and related technologies.

The IEEE 802.3x standard specifies an Ethernet pause frame, which can be sent by a full-duplex network node (e.g. a switch port) to tell the other end of a particular link that it needs to pause its output for some time. But that is a deprecated feature that should generally be avoided and never depended on.

| improve this answer | |
  • Ethernet flow control is actually (somewhat) obsolete in that it can cause head-of-line blocking unless carefully controlled. For general use it's deprecated. – Zac67 Apr 9 at 10:01
  • As @Zac67 points out, ethernet flow control is often not recognized by devices, and it is poorly implemented. That is something that should be avoided and never depended upon. – Ron Maupin Apr 9 at 13:00
  • Thanks, edited. Anyway, it looks like Gavin Lock's answer is now much more thorough than mine. – telcoM Apr 9 at 13:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.