- Mastering Python Networking
- Eric Chou
- 387字
- 2021-07-02 21:42:34
The challenges of CLI
At the Interop expo in Las Vegas 2014, BigSwitch Networks CEO Douglas Murray displayed the following slide to illustrate what has changed in Data Center Networking (DCN) in 20 years between 1993 to 2013:

While he might be negatively biased toward the incumbent vendors when displaying this slide, the point is well taken. In his opinion, the only thing in managing routers and switches that has changed in 20 years was the protocol changing from Telnet to the more secured SSH. It is right around the same time that we start to see the consensus around the industry for the clear need to move away from manual, human-driven CLI toward an automatic, computer-centric automation API. Make no mistake, we still need to directly communicate with the device when making network designs, bringing up initial proof of concepts, and deploying the topology for the first time. However, once we have moved beyond the initial deployment, the need becomes to consistently make the same changes error-free, over and over again without being distracted or feeling tired. Sounds like an ideal job for computers and our favorite language, Python.
Referring back to the slide, the challenge, is the interaction between the router and the administrator. The router expects the administrator to enter a series of manual inputs that requires human interpretation. For example, you have to type in enable to get into a privileged mode, and upon receiving the returned prompt with # sign, you then need to type in configure terminal in order to go into the configuration mode. The same process can further be expanded into interface configuration mode and routing protocol configuration mode. This is in a sharp contrast to an computer-driven mindset. When computer wants to accomplish a single task, say put an IP on an interface, it wants to structurally give all the information to the router at once, and then it expects a single yes or no answer from the router to indicate success or failure of the task.
The solution, as implemented by both Pexpect and Paramiko, is to treat the interactive process as a child process and watch over the interaction between the process and the destination device. Based on the returned value, the parent process will decide the subsequent action, if any.
- Python深度學(xué)習(xí)
- Dependency Injection in .NET Core 2.0
- OpenCV for Secret Agents
- Rust Cookbook
- C++程序設(shè)計基礎(chǔ)教程
- 快速念咒:MySQL入門指南與進(jìn)階實(shí)戰(zhàn)
- 編程數(shù)學(xué)
- WebRTC技術(shù)詳解:從0到1構(gòu)建多人視頻會議系統(tǒng)
- Python Web數(shù)據(jù)分析可視化:基于Django框架的開發(fā)實(shí)戰(zhàn)
- 程序設(shè)計基礎(chǔ)教程:C語言
- RISC-V體系結(jié)構(gòu)編程與實(shí)踐(第2版)
- C語言程序設(shè)計上機(jī)指導(dǎo)與習(xí)題解答(第2版)
- Python算法指南:程序員經(jīng)典算法分析與實(shí)現(xiàn)
- C語言從入門到精通
- Moodle 3 Administration(Third Edition)