show lldp presents stale neighbours as current, and its columns run together #1265

Closed
opened 2026-11-09 20:13:55 +00:00 by jaylouisw · 0 comments
Owner

What happens

show lldp lists a neighbour identically whether it is still there or not. Pull the cable, and nothing
changes:

LLDP neighbours on Switch (L2)-sw:
  Neighbour           Local port      Port ID         Mgmt address
  ASR 1001-X aggregation services router-r1Fa0/1           Gi0             10.0.0.1

Shut the far port instead — still nothing changes. The entry is never aged, never marked, and the table is the
only place to answer "what is on that port".

Two things are wrong in that one row:

  1. No staleness. An entry whose local port can no longer carry a frame is presented as current, forever.
    show arp and show mac address-table were both fixed to mark this (#1254, #1256); this table was not.
  2. The columns run together. Neighbour is padded to 20 characters and a real device name is 55, so
    ...router-r1Fa0/1 is printed — the system name and the local port are one field. The table cannot be read
    field by field, which is the only thing it is for. The header is misaligned the same way.

Expected

  • a neighbour whose local port can no longer carry a frame is still listed (real switches hold the entry until
    its TTL expires, and this model has no clock to age it with) but the Local port says why, in the same
    sentence the other tables use: (down: link down), (down: peer shut down), (administratively down);
  • the mark clears when the link comes back;
  • a neighbour recorded against a port that no longer exists is marked (gone) rather than inventing a device;
  • column widths come from the data, so no name can ever run into the next column;
  • the empty table still prints a header and says nothing has been heard.

Scope

The existing show lldp output. No new commands.

## What happens `show lldp` lists a neighbour identically whether it is still there or not. Pull the cable, and nothing changes: ``` LLDP neighbours on Switch (L2)-sw: Neighbour Local port Port ID Mgmt address ASR 1001-X aggregation services router-r1Fa0/1 Gi0 10.0.0.1 ``` Shut the far port instead — still nothing changes. The entry is never aged, never marked, and the table is the only place to answer "what is on that port". Two things are wrong in that one row: 1. **No staleness.** An entry whose local port can no longer carry a frame is presented as current, forever. `show arp` and `show mac address-table` were both fixed to mark this (#1254, #1256); this table was not. 2. **The columns run together.** `Neighbour` is padded to 20 characters and a real device name is 55, so `...router-r1Fa0/1` is printed — the system name and the local port are one field. The table cannot be read field by field, which is the only thing it is for. The header is misaligned the same way. ## Expected * a neighbour whose local port can no longer carry a frame is still listed (real switches hold the entry until its TTL expires, and this model has no clock to age it with) **but the Local port says why**, in the same sentence the other tables use: `(down: link down)`, `(down: peer shut down)`, `(administratively down)`; * the mark clears when the link comes back; * a neighbour recorded against a port that no longer exists is marked `(gone)` rather than inventing a device; * column widths come from the data, so no name can ever run into the next column; * the empty table still prints a header and says nothing has been heard. ## Scope The existing `show lldp` output. No new commands.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1265
No description provided.