Backend Engineering
brian | Published: March 4, 2024, 12:27 p.m. | Updated: May 25, 2025, 9:42 p.m.
Recieve Buffer
Continuing from the last article "here ", lets say we have already established the connection, and now the client has sent data.
1. After the client sends data, the NIC(network interface card) receives the frame, it will be parsed, and then the frame will be delivered to the OS kernel.
2.The Kernel takes the data, and moves it to the "Receive Que/Receive Buffer" to store temporarily store incoming data (i.e HTTP request) Then we may ACK the client
3. in the process the webserver (acting as a reverse proxy e.g nginx) intercepts the encrypted data packets and decrypts the data using the SSL/TSL certificate.
4. The application process of the backend server reads the HTTP request data from the receive buffer using kernel-provided APIs, such as read(). This data is then copied into the process's memory space for further processing.
5. Once the HTTP request data is in the application process's memory, the backend server parses the request headers, extracts any request body data, and performs request processing logic based on the received data. This includes routing the request to the appropriate handler or view function, querying databases, and generating a response.
Send Buffer
1. The backend server application generates a response
2. The response is then copied from the application process memory to the send buffer(temporary storage area managed by the kernel.) using kernel-provided APIs, such as write() or send()
3. The kernel then initates the transmission of data