Subject: FULL DUPLEX IS BAD! Date: 4 May 2000 14:29:18 GMT From: mcnuttj@missouri.edu Organization: University of Missouri - Columbia Newsgroups: comp.os.linux.networking I have seen a lot of posts in here lately talking about how people are worried about how many collisions they're getting and asking "How can I set my card to full duplex?" You don't want to do that! The only place it makes sense to have full duplex is on a switch- to-switch connection, and even then, only in some circumstances. Half duplex (collision detection) allows the card and the switch to slow things down when buffers become full. Full duplex allows attached devices to just BLAST the wire with traffic under all conditions. So what happens if the buffer on the switch is full? Half duplex: The switch generates a false collision, which tells the NIC to back off for a random period of time and retransmit. Retransmit time: milliseconds. Full duplex: The card sends the frame, not knowing that the switch can't take it. The switch loses the frame because it's buffers are full. Nobody tells the server that, so the application (web server, FTP server, whatever) has to WAIT until the timeout hits, and then has to retransmit the frame. Retransmit time: SECONDS. In other words, full duplex just KILLS you when you fill up the buffers. How often does that happen? Pretty often if the "sending" side is running at 100Mb and the "receiving" side(s) is (are) at 10Mb. The switch is forced to buffer all the traffic sent by the server until it has time to send the frames down the 10Mb slower link(s). Oh, yeah, one more thing: You can't use full duplex on a hub. Ever. Hubs *always* run in half duplex because more than two devices share the "wire". Lastly, Fear and Loathing About Collisions: Collisions are *not* *bad*. They are normal for Ethernet. That's just the way Ethernet works. This seems counterintuitive, but watch how it works: I want to send a frame. I check to see if the wire is free. If it is, I send it. No problem. If it isn't, I wait a certain number of slot times until it is, then I check again. If I send a frame and someone else sends a frame at the same time, the signal becomes corrupted. I sense this and send a "collision" signal, which tells everyone that a collision occured and that they also need to retransmit their frames (in case they don't see the collision themselves). We *both* then wait a random amount of time and retransmit. NO DATA IS LOST. Now, suppose that on the second try, I get another collision. No problem. I wait a little longer this time, and retransmit again later. NO DATA IS LOST. The second event is called "multiple collisions." When you get multiple collisions, you have a busy segment, but it's still nothing to worry about. *BUT* (this is the big deal) suppose that I get *16* collisions while trying to send the same frame. That's called "excessive collisions" and the frame is DROPPED. This is recorded in 'ifconfig' by the way. *THAT* is the only case you need to worry about, because NOW you're losing data, and you need to be checking your driver and your link because excessive collisions almost *NEVER* occur on a functional Ethernet (at least, not when you have < 20 10/100 devices). Excessive collisions is not a count of how many collisions you've seen on the wire. The "Collisions" count in ifconfig can be 500 billion without having a single instance of an excessive collision. Excessive collisions is an event where you get 16 collisions on *one* frame. I hope this helps calm some people down, because it's very easy to a) waste a lot of time on something that isn't going to help you b) set something up at full duplex only to be disappointed by even poorer performance. Which reminds me. One last thing on full duplex: Keep in mind that every time you receive a frame, either your CPU is interrupted or your DMA controller is busy with some data transfer. Do you really want the network to be able to pull resources from your computer at *ANY* *TIME*? Full duplex does not provide a way to make the switch slow down. A NIC set to half duplex will simulate a collision, forcing the switch to wait until the CPU can catch up. I have *SEEN* *THESE* *THINGS* *IN* *ACTION*. I'm not making this up based on specs or research. This is how it works. Every single time we've set a server up with full duplex, the performance has been *worse* than at half duplex. If you need more bandwidth - and I mean REALLY need the bandwidth -, get a NIC with multiple links and set up a multilink trunk (also called "link aggregation"). It's basically two cables into the NIC instead of one, giving you access to *two* buffers on the switch instead of just one. Run both at 100Mb and crank away. --J