Network Infrastructure & IDFs
Relevant source files
The following files were used as context for generating this wiki page:
The Network Infrastructure and Intermediate Distribution Frame (IDF) system is a core component of the IT Management System. Its primary purpose is to manage physical network assets, including their locations, rack layouts, and the interconnected devices that constitute the backbone of an organization's network. This module provides a comprehensive workspace for tracking the lifecycle and connectivity of network hardware across multiple tenants.
Sources: modules/idfs/AGENT_NOTES.md:4-6, wiki/Modules.md:95-99
System Architecture & Data Flow
The IDF system operates as a "protection zone" within the application, requiring strict adherence to synchronization rules to maintain data integrity across multiple linked tables. It utilizes a centralized metadata table (idfs) which integrates with rack positions, port configurations, and physical cable links.
Core Components
- IDF Registry: Manages high-level metadata such as location and company ownership.
- Rack Visualizer: An interactive interface for managing RU positions and device placement.
- Port Manager: Handles the configuration of individual ports and their physical links.
- Synchronization Layer: Ensures that changes in rack state are mirrored across equipment and switch port tables.
Sources: wiki/IDF-Synchronization.md:8-13, wiki/Modules.md:101-106
Data Relationship Diagram
The following entity-relationship diagram illustrates how the IDF module connects to other core system entities.
IDF Synchronization Logic
Consistency is maintained through a strict "Hard-fail policy." Any operation that modifies rack or device state—including Creating, Editing, Updating, Deleting, Copying, or Moving—must utilize database transactions to ensure that partial updates do not occur.
Synchronization Requirements
| Table | Role in Synchronization |
|---|---|
idfs | Main IDF record metadata. |
idf_positions | Tracks individual Rack Unit (RU) positions. |
idf_ports | Tracks port rows specifically on the IDF side. |
idf_links | Manages links between specific positions and ports. |
switch_ports | Mirrored rows for switch port management. |
equipment | Aligned via idf_id to ensure assets are correctly located. |
Sources: wiki/IDF-Synchronization.md:15-27
Port Reset and Parity
When a link is deleted or a device is unlinked, the system must reset the synchronized ports to a specific tenant default state:
- Status: Set to "Unknown".
- Color: Set to Gray (
#808080).
Sources: wiki/IDF-Synchronization.md:46-49
API & Interaction Flow
The IDF system relies on a suite of asynchronous POST-only JSON handlers located in modules/idfs/api/. These endpoints facilitate real-time updates to the rack visualizer without requiring full page reloads.
IDF API Endpoints
| Method | Endpoint | Purpose |
|---|---|---|
| POST | position_save.php | Updates RU metadata (name, notes). |
| POST | link_create.php | Establishes physical connectivity between ports. |
| POST | port_update.php | Updates port status, color, and labels. |
| POST | position_delete.php | Removes a rack position (requires cleanup of links). |
Sources: scripts/api.php:123-142, wiki/Modules.md:107-111
Rack Update Sequence
This diagram shows the communication flow when a developer or agent updates a rack position through the UI.
Technical Constraints & Business Rules
- Unique Naming: IDF names must be unique within the scope of a single
company_id. - Physical Linkage: Every IDF record must be associated with a valid entry in the
it_locationstable. - High-Density Support: The system supports up to 250 positions per rack.
- Batch Operations: To avoid unique constraint collisions during reordering, the system uses temporary offsets (starting at 1000).
- Multi-Tenancy: All queries must be strictly scoped by the
company_idretrieved from the authenticated session.
Sources: modules/idfs/AGENT_NOTES.md:16-19, wiki/IDF-Synchronization.md:52-54, modules/idfs/AGENT_NOTES.md:28-29
Implementation Example: Position Update
The following JSON payload illustrates the structure required to communicate with the IDF API for updating a rack position.
{
"csrf_token": "valid_token_here",
"id": 12,
"name": "U12",
"notes": "Reserved for Core Switch"
}
Sources: scripts/api.php:144-148
Summary
The Network Infrastructure & IDF module acts as the physical source of truth for the IT Management System. By enforcing strict synchronization rules and transactional updates between the rack visualizer and the asset inventory, it ensures that the virtual representation of the network matches the physical reality of the data center.