Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Collisions
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Sat May 31, 2003 9:41 pm    Post subject: Collisions Reply with quote

This may sound like a daft question but what causes collisions on an ethernet network?

The reason I'm asking is I've just got a new switch which has collision leds and they are going mad. I knew collisions could happen, but I thought it was a rare thing which happened when IPs were setup wrong (2 matching) or something similar.

If someone could tell me what is causing the problem then I can hopefully fix it and hopefully improve my network speed.

Ta
Back to top
View user's profile Send private message
fatcat.00
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2002
Posts: 145

PostPosted: Sat May 31, 2003 10:20 pm    Post subject: Reply with quote

Heh heh a good question, but the answer is pretty ugly.

Ethernet uses a technique called Collision Detection/ Multiple Access (CDMA, not to be confused with the cell phone standard).

CDMA means this in simple terms:
The various Ethernet adapters on a network are sitting there, listening intently. One of them decides that he wants to send a frame over the line. If he doesn't hear any other NIC transmitting, he goes ahead and sends his frame.

Usually this works fine, but sometimes another NIC decides to send at the same time. This is a collision. When a collision happens, all the NICs go quiet, usually for a random, very brief period of time. Hopefully both NICs that caused the collision the last time will not try transmitting at the same time again, but if they do, then the process simply repeats.

Now, this may seem overly simple but that is pretty much how it really works. Ethernet's biggest advantage over other layer 1 and layer 2 protocols is its simplicity. If you know the difference between RISC and CISC in the microprocessor worlds, you can think of Ethernet as RISC, where Token Ring could be thought of as CISC.

Collisions are rarer in switched environments, but fairly common in non-switched environments. If you are using a hub (not a switch), then you will see collisions all the time. The busier your network, the more you will see. In fact, even though Ethernet commonly is rated at 100Mbps, non-switched networks top out at 50-60Mbps due to collisions. Switched networks can get closer to the full speed.

If your collision light blinks as quickly as a few times a second, you are probably OK. If it is solid, or if the level (if it shows a level) is very high, you might have a problem on your network. A bad hub, switch, NIC or a loop in your network can cause massive collisions which will severely impact your network's performance.

Does that answer your question?
_________________
-- Fatcat
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Sat May 31, 2003 10:55 pm    Post subject: Brilliant answer Reply with quote

That answers it perfectly. I do have a 10/100 switch but all 3 machines only have 10Mbps cards.

I was getting loads of collisions when I was copy a lot of data off one machine onto the other two at the same time. From what you said it is very reasonable that there should be collisions as there was a lot of data flying about.

As it was a one off sorting my machines out hopefully I won't have to worry about it, and when I can afford it, and have the time, I'll stick some 100Mbps cards in to speed the whole lot up.

Again, ta, good answer. :D
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Sun Jun 01, 2003 8:11 pm    Post subject: Re: Collisions Reply with quote

d0wn_under wrote:
This may sound like a daft question but what causes collisions on an ethernet network?

The reason I'm asking is I've just got a new switch which has collision leds and they are going mad. I knew collisions could happen, but I thought it was a rare thing which happened when IPs were setup wrong (2 matching) or something similar.

If someone could tell me what is causing the problem then I can hopefully fix it and hopefully improve my network speed.

Ta


You should never see collisions in a switched enviroment. Well maybe one or 2 per billion of packets switched unless something it wrong. You mentioned in another post that you have 10Mb/s cards which are probably older cards which might be acting strangely with your switch.

Network Truth #23 - Autonegotiation doesn't work, has never worked, and will never work.

Login into your switch and check to see what the interfaces have set themselves to. On a Cisco the command would be
show interface fastether 0/4
or whatever your interface is. If the interfaces are set to half duplex this is the reason you're seeing so many collisions. half duplex pretty much means "act like a hub and only one person can talk at a time". full duplex means any interface can send or receive to any other is is only availible on switches as oppsoed to hubs.

Fixing this is very problematic on Linux. Depending on the driver you may be able to use ethertool or other ether tweakers to tell the driver you want full duplex. You may need config the switch to manually choose full duplex also. Generally getting 10mb/s cards to do this properly with current switches has resulted in headaches for me and very little full duplex. If you have 100mb/s cards I'd suggest using them as the chances of things just working increases significantly with newer cards.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Sun Jun 01, 2003 8:45 pm    Post subject: Confused Reply with quote

I am now confused, The new "thing" I have bought is an ADSL modem with 4 network ports built in.

In some shops when I was looking they were calling them routers, others were calling them switches and others were calling them hubs.

From what I managed to pick up a hub is the lowest form, running at the lowest speed of all involved, a switch will run some at 10 and some at 100 if there is need and a router is something that will swap packet from network to another.

Therefore, from my logic I have an ADSL router with built in switch. Is this correct?

There are duplex lights on the box and none of them are lit so I assume that I have half duplex. Two cards are old, the third one was a cheap but new 10Mbps. I'll have a go at turning on full duplex and see what happens if I manage it.

Ta
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Mon Jun 02, 2003 12:14 am    Post subject: Re: Confused Reply with quote

d0wn_under wrote:

From what I managed to pick up a hub is the lowest form, running at the lowest speed of all involved, a switch will run some at 10 and some at 100 if there is need and a router is something that will swap packet from network to another.

Therefore, from my logic I have an ADSL router with built in switch. Is this correct?

Ta


Here's the quick and dirty.

hubs are half duplex. When two devices to try to each other the hub blocks and the collision happens

switches are full duplex which means all the devices can talk to each other and there should be no collisions

Connecting to a switch at half duplex makes it a hub for all practical applications and therefore you get collisions.

Hubs can run at 10 or 100 depending on the brand. The same with switches. It's whether they can support each interfaces sending and receiving to other that makes the difference. Think of a hub as single threaded and a switch as multi-threaded.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
fatcat.00
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2002
Posts: 145

PostPosted: Mon Jun 02, 2003 1:29 am    Post subject: Reply with quote

What kashani is saying is true for consumer-grade devices. You will not see collisions on a switch until its frame buffers fill up, and then you may. Enterprise equipment has very deep buffers, so collisions are quite rare. You only see them if you have hosts that are pounding the hell out of the network, or there is some kind of problem. Very unusual under normal circumstances.

*Most* of the consumer grade devices are switches, but do not have deep buffers, so you tend to see more collisions or dropped frames. If you have a half-duplex device, and if the switch and the NIC try to talk at the same time (which half-duplex doesn't allow) a collision might result.

On the other hand, switches always have a choice when their buffer gets filled with frames. They can either transmit a frame and cause a collision, or they can just drop frames into a bit-bucket (causing TCP retransmits, or lost UDP packets if thats what was encapsulated). I have no idea which one is a more common approach. In either case, lower performance is the result.

kashani is on the money in saying that full-duplex is what you want for the highest throughput. In half-duplex mode, your switch becomes a hub for the NIC that is in half-duplex. In consumer-grade devices, maybe it becomes a hub for all NICs, I don't know. In an enterprise switch, only the half-duplex port is affected.

BTW, the reason people call these devices different things is because they *are* different things. This class of device is called a "multi-layer" device, which means it fulfills the function of at least two layers (using the OSI model). The switch is Layer 1 and 2, the router is Layer 3, and the firewall is Layers 4-7, depending on what protocol you are talking about. This is not important, its just an explanation as to why these things get called different names.

Bah, I am just rambling now...must...sleep.
_________________
-- Fatcat
Back to top
View user's profile Send private message
d0wn_under
Guru
Guru


Joined: 13 Mar 2003
Posts: 300
Location: Sheffield, England

PostPosted: Mon Jun 02, 2003 8:44 pm    Post subject: I think I'm getting there Reply with quote

All the cards seem to be half duplex only so I'm going to save up and get at least a full 100 for my main machine and let the rest suffer for a while.

I think what you say about different names is true, but in most shops I think it is more the staff use the buzz words they've picked up sometimes wrongly. I know that some places do as I had exactly the same product described as a switch, hub and router in different shops each saying that any other description is wrong and that the others don't know what they are saying. :)

Thanks all
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Mon Jun 02, 2003 9:18 pm    Post subject: semantics Reply with quote

Don't worry it happens at the high end too. Nothing like pointing out a "layer 3 switch" is a router with lots of ports when it comes down to it.

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
paranode
l33t
l33t


Joined: 06 Mar 2003
Posts: 679
Location: Texas

PostPosted: Tue Jun 03, 2003 12:49 pm    Post subject: Reply with quote

I think it's actually CSMA/CD for Carrier Sense Multiple Access w/ Collision Detection. The collision detection being a revision to the initial protocol. 8)
_________________
Meh.
Back to top
View user's profile Send private message
fatcat.00
Tux's lil' helper
Tux's lil' helper


Joined: 12 Aug 2002
Posts: 145

PostPosted: Tue Jun 03, 2003 3:48 pm    Post subject: Reply with quote

Doh! I stand corrected. CSMA/CD is what I meant. I blame a chemical imbalance (to be corrected with more chemicals), a misspent youth, an unhappy childhood, misfirings neurons or cosmic rays...you pick :)
_________________
-- Fatcat
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum