Posts

Showing posts with the label Networking

Can the Mirai botnet teach us how to make Android apps faster?

Recently, I've been spending a lot of time thinking about Android app performance, specifically regarding network requests. Developers working on mobile apps are allowed a lot more customization for low-level details (for example, we get to customize our own network stack!) but in exchange, we must plan for our applications to work in some crazy environments. Our users might be on WiFi, 5G, 4G, or even GPRS. They could be sitting in a coffee shop or riding on a high speed rail with their cell service hopping to a new cell tower every 10 minutes. They could even be using satellite if they're sailing on a boat or flying through the air. On top of all this, we need to be able to support everyone using a $100 to $1000 smart phone. Interestingly enough, the conditions that mobile developers have to run their mobile apps in is actually reminiscent of the conditions that botnet developers have to run their malware in! The Mirai botnet malware ran with a tiny memory footprint, a tiny e...

Can we use Varnish as the backend?

In college, one of my favorite classes in college was a cloud networking class where we did a lot of work with programmable switches using P4, a domain-specific language for networking devices like routers and switches. The language was very limited in that you could not have loops or even do simple tasks like division, but these limitations allowed you to process packets at line rate. Using P4 to write custom switch logic, creative researchers have recently been able to figure out how to do a lot of interesting things like accelerate SQL queries or load balance servers. I recently found out about Varnish and the Varnish Configuration Language (VCL), and it reminds me of P4. While switches deal with data on the network layer, a Varnish cache deals with HTTP requests on the application layer data. While programmable switches run P4, a domain-specific language that has limits in order to keep code fast, Varnish caches can run VCL, a domain-specific language that is also similarly limited...

The Internet version of an old prank

Back in the 19th century in London, a prankster named Theodore Hook "DDoS'ed" a large part of London in what became known as the Berners Street hoax. Hook played a prank on the residents of 54 Berners Street by sending out letters requesting various random people to all arrive at 54 Berners Street on the exact same day at around the exact same time. Apparently first to arrive were chimney sweeps, followed by people delivering coal, and it eventually culminated to doctors, dignitaries, and delivery men carrying pianos and organs all arriving at around the same time to the same house. This brought traffic to a halt in a large part of London, effectively DDoS-ing the city. In the Internet age, Hook's Berners Street hoax idea has taken a new identity in the form of a DDoS attack called the Distributive Reflective Denial of Service (DRDoS). The idea is simple: Sometimes when you send a packet requesting a response to a server, it will respond with a bunch of packets back t...

You can control individual packets using WinDivert!

Image
WinDivert is one of the most interesting packages I've recently come across. What WinDivert allows you to do is apply a filter to grab some subset of packets that pass through your Windows computer, and then apply some logic to the packet to maybe modify, and then drop or re-inject the packet. Here's a great diagram from this website that sums it up: Using PyDivert , a WinDivert Python binding, we can specify the PROGRAM portion in the above diagram, which means that we can now capture whatever packets we want, change them however we want, and then either drop them or re-inject them to be sent out whenever we want. The big sell here is that WinDivert allows you to play with packets on Windows without writing code that modifies the core operating system components that run in the kernel! The drawback is of course speed and efficiency, but for a lot of blog-post-worthy applications, we don't need that much speed and efficiency. Stay tuned for more stuff if this piqued your ...