BFD makes FSM transition after building Poll response instead of before

Aperta
#864 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust
Ambito
networking

Direzione di ricerca

Individua la gestione di Poll dei pacchetti di controllo BFD e i test Poll esistenti; esamina dove vengono elaborate le informazioni sulla sessione remota, le transizioni di stato, la modalità Demand e la risposta immediata Final. Aggiorna l’ordine in modo che la risposta utilizzi lo stato locale risultante continuando a bypassare il timer periodico. Estendi i test Poll per verificare le combinazioni di stato Init/Final, Up/Final e Down/Final.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bfd Bug mgd needs testing rust

The following is an issue identified by AI when I asked it to do an adversarial code review of #795. This was pre-existing in the sync/pthread impl, which is why it was not addressed as part of the async swap-out.

Problem

When a control packet has the Poll bit set, the state machine currently
constructs and queues its Final response before applying the state
transition caused by the received packet.

Examples:

  • Local Down receives remote Down+Poll:

    • Final is created with State=Down;
    • local session then transitions to Init.
  • Local Init receives remote Init+Poll:

    • Final is created with State=Init;
    • local session then transitions to Up.

The queued response therefore advertises the state from before the
received packet was processed.

RFC 5880 §6.8.6 applies the received state transition before sending the
Final response. RFC 5880 §6.8.7 requires transmitted State to reflect
the current local session state.

Impact

The remote peer receives stale state in the mandatory immediate Poll
response. This can require additional handshake packets and may delay or
disrupt convergence, particularly when Demand mode suppresses subsequent
periodic packets.

Proposed direction

For an accepted packet:

  1. update remote session information;
  2. apply the local state transition;
  3. determine whether Demand mode is active;
  4. construct the Poll Final response from the resulting local state.

The Final response must still bypass the normal periodic transmission
timer.

Testing

Extend Poll tests to check the State field, not only the Poll and Final
bits:

  • Down + received Down/Poll produces an Init/Final response;
  • Init + received Init/Poll produces an Up/Final response;
  • Up + received Down/Poll produces a Down/Final response.

References

  • RFC 5880 §6.8.6
  • RFC 5880 §6.8.7

Context

This ordering behavior predated the async implementation and was retained
by #795 and #796.

Lingua principale
Rust
Stelle
100
Fork
8
Merge medio
2g 1h
PR unite (30g)
18

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di oxidecomputer/maghemite

Tutte le issue di oxidecomputer/maghemite

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.