Collisions: What Are CSMACA and CSMACD?


Collisions: What Are CSMA/CA and CSMA/CD?

In the original PARC Ethernet, the method used to exchange data on the network media was called Carrier Sense Multiple Access (CSMA). The Ethernet II specification added Collision Detect (CSMA/CD) to this technique. A collision occurs when two workstations on the network both sense that the network is idle and both start to send data at approximately the same time, resulting in a garbled transmission. The term collision itself seems to imply that something is wrong. In some technical literature, this kind of event is called a stochastic arbitration event, or SAE, which sounds much less like an error than does collision. However, collisions are expected in older Ethernet networks. Only when they become excessive is it time to search for the sources of the collisions and rearrange some workstations or network devices as appropriate.

Note

The collision domain has pretty much been relegated to history. Hubs and half-duplex connections still use CSMA/CD, but if your network uses Fast Ethernet switches, in full-duplex mode, then CSMA/CD no longer comes into play. Instead, full-duplex switches use separate wire pairs in the cable so that the switch port can send data to the attached computer, while receiving data from that computer on another wire pair. When creating a new network today, the cost of network adapters and switches makes it a very inexpensive proposition to use full-duplex network adapter cards and switches. The CSMA/CD technology is discussed in this chapter to let you understand how Ethernet has evolved, and to provide information for those who still have legacy Ethernet equipment installed.

Make absolutely sure that when you plan for your network ports you are using technology that supports the settings you intend to use. Most older systems (NICs, switches, and so on) use older technology that cannot auto-negotiate the settings properly, thus causing slowdowns and other issues. Make sure that when in doubt, set both sides of the network connection for auto-negotiation, or only set them to the exact standards in which they can operate.


The Manchester encoding scheme that was used on early Ethernet implementations provided an electrical signal that varied from +0.85V to -0.85V. Collisions could be detected when this voltage varied by an amount considerably more than that allowed by this range.

So you can see that the rules used to create Ethernet networks are not simply arbitrary decisions made by some committee; they relate to the characteristics of the physical devices used to create the network. When using a collision detection mechanism to arbitrate access to the network, the transmitting device needs to know how long it will take, in the worst case, for its transmission to travel to the farthermost device that resides on the same segment.

Why is this? Consider what happens when a device starts transmitting. Because the signal moves through the wire at a non-instantaneous speed, it will take some amount of time before all devices on the same segment sense that the cable is being used. At the farthermost end of the cable, it is possible for another device that has not detected the first transmission to listen and then start signaling its own data onto the network, just before the first signal reaches it. The result is a collision. The first station that initiated a transmission will not detect that a collision has occurred until the corrupted signal travels back to it, hence the round-trip timer value.

A 10Mbps Ethernet network signals at a speed of 10 million bits per second. The standard says that the round-trip time can be no more than 51.2 millisecondsthis is the amount of time it takes to transmit about 64 bytes of data at 10Mbps. Thus, the rules state that a device must continue to transmit for the amount of time it would take for its signal to travel to the most distant point in the network and backthe round-trip time.

To put it another way, a workstation could not start to transmit yet another packet until enough time had elapsed for the two nodes farthest from each other in the particular topology of the Ethernet standard used to send a packet.

If the device does not continue transmitting for the duration of the round-trip time, it is not capable of detecting that a collision occurred with that frame before it began to transmit another frame.

If a frame that needs to be transmitted is less than 64 bytes in length, the sending node will pad it with zeros to bring it up to this minimum length.

A maximum size for the frame was also added by the Ethernet II specification, resulting in a frame size with a minimum of 64 bytes and a maximum size of 1,500 bytes.

Note

Actually, the term "byte" that is used in this chapter to specify the length of a field in an Ethernet frame is not the most specific term that can be used by those who designed these specifications. Instead, "octet," which means 8 bits, is the term you will see in most of the standards documentation. For purposes of clarity, the term "byte" is used here because most readers will be familiar with its meaning and less likely to be confused. However, if you are planning on obtaining certification for Cisco products, remember the word octet!


The method that a device uses to communicate on the network is described in the following steps:

1.

Listen to the network to determine whether any other device is currently transmitting (Carrier SenseCS).

2.

If no other transmission is detected (the line is free), start transmitting.

3.

If more than one device senses that no transmission is occurring, both can start transmitting at the same time. The network physical connection is a shared medium (Multiple AccessMA).

4.

When two devices start transmitting at the same time, the signal becomes garbled and the devices detect this (Collision DetectionCD).

5.

After transmitting data onto the network, the device again listens to the network to determine whether the transmission was successful or whether a collision has occurred. The first device that detects the collision sends out a jamming signal of a few bytes of arbitrary data to inform other devices on the network.

6.

Each device that was involved in the collision then pauses for a short time (a few milliseconds), listens to the network to see whether it is in use, and then tries the transmission again. Each device that caused the collision uses a random backoff timer, reducing the chances of a subsequent collision. This assumes, of course, that the network segment is not highly populated, in which case excessive collisions can be a problem that needs troubleshooting and correction.

Note

Excessive collisions can reduce network throughput. Later in this chapter, we'll look at what you can do when network utilization starts to exceed 40%50% of the capacity of the transport medium.


Because Ethernet enables more than one device to use the same transmission medium, with no central controller or token designating which network node can transmit, collisions not only can occur, but are indeed expected events. When this happens, as explained in the next section, each node "backs off" for a certain amount of time intended to prevent the possibility of another collision before attempting retransmission.

Note

In contrast, collisions don't occur on Token-Ring networks. Instead, access to the network is granted in a controlled manner by passing a certain frame (the token frame) from one station to another. A station that needs to transmit data does so after it receives the token frame. When it is finished transmitting, it sends the token frame to the next station on the network. Thus, Token-Ring is a deterministic network and guarantees each station on the ring the capability to transmit within a specified time. Ethernet, however, is a more competitive environment in which each station on the LAN must contend with any other station that wants to transmit on the same LAN.


The Backoff Algorithm

Without a backoff algorithm, the device that detects a collision will stop and then try once again to transmit its data onto the network. If a collision occurs because two stations are trying to transmit at about the same time, they might continue to cause collisions because both will pause and then start transmitting at the same time again. This will occur unless a backoff algorithm is used.

The backoff algorithm is an essential component of CSMA/CD. Instead of waiting for a set amount of time when a device backs off and stops transmitting, a random value is calculated and is used to set the amount of time for which the device delays transmission.

The calculation used to determine this time value is called the Truncated Binary Exponential Backoff Algorithm. Each time a collision occurs for an attempted transmission for a particular frame, the device pauses for an amount of time that increases with each collision. The device tries up to 16 times to transmit the data. If it finds that it cannot put the information onto the network medium after 16 attempts, it drops the frame and notifies a higher-level component in the protocol stack, which is responsible for either retrying the transmission or reporting an error to the user or application.

Note

A method similar to CSMA/CD is CSMA/CA, in which the last two letters, CA, stand for collision avoidance. Networks that use this method access the physical mediumsuch as AppleTalkand listen to the network just as an Ethernet device does. However, before sending out a frame on the network, networks using CSMA/CA first send out a small packet indicating to other stations that they are about to transmit. This method helps to greatly reduce collisions but is not widely used because of the overhead produced when its networks send out the informational packet. The IEEE 802.11 wireless networking standard also uses CSMA/CA as its network access method.


Defining the Collision DomainBuses, Hubs, and Switches

In Chapter 8, "Network Switches," the concept of limiting the collision domain is discussed in depth. Because traditional Ethernet uses a shared network media, it is necessary to control access to that media and to detect and correct errors when excessive collisions happen.

For a small local network that connects only a few computers, a standard 10Mbps Ethernet hub can be purchased for well under $20, if you can still find one. A small 5- to 10-port switch can usually be purchased for around $20$50, depending on the number of ports. As technology advances, you will see smaller devices with higher port density at much lower costs.

Using a small hub creates a collision domain that consists of usually 5 to 10 computers. Although the hub gives the appearance of a physical network star topology, the hub acts in that manner only as a wiring concentrator. All computers connected to the hub exist on a logical bus, and all communications pathways are shared. A frame transmitted by one workstation connected to the hub will be heard by all the other workstations attached to the hub.

Hubs were traditionally employed to connect smaller departments to a larger network. With switches now at about the same price as higher-end intelligent hubs, the choice is now obviously to purchase a switch. This is because the switch limits the collision domain to only two nodes: the switch itself and the computer attached to a particular port. If full-duplex mode is enabled, there is no collision domain. The switch acts to relay network frames only to another port so that it can be delivered. If most of your network traffic remains inside the departmental LAN, a switch can dramatically improve throughput for users.

If a substantial portion of the network traffic resides on servers outside the LAN, then using a switch that has a fast connection to the switch on which the server resides also can provide a faster connection for end users. By decreasing the size of (or eliminating) the collision domain, switches allow for greater throughput on an Ethernet network.

The next few sections will acquaint you with the basics of early shared media Ethernet technology, from bus architectures to hubs. It is important that you understand these technologies in order to see the justification for upgrading to switched Ethernet technologies.




Upgrading and Repairing Networks
Upgrading and Repairing Networks (5th Edition)
ISBN: 078973530X
EAN: 2147483647
Year: 2006
Pages: 411

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net