mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-11 21:10:29 +01:00
Connecting rear ports through circuit causes error when connecting devices #2690
Closed
opened 2025-12-29 18:21:08 +01:00 by adam
·
17 comments
No Branch/Tag Specified
main
update-changelog-comments-docs
feature-removal-issue-type
20911-dropdown
20239-plugin-menu-classes-mutable-state
21097-graphql-id-lookups
feature
fix_module_substitution
20923-dcim-templates
20044-elevation-stuck-lightmode
feature-ip-prefix-link
v4.5-beta1-release
20068-import-moduletype-attrs
20766-fix-german-translation-code-literals
20378-del-script
7604-filter-modifiers-v3
circuit-swap
12318-case-insensitive-uniqueness
20637-improve-device-q-filter
20660-script-load
19724-graphql
20614-update-ruff
14884-script
02496-max-page
19720-macaddress-interface-generic-relation
19408-circuit-terminations-export-templates
20203-openapi-check
fix-19669-api-image-download
7604-filter-modifiers
19275-fixes-interface-bulk-edit
fix-17794-get_field_value_return_list
11507-show-aggregate-and-rir-on-api
9583-add_column_specific_search_field_to_tables
v4.5.0
v4.4.10
v4.4.9
v4.5.0-beta1
v4.4.8
v4.4.7
v4.4.6
v4.4.5
v4.4.4
v4.4.3
v4.4.2
v4.4.1
v4.4.0
v4.3.7
v4.4.0-beta1
v4.3.6
v4.3.5
v4.3.4
v4.3.3
v4.3.2
v4.3.1
v4.3.0
v4.2.9
v4.3.0-beta2
v4.2.8
v4.3.0-beta1
v4.2.7
v4.2.6
v4.2.5
v4.2.4
v4.2.3
v4.2.2
v4.2.1
v4.2.0
v4.1.11
v4.1.10
v4.1.9
v4.1.8
v4.2-beta1
v4.1.7
v4.1.6
v4.1.5
v4.1.4
v4.1.3
v4.1.2
v4.1.1
v4.1.0
v4.0.11
v4.0.10
v4.0.9
v4.1-beta1
v4.0.8
v4.0.7
v4.0.6
v4.0.5
v4.0.3
v4.0.2
v4.0.1
v4.0.0
v3.7.8
v3.7.7
v4.0-beta2
v3.7.6
v3.7.5
v4.0-beta1
v3.7.4
v3.7.3
v3.7.2
v3.7.1
v3.7.0
v3.6.9
v3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-r1
v1.0.3
1.0.0
Labels
Clear labels
beta
breaking change
complexity: high
complexity: low
complexity: medium
needs milestone
netbox
pending closure
plugin candidate
pull-request
severity: high
severity: low
severity: medium
status: accepted
status: backlog
status: blocked
status: duplicate
status: needs owner
status: needs triage
status: revisions needed
status: under review
topic: GraphQL
topic: Internationalization
topic: OpenAPI
topic: UI/UX
topic: cabling
topic: event rules
topic: htmx navigation
topic: industrialization
topic: migrations
topic: plugins
topic: scripts
topic: templating
topic: testing
type: bug
type: deprecation
type: documentation
type: feature
type: housekeeping
type: translation
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/netbox#2690
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @steffann on GitHub (Jun 22, 2019).
Environment
Steps to Reproduce
At this point all is still well: both devices are connected to each other.
This will fail as the first interface connection will have used the circuit termination point id in its
_connected_circuittermination_id. The second interface will try to put the same termination point id in its_connected_circuittermination_id, which will fail because that is aOneToOneField.Expected Behavior
When connecting multiple devices/interfaces through a mux they are expected to share the same circuit. Use cases are CWDM and DWDM. In Django terms: I expected
_connected_circuittermination_idto be aForeignKey, not aOneToOneField.Observed Behavior
Notes
This case seems similar to https://github.com/digitalocean/netbox/issues/3193, but is different. That issue applies to cables where the rear port of one mux isn't directly connected to the rear port of another mux, but is passed through other patch panels (implemented as 1 front port mapped to 1 rear port).
@steffann commented on GitHub (Jun 22, 2019):
I have tested the following changes, and have been working with them in production:
That way there won't be a change to the endpoint data model, CWDM and DWDM circuits will work, and endpoints will show the correct peer endpoint.
If this is an acceptable solution I can have a pull request ready in minutes.
@steffann commented on GitHub (Jun 22, 2019):
A preview of what I suggest can be found here: https://github.com/digitalocean/netbox/compare/develop...steffann:multilink-circuit
@jeremystretch commented on GitHub (Jun 24, 2019):
The root issue here is a conflict between two approaches, namely whether or not a circuit termination should be considered a path endpoint. In the scenario you describe, it makes sense to follow a connection across the circuit to its peer termination. But in other cases (e.g. attaching to an Internet transit circuit with no defined peer termination) it makes sense to stop at the circuit. I think we need to come up with some reference models and tests before we proceed any further.
@steffann commented on GitHub (Jun 24, 2019):
Agreed. I'll write up some possible scenarios, and we can see where the common cases are.
@steffann commented on GitHub (Jul 7, 2019):
Sorry this is taking a bit more time. I had some urgent work related things I had to attend to. I haven't forgotten about this though!
@steffann commented on GitHub (Jul 26, 2019):
Ok, finally time to work on this :)
Let's look at the possible scenario's from the user's point of view. I am ignoring the
dcim_interface._connected_interface_idanddcim_interface._connected_circuittermination_idfields for now. Those are implementation-specific cache fields, and I have the feeling that we might come up with better cache fields after evaluating the scenarios.I see these possible scenario's. These are the "classical" ones without front/rear ports. Let's assume that the A side is connected to a device interface through a circuit-termination (CT). Obviously all scenario's apply with A and B sides reversed as well.
In scenario 1 we only know that the device on the A side is connected to the circuit. The user interface should show which circuit the device interface is connected to. Display "via
circuitin the user interface".Scenario 2 expands on this a bit because we now know, through the circuit-termination, which site the other end of the circuit goes to. I suggest we show both the circuit and the remote site in the user interface. Display "to
siteviacircuit".Scenario 3 should show the user that the device interface is connected to which remote device interface, plus which circuit the connection uses. As we already know the remote device, I don't see much value in showing the remote site of the circuit-termination as well. Display "to
deviceportviacircuit".Then on to some more complex scenarios where there are multiple circuits on the path:
I think these scenarios are similar to the first three. In the user interface I personally would like to see all the circuits to make it more intuitive, especially when looking a the impact of outages. I think it would also be useful to see the sites of CT 1B, CT 2A, etc. (removing duplicates when CT 1B and 2A are in the same site, as they will probably be in most cases). For example: "via
circuit1-ct1B/2A-site-circuit2" etc.And then on to the scenarios that I opened this ticket about: CWDM and DWDM circuits and suchlike multiplexers:
I'm assuming that the names of the front ports will correspond to channel names or something similar. Is that a reasonable assumption?
For scenario 7 I think it would be useful to show the front port name and the circuit in the user interface. That is probably the information a user needs most. Display "via
mux1-front-circuit" (e.g. "via CH32 - DarkFiber123").Scenario 8 would benefit from showing the remote site name as well, similar to scenario 2. Display "to
ctB-siteviamux1-front-circuit" (e.g. "to Amsterdam via CH32 - DarkFiber123").Scenario 9 seems to be an error, but maybe there are cases where the mux device has a separate channel for out-of-band management which doesn't have a corresponding front port. Display "to
mux2viamux1-front-circuit" (e.g. "to mux01.ams1 via CH32 - DarkFiber123").In scenario 10 the user probably wants to know the front port that the connection ends up at. Display "to
mux2mux2-frontviamux1-front-circuit" (e.g. "to mux01.ams1 CH32 via CH32 - DarkFiber123").A possible optimization could be to display "to
mux2mux2-frontviacircuit" (e.g. "to mux01.ams1 CH32 via DarkFiber123") when the front names on both MUXes are the same, as will be the case when those names are CWDM/DWDM channel names.Scenario 11 would of course show the connected device and interface together with the circuit. If we can assume that front port names are indeed channel names, then that information would be useful to show as well. Display "to
remote-deviceremote-interfaceviamux1-front-circuit-mux2-front" (e.g. "to router1.ams1 xe-0/0/0 via CH32 - DarkFiber123 - CH32").The same optimization with duplicate front port names would apply here too: "to
remote-deviceremote-interfaceviamux1-front-circuit" (e.g. "to router1.ams1 xe-0/0/0 via CH32 - DarkFiber123").For the CWDM/DWDM scenarios we might need to rethink the
circuits_circuittermination.connected_endpoint_idfield as a circuit-termination may be connected to a rear port, in which case there is no single interface that it's connected to.And then there are the scenarios where there are multiple CWDM/DWDM MUXes on the path:
For these scenarios I would suggest prefixing the display text of the previous section with "via
mux1-front-circuit-mux2-front" (or the shorter optimized version, with front port names omitted if they are the same as the previous front port name).Scenario 12 would display "via
mux1-front-circuit1-mux2-front-mux3-front-circuit2" (e.g. "via CH32 - DarkFiber123 - CH32 - CH32 - DarkFiber456"), or optimized to "via CH32 - DarkFiber123 - DarkFiber456"Scenario 13 would display "to
ct2B-siteviamux1-front-circuit1-mux2-front-mux3-front-circuit2" (e.g. "to Amsterdam via CH32 - DarkFiber123 - CH32 - CH32 - DarkFiber456"), or optimized to "to Amsterdam via CH32 - DarkFiber123 - DarkFiber456"Scenario 14 would display "to
mux4viamux1-front-circuit1-mux2-front-mux3-front-circuit2" (e.g. "to mux01.ams1 via CH32 - DarkFiber123 - CH32 - CH32 - DarkFiber456"), or optimized to "to mux01.ams1 via CH32 - DarkFiber123 - DarkFiber456".In scenario 15 would display "to
mux4mux4-frontviamux1-front-circuit1-mux2-front-mux3-front-circuit2" (e.g. "to mux01.ams1 CH32 via CH32 - DarkFiber123"), or optimized to "to mux01.ams1 CH32 via DarkFiber123 - DarkFiber456".Scenario 16 would display "to
remote-deviceremote-interfaceviamux1-front-circuit1-mux2-front-mux3-front-circuit2-mux4-front" (e.g. "to router1.ams1 xe-0/0/0 via CH32 - DarkFiber123 - CH32 - CH32 - DarkFiber456 - CH32"), or optimized to "to router1.ams1 xe-0/0/0 via CH32 - DarkFiber123 - DarkFiber456".I hope I covered all likely scenarios here. Once we agree that these are correct, and that the display text for each scenario is what we want it to be, then I will write a proposal in pseudo-code to capture the common elements and try to come up with a maintainable code structure.
@steffann commented on GitHub (Jul 26, 2019):
Oh, another thing to think about: what to do when we are showing the connected endpoint of a cable that ends up at a rear port without having gone through a front port (for example when showing what a circuit termination is connected to). I think we should show the rear port and its device as the endpoint. Going any further would make us end up at one of the endpoints of a front port, which would make no sense.
@bsteinert commented on GitHub (Aug 5, 2019):
@steffann i see a scenario that would not be covered. when you connect a multiplexer to a extension port of another multiplexer (often 1300nm cwdm or 1550nm dwdm) to extend your network this could break things in documentation..
--> "From Site1 to Site2 via Mux-1 1330nm - Mux-2 1300nm - DarkFiberX - Mux-3 1300nm - Mux-4 1330nm"
That get even more complicated when i add PatchPanel to NetBox...
Thank you very mutch for working on this!
@garnser commented on GitHub (Sep 26, 2019):
@bsteinert I've the exact same issue as you've, to make things worse some multiplexers only have front-ports which isn't supported at all since a Front port requires a rear-port.
@steffann commented on GitHub (Sep 29, 2019):
Well, the term "rear-port" is used for the port that aggregates one or more front ports. It doesn't have to be physically on the rear of the device :) And a "front-port" may physically be on the back.
@steffann commented on GitHub (Oct 20, 2019):
A lot of work has been done in https://github.com/netbox-community/netbox/pull/3585. I could use some extra eyes on the changes at this point. Because of the large number of changes I would like to ask for some guinea pigs^W^Wvolunteers to thoroughly test these changes
@amtypaldos commented on GitHub (Oct 21, 2019):
We have just hit a wall due the no MUX support so I would gladly do some testing for you!
@steffann commented on GitHub (Oct 23, 2019):
I created a demo test case where Site A and Site B are connected using a DWDM circuit with a mux at both ends. Eth1 of router at Site A is connected over
CH35to the router at Site B.I also connected a second mux at Site A to the
Upgport of the first mux. Eth2 of the router at Site A is connected toCH50of the second mux. At site B theUpgport of the mux is conneced to another circuit going to Site C. At that site there is a mux of the same type as the second mux at Site A, and the router at Site C is connected toCH50of that one.Just to create a scenario with nested muxes and multiple circuits :)
The interfaces of Router A now look like this:
@steffann commented on GitHub (Oct 23, 2019):
This issue started with an error message, but the cause for that error message was much deeper. It is caused by the interactions between front ports, rear ports and circuits. A quick bug fix is therefore not possible (or just plain ugly).
I'll copy the use cases to a new feature request so we can discuss that properly, and by implementing that this bug will be solved as well.
@steffann commented on GitHub (Oct 23, 2019):
Oh, another reminder of why I think that this is not fixable without a bigger overhaul: if only circuit terminations and interfaces are considered "connected" endpoints, then a path that ends anywhere else (a rear port for example) is considered "not connected", which is very misleading. The physical port is connected to something, it's just that the path doesn't end at one of the supported endpoint types. Trying to fix that basically led to the feature request in #3633.
@steffann commented on GitHub (Oct 23, 2019):
Unless someone has a workable short-term fix, I'd like to suggest closing this bug report as "unfixable without major overhaul".
@jeremystretch commented on GitHub (Mar 19, 2020):
This was resolved by the work done on #3193 in PR #4387. (There are still issues with the cabling model, however this specific bug as detailed in the "steps to reproduce" has been fixed.)