Communication

Communication

Ethernet and CSMA/CD

Networks including the internet AS Level 13 min read

On this page
  1. What you need to be able to do
  2. Ethernet
  3. Why collisions happen
  4. CSMA/CD step by step
  5. Dry run: CSMA/CD slot by slot
  6. Mark-scheme focus
  7. Worked examples
  8. Summary
  9. Can I do this?
  10. Quiz

What you need to be able to do

Syllabus 2.1 Networks including the internet
  • 2.1Explain what Ethernet is.
  • 2.1Explain how collisions are detected and avoided, including CSMA/CD (Carrier Sense Multiple Access with Collision Detection).

You need: Network topologies (collisions happen on shared media such as a bus).

Ethernet

Ethernet is a protocol (suite): a set of rules for transmitting data over standard wired / cabled network connections in a LAN.
  1. Data is sent in frames; each frame has the source and destination (MAC) addresses and error-checking data (so damaged frames can be detected and sent again).
  2. On a shared medium, Ethernet uses CSMA/CD to deal with collisions.
  3. An “Ethernet cable” is just a cable used to carry data using the Ethernet protocol: Ethernet itself is not a cable.
“Ethernet is a cable” was the majority wrong answer in June 2023. Start with “Ethernet is a protocol …”.

Why collisions happen

one shared cable (backbone), terminator at each endABCD✶
On a shared cable, if two stations start sending at the same moment their signals collide and both frames are garbled.

On a shared transmission medium (a bus, or devices sharing a hub) more than one computer is connected to the same medium. If two workstations start to transmit at the same time, their signals overlap: a collision. Both frames are corrupted and must be sent again.

CSMA/CD step by step

Part of the nameMeaning
Carrier Sensea station listens to the channel before sending: is anyone transmitting?
Multiple Accessmany stations share the same medium
Collision Detectionwhile sending, a station checks for a collision (the signal on the line isn't what it sent)
  1. A workstation with data to send listens to (monitors) the communication channel.
  2. If the channel is busy, it waits; when the channel is idle / free, it sends its frame.
  3. Two workstations can still start at the same moment (both heard silence): a collision.
  4. When a collision is detected, the workstations stop (abort) transmitting and send a jamming signal so every station knows.
  5. Each workstation waits a random amount of time (back-off) before trying again: because the times differ, they are unlikely to collide again.
  6. If collisions keep happening, the random wait time is increased each time (binary exponential back-off).
A protocol is a set of rules: it cannot “do” anything. Write “the workstation listens / sends a jamming signal”, not “CSMA/CD listens” (June 2022, November 2022 reports).

Avoiding collisions

Carrier sense itself avoids most collisions: nobody starts while someone else is sending. Collisions can only happen in the short moment when two stations start together. Modern wired networks avoid them almost completely by using a switch: every device has its own link, so there is no shared medium.

Beyond the syllabus: for understanding only. Wi-Fi uses CSMA/CA (Collision Avoidance): radios can't listen while they transmit, so stations wait a random time before sending and the receiver acknowledges each frame.

Drawbacks of CSMA/CD

  • waiting time can keep growing as random back-offs increase (in the worst case, waiting indefinitely)
  • a constant jamming signal could stop anything being sent
  • certain nodes cannot be prioritised
  • only suitable for short-distance networks
  • not scalable: more nodes means far more collisions and longer waits

Dry run: CSMA/CD slot by slot

Run the protocol yourself. Time is split into slots. For each slot, decide what each station does and what is on the cable, then check the row: the bus drawing shows the slot once you have it right. Rules: a station with a frame listens; it sends only if nobody is already sending or jamming; two starting together collide; next slot they jam; then each backs off for its own number of slots and listens again. “New scenario” gives a fresh run.

CSMA/CD dry run

The completed dry run for this scenario (A and B ready in slot 1, 2 slots each; C ready in slot 3, 1 slot; back-offs A 2, B 1):

SlotABCChannel
1SendSend—Collision
2JamJam—Jam signal
3Back-offBack-offSendBusy
4Back-offSend—Busy
5WaitSend—Busy
6Send——Busy
7Send——Busy

What the run shows: the collision in slot 1 costs three slots (collision, jam, back-off) before any frame gets through; C slips in during the back-off; A has to wait in slot 5 because B is sending (carrier sense working). That lost time is why CSMA/CD performs badly on a busy shared cable.

Mark-scheme focus

Describe what is meant by Ethernet (3 marks)

9618/12/M/J/23 Q1Paper 1 · Theory fundamentalsPart (d)3 marksFull size
(d) Computers can be connected using Ethernet. Describe what is meant by Ethernet. [3]
Credited
  • A protocol (suite) B1
  • for data transmission over standard / universal wired network connections B1
  • Uses CSMA/CD // data transmitted in frames … each frame has a source and destination (IP / MAC) address … and error-checking data B1
Not credited
  • “Ethernet is a cable”
  • “Ethernet is a type of internet”

From: 9618/12/M/J/23 Q1(d)

Describe CSMA/CD (4 marks)

9618/12/M/J/22 Q9Paper 1 · Theory fundamentalsPart (c)4 marksFull size
(c) Ethernet uses Carrier Sense Multiple Access/Collision Detection (CSMA/CD). Describe CSMA/CD. [4]
Credited
  • A workstation listens to the communication channel … data is only sent when the channel is free B1 B1
  • Because more than one computer is connected to the same medium, two can start to transmit at the same time, causing a collision B1
  • If a collision happens, the workstations send a jamming signal / abort … and each waits a random time before resending B1
Not credited
  • “CSMA/CD checks the line / sends a jam signal” (the protocol doesn't act)
  • Missing the random wait
Why

Every action belongs to a workstation; the random wait is what stops the same two colliding again.

From: 9618/12/M/J/22 Q9(c)

  • CSMA/CD in about every other paper: describe it (3-4), or describe what happens after a collision (2), or name tasks (3), sometimes with drawbacks (2).
  • Ethernet: a protocol, frames, addresses, error checking, CSMA/CD.

Worked examples

Example 1 · CSMA/CD on a bus (Paper 1, 4 marks) ★ Easy
9618/11/O/N/22 Q8Paper 1 · Theory fundamentals4 marksFull size
A Local Area Network (LAN) uses a bus topology. Describe how Carrier Sense Multiple Access / Collision Detection (CSMA / CD) is used in a bus network. [4]
1 Read it with me what is actually happening?

Tell the story in order: listen, send if free, why collisions still happen on a bus, what happens after one.

  • bus topologyone shared cable
  • describe how … is usedthe actions, in order, by the devices
2 What is it asking for? the target, part by part
  • WholeCSMA/CD on a bus4
3 What do we know? everything the question gives us
    4 Plan the route work backwards from what we want
    FindKey ideaAlready have itWork out firstTrap
    • Story
      • 1check channel busy?
      • 2wait or send
      • 3collision: abort / jam
      • 4random wait, retry
    5 Now solve it have a go on paper first, then open the worked solution
    1. CSMA/CD is a protocol used to detect and deal with collisions in a bus B1
    2. Before transmitting, a device checks if the channel is busy; if busy it waits, if free the data is sent B1
    3. Two workstations can start at the same time on the shared medium, causing a collision; if a collision is detected, transmission is aborted / a jamming signal is sent B1
    4. Both devices wait a (different) random time and then try again B1
    6 Check it does the answer make sense?

    Every action has a device doing it ✓. The report: “packets”, not “packages”.

    Example 2 · Managing a collision; two drawbacks (Paper 1, 4 marks) ★★ Medium
    9618/13/M/J/24 Q5Paper 1 · Theory fundamentalsPart (c)4 marksFull size
    (c) A different part of the network uses the Ethernet protocol. (i) A collision is detected. Describe how the collision is managed using CSMA/CD. [2] (ii) Identify two drawbacks of using CSMA/CD. [2]
    1 Read it with me what is actually happening?

    (i) starts AFTER the collision is detected: no marks for listening first. (ii) two weaknesses of the method.

    • a collision is detectedbegin from the detection
    • drawbacksproblems with the method itself
    2 What is it asking for? the target, part by part
    • (c)(i)after the collision2
    • (c)(ii)two drawbacks2
    3 What do we know? everything the question gives us
      4 Plan the route work backwards from what we want
      FindKey ideaAlready have itWork out firstTrap
        5 Now solve it have a go on paper first, then open the worked solution
        1. (i) A jamming signal is transmitted by the sending device / transmission aborted B1; the device waits a random time before trying again … the wait increases with further collisions B1
        2. (ii) Random time increases each time, so waiting can become very long / infinite B1; nodes can't be prioritised // limited distance // not scalable // possible constant jamming B1
        6 Check it does the answer make sense?

        (i) contains nothing from before the collision ✓.

        Example 3 · Three tasks devices perform (Paper 1, 3 marks) ★ Easy
        9618/12/O/N/23 Q7Paper 1 · Theory fundamentalsPart (c)3 marksFull size
        (c) State three tasks performed by devices to deal with collisions when using the CSMA/CD protocol in a network. [3]
        1 Read it with me what is actually happening?

        “Tasks performed by devices”: verbs the workstation does.

          2 What is it asking for? the target, part by part
          • (c)three tasks3
          3 What do we know? everything the question gives us
            4 Plan the route work backwards from what we want
            FindKey ideaAlready have itWork out firstTrap
              5 Now solve it have a go on paper first, then open the worked solution
              1. Monitor the communications channel and send only when it is idle B1
              2. Detect a collision and stop transmitting / send a jamming signal B1
              3. Calculate a random back-off time, then retransmit (increasing it after repeated collisions) B1
              6 Check it does the answer make sense?

              Each is a task, done by the device ✓.

              Summary

              • Ethernet: a protocol for wired LAN transmission; frames with source / destination MAC addresses and error checking; uses CSMA/CD.
              • CSMA/CD: listen; send when idle; detect collision; stop + jam; random back-off (growing); retry.
              • Switches avoid collisions by giving each device its own link.
              If you see…do this
              “describe Ethernet”protocol + wired + frames / addresses / error check / CSMA/CD
              “describe CSMA/CD”workstations listen → send if idle → collision → jam → random wait
              “a collision is detected …”start from the jam signal

              Can I do this?

              Anything unticked: revise that section first. All ticked: take the quiz.

              Quiz

              The multiple-choice and guided questions need JavaScript. The concept checks and exam practice below work without it.

              Concept checks

              Answer each one in your head first, then open it.

              1If every station listens first, how can two still collide?Show answer

              A signal takes time to travel along the cable: two stations can both hear silence and start within that tiny gap, before either signal reaches the other.

              2Why does the back-off time get longer after repeated collisions?Show answer

              Repeated collisions mean the network is busy; spreading the retries over a longer time makes another clash less likely.

              3Does CSMA/CD matter on a full-duplex switched network?Show answer

              Hardly: each device has its own link and can send and receive at once, so collisions don't occur.

              Exam-style practice

              New questions, not used above. Do them on paper, then mark your work against the official mark scheme.

              Q1Past-paper style4 marks

              A small office uses a bus network running Ethernet.

              1. (a)
                Explain why collisions can occur on this network.
                [2]
              2. (b)
                The office replaces the bus with a star topology using a switch. Explain why this reduces collisions.
                [2]
              Show the mark scheme
              PartAnswer / workingMarksGuidance
              (a)All devices share the same transmission medium / one cableB1
              Two devices can start transmitting at the same time (both hearing an idle line)B1
              (b)Each device has its own link to the switch // no shared mediumB1
              The switch forwards each packet only to its destination, so devices are not competing for one cableB1
              Total: 4 marks
              Q2Past-paper style3 marks

              Stations P and Q on an Ethernet bus both start sending in the same time slot.

              Describe what P does from the moment the collision happens until its frame is successfully sent.

              1. [3]
              Show the mark scheme
              PartAnswer / workingMarksGuidance
              P detects the collision, stops transmitting and sends a jamming signalB1
              P waits a random back-off time (different from Q's)B1
              P listens again and resends when the channel is idle (backing off for longer if it collides again)B1
              Total: 3 marks

              Your progress on this note is saved when JavaScript is on.