Network engineers do not need to become full-time coders to succeed--but some coding skills are really useful. In this episode of the Hedge, David Barrosso (you can find David's github repositories here), Phill Simonds, and Russ White discuss which programming skills are useful for network engineers.
Audio and video play straight from the show's own hosting. PodSubs stores and serves no media.
Transcript
From the show. Tap a time to play from there.
- Join us at The Hedge for a conversation - about engineering, - technology, and business. - In this episode, Russ White, Tom Ammon, and - David Barroso - dig into programming fundamentals for network engineers. - Well, hello, Phil. You have put up a - lot of stuff in your little home office - studio since - the last time I've seen it. Look at
- all that - foam on the walls. I don't know. I - may have to up my game a little - bit. And David, - where are you physically located, David? Just so - that our listeners have a - sense of who we have on. - I'm located in in Stockholm, Sweden. - Oh, okay. Scotland. Oh, that's really cool. Stockholm. - Oh, Stockholm. Sweden. Okay. I thought you said - Scotland. - Okay. Yeah. So Stockholm, - you know, I've never been to Stockholm, actually. - I worked for Ericsson. They tried to get
- me to come to Stockholm on a regular - basis, and I never ended up going. But, - yeah, that's cool. Good. - Nice place from what I understand, but very - cold. - Oh, right now it's quite cold. Yes. It's - it's it's very nice during summer. - Okay. Very nice in the summer. I like - the way you do that. - Well, - if you're into the country skiing and things - like that, it's also great during winter. I'm - I'm not a a snow person, so - I'd rather stay here in summer. - I have a lot of friends who live
- in Nook, Greenland, - and I always wonder about them. You know? - It's like, - you really have to love winter sports to - live in Nook, Greenland somehow or another. - It's okay. It's kind of crazy. But anyway, - so David, we're talking about - network engineers and programming. So, you know, we - started before the recording talking a little bit - about your background. It might be good to - fill readers, listeners. Readers, where am I today? - Anyway, it might be good to fill listeners
- in on that a little bit, - as to what your background is so they - have a sense of your experience in that - space. - So my background is, - network engineering. So I've been working at, - like, service providers, like NTT, for instance. - And then around - five years ago, I - jumped into, like, full time, - programming in the networking space. So I have - a lot of experience in both programming - and as a network
- operator. Okay. Awesome. Great. - So - let's just start with a simple question. Why - do network engineers need to learn to code - or need need to have programming skills? I - should say, I should not say learn to - code because I think there is a difference - between having programming skills - and - being a full on coder. So let's just - start with why is it important for network - engineers to have, coding or programming skills? - I think mostly - because, - I mean, if you look at the type - of networks that we manage, like, ten years
- ago, like, we would have, like, a, I - don't know, like, a few switches, a few - routers. Like, you could count them in the - in the dozens. - And so everything was more or less manageable, - like, for a human to to deal with - with everything. Like, nowadays, - like, everything is super fast paced. Like, you - need to do changes super fast because of - the cloud and and other things, and you're - also managing, like, way more - devices, like, one, two, - even three orders of magnitude, - higher. - So it's a matter of
- being able to to do your job to - begin with. And then secondly, there are also - other benefits. - Consistency, - and - if you get speed, you manage to... You - can also free up your time to do - more interesting stuff instead of just, like, firefighting - and deploying villains and firewall rules. - So I think there are several reasons, not - just one, to be honest. - Yeah. I I would actually add to that - personally. I think knowing... - Having programming skills and even to the point, - I mean, my my second language... People ask - me what my second language is sometimes. I'm
- in a PhD program and they're like, oh, - what are the languages you study? And I - always say, Si. And they don't make the - joke. But anyway, - you know, they're expecting Greek, Latin, or German. - And I'm always like Si. - Like, is that a language? Yeah. - Anyway, - so I think it's important as well because - it's a mindset. Right? I mean, it's a... - Programming or coding is a different mindset. - I was talking to Alastair Woodman, - nobody else. Well, I think Phil might know
- Alastair a little bit. But... And he was - saying, you can always tell the difference between - a good coder and a bad coder because - a good coder works with tools. They build - their own tools. It's like a carpenter. They - have all these tools that they use. And - then the really bad coders, or the coders - who don't really know what they're doing, they - just use things raw, just like they are. - Right? They just pop the slider up in - factory default position, and they just do whatever - they're going to do. Whereas, good coders are - always customizing their environment and building tools to - help them. I think those kinds of mindset - things are really, really helpful even for network
- engineers. - Yeah. Even just computational thinking as a skill - set in itself is super helpful - in approaching networking problems, other problems. - My... I'm not very affluent in programming yet. - I know basically just Python and some Java, - but, - my journey - into that even has helped me understand the - systems that are operating on top of the - network a lot better and, has increased my - ability to troubleshoot and resolve issues. - Yeah. Interesting. So so I guess that segues
- into the next question. - So if you're gonna learn programming skills, - what languages should you learn? What should you - do? Any ideas, David? - That's gonna depend a bit on your, - like, on your on your field. In the - network - world, the main one would be Python. Like, - there is a library for almost - everything network related, - and it's also what's getting, - most traction, - in our communities. So Python, like, without any - doubt.
- And Golang would be also also a a - good option, but that has a bit of... - There's... - The community is not that big there in - the networking space yet, so I would - I would say, Python. - Interesting. Do you see Golang growing as a - language that's used in the network automation space? - I I think so. I'm actually - doing, like, at at work, for instance, everything - I do nowadays is, is Golang. Like, there - are a few reasons for for that. Like,
- my main reasons would be, like, - speed. Like, colon is way faster than, than - Python. - And, also, - because it's statically - typed, - the code tends to be more reliable. - Like, there's no way that you can pass - the wrong type to a function, - and then everything just explodes, which is kind - of a common problem in, - in Python. So I think long term... And - when I say long term, I mean, like, - I don't know, like, maybe ten years. I - think Golang - is
- maybe, - in the position that Python is, today and - Python may be the - the the pearl of today - for people who makes fun of pearl. - Yeah. Interesting. But it... So it... It's hard - to predict in ten years, but that... That's - why that exists. Yeah. I mean, who knows - what's gonna happen in ten years? ATM, - according - to some analysts, was going to take over - the desktop in ten years. I mean I - still remember the charts.
- I'm still not running ATM so - maybe they were wrong. - So - it might be interesting to go into a - little bit of the difference between Python and - Golang, for people who aren't familiar with the - two different programming languages and even the paradigm - of different ways of building programming languages or - the way they work. For instance, Golang is - not really an interpreted language, but Python is. - Can we go into a little bit of - that and try to explain, - maybe for listeners, - why that's different or or what the differences - there are?
- So the main difference between an... The interpreted - language and a compiled - language is that you... Like, in Python, for - instance, which is interpreted, you would write your - code, and then you have this, dot p - y - file that then you use Python, - like, the program to run that that script. - Right? So every time you need to run - your script, you need Python in the same - machine to be able to to run it. - With a compiled language like like c, Java, - Golang,
- you have instead, a compiler that will read - the code and generate a a binary, and - that binary can be run without requiring, - the the, like, Java itself or, - or Golang or - or or or the c compiler. Like, you - have the binary, and the binary can be - can be run. - Another benefit - of, - compile language as opposed to runtime, - languages, - runtime - language is the same as interpreter languages, is
- that you are able to catch, - errors on compile time. Like, usually, - compiled languages are also, - statically typed. So you need to say, like, - oh, this function takes these parameters, and these - parameters are of are of this particular type. - So you make a mistake and pass the - wrong type, - things just, - blow up at compile time. So it means - that when you run the program, you don't - find any surprises that, oh, yeah. I passed - this type, and this type doesn't have this - particular - attribute, which is a common,
- problem with with Python. Like, anyone that has - written some Python has seen the typical, - error, non type - has... Doesn't have the attribute - blah. Right? - So those would be, like, - main main differences, - I guess. Yeah. So so it also depends - on whether the language is strongly typed or - or weakly typed. Right? So c, for instance, - is not a weakly typed language. You can - cast a string to a pointer - or a string to a like you can
- take the ASCII value of a number and - just use it as a number with no - conversion. Like it's just stored in memory locations. - You can do whatever you want to. In - fact, a lot of people who start with - C, that's one of their biggest confusions is - the whole pointer mess, how you can cast - pointers and pass pointers and shared memory versus - things that are not shared, stuff like that. - Whereas with Golang, it's a strongly typed language, - right? So if you want to cast - a text string as integers or as a - different type, you've actually got to go through - the process of doing that cast. You can't
- just randomly use the array or the string - in a different way, - which also helps catch errors, right? - Yeah. Yeah. Correct. - So, and now, Python, now is Python weakly - or strongly typed? - I think it's pretty weakly typed from what - I remember. I don't do a lot of - Python. So... I... Py... Python - is actually, - strongly typed, but it's dynamically - typed, which means that you can change variable. - You you can change the type of of - variables, but you cannot easily convert,
- like, between types. Like, if you have, an - object of a particular type, you cannot just - say, like, oh, now it's gonna be this - other thing that's just, - blow. So the the main thing is that - it's dynamically typed. So you have this, - variable n, and you can start with n - being an integer, and then three lines below, - you just assign a string in there. - So it's dynamic. That's even more confusing than - c. Because it's just... Yes. Whatever it is - in C, it's always a string. You can - use it as a number, but it's still
- a string. And, you know, you assume that - if it's a string, there's a null endpoint - and stuff like that. So that's interesting. Now, - another difference is that - compiled languages like C Golang - are required - to be recompiled for different processors. Now, that - used to be a big deal. And in - some cases, it still can be. In data - centers, you can get ARM chips versus Intel - chips. And it used to be AMD had - a completely different, - different API or a different instruction set than - Intel did, so you would have to recompile
- on multiple platforms. - And that still is true, like, with cell - phones or with - ARM chips and data centers or tablets or - something like that. Whereas with something like - Python or even Java in a JVM, - which it is kind of a virtual machine - that you're running inside of, - then you can just run it on anything. - It doesn't matter because it just... There's the - interpreter sitting there that does the job of - making the right machine code pop out the - other end. So those are kind of some - of the differences. - So now let's talk. So
- so Golang is interesting. - I really like Golang. I've looked at Go - BGP and stuff like that. Now I don't - know that I would still - suggest running... - I still think building a routing protocol or - something is still something that you should be - doing in C because of the expressive semantics. - But as a network automation, - now what type of tools are available in - Golang for network automation? I assume you have - gRPC, - which means you can do JSON and stuff - like that. But are there - things like SaltStack or anything else that you
- can use or Ansible that you can use - with Golang? - So I haven't I haven't seen anything - like that. Like, everything I'm using, for instance, - is mostly built on top of gRPC, - which works, like, beautifully with with Golang. - But now I haven't used anything like... I - haven't seen anything like salt or or anything - like that. For those familiar with with Nornir, - I wrote, a Golang equivalent, which is basically - what I'm what I'm using.
- So tell us about that a little bit - because that's really interesting. It's... Like I said, - good coders always build their own tools. So - tell us about this tool that you've built. - It's very interesting. - So - this is for both, Nournier and and Gournier, - which is the Golang equivalent. Like, the idea - here is to have, like, a framework - to, - to do, - various things, like loading an inventory of of - devices - and then being able - to to pass task to the to the - framework to execute those tasks over
- over those devices. So you would say, like, - okay. I'm gonna I'm gonna create a task - that its own... Only responsibility - is to configure a set of, BGP - peers. - And then you just say, like, okay. This - is my inventory. This is my task. Just - do it over this set of devices, and - then everything just... Like, all the multithreading, - all the passing data around, making sure that - the, - code, - is executed and all that. That's just - done for for you. You only have to - think in terms of,
- individual operations, and then all - the magic on these different devices happens by - itself. - Really cool. So is this open source? You - can get this on Git? - Yeah. This is all on on GitHub. It's - all Apache two, - licensed - and, yeah, available on - PyPI in the case of, - Nournier for Python, and is just available via - GoGet as as useful. - Okay. - So Nournier is written in Python and uses...
- It has plugins for Netmiko and Napalm. Do - you have similar plugins in the Gornir, - library for Golang? - So there is some, - plugins for SSH based, - devices, but because everything I'm doing is, gRPC - myself, so - I... I'm mostly just, - having integrations for my own gRPC devices. - Very cool. - Awesome. - That's great. So
- so let's talk a little bit about the - skill set. So - when you think about learning how to code - or a network engineer thinking about learning how - to code, what is it that they should - be learning? Is it data structures, algorithms? - I know Git. Git's a big one, and, - honestly, I still struggle with Git, and I - need to spend some time doing better with - Git. And it's really sad because I'm a - maintainer on FR routing, so I push PRs - all the time. I did code reviews and - PRs all the time, and I'm in the - code all the time looking at how things - work, and yet I still feel completely lost
- in Git a lot of times. So I - know Git's a big one. Right? I mean, - you need to learn Git to start from. - That would be my immediate guess. - Yeah. I mean, I think there are several - tools - to program that people - usually overlooks. Like, they - go straight into coding, and they - don't, spend any time, like, learning the the - tools for parameters. Like, for instance, like, the - the usual - one that people, - ignores is learning how to use a debugger.
- And that's the only way of actually - trying to more or less sanely, - troubleshoot code when it doesn't work as as - expected. Like, a debugger is something that can - tap into your program, and then you can - stop the execution of your program and say, - like, okay. Can you just show me the - memory - when you hit this particular line of the - code? So that's useful to start seeing, like, - okay. Why is this not working as as - expected? And people usually, - ignores, - that. Another thing that is very useful to - learn to use is some proper
- ID. IDEs can help you with the debugger - itself. It can help you by... With auto - completion, with - inline documentation. It just makes your life so - much easier, especially when you're starting - and you may not know - the the libraries that you need by heart. - Like, you start typing, and the auto complete - more or less shows you the option that - you have. Like, oh, yeah. This is the - function that I that I was thinking of, - which is also great for exploring new, - libraries. - And, of course, - Git, I would say that those are the
- most important - overlooked, - tools that people need to learn. - Yeah. I think it was about six months - into my journey of learning Python that I, - ran into PDB, IPDB - and started using it. And I was like, - oh my gosh. This is fantastic. It, - really changes the game for actually understanding how - your code is running instead of just trying - to arbitrarily troubleshoot - functions and things. So, - what do you use in Golang? Is it, - g d... Is there, like, a GDB? What's - the,
- the the tool for debugging? - Yeah. So there is GDB, and there is - also one that is tailored for Golang, specifically, - which is called Delves. - Okay. - So Delve... - Oh, sorry. Go ahead. And - I was gonna say Delve is pretty similar - to to PDP. So you have experience with - it. Like, you would... And just start playing - with Delphi. You will see, like, it's pretty - much the same type of interface, the same - type of commands, and and everything.
- Uh-huh. What... How does GDB - differ from Delphi? - So - GDB is more tailored - for compiled software, so it's a bit more - rough to to to follow. Like, - like, you will... - It doesn't integrate that well with the with - the Golang code, so it's harder to - jump into particular lines and and things like - that. - Gotcha. Gotcha. Do you use, other tools along - with that? Like, do you set breakpoints in,
- some sort of text editor in order to - run your code and, - debug it? Or do you typically just walk - through the program directly? How do you go - about that normally? - I usually deal with the command line directly. - And by the command line, I mean the - command line that the debugger - gives you. When you start to do a - program, it jumps into this, - shell, within, - PBB or Dell or any other you may - be using. And then I just type the - the break points in in there. I program - mostly in in - BI, so I don't have a lot of...
- I don't have a super fancy - ID myself. I tend to just, - deal with the with the common line. - Oh, that's interesting. - So I use Visual Studio Code, - quite a bit, - because it's just easier to jump around like - a text document and edit it that way - for for me. I'm curious why you use - VI and just go directly from the the - CLI. - So I mostly use VI because everything I - do is in the
- in the command line anyway. Like, I'm... When - I'm programming, I'm mostly, like, - working with, - containers, - maybe SSHing into remote machines, and I'm always - in the in the command line doing whatever. - So I used to use, - ATOM, - before jumping into VI. - And I - I felt that I was always jumping between - Windows and losing - track of what I was doing, - with so much context switching. So I started - just, like, using TMX and and BI, and
- then my workflow just became - a bit faster and and better. - Although it has a bit of - a learning curve, like, - the... Going through configuring the eye and t - mux to your, - liking. - Yeah. Yeah. - I think you're muted. Yeah. I'm muted. - So, - yeah, let me think about what I was - just gonna say.
- I just blew my... Blew myself up. - So you don't use Z Max? I'm I'm - pretty amazed that you use VI. You're hung - on VI. - VI, I find very difficult to use personally. - I know most of the coders I deal - with don't find it very difficult to use, - but I I seem to find it very - difficult to use. - So I I tried to use Emacs a - couple of times, and - I have found two problems with it. The - first one was that I haven't had the - time to actually - customize it to my liking yet, so
- I don't have the same environment that - I would have with VI. - And the second issue is that I I - have problems in my my hands. So I'm - very sensitive - to changes in the movements that I do - with my fingers and my wrist. And - I... Two days that I tried TMax, that - just led to a - lot of pain. So decided to to just - stop. - That's very interesting. Yeah. So so that's another - interesting point is that your tools are often,
- can be man... Or can be impacted by - what you do on a regular basis, like, - what your workflow is, which is very interesting - because - because a lot of people say, well, how - do you write fast in Microsoft Word or - whatever? They're always fussing me about writing books - in Microsoft Word. You should be using markdown. - And I say, well, I don't know. I've... - Don't even use the standard Microsoft Word menu - system. I have my own that I've built. - And second of all, I don't use a - mouse. I use a tablet. - And so because I use a tablet, I - can actually switch back and forth between the
- keyboard - and the tablet much, much faster, particularly if - I put on touch mode on the tablet. - I don't even have to pick a pen - up or anything. I just reach over there - and do it. - So I find it actually to be pretty - fast. So I think the work flow is - really, really important. People don't think about the - workflow - in terms of what they're doing. - And second of all, just the idea that, - you know, your physical... - The way you're physically made is that it's - easier for you to use your fingers in - a way where all the commands are close - together. And I don't think people think about
- those things. But they're really important in getting - your workflow speed up. - Yeah. Yeah. I agree. I I try to - avoid anything that requires, - a mouse mouse for the same issue that - I mentioned before. Like, if I use a - mouse for long periods of time, I start - getting pain in my in my wrist. I - always try - to optimize for for the common line because - I feel more comfortable typing. I also feel - that I'm - faster typing than just moving the mouse around, - but mostly because it doesn't lead to to
- pain. - Yeah. Right. Right. - So in the realm of programming beyond tools, - do you think people need to learn algorithms? - Like, I see people who say, I just - don't need to learn algorithms and data structures - or anything like that. I just need to - go learn how to do stuff. How would - you pit those two arguments against one another, - or how do you see that playing out? - So - regarding - algorithm, I'm not sure that it's so important - nowadays because - most of - the useful ones are gonna be implemented as
- part of the standard library. Like, how to - sort a a list, how to search in - a sort of list. Like, all those kind - of things are already - solved. It's nice to know them because that - also - helps you, like, - like, to think about - problems and and whatnot. I don't think they're - extremely, - important. I think data structure is more important - because a lot of people struggle with, like, - Oh, I have I have all this data, - and they have even problems iterating
- over the data because they don't understand the - difference between a map or a dictionary, - and a list, for instance. Like... So I - think data structure is certainly super important. - Algorithm, - it's nice to know because that's gonna open - up, new way of thinking for you, but - I would say it's not as important, - nowadays. So that brings up a good question. - What what are the differences between a map, - a list, and a dictionary? - So a dictionary and a map is mostly - the same. It's just that different languages call - them, in different ways. In Python, it's called,
- a map... A dictionary. - In Perl, it's called, HashMap, if I recall - correctly, and in Golang, it's called, a map. - So that's just the same data structure, just - different, - programming languages call it, - differently. - And, - so the main difference between - a map and a and a list, - or a dictionary and a list would be - that, - a list is just - what the name implies. It's just a list - of elements. So you have one element after
- the other. They may be sorted - in the same order as they're inserted in - the in the list. - While - a map or a dictionary, - they're usually not - ordered in a list. What they are is - just referenced by, by a key. So you - have a set of elements within the dictionary, - and the way that you access them is - by saying, like, okay, give me this particular - element. And then that particular element is just - referenced by this by this key. Yeah. And - I suppose that kinda ties back to algorithmic
- efficiency too a little bit because if you - have a list of, you know, a million - different data points, you would have to loop - over the entire list to find something. Right? - Whereas with the dictionary, you can just do - a a hash lookup on the key. So - algorithmically, it's a lot more efficient depending on - what exactly you're trying to do with the - program. - Yeah. It depends on what you're trying to - get out of the right because - if you can structure it in the way - where you have - a key - to get things, then that's fine. But sometimes - you can't. Right? Sometimes it's...
- Yeah. I mean, those data structure are mostly - interesting - when you're - talking about - efficiency. Like, you really need to - to, like, make your code, - like, super efficient because of what you're doing. - And then it's when it's interesting to know, - like, the, like, the very deep details of - those data structure, how they're implemented in the - in the language, and and and whatnot. But - that's probably - programming... As network parameters because
- we're all... We're always gonna be bound by - IO anyway. Mhmm. So the CPU is gonna - be idle anyway most of the time. So - so you would say you're bounded mostly by - the way... The most logical way to structure - the data in a way that makes it - easy to read the code - or understand what's going on rather than - as much around, - making the program efficient. Because I know in - c, we go to great lengths to make - things - as efficient as possible in many cases using - data structures that most people wouldn't even begin
- to understand. - So that's that's interesting. - Yeah. Correct. I mean, if you're writing BGP - as the as the demon to to run - it in your machine, like, sure. Like, you're - gonna have to be dealing with, - a stream of bytes to make everything as - efficient as as possible, - like three s and other data structures. - But if you're just trying to automate, - like, the, like, the - deployment of configuration to this particular BGP instance, - then just make sure that you optimize for
- for the human that is gonna be, - dealing with the system rather than for the - machine. Because in the end, I mean, - you're talking like a few milliseconds - of latency between your, - management station - and the system that you're configuring anyway. - So saving a few nanoseconds is gonna be - just negligible. - Yeah. Yeah. And if you use something like, - Napalm or NetMico in order to log into - a box and, - get data back or a gRPC call or
- or whatever that... Like you're saying, that's IO - bound. So it's gonna take a lot of - time for that query to go through the - network, - whereas the the time that the CPU actually - takes to process that and parse the data - that you get back is, like, fractional. - So... - Yeah. Yeah. Awesome. So if you were... Since - you've made the transition, - if you were talking to a network engineer - today who wanted to get started in programming - or just even learning the skill sets, where - would you tell them to start? Is there - a book? Is there just go do it? - Or how would you how would you start
- out talking to people? - So I would suggest - going through - places - like Coursera, - edX. - I know - that Kirk Byers, who is the, - author of Nemeco has also some - training - courses. I would suggest - just pick one of these and - go through through them. And - when you have completed any of these courses, - just try to jump into any - open source project and start
- helping there as much as you can - learn the the tools, the processes, - and - and things like that. I... Most most - most people will just do one of these - courses and not do the - open source thing. - And - that's - a bit of a pity, especially when you - are working alone because then you're missing out - on a lot of, - interest in tooling. Like, how to use - gate when - you're,
- several people working together. How you... How to - use - a CI system for testing. How to use, - testing libraries and and things like that. So - that's also an important, - skill that people often overlook. And it's super - hard to get if you're working alone in - in your, - particular company. So I think it's interesting to, - after you have done some learning, try to - get into - a larger team even if that larger team - is just some open source project. Alright. Well,
- thanks David for coming on, and we'll hope - to talk to you again in the near - future. - Thank you for having me. Thank you, David. - Thank you for joining us. You can find - the hedge at rule11.tech.
One of the more interesting ways to use AI tools is to use local hardware and open weight models, or even cloud-based closed-weight models, to build skills you can then use a tools to help you accomplish specific tasks....
Brian Trammell joins Alvaro Retana and Russ White to discuss his IETF draft Optional Security Is Not An Option, and why optional security is very difficult to deploy in practice. Brian blogs at http://trammell.ch and...
Social media services have largely become a marketplace designed to capture and hold your attention, rather than places where people share information and talk to one another. A large part of this is because they are...
Who should be held liable when AI fails? Who is liable when an AI system "breaks into" a network or system, causing a major breach? Listen in as Tom and Russ discuss two articles covering these topics on this roundtable...
Just about everyone is watching the financial markets, either wondering how much better they can get, or when the AI financing bubble is going to crash. Dough Dawson, from POTs and PANs, joins Tom and Russ to talk about...