Network engineering is quickly moving towards a world where it's as much programming and automation
as it is packets and ports. Join Hank Preston and me to discuss what parts of Python are
important for network engineers to learn. This is Talk Python to Me, episode 175, recorded August 8th, 2018.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries, the ecosystem, and the personalities.
This is your host, Michael Kennedy. Follow me on Twitter where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm
and follow the show on Twitter via at talkpython. This episode is brought to you by Linode and Brilliant.org.
Check out what they're offering during their segments. It really helps support the show.
Hank, welcome to Talk Python. Thanks, Michael. Thanks for having me. Yeah, it's great to have you here.
We're going to delve into a topic that I think is really interesting, and I think it highlights one of the reasons of this explosive growth in Python.
We've had people writing web apps in Python for a long time, but now Python is starting to appear in these other domains where programming wasn't necessarily the first thing that people did.
And we're going to talk about programming for network engineers.
Excellent. It's a topic close to my heart because that's what I talk about most days these days.
Yeah, that's awesome. So before we get to that, let's focus on your story and just talk about how you got into programming in Python.
Where did it all start?
Yeah, so it's good. So my story and my rapid love affair with Python started, I would say, I think it was about five years ago.
And I was working at Cisco, which is where I currently am now, as a systems engineer and solutions architect focusing on data center topics.
And around that same time, the cloud kind of tidal wave was hitting everybody.
And so part of our role...
What year was that?
Yeah, I'd have to go back and look.
I mean, somewhere in the 2012, 2013 area is where it kind of...
It'd been there for a while, but that's where it started to affect my day-to-day job.
Right. It kind of left the, hey, all the startups are doing it.
But the Fortune 500, they're going to never touch the cloud ever, ever, right?
Until they did.
Yeah, no. And that's really what it was going through.
At that point, the customers I was dealing with mostly were like the Fortune 500s, enterprise customers in the Midwest.
And we were starting to hear from the likes of these large kind of Fortune 500 and Fortune 100 customers that they're starting to experiment.
Or they've realized that they had been experimenting in the cloud for a long time.
It's just nobody told them that they had stuff that was out there, which was always fun.
So as this was going through, I had one of my managers came up and said, hey, we need to start understanding what this whole cloud thing is.
We need to understand what application development is, what a cloud app is, and why it's so different, and how to talk to folks that are in here.
And I had the opportunity to kind of go off and spend some time on a program that Cisco put together around cloud native development.
And so it was kind of a boot camp approach to diving into a bunch of different topics.
And it was from containers to cloud applications.
And part of that program was actually two weeks of Python training.
I credit Raymond Hedinger with giving me an awesome kind of exposure to Python, diving me in really well.
His intensive introduction to Python class is the most aptly named technical class I've ever had.
That's cool.
Was this an in-person class?
Did he come out to your equation?
He did.
So he actually, I don't know if he's still doing it today because I haven't looked in a while.
But at that point, he was teaching Python every week for Cisco classes.
And so he would teach a class in San Jose, and then he'd go down to Austin, and then he'd go to RTP.
And he would just be teaching our developers inside of our business units, inside of our services organization, Python fundamental skills, because it was becoming so important to everything that was there.
And so this was a class focused on our field engineers to go through and start to help us get prepped into it.
And he actually had, his classes still exist.
And I still see them go through the pieces occasionally.
But it's like an intro, and then it was an intermediate, and then an advanced.
And I swear, across those three weeks of training classes, it was like a year of intense college study to go through.
Just the level of kind of depth that he took us and how quick we went in.
That's really interesting.
I feel like colleges, for some reason, when they teach programming, it goes incredibly slow compared to how fast you can actually learn it if you just put your head down, right?
Absolutely.
And that was the piece.
And normally, many of us have been used to go into these training classes where you can go in and you can step out for a phone call, or you can go take a meeting halfway through, and you really don't miss anything.
In this case, it was a very kind of, if you stepped out, you were like lost.
It was like you lost a week of a college class.
And so that's where I dove into Python.
And I mean, within just a couple of days, I realized that programming was different from when I did it originally.
Because I had a background in some development.
I had done some Java and C++ and a bit of .NET development, some database work.
And then I made a conscious decision to kind of go over and move more into the infrastructure space and focus on kind of systems and then eventually networking as kind of a specific domain.
Frankly, because I wasn't a big fan of Java.
And I got tired of developing in Java.
So I gave up on that.
But when I had this exposure to Python, it was such an easy language to get into.
The syntax was really kind of readable.
I didn't need to be a software developer.
I could kind of dabble with it for a little bit and then come back.
And I didn't feel like I lost anything.
I could consume other people's code really easy.
And it's a lot of those characteristics about Python, which is what's made it so successful in the network engineering, as well as kind of general infrastructure engineering space as kind of a language of choice.
I think that's a really interesting point.
And there have been a lot of languages that are easy to read, like VB is a language you could read pretty easy, right?
Visual Basic.
But a lot of the ones that are easy to start with have these pretty low ceilings.
It's like, well, you can build up to this point, but you want to build something real.
You put that away and you get out the Java, you get out the C++.
And Python doesn't have really that ceiling quite nearly as low.
And I think that's partly one of the things that makes it really special.
Yeah.
And that's been one of the huge elements for me.
I mean, I've been doing Python daily for several years now going through.
And I still go back to some of the fundamental skills that I learned in those early classes.
But the programs I'm building are much more sophisticated than some of the early ones that go through.
And when I look at some of the new features that come into the language, they're really exciting things that are coming after it.
But they're being put in a way that you don't have to use those, right?
It still gives you this ability to kind of work your way into Python, absorb the capabilities when it makes sense for you.
And there's a challenge there.
It's not like with JavaScript.
It feels like you have to like immediately you're embedded inside of all sorts of promise statements and multiple levels of like embedded.
And you can't do anything.
With Python, you can start really simple.
And then when the time calls for it, there's all of this other stuff that you can pull out and become very sophisticated as far as the language goes.
Yeah.
That's part of its sort of elasticity up and down the experience scale, right?
You don't have, like you said, you don't have to be an expert in all of Python to build interesting things.
Like you maybe don't even know what a function is, but you could still do some pretty interesting stuff in straight down.
You know, you don't need to care about code reused or whatever, right?
Yep.
It's object oriented under the hood, but you can completely ignore objects.
Until you realize that there's value in it.
And hell, half my code still ignores objects, it seems like these days.
Yeah, that's quite an interesting point.
So speaking about these days, what are you doing day to day?
You're a developer evangelist at Cisco, is that right?
Correct.
Dev evangelist.
Yep.
So I'm a network programmability evangelist with Cisco inside of our DevNet organization.
So DevNet's the developer enablement program for Cisco.
And so it's where people that are looking for our API documentation and SDKs and sample code and sandboxes and resources.
That's all of that's available up on DevNet.
And my team of evangelists are like you would find in any of the developer enablement programs.
As we go out and we help people better make use of and understand what's possible with the tools.
Cisco has a huge portfolio of products from networking to security and collaboration.
I focus really, really fully in the network automation, network programmability space.
And so there's tons to keep us busy and there's tons of work out there helping all of these enterprises and the network engineers inside of the enterprises figure out what automation means and how they can start to automate their deployments.
And what does it take to skill up and make changes?
And these are the types of things, resources we build, as well as kind of events that we hold and discussions we give.
So you might be going out and visiting like a group of network engineers who maybe haven't done a lot of programmability automation of networks and you help sort of bring them along or maybe help them design how that applies to their infrastructure or something like that.
Exactly.
Yeah, there's there's I usually I frame it in two two cases where it goes through most days these days organizations are recognizing they need network automation.
And so they're going to their networking teams and saying, OK, we need to figure this out.
What resources are available?
And so I can I go into some of those organizations and I'll spend a couple of days helping them and kind of leading introduction to programmability classes.
And so just last week, I actually spent an entire day with one of my customers.
We had about 20 engineers in the room and we were going through basics of Python.
And so what is a Python script?
How do you create variables?
What are libraries and what libraries are interesting for the network engineer?
How do you parse data that comes back?
Because that's a big part of dealing with clear text versus JSON and all these other.
Yeah.
What is JSON?
How do you process it?
What is XML and what's a YAML file?
All of that goes through.
And that's a big part of this bringing Python into the network engineering field is network engineers have been in IT for years and many of them took comp sci classes way back when.
And they may have done similar cases like I did.
Didn't like Java a whole lot.
And so went into networking.
Program is not fun.
I'm out of here.
Yeah.
Enough of that.
I'm going to go make packets go across the network.
So what we're doing now is trying to help remind them kind of some of these skills that are there.
They start to like knock the cobwebs off some of the fundamental programming stuff they had for maybe 20, 30 years ago when they went to school.
And then start to add these new elements that are there.
XML didn't exist for some of these guys when they went through it.
And YAML certainly didn't.
And so showing them the value.
And so showing them the value, showing them how to use it, how to connect to a device through Python using one of these APIs that are available.
And why is that better than doing it the way that they're doing it today?
Because that's a big part of the discussion often is showing them that there is value in making this journey.
Right. Because a lot of them probably didn't decide to be programmers.
I mean, maybe that's a good way to segue into like what is the background of a typical network engineer?
Like you said, maybe they have some programming experience, some technical experience, but they probably didn't choose networking because they wanted to be a programmer.
So what's the story there?
What do you experience?
Yeah, they absolutely didn't choose networking because they wanted to be a programmer.
In fact, one of the things I hear an awful lot when we start to have these discussions is in some cases they're coming kicking and screaming because they really don't want to be a programmer and they don't want to learn these new skills.
And it's helping them recognize that just because you're going to do some automation, you're going to learn some Python, doesn't mean that you're now a software developer because these skills are becoming relevant to data scientists, to engineers, to everybody.
And so there's this blurring and the gap.
A typical network engineer has a foundation in kind of network theory and connectivity areas that are there.
So there's the typical kind of OSA model of layer one, two, three, all the way up to seven.
So they understand the fundamentals of how network traffic works.
They spend their days dealing with networking concepts like IP space and ports and firewalls and load balancers.
So all of these elements, these foundational elements that help make applications function that the cloud relies on to go through.
The network engineer is coming in these discussions with this understanding of how kind of this foundation goes through.
And despite the fact that in many cases they don't think that they've done a lot of automation or they've done a lot of programming or scripting in their previous life, let's say,
many of them have because every network engineer I've ever known has been a problem solver and is always looking for ways to do things a little bit better.
And so for the longest time, and in some cases still today, it's a CLI interface.
A command line interface is how we configure a network.
Maybe a bash script or something like that that'll like process, you know, like automate that in that sense, right?
Exactly.
There's there's expect scripting, right?
So send this and expect to get this back and then send this other one away because there's network.
Every network engineer I've known really hates having to repeat themselves over and over again.
And so they've figured out ways to make their jobs better.
And so that's the big thing I'm trying to show them is this move into using Python is actually going to make what they've done in the past simpler and actually a little bit more pleasurable because we can take away some of the challenges that were there.
There is a bit of that, I don't want to say hurdle, but like a plateau to get people over.
And that first aha moment, that's one of my favorite things to see when I'm working with somebody is when they get it.
They understand the value.
They understand that it's not this thing to be dreaded.
Right.
They're like, I don't want to do this.
This is not my job.
This is not what I signed up for.
Wait a minute.
That's pretty awesome.
Yeah.
Okay.
Maybe it's worth it.
Something like that, right?
Exactly.
So you talked about getting into Python almost because of the cloud and things like that.
It seems to me the cloud movement itself has probably dramatically changed what it means to be a network engineer in the first place, right?
Like there used to be these physical things.
You could log into them and mess with them.
And now it's APIs and VMs and data centers far away from you.
Yeah.
It's completely accurate.
I mean, it comes back on network engineers ourselves to some extent that it seemed that we got so far away from what a network really was.
And we started to see a network as these physical routers and switches and firewalls that we touched rather than the act of connecting together the pieces that are there.
And so I talk a lot.
One of the conversations I give is this evolution to networking in the programmable age.
And I go back in time to when the network really was just routers and switches and servers.
Yeah.
You refer to that as the four ages of networking.
Do you want to take us through it?
Yeah, exactly.
And so originally, right, in what I often call kind of like the stone age of networking, things were simple.
We had servers and workstations and printers, and they connected into switches, and then maybe we had a router to communicate with them.
And the biggest thing network engineers were focused on is kind of like making sure that spanning tree didn't cause issues in the network and that if they were going to have to use some VLANs to carve computers and printers off.
Because at that point, the network was you could walk into any closet and you could reach out and touch it.
It was usually like teal green and had Cisco written on it, and that was the network.
And there were cables, and it was really easy.
But over time, the first hint of the kind of the changes to networking that I started to see, and many of us did, was virtualization, x86 virtualization with VMware and these other things.
And the concept of a V switch came out.
And it wasn't even that long ago, I would have heated discussions with networking and server teams about whose responsibility it was for the network inside of a hypervisor.
Because the network guys didn't want to do it because it wasn't a physical switch, and the server guys had no idea what a VLAN was or what a tag was.
And so there was this huge challenge that went through.
And sadly, in many of those cases, the networking guys just stuck their head in the sand and said, you know what, I'm just going to let the server guys deal with it because it doesn't really matter.
And then as we moved from kind of that stone age, that early piece that went in into the dot-com era and all of these other pieces, new things went after us.
After x86 virtualization, we got blade switches.
And so we had these new physical pieces.
But rather than buying a blade switch from a networking vendor, maybe it's being bought from a server company.
And so networking guys were once again saying, you know what, that's not my stuff.
I'm not going to deal with it.
And then what was it, two years ago, we started to see kind of the container explosion.
And so now we've got networking inside of Linux servers that are behind virtual switches that are running embedded inside of a blade server someplace.
And the networking guys are finally realizing that there is a lot of networking that is happening outside of their physical switches.
And that's been a big kind of aha moment.
And then we can bring in the cloud elements.
Because when we talk about the cloud, if we're talking public cloud, in these cases, now we're sending workloads and resources up there.
And we don't even have the luxury as a network engineer to know that at some point that traffic will go through my physical switch.
Because you don't own those physical switches.
Yeah, the one final bastion of thing they claimed is theirs has now been virtualized and moved out.
And so now it's all the other stuff.
They're like, well, that's not really my problem.
Like, that's like what's left that they now need to work with, right?
Exactly, exactly.
And so as the evolution from virtualization to containers to cloud, and I love the fact that cloud is now starting to turn into this, rather than people thinking of the cloud as a place, like AWS is the cloud or Google or Azure or one of these other cloud providers.
This idea of cloud is just kind of an approach, a fully programmable approach to infrastructure.
And so I've got customers today that consider their data centers their cloud on that side as well.
And they want to manage their clouds the same way that they consume and manage their other ones.
This is with this huge pressure.
Yeah, I think it is.
And I think what's really interesting is, you know, there's this joke or, I don't know, sarcasm or whatever that says, you know, the cloud is really just somebody else's computer.
Yeah.
Right.
Which I think that's a little bit disingenuous.
Technically, it's true.
Someone owns the computer.
But I think fundamentally, the cloud is a programmable set of infrastructure that you don't have to go touch, right?
And that programmability could be within your data center.
It could be AWS.
It could be somewhere else like Linode or something, right?
It's the ability to write some code and servers and switches and networks come into existence, I think, in my mind, at least.
Yeah, I think that's accurate.
The idea that the cloud, you don't have to worry about the infrastructure is true if you're consuming cloud.
But there's also this other group of engineers that are building clouds, right?
Right.
And somebody has to do that.
And it's been interesting to watch the pendulum swing from 100% public cloud strategies to 100% hybrid cloud and then some people coming back to fully private cloud.
If any part of an organization and enterprise strategy involves some element of private cloud, be that for data sovereignty or security or cost, because that does come up occasionally.
Well, now the people that are writing and deploying apps want to consume the cloud inside of your data center the same way they did it in the public cloud.
But now you have to have a team that can build the infrastructure that can offer that service.
And that, I think, is the huge pressure.
And that maybe means programming API, like creating APIs for them to consume and stuff like that, right?
Exactly.
It hasn't come up a lot, but I've had two cases specifically with enterprises where they had taken on, they had done some automation of their own.
They were doing a lot of work in the networking space.
But they were starting to get requests from application teams and systems and services teams to offer the network services through an API interface.
And so they were starting to build an API that their application teams could consume and their operations teams could consume to make general connectivity or logging requests or information.
And so we got to actually, it was a really fun project we did because we got to show, okay, well, let's talk about API design.
How do you build an API?
What makes an API good so that your developers who are used to consuming APIs from Google and Azure and all these other folks will be happy about consuming your API?
All of a sudden you're put into the place where like you have to compete on API design with Google and Amazon, which, you know, just a while ago, maybe you were even really interested in writing APIs and you're kind of in the deep end at that point, right?
Exactly.
And those are the interesting pieces that are coming at it.
And organizations are getting these changes and these adjustments so fast these days.
And I think that's a big challenge that every industry has, but certainly the network engineers have.
It's trying to figure out how do they keep up?
How do they, it's, there's always that analogy of you're laying the track as the train is kind of approaching.
And I think that that's never going to change in the IT space.
And that's been a big struggle because for better or worse, the networking industry didn't have a lot of adjustments for several years, let's say decades in some cases.
And this adjustment to cloud and programmability and automation is this massive pivot.
And so now we've got a lot of engineers and network engineers out there just trying to figure out how do I keep up, right?
What do I learn next?
Where do I go through on this area?
And that, that sense of overwhelming nature.
And my, my advice to them is, okay, yes, there's a lot, but remember this is an exciting time, right?
We were talking about how bored we were two years ago.
Now you've got cool stuff to work with.
Let's look at the value of what all of this new stuff has for us.
This portion of Talk Python to me is brought to you by Linode.
Are you looking for bulletproof hosting that's fast, simple, and incredibly affordable?
Look past that bookstore and check out Linode at talkpython.fm/Linode.
That's L-I-N-O-D-E.
Plans start at just $5 a month for a dedicated server with a gig of RAM.
They have 10 data centers across the globe.
So no matter where you are, there's a data center near you.
Whether you want to run your Python web app, host a private Git server,
or file server, you'll get native SSDs on all the machines,
a newly upgraded 200 gigabit network, 24-7 friendly support,
even on holidays, and a seven-day money-back guarantee.
Do you need a little help with your infrastructure?
They even offer professional services to help you get started with architecture,
migrations, and more.
Get a dedicated server for free for the next four months.
Just visit talkpython.fm/Linode.
Yeah, that's got to be interesting to be in that position.
Because I feel like network engineers were fairly, they didn't feel the full pressure of all this stuff.
Like the changes that we feel constantly in software development.
Like, I mean, imagine you're a JavaScript developer.
Like, you just learned one front-end framework.
And it's like now ridiculous to use it.
There's a new one, right?
Yeah.
That's like three weeks together.
It's just constantly like that.
Python's a little less bad.
But this does sort of hit them, not out of the blue, but I think it's kind of a wave, a tidal wave type thing.
I think also like sysadmins probably had a similar experience as well.
I've seen it in the same, I mean, the installation, I think the farther you get from the end product, and the end product for most of these cases is some piece of software someplace.
And so the farther you are from the end product, the longer it took for some of this pressure to kind of go through.
Because software developers solved a lot of the things on their own, and then eventually it kind of overflowed into the systems teams.
And so now the server teams had to figure out how to deal with the capacity and the agility.
And then eventually that overwhelmed them to storage.
And we're getting it into security now, security and networking now.
And that's where this insulation is breaking down, because it was this like tidal wave that was just pushing and pushing and pushing.
And eventually it just kind of knocked the wall over.
And all this demand is coming at network engineers to be agile, to be secure, to offer segmentation, to be able to implement.
We're getting requests for machine learning and artificial intelligence inside of the network now to make network decisions.
And I'm still teaching Python 101 to folks.
And they're also asking, well, where does blockchain fit in?
It's all of these topics that are coming in at the same time, which is good and bad.
Certainly keeps the job interesting.
Yeah, you've got to have the right mindset.
But it definitely sounds like a fun and exciting time.
So that's some of the ways that automation and Python have sort of changed the role for network engineers.
What else is changing for them?
What else is Python sort of changing that I don't even know to ask about?
Yeah, I mean, I think that's the interesting one that goes through.
One of the impacts of using Python to automate your network is kind of all of the things that come along with that.
Because now they are writing some code someplace.
And so there's all these new strategies around kind of where do we put code?
And so at the same time we're teaching Python, we're teaching source control strategies.
Of course.
We're showing folks how to deal with branches and how to use issue logs and pull requests to go through, which then gets to take us down kind of a pipeline path and go in.
One of the interesting pieces that often comes quickly is how fast an engineer goes from thinking Python is going to be their answer and then reaching out to some other management tool like Ansible, which is written in Python.
But they say, you know, I don't have to learn Python.
I can just go learn Ansible and fix all these issues and I'll just go down that path.
And that goes for a little while and then all of the challenges that potentially come out of that come through and then eventually they're back to, okay, maybe I do really need to understand the Python under the hood.
I can't just kind of absorb some new open source tool to make everything better.
Yeah, for sure.
Of course, that whole software carpentry side of things has got to come in, right?
Like as soon as you start to depend upon Python scripts to do your job, it's like, well, we should actually version control this and how do we share this together and how do we test it?
And just, you know, all those layers just start to come crashing in.
It's pretty interesting.
I had a question came in to me over LinkedIn.
It was two days ago and it was from a network engineer who I've been talking with for a while.
And he's like, all right, here's the challenge we have is I've got people across my organization writing automation scripts to do really interesting things.
And we've made a lot of progress, but now we've got islands of automation and everybody's automation looks different and nobody can use everybody else's automation.
So how do we, how do we bring these things together?
And so we started to talk about things like coding style guides, right?
You have to come up with some, some approach and styles, not syntax, which means there's no right or wrong way.
It's, it's kind of a consensus.
Somebody has to say, this is how we do things.
And then kind of making sure that people aren't porting their code and their scripts kind of on their machine and start to collaborate through repositories and go down that path.
And, and that's an interesting piece that goes in.
Moving network engineers away from the days where they, they would store their information in text files that were their version control was .v1, .v2, .v3.
You really got to save it and zip it up.
Yeah.
And then teaching them just the magic that's offered and available inside using some sort of source control and version control system goes through.
We spend probably just as much time trying to teach fundamentals of source control as fundamentals of Python and some of these early workshops, because that's what it takes to be successful in these areas.
And having, having, having approached this myself and kind of stumbled my way through it, there's, there's things that I wish I would have started doing sooner that I'm trying to help network engineers today kind of learn from the mistakes that I made rather than having to go make the mistakes themselves.
Yeah.
Coming through this path, it sounds like many of them do.
I'm sure they go through the experience of creating what you would think of as a script that does a very specific thing that you can run to.
Well, there's actually this algorithm in here and these are the inputs of the algorithm.
How do I turn this actually into say a library or a project someone else could consume?
And how do we start to build these building blocks?
I think that's probably an interesting transition as well.
Yeah.
It's interesting to go through.
I mean, one of the, one of the strategies we use to try to break down the learning of automation and the value, the value prop that's there is, is we sit down and we say, okay, well, what are, what are like the five things that you spend almost every day doing?
Or maybe we take a trouble ticket.
What every trouble ticket comes through.
Every organization usually has like, these are the information you need to gather before you ever start working on a trouble ticket.
Well, let's, let's figure out how we can automate that.
And then we break those up into these little pockets.
And so maybe we've got a team of a dozen engineers and three of them work on step one, three of them work on step two, the rest of them that go through.
And then the goal is by, is to show them how they can then consume everybody else's work and say, okay, well, we can pull in this other person's piece of code.
And so you don't have to do that.
And so you don't have to redo that yourself as long as you're kind of abiding by these kind of ideas of how these libraries work or inputs and outputs that go through it.
You don't care.
Like, it doesn't matter what happened inside of their function.
You just know what you need to send it and what to expect to come back.
And if we all agree on that, well, you saved yourself two hours worth of work.
Every day.
Yeah.
Or something like that, right?
Absolutely.
Yeah.
That's pretty awesome.
So maybe now's a good time to talk about some of the major packages that people might use for in this programmability space.
So, of course, probably a lot of these devices have direct APIs and you could, you know, create a JSON request and like send a post or something over.
But it's probably better to use some higher level library, right?
Yeah.
So there's a bunch of them that go through.
And so we've mentioned Ansible already.
Ansible is written in Python.
Most people just use it as a program rather than as a library.
But we do have some folks writing Ansible modules to extend out the capabilities that are there.
Right.
Most of the time, programming Ansible is like constructing YAML files, right?
Exactly.
And until the module you need isn't there or it's not working exactly right.
And so those go through.
But for folks building kind of the raw Python and they want to go down that path, I always start with the fundamental toolkits, right?
You mentioned the APIs.
And so the key networking APIs today are basic REST fundamentals.
And so REST APIs, we're going to consume them the same way that anybody else is using requests library is going to go through.
So that's an early one we teach.
Inside of the networking space, the long-lauded and also kind of disparaged API of SNMP still exists.
And so occasionally we work with PI SNMP to work through and bring SNMP details in.
But frankly, the newest interfaces, and these are new standards that were developed by the IETF for network programmability specifically, are netconf and restconf, which are model-driven programmability interfaces based on data models that are agreed upon and well understood.
And then these interfaces return data either in XML and JSON.
So now we're getting into kind of true programmability interfaces.
And so the NC client library is what we use to communicate with netconf at their, with the netconf protocol.
And then after we get kind of, let's say, the hammers, the screwdrivers, the nuts and bolts, kind of understanding those pieces, then we can step up to some of the libraries that have been developed to kind of consume those and offer an easier way to go through.
And so in the netconf model-driven programmability space, there's actually an open source project called YDK.
It's Yang Development Kit that was spearheaded, and most of the development actually comes out of Cisco, which aims to wrap up the data models in a Pythonic library so that you don't have to make native API calls.
You can just work with them through a Pythonic library.
Then there's the configuration management tooling that's out there.
And so the good folks over at Spotify started out the Napalm project, which is all about multi-vendor kind of network configuration pushes.
So that's a library that's often used by a lot of organizations trying to actually push out and maintain true configuration standards across.
And then there's some newer ones that are popping up here and there, kind of as new challenges are being designed and extended out.
Yeah, Napalm looks pretty interesting.
I had David Barroso on episode 128 to talk about that.
The idea is there that you have a unified API regardless of the underlying devices, right?
So it kind of handles the inconsistencies across the different providers and such, right?
Yeah, Napalm is one of a handful of libraries that aim to do that same thing.
As many organizations and engineers have to deal with different network platforms from multiple vendors.
Or even if you're just Cisco, we've got multiple platforms that are there.
And so within Napalm, and then there's another tool called NetMiko that tries to kind of say, okay, let's have standard ways through Python to write the code.
And then the libraries themselves understand the intricacies of interfacing with a specific platform or specific software version.
And you can focus on kind of very consistent commands and capabilities.
Yeah, I feel like the cloud is the new lock-in.
If you're on AWS and you deeply use their APIs, it's extremely hard to move along, right?
And same thing for Azure, right?
They're all different APIs and they all have different capabilities.
And I'm not thinking just VMs.
I'm thinking like their cloud storage, their database offering, all these different things, right?
I think that's why we see Microsoft just go, yeah, we don't actually care if he's Windows or not or Office because we got something better.
Thanks.
Well, I think that's the piece that goes through.
I mean, everybody's always, there's this, the nasty term of lock-in.
Nobody wants to be locked in.
And I think the dirty secret is you're always locked into something.
You just have to pick where you want your flexibility to be, what you're willing to be locked into.
And then know that you've made a commitment there.
I had an interesting conversation with one of the, a director of cloud and one of the customers I was talking through.
And he said, look, we made, and this was an organization that had been around for a hundred years.
We made the decision decades ago that we were going to go into the mainframe and we were locked into the mainframe and it served us well.
And there were ups and downs, but, but that worked well for us.
And at this point they were making the decision to lock themselves into a cloud provider because they knew if they jumped in and they took advantage of all of the,
the value added services that the cloud provider had, and they embedded those into their applications, they knew full well, there was no way that they were going to be able to move without some significant cost.
It was like when the days when they had to transition from a mainframe or Itanium onto x86, right?
That was a big project.
It was, it was a huge thing.
There had to be some massive component event.
The cloud is doing the same thing.
Organizations that want to take advantage and accelerate their development by taking advantage of all of the services that AWS or Google or Azure offer.
They do that hopefully knowingly at the price and at the cost.
And with luck, the person that made that decision for the organization kind of had the right to make that decision for the organization.
Yeah, that's an interesting point.
But I definitely do see that as like, if you're willing to commit, you get full advantage of it, but you are committed.
Yeah.
You're there.
Yeah.
But locking themselves into mainframes, that was a good idea for many years for a lot of these companies.
Right.
So it's just, that's a choice, but it is interesting, I think.
This portion of Talk Python to Me is brought to you by Brilliant.org.
Many of you have come to software development and data science through paths that did not include a full-on computer science or mathematic degree.
Yet, in our technical field, you may find you need to learn exactly these topics.
You could go back to university.
But then again, this is the 21st century and we do have the internet.
Why not take some engaging online courses to quickly get just the skills that you need?
That's where Brilliant.org comes in.
They believe that effective learning is active.
So master the concepts you need by solving fun, challenging problems yourself.
Get started today.
Just visit talkpython.fm/brilliant and sign up for free.
And don't wait either.
If you decide to upgrade to a paid account for guided courses and more practice exercises,
the first 200 people that sign up from Talk Python will get an extra 20% off an annual premium subscription.
That's talkpython.fm/brilliant.
So I guess the reason I bring that up is like Napalm having the ability to have this unified API kind of lessons that lock in just a little bit.
And I think that's something that a lot of customers and engineers are looking at network programmability to give them that feature set to go through.
And so it used to be that you were locked into a networking platform because that's what you built your automation around.
Or that's what you knew how to configure.
That was the tooling that you had.
So today, if you say, okay, my lock-in choice is we're going to use Napalm.
We're going to use Ansible.
We're going to use Puppet or Solved or Cisco's NSO platform.
One of these tools, that's going to be our point of interaction.
As long as you work with those, then we're happy with it.
And so that's the thing we're starting to see is organizations say, this is our tooling choice.
How do you fit into this tooling choice as it goes through?
Because they want the ability to kind of Lego block and swap in and out underneath the tooling choice because that's their entry point.
That's really interesting.
Another one that you brought out was Nornir.
I'm not sure if I'm pronouncing that right.
But that seems like a very Pythonic one.
They're like, they're deeply embracing Python as the way.
Do you want to talk about that a bit?
Yeah.
So I'm not super familiar with it.
I'm just starting to learn it myself.
And it's a new one that came through.
David from Napalm, as well as Kirk Byers, who did the NET NICO program and some other pieces,
have kind of joined forces to build up this new automation framework for Python.
And it's very much designed to be a Pythonic mechanism to go.
A lot of the stuff that it talks about is rather than working in some domain-specific language
where you're limited by what that domain-specific language is capable of, what you're able to describe.
With Nornir, the idea is we want to give people the full power of Python, right?
Let's not rewrite programming.
Let's not shackle what's possible.
Let's say, here's how we'll go through.
And Nornir is a library that goes in.
And what's been interesting is we talked a little bit about the levels of abstraction
and consumption.
As I looked at Nornir, under the hood, it's leveraging tools like Napalm to actually do
the interface configuration.
And so it seems like we're getting these kind of rushing, nesting dolls of libraries.
It's turtles all the way down.
Yeah.
You just pick up, okay, we're going to use this one.
And then when you look under the hood and you do like a pip freeze, you realize all of
the other things under the hood it's using.
And this new fancy library is actually not doing all that much on its own, not to limit
or minimize what these libraries do.
But that's the idea.
And I think one of the values that these offer is they're building on top of the foundation
that's already been laid.
And so we see that inside of all of these tools that go through.
What I think is really interesting about Nornir is the fact that they have fully embraced
Python.
Because one of the comments we see kind of over and over, and you'll see the Twitter
debates on these one, is don't use Ansible as a programming language.
And then people are like, why not?
I can program in it.
It's not a big deal.
It's like, but you can't really do it.
And then there's the debates that go back and forth.
And it seems like in the networking space, there is starting to see this push for some
of the early adopters, the folks that have kind of got tons of battle scars from trying
to do things in an interesting way, saying, you know what, we need to go back.
We need to make sure that we've got more control over what's possible.
Network engineers at our heart have always really enjoyed toying with nerd knobs, having
access to all the features, understanding what's going on.
And I think we're starting to kind of get that maturity level across areas of the industry
to say, okay, we need to really, we need to dive into this a little bit hard, have a little
bit more control, have a little bit more flexibility with what's there.
Because despite the fact that they don't want to be locked into a platform, they also want
to be able to do whatever they can with those platforms that they've chosen.
And if you're limited by what you're allowed to do inside of your infrastructure, because
some automation tool doesn't support it, well, that's now we have to extend our
automation tool and make some other choice.
Right.
They highlight a lot of interesting, what they call benefits on the Nornio project, like
a domain-specific language.
A DSL can get complex when you've got to do advanced stuff.
So avoiding the complexity of code might not be avoided anyway, right?
Code is easier to debug.
Like you can actually just set a breakpoint and debug it.
You might write code anyway.
You can leverage your IDE for linting.
And I think the final one is like a pretty interesting that they list here.
And it says a side benefit of using this is it'll also teach you Python, which you'll find
to be a lot more useful than just knowing like a DSL.
So for example, like you might learn Nornio, but now you know Python.
And if you need to get another job, it's not, well, I can program Ansible.
I can actually program full stop, right?
Exactly.
And that's the piece that comes through.
I'll have folks ask me, should I learn Python or should I learn Ansible to automate my network?
And my answer to most folks is you need to learn both, probably.
Ansible is a great tool.
It's super popular in the network automation space today for a variety of reasons.
And I don't see that popularity going away.
But one of the things that comes up time and time again is engineers and enterprises will
get to a point with a tool like Ansible and then figure out, okay, I can't go any farther.
And it's one of the points that you call out is they need an advanced feature or they need
some piece of logic element or they need to do something.
And they just can't do it with a tool like Ansible that's there.
And so now they're either writing their own Python code to consume it as Ansible or they
revert back and they start doing something else with a tool like Napalm or Dornier as it goes in.
And I think it's going to be this pendulum swing that goes back and forth.
As we start a little bit with Python, we get frustrated because it seems like we're doing
a lot of stuff that should be easier.
You move to a higher level tool.
You get frustrated because now you're limited with what you can do.
But now you've learned a little bit more and you go back and forth.
I think every organization and every engineer will find this sweet spot of what to consume
and what to build yourself.
Yeah.
I don't think it's only going to get better, right?
Like there's only more stuff on PyPI that you can pip install.
Absolutely.
I think last time I looked, it was like 147,000, but I haven't been counting for a few weeks.
So it's probably even higher.
It's insane.
It's great.
It's getting to the point now where you've got to be careful.
The number of times the pluralization of a package has thrown me off where I swear I installed
the package I wanted and then come to find out I, instead of installing requests, I installed
request, which is a completely different library and works completely differently.
What do you mean this function's not here?
I know get is on request.
No, that's plural.
That's right.
Yeah.
Those come up time and time again as it goes in.
And I love the fact that anybody can build something and post it to PyPI.
That's awesome.
The barrier of entry is so low.
I think that's what's part of what makes Python kind of Python.
But there's also that piece that I have to remind folks is just because you can pip install
something doesn't mean that you should necessarily trust it with what's going to go on.
Do a little bit of research.
Go figure out what's there.
Is this a mature library?
Are there other people using it?
Is it maintained?
And that's another skill set out of programming that network engineers need to start to learn
is that it's very easy to grab something and not understand what it is.
And the skill set of not just copying and pasting from Stack Overflow is one that we have to
remind people over and over again.
Yeah.
That's a super interesting thing to evaluate an open source project, whether you want to
take it as dependency, right?
Because if you have a billion dollar company that depends upon this thing, but it's actually
some freshman students' little project that they threw up there that has four stars on
GitHub and they've since moved on to some other language and they don't even care about
it anymore.
Like that's a shaky foundation.
Exactly.
But you got to know to look, right?
Audio bloop there for a second.
The other piece that comes in that's very related to just like the reliability and the
upkeep for it is the impact of open source licensing that goes in at some of these areas.
We're starting to get more and more conversations with lawyers getting involved to say, okay,
well, what is the impact of using that open source library?
Is there something in there that says that they have a portion of our company now because
we happen to use their library to configure our network?
And those are interesting discussions that as we start to code and just use community delivered
applications that I think it's not limited just to network engineers.
But because we're new to the programmability space and we didn't cut our teeth through some
of these other areas, I've seen several folks kind of be very surprised to find out like
what the impact of some of these choices they've made has been.
Yeah, it definitely can catch you off guard.
So while we're talking about learning these new things and stuff you have to learn, maybe
it's worth highlighting this project.
I don't know.
Would you call it a proper course that you created called Learn Network Programmability Basic?
Yeah, it's a great one that goes through.
And so the Network Programmability Basics video course was designed very specifically to help
network engineers jumpstart into programmability and automation.
The question we get more often than not is how do I get started?
Because there's this overwhelming nature.
There's so many topics that are out there.
And so what I did inside the course was kind of say, okay, let's break down the basic fundamental
information that you should know.
So we talk about programming basics.
So we go through some Python fundamentals.
We go through what are APIs.
We talk about those elements.
And then we walk up the network structure tree, starting with device level APIs and then going
into like SDN controllers and network controllers.
We talk about capabilities around hosting applications at the edge, so some five computing pieces, and
then even get our way into kind of this net DevOps space where we're starting to treat the
network as code.
And we're adopting things like configuration management strategies and CICD in the network.
The Programmability Basics video course is definitely not designed to turn someone into an expert.
My goal when I put it together was to give enough background knowledge, define enough terms, expose people to some concepts, and give them a chance to run code themselves against infrastructure, kind of in a controlled fashion.
And so that they can, they're more prepared to take that next step.
To say, okay, I've seen a little bit of Python.
I know what these APIs are.
I know what the library does.
Now I'm a little bit more comfortable to go kind of do a little bit of Googling and research to take a class on Udemy or go grab something off of another area or sign up for another piece.
And that's really the focus of the material we have there is to do that jumpstart.
I like to joke, my goal is to speed people up somewhere in the two to four months range, right?
Let's cut two months off of your journey to understanding network automation.
If I can help you do that, I've been successful inside of that course.
Yeah, that's really awesome.
And I think one of the jobs of the most powerful courses is not to teach you all the way down through the stack of what they're doing, but to expose you to just enough of all the things so that you're like, I know there's this thing that solves my problem.
And I know a little bit about it.
And I now know where to go to look to learn it because it's almost like this paradox of choice or like this overabundance, right?
There's not a scarcity of things you can use.
It's there's so many things I could use.
I don't even know where to start.
And so having that like first step in the right direction for all these different things is really powerful.
Exactly.
And it's so easy to be overwhelmed in any topic today.
I mean, the Internet just makes it ridiculous for how much information that goes through.
And so that's been the purpose of the video course, as well as the other resources that we put together and we kind of curate up on DevNet to say, OK, let's give you let's give a network engineer.
Let's give a collaboration engineer or a server engineer kind of a somewhat curated entry point so that we can start to define those terms and expose them to what the art of the possible.
Right.
I like to say my my job is an evangelist.
The evangelism side of my job is to kind of show people what's possible, give them a glimpse of the future and get them excited for it.
And so they're willing to invest more time and to go figure it out themselves and put the time.
Yeah, I think that really sums it up perfectly.
So I think maybe maybe we should leave it there for the networking.
But I did want to ask you a question about PyCon because you're you're in Ohio and you were just at PyCon.
It was in Cleveland this year, which is a great experience.
I feel like a lot of people don't go to PyCon because they're like, oh, that's for the hardcore developers that only like maybe speak to the people who are somewhat in your space who feel like PyCon isn't for them.
What was your experience there?
I love my experience of PyCon.
This was my first year going to PyCon.
I'm looking forward to next year and going back.
It's back in Cleveland again.
So it's going to be super easy for me to get to.
So I'll definitely be there.
The organizers were super friendly.
All of the presenters were amazing and going through.
And that's one of the things I've really loved about the Python community in general.
And it certainly showed at PyCon was the inclusive nature of where everybody's at.
It doesn't matter if you have written a library that that 150,000 people are using on a daily basis.
Or if you you've just written your first Hello World app, you will have a good time at a conference like PyCon.
And then what was interesting for me from the network programmability perspective is I was just there kind of as an audience member.
I was going through.
I was attending talks.
And then they had open spaces where people could anybody could sign up for a topic, grab a room, and then people could go talk about stuff.
And I noticed that somebody signed up a Python for network automation open space.
And I was like, wow, there's other people here doing this.
And so I went and kind of sat through it and talked with a whole bunch of other people.
And I was excited to see that there was probably 30 or 40 people there just at the open space part of it that were interested in using Python for network automation.
And these range from engineers from companies like Facebook and Netflix and Amazon, all the way down to small mom and pop shops that are just using a little bit for their own automation, as well as students that are just interested in networking and trying to figure out a kind of where Python fits in.
And so I encourage everybody, if you have the opportunity to go to Python, whether it's the big global one, a regional one, or even one of the regional conferences that we just had, PyOhio here in Ohio, go become part of the community.
It's a wonderfully inclusive and welcoming community.
And you'll meet some really good people.
Yeah, that's great.
I'm glad you brought up the open spaces because from the outside, the conference probably feels a lot like, well, there's these talks and the talks are on YouTube, so I don't really need to go.
But I find the talks to be interesting and powerful, but actually, it's all the other stuff that makes it worth going.
Like, it's really amazing.
I think they called it the hallway track.
You can't do the hallway track on YouTube after the event.
You can only get that while you're there.
Not unless you get a friend to stream it live or something.
That'd be interesting.
Yeah, actually, it would, wouldn't it?
But like the open spaces are not recorded.
And you don't have to have any particular skill to run an open space.
You have to have the willingness to put it on the board and the willingness to kick off the topic.
But you don't even have to lead it.
You just have to say, I want a bunch of people who are interested in network programming to get together.
And that's it.
You could be like, I have no idea, but I wanted to talk to you all.
So here we are.
Yeah, yeah.
Yeah, that's awesome.
It's great to go through.
So it's an awesome conference.
So I encourage everybody to go.
If you're on the fence, sign up.
Yeah, I'm definitely looking forward to going.
I'll get my ticket soon as it opens up.
Exactly.
All right.
Well, I think we'll leave it there for the topics.
So now we're down to the final two questions.
If you're going to write some Python code, what editor do you use?
Yes.
So I go back and forth depending on what I'm writing.
If I'm writing Python code and it's focused on kind of a sample or demo or just kind of proof of concept,
I go pretty lightweight these days.
And I use Adam because it opens quick.
It has exactly what I'm after.
And no more, no less.
When I sit down to work on an actual Python project, there's a couple of libraries I work on.
There's a couple of programs that I go through.
I always go back to kind of the first editor that I fell in love with, which was PyCharm.
And so I always find myself back into PyCharm.
I love the integration capabilities that are there.
I love being able to work just within the interface and go through.
And so I bounce between the two of those depending on which project I'm working on at a given point in time.
Yeah, that's cool.
I do that with VS Code and the Python plugin and PyCharm, of course.
So something really, really quick.
I just want to open it up and look at it, probably throw it in VS Code.
But otherwise, PyCharm as well.
Nice.
It seems like there's a big debate in my team.
There's half of us that like Adam and the other half of us are big VS Code folks.
And for me, it's one of those like, if I've got something that works for me, I'm perfectly happy to use it.
I don't need to go explore other tools that are there.
Yeah, sure.
Well, you guys can at least now rest assured that they're owned by the same company.
That is true.
That is kind of funny.
I'll be interested to see if they end up merging as products.
I don't know if they will, but Nate Friedman, Nat Friedman, the guy who's going to be the CEO, maybe is the CEO of GitHub.
Now, I don't know when he officially starts, but he came out and said, we're not dropping Adam.
We're going to keep working on it.
People love it.
We're going to do these things at least in parallel now.
That's good.
Excellent.
Yeah, good to hear, right?
All right.
Last question.
Notable PyPI package.
I'm going to call out NC Client for me.
NC Client's the NetConf client for Python.
And I go back to it time and time again for my automation these days.
Because as much as I love the higher order packages that we talked about, like Napalm and Nornier, I'm still kind of at the tinker level.
And I like being able to get right down into it.
So that's always one that I go back to.
Okay.
That's awesome.
All right.
Well, Hank, thanks for being on the show.
It's been really great to talk to you about all the stuff.
And I think there's a lot of interesting lessons people can take away from learning how network engineers are moving into this programmability because so many different disciplines are.
Absolutely.
Well, thanks for having me, Michael.
I appreciated the opportunity.
Yeah.
You bet.
Talk to you later.
This has been another episode of Talk Python to Me.
Our guest on this episode has been Hank Preston.
And it's been brought to you by Linode and Brilliant.org.
Linode is bulletproof hosting for whatever you're building with Python.
Get four months free at talkpython.fm/Linode.
That's L-I-N-O-D-E.
Brilliant.org wants to help you level up your math and science through fun, guided problem solving.
Get started for free at talkpython.fm/brilliant.
Want to level up your Python?
If you're just getting started, try my Python jumpstart by building 10 apps or our brand new 100 days of code in Python.
And if you're interested in more than one course, be sure to check out the Everything Bundle.
It's like a subscription that never expires.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I really appreciate it.
Thank you.