SDN Flow Table Rule Generator
Configure, visualize, and export OpenFlow 1.3 compliant flow rules. Define match fields, instructions, and priorities to simulate a software-defined network data plane.
3
Active Rules
Allow
Default Policy
OpenFlow 1.3
Protocol Version
Current Flow Table (Table 0)
| Priority | Match Fields | Instructions/Actions | Timeouts (Idle/Hard) | Cookie | Action |
|---|
* Higher priority rules are matched first.
Create New Flow Rule
Global Table Settings
Removes rule if no packets match for X seconds.
Removes rule after X seconds regardless of activity.
Simulated Local Controller
Date: ${new Date().toLocaleDateString()}
Protocol: OpenFlow 1.3
Flow Entries
| Priority | Match Criteria | Actions | Timeouts |
|---|---|---|---|
| ${r.priority} | ${JSON.stringify(r.match).replace(/"/g,'').replace(/,/g,', ')} | ${r.actions.type}${r.actions.port ? ':'+r.actions.port : ''} | ${r.timeouts.idle} / ${r.timeouts.hard} |
Generated by SDN Flow Table Rule Generator.
`; const opt = { margin: 0.5, filename: 'SDN_Flow_Table.pdf', image: { type: 'jpeg', quality: 0.98 }, html2canvas: { scale: 2 }, jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' } }; html2pdf().set(opt).from(element).save(); } // --- Event Listeners --- // Tabs tabBtns.dashboard.addEventListener('click', () => switchTab('dashboard')); tabBtns.builder.addEventListener('click', () => switchTab('builder')); tabBtns.config.addEventListener('click', () => switchTab('config')); // Nav Buttons document.getElementById('sdn-dash-next-btn').addEventListener('click', () => switchTab('builder')); document.getElementById('sdn-builder-next-btn').addEventListener('click', () => switchTab('config')); document.getElementById('sdn-builder-prev-btn').addEventListener('click', () => switchTab('dashboard')); document.getElementById('sdn-config-prev-btn').addEventListener('click', () => switchTab('builder')); // Functionality document.getElementById('sdn-add-rule-btn').addEventListener('click', addRule); document.getElementById('sdn-pdf-btn').addEventListener('click', generatePDF); // Live Preview Updates Object.values(inputs).forEach(input => { if(input) input.addEventListener('input', updatePreview); if(input) input.addEventListener('change', updatePreview); }); // Initialization renderTable(); updatePreview(); });