GOTO - Today, Tomorrow and the Future

Building Green Software Part 5: Green Networking • Anne Currie

April 19, 2024 Anne Currie & GOTO Season 4 Episode 16
GOTO - Today, Tomorrow and the Future
Building Green Software Part 5: Green Networking • Anne Currie
Show Notes Transcript

This interview was recorded for the GOTO Book Club.
http://gotopia.tech/bookclub

Read the full transcription of the interview here

Anne Currie - Co-Author of "Building Green Software", Leadership Team at Green Software Foundation & Veteran Software Engineer

RESOURCES
https://amzn.to/3IKopW5
https://greensoftware.foundation

Anne
https://www.annecurrie.com
https://twitter.com/anne_e_currie

DESCRIPTION
How will software development and operations have to change to meet the sustainability and green needs of the planet? And what does that imply for development organizations? In this eye-opening book, sustainable software advocates Anne Currie, Sarah Hsu, and Sara Bergman provide a unique overview of this topic—discussing everything from the likely evolution of national grids to the effect those changes will have on the day-to-day lives of developers.

Ideal for everyone from new developers to CTOs, Building Green Software tackles the challenges involved and shows you how to build, host, and operate code in a way that's not only better for the planet, but also cheaper and relatively low-risk for your business. Most hyperscale public cloud providers have already committed to net-zero IT operations by 2030. This book shows you how to get on board.

You'll explore:
• How the energy transition is likely to change hosting on prem and in the cloud—and how your company can prepare
• The fundamental architectural principles of sustainable software development and how to apply them
• How to determine which parts of your system need to change
• The concept of extending hardware longevity and the part that software plays

* Book description: © O'Reilly

RECOMMENDED BOOKS
Anne Currie, Sarah Hsu, & Sara Bergman • Building Green Software
Ioannis Kolaxis • 101 Green Software
Mehdi Khosrow-Pour • Green Computing Strategies for Competitive Advantage and Business Sustainability
Lässig, Kersting & Morik • Computational Sustainability
Zbigniew H. Gontar • Smart Grid Analytics for Sustainability and Urbanization
Katsoni & Segarra-Oña • Smart Tourism as a Driver for Culture and Sustainability

Twitter
Instagram
LinkedIn
Facebook

Looking for a unique learning experience?
Attend the next GOTO conference near you! Get your ticket: gotopia.tech

SUBSCRIBE TO OUR YOUTUBE CHANNEL - new videos posted daily!

Hello. My name is Anne Currie. And I am one of the co-authors of the new O'Reilly book, "Building Green Software," which has been serialized on the O'Reilly website, as we write it, as we go through. As it comes live on the website, we're also talking about it here in the "GOTO" podcast. And the next chapter that we're going to talk about is networking, green networking. And the reason why we added a chapter called green networking, was because suddenly I started to see, we started to see all over the place, in tech newspapers, and even real newspapers, stats saying, the internet uses the same amount of electricity as a small country. And that needs to be better, that needs to stop. And so we decided, well, let's dig into that a little bit and find out what's causing that, and what we need to do about it.

So we started to look into that. And of course, the first question you have to ask is, is it plausible? Yes, it is. It is entirely plausible. The internet is a huge machine, the biggest kind of meta-machine that humanity has ever created. So it's not surprising it uses a great deal of electricity. But what do they mean by the internet? I think when they're talking about that kind of stat, what they're talking about is the internet being up, from soup to nuts. It's the wires, it's the undersea cables, it's the connections at the bottom, the switches, the routers, the things like CDNs that help you pass data around, all the way up to applications running in data centers. So all of that is what they're talking about when they say that the internet is the footprint of a small country. Everything has to be reduced, everything has become more efficient, and everything has to go to zero carbon. But it's useful to know where you're targeting your efforts. Generally, we find, whenever we look at these kinds of things, that some areas are just really bad, are just hemorrhaging energy, causing huge amounts of carbon into the atmosphere, and some bits are not.

So it's well worth doing a bit of a dive into what we mean by the internet in that statement. And where the energy is being spent. So let's look at the bottom first, what if you were somebody who was a networking expert would consider to be the network? So, the fiber optic cables, the routers, and switches. Now, the interesting thing about those is that they are very, very optimized to be energy efficient. Networking is something that... A lot of the decisions in networking focus on a metric called watts per bit. And it's all about how much... And all networking experts focus on reducing that metric as far as possible. Now, watts per bit is not the same as carbon emitted per bit, but it is a reasonable proxy for it. So we know that loads of folk are putting lots and lots of attention into making that as efficient as possible. And as a result, the internet, the wires, and the switches, and routers, and the internet are really quite efficient.

It's generally considered that in a data center, if you go for a data center, and you map out where the energy is being used in that data center, then in a modern one, about 10% of the power goes to that kind of low-level networking stuff, and 90% goes to applications. And there's no reason to... Now, in an older data center, with older networking equipment, it's higher. But for more modern stuff, the networking equipment is quite sufficient. So that's probably not our low-hanging fruit here. We could look at the 10%. But we're probably better off looking at the 90%. We've got a lot of efficiency there. We've got our watts per bit metric that we're optimizing against. But is there other things that we could do? Could we be doing more demand shifting? This is something I hear green activists asking about quite often. Could we do demand shifting the traffic on the internet? So traffic on the internet is routed with a protocol called BGP or Border Gateway Protocol. And it's what's been routing the internet since its inception pretty much, the modern internet. And it works incredibly well. Bits of the internet come down, but the internet as a whole does not come down, which is amazing...it's a miracle.

At the moment, BGP routes packets mostly based on kind of trying to get them to where it need to go as quickly, with as few hops as possible. There's a little bit of additional stuff they do about relationships between ISPs and things like that. But basically, it's optimizing for getting stuff from A to B as quickly as possible. But a lot of green activists are saying, well, could it be routing based on our carbon intensity data as well? Could it be saying, oh, well, I'll route into countries where the grid is currently green, and route away from countries where the grid is fossil fuel powered? Now, I spoke to quite a few networking experts about this, to ask if that was a good idea. And the resounding answer was no, really, don't do that. It's the internet, it's amazing how well the internet works. Astonishingly, it works at all. And it does work. It doesn't just work a bit, it works amazingly well. It's incredibly resilient. But a lot of how that has happened is based on the fact that BGP is very simple but very powerful. It's been around for a long time, it's very bedded in.

The internet is vastly more complicated than you think it is. And so it is even more impressive that it works. And a lot of the behavior of the internet, all of the reasons why it does work, is more emergency than we might like to think. We can muck around with it, and we will need to upgrade BGP in the long run. But it is a big, big project, and many decade-long projects, and quite a scary project. So, if BGP was a massive cause of all the energy use in...was low-hanging fruit, was the biggest cause of the energy that was being used by the internet, then I'd be saying, oh, well, maybe we do need to be looking at something quite so radical as updating it, even though that's a multi-decade project.

But given that it isn't, given that 90% of the energy use that we're talking about when we talk about the internet is at the application layer, we probably don't want to muck around. We don't want to start mucking around with BGP. There's lower-hanging fruit higher up the stack. And what kind of things are we talking about here? Once a packet leaves a data center, guided by BGP and across these very efficient... Because fiber optic cable is very efficient compared to, for example, copper. Once your packet from London to Paris leaves your London data center, it gets to the Paris data center pretty efficiently, pretty directly. It doesn't go around the globe 20 times searching for Paris, and then finally get there. It does generally get to Paris quite efficiently. But before it leaves a data center, your packet can do all kinds of crazy stuff. It might go through very expensive service meshes, acquire loads and loads of additional layers, and then unwind from loads and loads of additional layers. It can bash back and forth between your microservices. It can be saved in an unnecessarily large number of copies. It could be compressed badly or not compressed well, or not compressed at all when it needs to be.

There's so much stuff that can happen above what we discovered, above the network layer, around networking, that it dwarfs any improvement we can make in the networks themselves. Especially as the networks are already focused on a kind of green software analogies metric, which is watts per bit. So if we don't want to be changing networks, what can we be doing? What should we be thinking about when we think about networks? What we should be thinking about learning from them. So as I said before, the survival of the internet during the pandemic, when there was a sudden increased demand for networking resources of 50%, with no time, which was an additional new...no time to lay new cables, no time to do anything. It was amazing. The internet survived that. And the way it did was something that is going to be utterly, utterly key to the energy transition. Which is, the internet and the applications running on the internet survived the pandemic lockdowns using demand shifting and demand shaping.

Now, demand shifting and demand shaping is something that I've talked about previously around green software. Because it's a concept that we're gonna have to get used to, because green power is not always available. The sun's not always shining, the wind's not always blowing. And one way of handling that is by shifting work to times when the energy on the grid is green, and shifting it away from when it's dirty and fossil fuel powered. And we have an excellent example of something that does that all the time in the internet, and the users of the applications that sit on the internet. Now, they don't shift because of energy, because energy, at the moment, is fossil-fueled, it's available at the flick of a switch. And nobody's having to demand shift or shape for that, although they will. But what internet applications are very used to is demand shifting and demand shaping based on bandwidth availability. And it's the astonishing ability of applications to do that, which is what allowed the internet to survive the pandemic lockdowns.

And these are two great examples of demand shifting and then demand shaping. So, a great example that you can learn from the internet of demand shifting is the use of CDN, content delivery networks. Now, you may be familiar with that, things like Cloudflare. The idea is that you move an asset, a big asset, into position, somewhere close to where end users are going to want to access it at some point, beforehand, and then the users access it later. Now, in the old days, CDNs were mostly used to give end users faster access to videos or whatever big asset that they wanted to see, that was stored on the CDN, and moved into position in advance. Because it gives the users the false impression that it just got to them very quickly. But in fact, it's a magic trick, it was already nearby. But during the lockdowns, it wasn't... And in fact, more generally now, it's always used to give users better performance. Sometimes it's used to even out bandwidth pressure on the internet.

So if you move an asset when there's no demand for it, and there's no demand on the internet, generally, you move an asset overnight. Then it's already there. And it has to go shorter hop when somebody is demanding it real-time at 5 p.m. when they get home and their kids turn on the television. So that is absolutely a classic example of demand shifting. That you fulfill the demand in advance. So you only have to do a small amount literally on demand. Now, in some ways, it's a bit of a misnomer, because it's not demand shifting, the demand hasn't shifted, the work has shifted. The demand happens exactly when the demand was always going to happen. But it's fulfilled using work that was shifted in time to when there wasn't a great deal of demand for other pressure on the systems. So CDNs, an excellent example of demand shifting, one of the main reasons why the internet survived 2020.

Another great example of why it survived is demand shaping. A good example of that is, in Europe, Netflix moved their programming from all being HD, which is the usual situation to all being standard definition, SD. And that massively reduced the amount of traffic that was flowing around on the internet. And that was a genuine example of demand shaping. The real demand was people wanted something to watch. And they could live with it being downgraded to SD from HD. So in the chapter, we put in some more examples of that. But yeah, the conclusion for this, I think I've been pretty good this time, because I massively overrun all my other talks, so I've been zooming through this one.

The lesson here is, don't rewrite BGP. It's not your low-hanging fruit. Do learn from the lessons of the pandemic, look at what networking did, and look at how applications handle variably available bandwidth when it comes to how you're going to handle variably available power. The internet and networking provide you loads and loads of prior art, which you can dig into and look at, and see what was genuinely and has been successful. So thank you very much indeed. It was lovely to talk to you.