Network Intricacies
Understand network intricacies critical to API design, including layered architectures like OSI and TCP/IP, protocol roles, latency and throughput factors, and the function of network sockets. Learn how these elements affect API responsiveness, reliability, and real-world usage, helping you design efficient and scalable APIs.
APIs send requests and receive responses over a network. The internet manages the complexity of cross-network data transmission through a layered architecture that originally standardized IP as a middleware layer around which innovation happens. Any application can rely on IP for data relay, and any communication technology can flourish beneath it, provided that it supports IP. In practice, however, most public-facing API calls use HTTP. A raw IP packet with a custom transmission protocol (something other than TCP or UDP) probably will not make it past enterprise firewalls, which allow only a handful of well-known protocols, or even past an ISP router. This raises a fundamental question: Why does a large proportion of API calls converge on REST over HTTPS?
The answer begins with the layered architecture itself. Assume an
Modularity, so each layer performs its own operations.
Easier network troubleshooting.
Changes in one layer do not impact the others.
Flexible accommodation of different application types.
Communication between any two systems proceeds layer by layer, with each layer performing its designated tasks before passing data onward.
The interface between layers determines which services the lower layer exposes to the upper layer. Each layer has at least one
The order of messages over the network.
Actions performed during message transmission.
The structure of messages.
How messages are received.
Error detection and correction.
The OSI model
The Open Systems Interconnection (OSI) model consists of seven layers. Each layer appends a header that contains protocol information, addresses, sequence numbers, and more.