DCQCN bugs and their fixes

Open
#21 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Start with dcqcn.h, dcqcn.cpp, roce.h, roce.cpp, and dcqcn_logger.cpp, using the cited upstream revision as context. Review each listed failure and fix, then run the relevant simulator cases, including incast and mixed link speeds. Done means the nine reported bugs are fixed and finished flows stop cleanly.

Written by the indexing model from the issue text.

Description

DCQCN bugs

Line numbers refer to upstream 64d199c.

1. _alpha is static
  • Where: dcqcn.h:44, dcqcn.cpp:22
  • Bug: All flows share one alpha, so a CNP to any flow changes every flow's rate cuts.
  • Fix: Made it a per-instance member, initialised to 1 in the constructor.
2. No minimum rate (divide by zero)
  • Where: dcqcn.cpp:56, roce.h:48
  • Bug: _RC (uint64) rounds down to 0 after repeated cuts. update_spacing then divides by zero, and the flow stalls or hits the assert at roce.cpp:341. Incast triggers it.
  • Fix: Clamp _RC >= _min_rate (rate/100000) after each cut.
3. Byte counter mixes packets and bytes
  • Where: dcqcn.cpp:117
  • Bug: It adds a packet count but compares against _B in bytes, so byte-counter increase and hyper-increase never run.
  • Fix: Multiply the packet count by _mss.
4. Alpha-decay timer never moves forward
  • Where: dcqcn.cpp:128
  • Bug: _last_alpha_update is never updated, so alpha decays on every tick instead of every 55 µs and falls to ~0.
  • Fix: Set _last_alpha_update = now inside the if.
5. Finished flows never stop (the sim never ends)
  • Where: dcqcn.cpp:113, roce.cpp:329
  • Bug: There is no _done check, and the stop check compares _highest_sent (packets) with _flow_size (bytes). Finished flows keep scheduling events, so every run goes to -end (~1000× slowdown).
  • Fix: if (_done) return; in both doNextEvents, and _highest_sent * _mss >= _flow_size.
6. Packet leak after a flow finishes
  • Where: dcqcn.cpp:159, roce.cpp:246
  • Bug: Packets arriving after the flow is done are dropped without being freed.
  • Fix: Call pkt.free() before returning.
7. _RAI / _RHAI are static
  • Where: dcqcn.h:46
  • Bug: Each source sets them from its own link rate, so with mixed link speeds all sources use the last value set.
  • Fix: Made them per-instance.
8. _T / _BC overflow
  • Where: dcqcn.h:55
  • Bug: They are uint16_t; _T overflows after ~3.6 s without a CNP.
  • Fix: Changed to uint32_t.
9. Sink logger looks for the wrong record type
  • Where: dcqcn_logger.cpp:126
  • Bug: It parses HPCC_SINK, but records are written as DCQCN_SINK.
  • Fix: case Logger::DCQCN_SINK.
Dominant language
C++
Stars
35
Forks
23
PR merge metrics
No merged PRs in 30d

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spcl/HTSIM

All issues in spcl/HTSIM

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.