Proper way to model interfaces using SFPs as Module Types #19670
Replies: 6 comments 3 replies
-
|
For what it worth, here is my two cents )) Hope it makes sense )) Good luck. |
Beta Was this translation helpful? Give feedback.
-
|
I have started to think about this. Netbox Labs has also posted a blog post on the topic: https://netboxlabs.com/blog/sfp-modeling-modules-over-inventory-items/ What I am struggling with is the naming of the interface, this is driven by the name of the SFP+ which is inserted into the module-bay. Is there anyway to achieve getting the naming of the interface coming from the parent line card port? |
Beta Was this translation helpful? Give feedback.
-
|
I've finally found some time to dedicate to this topic, and after spending some time reviewing this and similar discussions I think I've identified a few discrete but related pain points. 1. Delineation between transceiver & interface depends on contextConceptually, there's often no clear distinction between an interface on a switch or router and its pluggable transceiver; we often use the two term interchangeably. For instance, one might refer to an interface in practice as QSFP+, as 40GBASE-S4, or as 40 Gbps Ethernet. All of these may be accurate depending on the context, but individually none of these terms fully capture the complete interface definition. 2. Variable interface assignmentConsider a QSFP+ slot on a switch. How you model the interface(s) this slot provides in NetBox depends on the type of transceiver installed. Installing a 40GBase-C4 direct attach cable (DAC) or 40GBase-S4 will yield a single Ethernet interface operating at 40 Gbps: However, if you were to remove that transceiver and install a breakout DAC terminating to four physically separate 10 Gbps transceivers on the far end, the local device will instead show four individual channelized interfaces: I think this is addressed by the new module-based approach: A 40GBase-S4 transceiver, for instance, would have only a single 40 Gbps Ethernet interface defined, whereas a breakout DAC would have four 10 Gbps Ethernet interfaces. 3. Variable interface namingThe matter of interface assignment is further complicated by platform as @RichardVReyden points out above:
NetBox currently doesn't offer any mechanism to automatically alter the name of an interface on a device type or module type depending on the platform, and implementing such a mechanism would be a fairly complex undertaking. Maybe we could do something similar to the token-based approach we use for deriving a position from the parent module bay. 4. NetBox does not provide physical fiber interface typesSuppose you want to create the breakout DAC transceiver with four 10GE interfaces mentioned above. What type do you assign these? NetBox currently doesn't list an applicable option for the interface type, because historically the convention has been to treat the SFP slot as the interface. This can be easily remedied by adding the necessary physical media as interface types. Edit: I've just submitted FR #20321 to propose adding a set of new interface types for this purpose. |
Beta Was this translation helpful? Give feedback.
-
|
Uh oh can of worms: the Device Type Library has many modules that are modular Devices with many interfaces which, according to the new modelling, should be modules. An example: https://github.com/netbox-community/devicetype-library/blob/master/module-types/Juniper/EX4400-EM-4Y.yaml |
Beta Was this translation helpful? Give feedback.
-
|
There is also a (maybe minor) issue with modeling various DAC cables (which exist in both 1-to-1 and 1-to-N varieties — e.g., 40G to 4×10G or 100G to 4×25G breakouts): Although the DAC cable is a single asset which has a single serial number and also a single asset tag, the NetBox model for it would consist of multiple objects (N+1 module objects for SFP “transceivers” and N cable objects for an 1-to-N cable), and at least the “asset tag” attribute cannot be duplicated on those module objects (and cable objects don't have those attributes at all). At most a single module object must be chosen to contain the asset tag for the DAC cable in the corresponding attribute; other module objects for the same DAC cable would need to have the “asset tag” attribute empty (although it could be possible to stuff the asset tag into some other field, so that the search for that value could still find it somewhere). Alternatively, the asset tag would need to have some extension suffix added to it, so that multiple module objects corresponding to the same DAC cable would technically have different asset tag values. Both variants are somewhat annoying to use for 1-to-1 cables, because such cables don't have a definite “main” end (for 1-to-N cables the obvious solution is to put the proper asset tag on the module object corresponding to the higher speed connector). Although given the overall stance of “NetBox is not an asset management system”, maybe this issue should just be ignored. |
Beta Was this translation helpful? Give feedback.
-
|
There are also some even more weird devices in the SFP form factor — E1 to IP gateways, which look like copper SFP modules, but actually contain a whole embedded system inside with an own IP address:
I suppose that the way to model such devices in NetBox would be:
As with DAC cables, the resulting structure seems to represent the network management side of the configuration correctly (you can even pretend that the internal connection is either copper or optical, depending on which one the gateway emulates); the only thing which is not represented in NetBox is the fact that all those objects (module, device and cable) are actually the same physical device and asset. Reconnecting such SFP to a different switch (or even to a different SFP slot on the same switch) can be cumbersome too — NetBox does not allow moving an existing module between module bays (even on the same device), so the module must be removed (which also removes the cable termination for the internal cable object) and added again in the new location, and then the cable termination needs to be restored manually (going from the existing cable object — just connecting the interface of the newly created module does not work, because the old cable still exists and occupies the IP interface on the device object). The device for the E1-to-IP gateway also appears as unracked (it can be associated with the same rack as the switch, but not with the unit occupied by the switch). Although it could possible to pretend that the gateway device is installed in a device bay in the corresponding switch, NetBox does not allow adding device bays to arbitrary devices unless the corresponding device type allows that, so if that solution is to be used, device types for all devices with SFP slots must be marked as “Parent”, so that the device instances can have device bays added manually if needed. This solution also does not represent the hierarchy correctly (ideally the device bay should be inside the corresponding module, but NetBox does not allow modules to contain device bays). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I have a switch with 4 fixed SFP slots. On the switch, these are represented by interface names:
Gi1/0/49-51
I create a module type profile called "SFP" and then create a module type called "GLC-SX-MMD", then on the device type for my switch, I add 4 Module Bays named:
Gi1/0/[49-51]
Then I create a new device for my actual switch.
As an example, my SFP is inserted into Gi1/0/51, so under module bays of the device, I add a module under my Gi1/0/51 module bay and select the GLC-SX-MMD module.
So now comes the question. Is this the appropriate way to model SFP interfaces? I'm guessing not because I have no way to model cable connections if I'm using modules to represent the SFP. Is there any guidance on the currently recommended way, since inventory items are deprecated as of v4.3.
Beta Was this translation helpful? Give feedback.
All reactions