![Page 1: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/1.jpg)
POOR DOCUMENTATIONUSING NETWORK AUTOMATION TO REPLACE
![Page 2: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/2.jpg)
TEXT
A TALK ABOUT…
▸ Autogenerating network documentation
▸ Best practices (that I didn’t necessarily follow)
![Page 3: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/3.jpg)
Who am I?
![Page 4: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/4.jpg)
‣ Allan Eising
‣ Network (automation) engineer
‣ Telia Norway
‣ AS12929, AS198309, AS25400
‣ blog.automate.network
‣ @allaneising (twitter)
‣ github.com/Eising
![Page 5: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/5.jpg)
DISCLAIMERALTHOUGH I TALK ABOUT BAD DOCUMENTATION, IT IS NOT MY INTENTION TO SHAME ANY INDIVIDUAL WHO MAY HAVE WORKED ON THIS NETWORK OR THE DOCUMENTATION AT ANY PRIOR POINT.
![Page 6: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/6.jpg)
STORY TIME
![Page 7: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/7.jpg)
SO LONG! ALL THE DOCUMENTATION IS ON THE
NETWORK DRIVE…
![Page 8: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/8.jpg)
![Page 9: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/9.jpg)
RESOURCES != SERVICES
![Page 10: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/10.jpg)
RESOURCES AND SERVICES
RESOURCES AND SERVICES ARE INHERENTLY DIFFERENT
▸ Resources are assigned, and have life cycles
▸ Resources can have pools, assignment policies
▸ Services include resources and connections between them
▸ Resources are owned by services
▸ Services are owned by products and customers (or infra)
![Page 11: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/11.jpg)
TRIBAL KNOWLEDGERESOURCE DOCUMENTATION
+
![Page 12: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/12.jpg)
THE GOAL
SEARCHABLE SERVICE DOCUMENTATION
![Page 13: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/13.jpg)
APPROACH
1. Write a Nokia SROS parser
2. Write a backend to store it in
3. Write a pretty front-end
4. ???
5. Profit!
![Page 14: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/14.jpg)
PARSING THE CONFIGURATIONSSTEP 1
![Page 15: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/15.jpg)
WRITING A PARSER
THIS TOOK A FEW ATTEMPTS… (ACTUAL SCREENSHOT)
![Page 16: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/16.jpg)
FIRST VERSION
LOTS OF REGEX
![Page 17: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/17.jpg)
TEXT
BUT BECAME BETTER IN THE END
![Page 18: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/18.jpg)
PROBABLY DON’T WRITE YOUR OWN PARSER
TAKEAWAYS
![Page 19: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/19.jpg)
BETTER…
POSSIBLY BETTER WAYS
▸ Netconf/YANG models where supported
▸ TextFSM
▸ show configuration | display json
![Page 20: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/20.jpg)
THE INVENTORYSTORING THE PARSED DATA
![Page 21: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/21.jpg)
THE BACKEND
DJANGO
▸ Easy to write
▸ Simple ORM
▸ Django-Rest-Framework for easy REST
▸ Alternatives exist, but ease is king
![Page 22: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/22.jpg)
BACKEND TAKEAWAYS
SOME LESSONS
▸ Use natural keys when possible!
▸ If hostname is unique, it’s the key
▸ Beware of human input errors
▸ Interface “int-1/2/3:10 “ is not the same as “int-1/2/3:10”
▸ Beware of things that ought to be unique, but aren’t
▸ In SROS logical interfaces can exist twice if one has no physical interface assigned - how to resolve in a parser?
![Page 23: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/23.jpg)
TEXT
DEVELOPMENT STAGES
![Page 24: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/24.jpg)
TEXT
FINAL ARCHITECTURE
![Page 25: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/25.jpg)
SOURCE OF TRUTH
▸ Unless you have very strict control over your data, your network is ALWAYS the source of truth
▸ This piece of software is not yet capable of provisioning
▸ Maybe later…
▸ It’s an excellent reference for the source of truth though
![Page 26: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/26.jpg)
NEXT STEP
THE GUI
![Page 27: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/27.jpg)
NEXT STEP
THE GUI
‣ Written using a modern javascript framework (Vue)
‣ Using pre-made UI components for easy, pretty styling (Vuetify)
‣ Interacting with the backend through REST
![Page 28: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/28.jpg)
TEXT
NODE OVERVIEW
![Page 29: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/29.jpg)
TEXT
SERVICE OVERVIEW
![Page 30: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/30.jpg)
TEXT
DIAGRAMS
![Page 31: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/31.jpg)
TEXT
DIAGRAMS
▸ You can see an autogenerated diagram
▸ It shows nodes and interfaces for each VRF
▸ Ordered per site
▸ Using Dagre-d3 library
![Page 32: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/32.jpg)
TEXT
BGP CONFIG
![Page 33: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/33.jpg)
TEXT
L2VPN DIAGRAMS
![Page 34: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/34.jpg)
TEXT
L2VPN DIAGRAMS
▸ L2VPNs are more complicated
▸ Graphing pseudowires between nodes
▸ Many sites become hard to read
▸ but it’s “good enough”
![Page 35: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/35.jpg)
SEARCHING!
![Page 36: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/36.jpg)
SEARCHING!
▸ You can search for either text strings or IP resources
▸ IP subnets allow you to pull a list of all more specifics in use in the network.
![Page 37: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/37.jpg)
TEXT
REPORTS
![Page 38: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/38.jpg)
TEXT
REPORTS
▸ This report shows all resources using more specifics from a supernet
▸ Returns Interfaces, Prefix Lists, Static Routes
![Page 39: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/39.jpg)
TEXT
TAKEAWAYS
▸ You don’t have to write the GUI as a standalone thing
▸ REST API is incredibly handy!
▸ Diagrams aren’t that complicated if the target is “good enough”
![Page 40: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/40.jpg)
REST EXAMPLE
REAL WORLD EXAMPLE OF REST USAGE
![Page 41: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/41.jpg)
TEXT
CONCLUSIONS
▸ It is indeed possible to create service documentation automatically
▸ It can be done quite a lot simpler than I’ve done here as well
▸ This tool has become extremely useful for everyday operations
▸ I’m looking in to which components I can open source (if any)
![Page 42: USING NETWORK AUTOMATION TO REPLACE POOR …events.dknog.dk/event/8/contributions/91/attachments/38/49/automation-talk...BACKEND TAKEAWAYS SOME LESSONS Use natural keys when possible!](https://reader034.vdocuments.us/reader034/viewer/2022050323/5f7d5d712ecd2c3d977bfa95/html5/thumbnails/42.jpg)
Thank you!
QUESTIONS?