From Tap to Server: How Requests Travel and Systems Communicate

From Tap to Server: How Requests Travel and Systems Communicate

Explore how requests travel from a user's device to a server, covering networking fundamentals, DNS, TCP/IP, HTTPS, APIs, authentication, and idempotency. Understand how systems communicate securely and reliably in real-world applications.

Series: The Anatomy of Modern Systems: From Architecture to Scalability (5 articles)

  1. …
  2. 3
    From Tap to Server: How Requests Travel and Systems Communicate This article
Every digital interaction begins with a request. A button click, a login attempt, or a payment confirmation may look like a simple action on the screen, but behind it, multiple systems work together to make it happen.
When Riya sends ₹500 to Sameer, her request travels through networks, reaches a server, passes security checks, and interacts with an API before the transaction is confirmed.
So, what actually happens between tapping a button and receiving a response? Let's follow the journey of a request and understand how networks and APIs make systems communicate securely and reliably.

The journey of a request


Let's take the network steps one at a time.

DNS: finding the server

Riya's phone knows a name, such as  payments.example.com , not the server's address. DNS translates domain names into IP addresses so the client can locate the right server.

IP addresses, subnets and CIDR

An IP address identifies a network interface so devices can communicate across a network. IPv4 looks like  192.168.1.10 ; IPv6 looks like  2001:db8::1 .
Private IP ranges are used inside private networks and are not directly reachable from the public internet:
10.0.0.0/8
172.16.0.0/12
192.168.0.0/16
Subnetting divides a larger network into smaller ones, which helps with IP management, isolation and organization. CIDR writes a network as an address plus a prefix length. In  10.0.0.0/24 , the prefix says the first 24 bits identify the network, leaving room for 256 addresses. A bigger prefix number means a smaller network, so  /16  is much larger than  /24 .
10.0.0.0/16
↓
Application subnet 10.0.1.0/24
Database subnet 10.0.2.0/24

TCP vs UDP

TCP is connection-oriented and gives reliable, ordered delivery. UDP is connectionless and faster, but does not guarantee delivery or order. A payment cannot arrive out of order or go missing, so payment APIs run over HTTP on TCP.
Before any data flows, TCP sets up a connection with a three-way handshake:



HTTP, HTTPS and TLS


HTTP sends application data with no protection. HTTPS is HTTP over TLS, which adds encryption, integrity and server authentication. Anyone on the same Wi-Fi as Riya cannot read or alter her request. Standard ports are 80 for HTTP and 443 for HTTPS. A payment API should accept HTTPS only.

Latency and round trips

Latency is the time data takes to travel between two points. Round trip time (RTT) is the time for a request to reach the destination and the response to return. Every handshake costs round trips, so opening a new HTTPS connection spends several RTTs before the first byte of payment data is sent. High latency directly hurts the customer experience, which is why we reuse connections and place servers close to users.

Understanding Network Layers and Devices

Networking is organized in layers. The TCP/IP model is the practical one used on the internet; the seven-layer OSI model is a useful reference when diagnosing problems.
TCP/IP layer
What it does
Examples
Application
Services used by applications
HTTP, DNS
Transport
End-to-end delivery
TCP, UDP
Internet
Addressing and routing
IP
Network access
Frames and physical transmission
Ethernet, Wi-Fi
Two important networking devices are switches and routers. A switch connects devices within the same local network, while a router connects different networks and forwards packets based on IP addresses.

APIs: the contract between systems

An API gives one application a defined way to talk to another. Here is the call Riya's app makes:
POST /api/v1/payments
Authorization: Bearer <token>
Idempotency-Key: TXN123
Content-Type: application/json

{ "from": "riya", "to": "sameer", "amount": 500, "currency": "INR" }
Every API call has an endpoint (the URL), a method (the action), headers (extra information such as credentials), a request body, and a response with a status code.

Methods and status codes

Method
Use it to
GET
Retrieve data
POST
Create or process data
PUT
Replace or update a resource
PATCH
Partially update a resource
DELETE
Delete a resource
Code
Meaning
200
Successful request
201
Resource created
400
Bad request
401
Authentication required or failed
403
Authenticated, but forbidden
404
Resource not found
409
Conflict
429
Too many requests
500
Internal server error
502
Bad gateway
503
Service unavailable

Authentication vs authorization


Authentication verifies who the caller is. Authorization decides what that caller is allowed to do. Logging in to the app is authentication. Being allowed to move ₹500 from this account is authorization. This is exactly the difference between a 401 and a 403.

Rate limiting


Rate limiting controls how many requests a client can make in a period, protecting the system from abuse and overload. With a limit of 100 requests a minute, the 101st gets  429 Too Many Requests .

Versioning

API versioning lets us change the API without breaking existing apps. Riya's older app keeps calling  /api/v1/payments  while newer apps use  /api/v2/payments .

Idempotency: Building Reliable APIs That Handle Retries Safely

What if Riya's phone loses signal right after she taps Pay? The app cannot tell whether the request arrived, so it retries. Without protection, that can charge her twice.
An operation is idempotent when repeating the same request does not cause an additional unwanted effect. The client sends a unique idempotency key with each payment. The server stores the key together with the result.
Request
Idempotency key
What the server does
1
TXN123
Processes the payment, moves ₹500, stores the result
2 (retry)
TXN123
Finds the key, returns the stored result, moves nothing
This one habit prevents most duplicate-payment bugs.

Troubleshooting Network Connectivity: A Step-by-Step Approach

If Riya’s app cannot reach the server, follow a systematic, bottom-up troubleshooting process:
IP configuration → Connectivity → Routing → DNS → Port → Firewall → Application
Task
Windows
Linux
Check interface and IP
 ipconfig 
 ip addr 
Test reachability
 ping 
 ping 
See the hops taken
 tracert 
 traceroute 
Look up DNS
 nslookup 
 dig 
See connections and ports
 netstat 
 ss 

The payment-system thread

Our payment app now has a secure, well-defined entry point. Riya’s request is resolved through DNS, encrypted with HTTPS, and routed through the load balancer or API gateway. Before reaching  POST /api/v1/payments , it passes authentication, authorization, and rate-limiting checks. An idempotency key protects against duplicate payments during retries, while API versioning allows us to introduce changes without disrupting existing clients.




Common mistakes

  • Accepting plain HTTP for payments. Always require HTTPS.
  • Blindly retrying a POST. Without an idempotency key, a retry can become a second payment.
  • Mixing up 401 and 403. One means who are you?, the other means you may not do this.
  • No rate limits. One misbehaving client can take the service down for everyone.
  • Changing an API in place. Breaking old apps without a new version.
  • Treating latency as constant. Design with timeouts, because networks are sometimes slow.

Key takeaways

  • A request passes through DNS, TCP, TLS and a load balancer before it reaches our code.
  • TCP gives reliable delivery; HTTPS adds encryption, integrity and server authentication.
  • Subnets and CIDR divide a network into isolated, manageable pieces.
  • An API is a contract: methods, status codes, authentication, authorization, versions and limits.
  • Idempotency keys make retries safe.
  • Troubleshoot networks from the bottom layer up.

Next up

The request has reached our payment service, and now the money has to be recorded somewhere. In the next post we look at the data layer: databases, transactions, replication and caching.

Series: The Anatomy of Modern Systems: From Architecture to Scalability (5 articles)

  1. …
  2. 3
    From Tap to Server: How Requests Travel and Systems Communicate This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article