...

/

The Narrow Waist of the Internet

The Narrow Waist of the Internet

Learn about the layered architecture of the internet to better understand how APIs work.

Introduction

APIs send requests and receive responses over a network. The internet opts for a layered approach to its architecture to manage the complexity of sending data across two entities, which could potentially be in two far-away parts of the world. Initially, the internet standardized the IP as a middleware around which all the innovation happens. We could make any application hoping that the IP would relay its data, and any new communication technology could flourish underneath the IP layer, provided it supports IP. However, many hiccups have happened over the years in the attempt to achieve that goal. Today, most public-facing API calls use HTTP. Let’s suppose we use a raw IP packet with our custom transmission protocol, something other than Transmission Control Protocol (TCP) or User Datagram Protocol (UDP). In that case, it probably won’t make it far, because most enterprises use firewalls that only allow a handful of well-known applications, and drop everything else. (Actually, such a packet might not pass through our ISP router!) Because this is a course on API design, our purpose here is to answer the following question from the first principles of networking:

  • Why does a large proportion of API calls converge to use REST over HTTPS?

We’ll first refresh the concepts of the layered architecture of the internet before describing insights to answer the question above.

Layered architecture

Let's assume that we have MM layered architecture, where each layer has a specific function. Any NthN^{th} layer in the ...