Internetworking Basics

  •  

     Chapter 6


    Ethernet Fundamentals

    These notes guide you through the understanding of how Ethernet Operates

    Introduction

    Ethernet Operation Overview

    The CSMA/CD Method

    Ethernet Timing
            Slot Time
            Interframe Spacing
            Backoff

    Collision Types
            Local Collisions
            Remote Collisions
            Late Collisions
            Remote Late Collisions

    Summary

     
     

    Introduction

    On completion of these notes you should...

    • Understand the basics of how Ethernet operates
    • Be able to describe the CSMA/CD strategy for shared media access
    • Be able to describe Ethernet timings - slot time, interframe spacing and backoff
    • Be able to describe the different collision types
     

    Ethernet Operation Overview

    On networks, it is a common for access to physical media to be shared amongst many devices. Strategies must be in place for dealing with multiple access to the shared medium. Three well known layer 2 technologies, Ethernet, Token Ring and FDDI, each use a slightly different strategy. Ethernet is the most common network implementation and uses a method called CSMA/CD as it's media access strategy. FDDI and Token Ring use a media access strategy called token ring.

    On a token ring network, nodes are arranged in a logical ring and a token circles around the ring continuously, traveling from from node to node. When a station wants to transmit, it waits for the token to arrive and then attaches data to it. The token proceeds on it's way carrying the extra payload. When it reaches the node with the payloads's destination address, it offloads the data and continues on it's way again. This approach to shared media access is called a deterministic approach; hence token ring is a deterministic protocol.

    Ethernet uses a different strategy. It allows stations to transmit frames onto the medium at any time, provided no other station is transmitting at the same time. This approach to shared media access is called a non-deterministic approach; hence token ring is a non-deterministic protocol.

    The Ethernet strategy known as CSMA/CD and is explored in next more detail.

     

    The CSMA/CD Method

    Let's suppose you have the ability to transmit frames on a network. How would you ensure your frame reached it's destination without error? Perhaps you are sharing the transmission medium with others - in which case you will need to ensure your frame doesn't collide with other frames. There needs to be some rules to follow - agreed upon by you and all other transmitting stations so the network traffic doesn't get mixed up.

    ~~Carrier Sense Multiple Access~~

    Some basic rules for transmitting a frame might be as follows:

    1. Before sending a frame, monitor the transmission medium and see if you can sense another "carrier" - a station that is already transmitting. This process is known as "carrier sense".
           
    2. If you detect an active carrier then defer transmission. Continue to monitor the medium until the carrier finishes.
         
    3. When you cannot detect an active carrier then perhaps you can transmit your own frame. But wait - when a carrier transmits lots of frames, it sends them one after another with a short period between each frame. That short period is called the interframe spacing. Better wait for that period to really make sure the carrier has finished and is not just pausing ready to send another frame.
        
    4. When you are convinced you cannot detect an active carrier then transmit your frame. If you have more frames to transmit then carry out each of the previous steps before transmitting each one.

    You might think that these rules are adequate and as long as all transmitting stations follow these rules then all will be well. However, suppose you carry out steps 1 to 4 above and decide the medium is clear to transmit. Suppose also that another station carries out steps 1 to 4 above at the exact same time as you and also decides the medium is clear to transmit. So now you transmit a frame and the other station transmits a frame - at the exactly same time - each of you believing the medium is clear. Of course the frames will collide and will be useless to a receiving station.

    So, what could be done to prevent this. Well there isn't much that can be done about stations transmitting frames at exactly the same time. The token ring method of only being allowed to transmit when you have the one and only token is one way of avoiding this sort of scenario, but the Ethernet method tackles the problem differently.

    ~~Collision Detection ~~

    Here are some additional rules to help with the problem of collisions:-

    1. While you are transmitting a frame, monitor the medium for a collision. You can usually tell when a collision has occurred on coaxial cable because the amplitude of the signal on the medium suddenly doubles. On UTP cable, you can tell because the receive wire pair will be active at the same time you are sending a frame down the transmit wire pair.
        
    2. If you detect a collision then stop sending your frame immediately. If the collision length is short, other stations on the network that are further away might not notice the collision. So, to make sure all listening stations are aware of the collision, send a 32-bit "jam sequence". The sequence jam will ensure that the length of the collision is sufficient to be noticed.
         
    3. Well, you still need to send that frame. Better not send it straight away after sending the jam sequence though - in case the other colliding station also decides to retransmit it's frame straight away. Then your frames would just collide again. Better to wait a random period of time chosen using a random number generator before starting the transmission process over. If the other colliding station also waits a random period of time before retransmitting then the probability of a another collision is greatly reduced. This process is called "backoff".
        
    4. If you are really unlucky and another collision occurs, then increase the random delay and then retransmit again. If collisions keep happening, then for each further attempt at transmission, keep increasing the backoff random delay time. This will further reduce the probability of another collision. Keep trying with this process until you can transmit a frame without collision.
        
    5. Once you have successfully transmitted a frame, then clear the collision counter you used to increase the backoff time after each repeated collision.
    6. If you think you have finished - well think again. All that effort was just for one frame. If you have any other frames to transmit (which you probably will have), then you need to repeat all the steps again for each frame.

    This method of accessing a shared medium is called Carrier Sense Multiple Access and Collision Detection - CSMA/CD for short. Ethernet is the network technology that uses this type of access method. CSMA/CD is necessary whenever you have a logical bus topology. For example, information sent on a physical bus or star topology (with a hub as a central connection point) flows logically as a linear bus. This means that collisions could occur.

    With switched networks, the situation is different and it is possible for frames to be transmitted by more that one station at a time. Switched networks employ either twisted pair or fiber optic cabling, both of which use separate wires for sending and receiving data. In a totally switched network, stations only communicate with the switch and never directly with each other. The switch links the sender to the receiver only, isolating the link from other stations. So, in this type of environment, stations can skip the collision detection process and transmit at will, since point-to-point connections are implied. This means end stations can transmit to the switch at the same time that the switch transmits to them, achieving a collision-free environment.

     

    Ethernet Timing

    Ethernet is extremely reliant on timing. Frame lengths, collision detection and the end-to-end size of an Ethernet network - number of segments, repeaters etc. are all based on various timing rules. These important timings are...

    • Slot Time: - The minimum length of time a transmission must go on for.
        
    • Interframe Spacing: - The time between transmission of frames.
        
    • Backoff: -The time a station has to wait before retransmitting after a collision.

    ~~ Slot Time and Minimum Frame Size~~

    Slot time is a critical timing rule for half-duplex Ethernet network operations. It is not required for Ethernet operations that must operate at full-duplex, such as 10 Gbps Ethernet.

    Slot time is the minimum time a station must transmit a single frame for. This means a frame cannot be too small or a station would not be able to transmit for long enough to abide by the slot-time rule. The reason a station has to transmit continuously for a particular length of time is as follows:-

    Suppose a station is transmitting a frame and a collision occurs at the far end of the network. The transmitting station will only be able to detect the collision when the collision wave has propagated back again. This takes time. If the sending station finishes transmitting before the collision wave makes it back to it, then it will not realise a collision has occurred. The slot time rule makes sure a transmitting station transmits for a long enough period of time, so it can detect any returning collision wave. On Ethernet networks operating at 10 and 100 Mbps, slot time is 512 bit times.

    A bit time is the time it takes for a transmitter to send a single bit out onto the medium. Faster networks like Gigabit Ethernet can send out bits at a faster rate than slower networks like 10 to100 Mbps Ethernet. If the slot time for Gigabit Ethernet was also 512 bit times, then the transmission time period would not be long enough for a station to detect collision waves. So the slot time for Gigabit Ethernet is 4096 bit times.

    To think about what slot and bit time means, look at an Ethernet frame below. If a transmitter has to transmit 512 bits of data to satisfy slot time, how many bytes is that? Which frame fields below must be transmitted to satisfy the slot time rule?

    Since 512 bits is 64 bytes, then on 10/100 Mbps Ethernet a transmitter must send out the preamble, destination, source, type and FCS fields. Ignoring the preamble, that only makes 18 bytes. So to satisfy slot time, a transmitter must send out at least 46 more bytes of data. This is why there is the 46 byte minimum size for the data/pad field of a frame - to ensure that slot time is satisfied. A station is not allowed to transmit a frame shorter in length than this.

    When Gigabit Ethernet first arrived on the scene, there was clearly a problem with the 512 bit slot time used on 10/100 Mbps Ethernet. Gigabit Ethernet can transmit 512 bits onto the medium so quickly, the signal would travel less than 100 meters before the station stopped transmitting. In other words, a station would have stopped transmitting way before any collision wave made its way back along a 100m of cable.

    So, the slot time for Gigabit Ethernet was increased to 4096 bit times - this is 512 bytes of data. If a short frame must be transmitted that meets the minimum data/pad field field length of an Ethernet frame but is too short to meet slot time requirements, then an "extension field" can be added to the frame. The extension field helps bring the total transmission size up to the required 512 bytes. Any extension field is discarded by the receiving station. Extension field are only used on half-duplex Gigabit operations. They are not necessary for full-duplex.

    ~~ Slot Time and Overall Network Size~~

    Slot time also limits the size of a network in terms of the maximum cable segment lengths and number of repeaters allowed. If the size of a network grows too big, a phenomenon known as "late collisions" can occur. Late collisions arrive too late in the frame transmission to be dealt with properly by the transmitting MAC and so the frame is dropped and is not retransmitted. Higher layers, such as the application layer must deal with the problem and force a retransmission of the frame.

    ~~ Interframe Spacing~~

    Once a frame has been transmitted, all station are expected to wait a specific period of time before another frame is transmitted. This is called the Interframe Spacing. For 10 Mbps Ethernet, the interframe spacing is 96 bit times (approx 9600 nanoseconds). The interframe spacing is the same for 100 Mbps and Gigabit Ethernet. This means that for the faster networks, the time between transmission of frames is shorter.

    ~~ Backoff~~

    If a collision occurs, then the two transmitting stations are required to stop transmitting. All station must wait the interframe spacing time before attempting to transmit after the collision. The two colliding stations must wait an additional random period of time, known as the backoff period before attempting to retransmit. This is to stop the two stations retransmitting at exactly the same time again and causing a further collision.

    So, following a collision, each station generates a random number (r). The value r is a number between 0 and 2k where k is the number of collisions that have occurred so far. The formula is shown below.

    0 =< r < 2k

    On the first attempt at retransmission r is a number from 0 to 1; on the second attempt, 0 to 3; on the third, 0 to 7 and so on. The number range for r can continue to increase for up to 10 collisions, whereupon the range reaches 0 to 1023. The station is allowed 16 attempts at retransmitting. The maximum range for r stays at 0 to 1023 after the 10th attempt. After the 16th attempt, the MAC sublayer is required to give up and it will report a 'excessive collision error' to the higher layers. Excessive collision errors occur most often on networks experiencing high traffic loads.

     

    Collision Types

    Collisions are a fact of life on CSMA/CD networks operating in half-duplex mode. Collisions cause a loss in bandwidth due to transmission of a frame and the resulting collision jamming signal (known as consumption delay). They also slow down transmission of frames since stations have to go through the backoff process before retransmitting after a collision.

    A single collision might occur when a station transmits a frame at the same time as another station transmits a frame but on the next attempt the frame was transmitted successfully. Multiple collisions occur when repeated attempts are made to transmit a frame but it keeps colliding.

    Provided collisions are not too abundant on a network, then stations can easily arbitrate on access to the medium and network performance is not greatly diminished. Thus, normal collisions are not considered to be errors, but are considered to be the normal operation of the CSMA/CD method of controlling access to the medium.

    If a network contains devices such as repeaters, bridges, routers, and so is segmented, a collision can be considered local or remote, depending on where that collision occurred. A local collision occurs on a segment local to a node that detects it. A remote collision occurs on a different segment to a node that detects it.

    The different types of collisions that occur are...

    • Local Collisions
    • Late Collisions
    • Remote Collisions
    • Late Remote Collisions

    Local and remote collisions are generally considered to be normal. Only late collisions are considered to be errors because they indicate cable runs longer than the legal maximum.

    ~~ Local Collisions ~~

    When a collision occurs on 10BASE-2 or 10BASE-5 coaxial cable, the waveforms from each signal interact to form another waveform. Parts of each waveform will cancel each other out while other parts will be reinforced - the amplitude and voltage level doubling. The voltage level will then be outside the allowed maximum level and all listening stations should detect this over-voltage condition and deduce a collision has occurred.

    On UTP cables, since transmit (TX) and receive (RX) are on different wire pairs, this over-voltage condition cannot occur. Instead, a collision will cause the RX line to go active at the same time a station is transmitting down the TX line. Collision observations of this kind only occur when the NIC is in half-duplex mode, since it is illegal to transmit and receive at the same time in half-duplex mode.

    ~~ Remote Collisions ~~

    If a collision occurs on the far side of a repeater, the collision wave may be passed along to other segments by the repeater but the over-voltage condition of the wave will be dampened out.

    So, on the segment where the collision occurred, the frame will be shorter than the minimum frame length of 64 bytes and will exhibit an invalid FCS field. It will also exhibit an over-voltage condition or cause simultaneous TX/RX activity.

    However, if the collision wave is passed onto another segment by a repeater, the frame will NOT exhibit an over-voltage condition or cause simultaneous TX/RX activity. However, it can still be detected as a collision since the frame will still be shorter than the minimum frame length of 64 bytes and exhibit an invalid FCS field

    ~~ Late Collisions ~~

    A collision is considered late if it occurs after 64 bytes, (512 bit-times) have been transmitted. Typical causes of late collisions are segment cable lengths in excess of the maximum permitted for the cable type. A collision wave is not detected by the transmitting stations until after the 64 byte slot time since it has to travel an excessive distance.

    When a late collision wave is detected, the frame is not retransmitted automatically by the MAC sublayer. Upper layer protocols must deduce that something went wrong and implement retransmission of the frame. This takes times and so late transmissions can cause excessive delays.

    ~~ Remote Late Collisions ~~

    It is possible for remote late collisions to occur. Such a collision would occur on the far side of a repeater and would be detected as a normal late collision by a transmitting station on that side.

    On segments the collision wave has passed onto, the collision wave would be detected after slot time has elapsed and the frame would exhibit an invalid FCS checksum.

     

    Summary

    On completing these notes you should have learned the following key points:-

    • There are two main approaches to controlling shared access to media; the deterministic approach such as Token Ring and non-deterministic approach, such as CSMA/CD.
    • Ethernet uses CSMA/CD for shared media access
    • Ethernet frame are transmissions are regulated by slot times and interframe spacing When collisions occur, a backoff algorithm must be used to determine how long a station must wait before attempting to retransmit
    • Collisions are a common when CSMA/CD is used for media access control
    • There are different types of collisions. Local and remote collisions are not considered as error. Late collisions are a symptom of network cable that are too long.
     
     

    Site Home

    Top

    Unit Home


       


      

     

     

       
    This Unit 

    Unit Information

    Assessment

    Syllabus

    Scheme of Work

    Learning Resources

    Notes & Lessons

    Assignments

    Quizzes

    Activities

    Resources

    Books & Things

    Links