Back to series
· 15 min read

Network Layering Models: OSI Seven-Layer Model and TCP/IP Protocol Stack Explained


I. What Is a Network Layering Model?

Computer network communication involves a great deal of complex work:

  • Applications need to exchange business data.
  • Data needs to be transmitted reliably from one host to another.
  • The network needs to find the destination device based on IP addresses.
  • The local area network needs to forward data frames based on MAC addresses.
  • The network card needs to convert data into electrical, optical, or radio signals.
  • Devices from different vendors and running different operating systems need to follow unified communication rules.

If a single protocol had to handle all of these problems at once, the system would become extremely complex and difficult to develop, maintain, and extend.

The network layering model adopts the idea of divide and conquer, dividing network communication into multiple layers, with each layer responsible for a relatively independent set of functions.

1. The Core Idea of Layering

Each layer focuses only on the work it is responsible for:

  • Providing services to the layer above.
  • Using the services provided by the layer below.
  • Engaging in logical communication with its peer layer through protocols.
  • Cooperating with adjacent layers through well-defined interfaces.

For example, the application layer does not need to care whether data is ultimately transmitted over a network cable or Wi-Fi; it only needs to use the communication capabilities provided by the transport layer.

The transport layer does not need to understand the content of an HTTP page; it only needs to be responsible for end-to-end data transmission.

The network layer does not need to understand the business meaning of a TCP segment; it only needs to perform routing and forwarding based on IP addresses.

2. Why Do We Need Network Layering?

Design Goal Specific Role
Reduce complexity Break complex communication into independent modules
Standardization Different vendors can implement communication according to unified protocols
Decoupling Upper-layer applications do not have to depend on the underlying transmission medium
Easy to extend The technology of a given layer can be upgraded or replaced independently
Easy to maintain Network problems can be located layer by layer
Promote interoperability Different systems and devices can communicate with each other

For example, a server running Linux can communicate with a computer running Windows because they follow the same network protocol standards, without needing to share the same internal operating system implementation.

II. The OSI Seven-Layer Model

The OSI model is an open systems interconnection reference model proposed by the International Organization for Standardization, which divides network communication into seven layers.

The OSI seven-layer model is an important theoretical model for understanding network architecture.

From top to bottom, they are:

  1. Application layer
  2. Presentation layer
  3. Session layer
  4. Transport layer
  5. Network layer
  6. Data link layer
  7. Physical layer

1. The OSI Seven-Layer Structure

Layer Name Core Responsibility Typical Protocols or Technologies Data Unit
Seventh layer Application layer Provide network services for applications HTTP, DNS, SMTP, FTP Data
Sixth layer Presentation layer Data format conversion, encoding, encryption, compression TLS-related mechanisms, character encoding, data formats Data
Fifth layer Session layer Establish, manage, and terminate sessions RPC session mechanisms, session management mechanisms Data
Fourth layer Transport layer End-to-end transmission, reliability, flow control TCP, UDP Segment, datagram
Third layer Network layer Logical addressing, routing, and cross-network forwarding IPv4, IPv6, ICMP Packet
Second layer Data link layer Frame encapsulation, MAC addressing, link access Ethernet, Wi-Fi, PPP Frame
First layer Physical layer Transmit bit streams and physical signals Twisted pair, optical fiber, radio signals Bit

Note: OSI is a reference model, which does not mean that every network protocol strictly corresponds to one of its layers. Real protocol stacks may span multiple layers, and their specific classification may also differ depending on the perspective from which they are discussed.

2. The First Layer: Physical Layer

The physical layer is responsible for transmitting raw bit streams over the communication medium.

It focuses on how data is transmitted through the physical medium, rather than on what the data specifically represents.

Main responsibilities:

  • Define electrical characteristics.
  • Define how optical signals and wireless signals are transmitted.
  • Define interfaces, connectors, and physical media.
  • Define signal encoding and modulation methods.
  • Define transmission rates and physical link characteristics.

Common transmission media:

Medium Characteristics
Twisted pair Commonly used in Ethernet local area networks
Coaxial cable Used in some wired communication systems
Optical fiber Suitable for high-speed, long-distance transmission
Radio waves Used for Wi-Fi, cellular networks, and so on

Questions the physical layer cares about:

  • How do electrical signals represent 0 and 1?
  • How do signals propagate through cables?
  • How do optical signals travel through optical fiber?
  • How are wireless signals modulated and demodulated?
  • How are signal attenuation, interference, and noise handled?

For example, when a network cable is used to connect a computer and a switch, the network card and the switch port need to transmit bit streams through physical layer technologies.

3. Layer 2: Data Link Layer

The data link layer is responsible for transmitting data between nodes on the same data link or LAN link.

Main responsibilities:

  • Encapsulate network-layer data into data frames.
  • Use MAC addresses to identify network interfaces on the link.
  • Control the sending and receiving of data frames.
  • Handle link-layer error detection.
  • Perform media access control according to the link technology.

An Ethernet frame typically contains:

Field Purpose
Destination MAC address Identifies the receiver
Source MAC address Identifies the sender
Type or length field Identifies the upper-layer protocol or data length
Data payload Carries upper-layer data
FCS Used for frame checking

Common technologies:

  • Ethernet: Ethernet networking technology.
  • Wi-Fi: wireless LAN link technology.
  • PPP: Point-to-Point Protocol.
  • VLAN: logical partitioning of Ethernet via 802.1Q.
  • ARP: resolves the link-layer address corresponding to a target IP in an IPv4 LAN.

Note that ARP is often discussed between the network layer and the data link layer. It does not fully fit the strict layering of the OSI seven-layer model.

The data link layer mainly addresses the following:

How is data delivered to the correct next hop on the current link?

For example:

If a computer needs to send data to another computer on the same LAN, it can forward Ethernet frames using the destination MAC address.

If the destination IP is not on the local subnet, the computer usually sends the data frame to the MAC address of the default gateway rather than directly to the MAC address of the remote server.

4. Layer 3: Network Layer

The network layer is responsible for data transmission between different networks.

It addresses the following question:

Through which network nodes should data travel from the source host to ultimately reach the destination IP address?

Main responsibilities:

  • Provide logical addressing.
  • Perform routing.
  • Enable data forwarding across networks.
  • Handle packet time-to-live.
  • Support network-layer error reporting and diagnostics.

Typical protocols:

Protocol Purpose
IPv4 Provides 32-bit network addresses
IPv6 Provides 128-bit network addresses
ICMP Network error reporting and diagnostics
IPsec Provides security mechanisms for IP communication

The two most important concepts in the network layer:

IP addresses and routing.

IP addresses identify the source and destination at the network layer.

A router looks up the routing table based on the destination IP address to determine the next hop and outbound interface.

For example:

When a computer accesses a remote server, the data may need to pass through multiple routers before reaching the destination network.

The network layer is responsible for forwarding across networks, but IP itself does not guarantee that data will be delivered, nor that it will arrive in the order it was sent.

5. Layer 4: Transport Layer

The transport layer is responsible for end-to-end communication between applications on hosts.

The network layer addresses how data is transmitted between hosts, while the transport layer further addresses how different applications communicate.

Main responsibilities:

  • Port addressing.
  • Data segmentation and reassembly.
  • Reliable transmission.
  • Flow control.
  • Congestion control.
  • Connection management.

Common protocols:

Protocol Characteristics Typical scenarios
TCP Connection-oriented, reliable transmission, ordered delivery HTTP/1.1, HTTP/2, database connections
UDP Connectionless, best effort, relatively low overhead DNS, real-time audio/video, some game communications
QUIC Based on UDP, integrates reliable transmission and TLS security mechanisms HTTP/3

TCP achieves reliable transmission through mechanisms such as sequence numbers, acknowledgments, retransmission, sliding windows, and congestion control.

UDP does not provide built-in reliable delivery mechanisms like TCP, but applications can implement acknowledgment, retransmission, or other control logic themselves as needed.

The transport layer uses ports to distinguish different application services on a host.

For example:

  • HTTP default port: 80.
  • HTTPS default port: 443.
  • SSH default port: 22.
  • DNS common port: 53.

Port numbers range from 0 to 65535.

6. Layer 5: Session Layer

The session layer is responsible for establishing, managing, and terminating sessions between applications.

It focuses on how the communicating parties maintain a logical interaction.

Main responsibilities:

  • Establish sessions.
  • Manage session state.
  • Control session interaction.
  • Support session recovery or synchronization mechanisms.

For example, some remote invocation systems need to maintain session state so that multiple requests can be associated with the same business interaction.

In modern Internet protocol stacks, the session layer usually does not have an independent, unified protocol-layer implementation; its responsibilities are often handled jointly by application-layer protocols, the transport layer, or middleware.

For example:

  • RPC frameworks can manage invocation sessions.
  • Web applications can manage user sessions through Cookie and Session.
  • Database connection pools can manage client sessions.

These functions do not mean that Cookie, Session, or RPC are all OSI session-layer protocols in the strict sense.

7. Layer 6: Presentation Layer

The presentation layer is responsible for addressing differences in data representation between different systems.

Different computers may use different data encodings, character sets, data formats, and representation methods.

The presentation layer is concerned with:

  • Data encoding.
  • Character set conversion.
  • Data serialization.
  • Data compression.
  • Data encryption and decryption.

Common technologies:

Technology Purpose
UTF-8 Character encoding
JSON Structured data representation
XML Markup language data representation
ASN.1 Abstract syntax representation
gzip Data compression
TLS Provides security capabilities such as communication encryption and authentication

For example, a client sends JSON data:

{
  "user_id": 1001,
  "username": "alice",
  "age": 25
}

The server needs to parse the content according to the agreed-upon data format.

Different systems can correctly understand the information sent by the other party only if they follow the same data representation specifications.

Note: in the actual TCP/IP protocol stack, TLS is not strictly an independent OSI presentation layer protocol. It usually sits between application protocols and the transport layer, providing secure transmission capabilities for upper-layer protocols.

8. Layer 7: The Application Layer

The application layer provides network communication services for applications.

It is the layer closest to users and business logic.

Main responsibilities:

  • Define application communication rules.
  • Define request and response formats.
  • Provide network services.
  • Handle application-layer business data.

Common protocols:

Protocol Purpose
HTTP Web requests and responses
HTTPS Secure HTTP based on TLS
DNS Domain name resolution
SMTP Email sending
IMAP Email access
FTP File transfer
SSH Secure remote login
DHCP Automatic network configuration assignment

For example, when a browser visits a website, it typically exchanges requests and responses with the server over HTTP or HTTPS.

GET /users/1001 HTTP/1.1
Host: example.com
Accept: application/json

The server might return:

HTTP/1.1 200 OK
Content-Type: application/json

{
  "user_id": 1001,
  "username": "alice"
}

The application layer is responsible for understanding the request path, request method, status code, and business data.

III. The TCP/IP Four-Layer Model

The OSI seven-layer model is better suited to understanding the functional division of network communication.

The actual Internet mainly uses the TCP/IP protocol suite.

The TCP/IP four-layer model divides network communication into:

  1. Application layer.
  2. Transport layer.
  3. Internet layer.
  4. Network interface layer.

1. The TCP/IP Four-Layer Structure

TCP/IP Layer Corresponding OSI Layer Main Protocols Core Responsibility
Application layer Application layer, presentation layer, session layer HTTP, DNS, SMTP, SSH Application data exchange
Transport layer Transport layer TCP, UDP, QUIC End-to-end communication
Internet layer Network layer IPv4, IPv6, ICMP IP addressing and routing
Network interface layer Data link layer, physical layer Ethernet, Wi-Fi, PPP Link transmission and physical communication

The TCP/IP four-layer model merges the OSI application layer, presentation layer, and session layer into the application layer.

At the same time, it merges the data link layer and the physical layer into the network interface layer.

This is a form of abstraction that is closer to how actual protocol stacks are implemented.

2. Differences Between OSI and TCP/IP

Comparison dimension OSI model TCP/IP model
Number of layers Seven layers Usually four layers
Nature Theoretical reference model Actual protocol suite and its layered abstraction
Design goal Standardize the division of network functions Support Internet communication
Application layer Application, presentation, and session are separated Merged into the application layer
Lower layers Data link and physical are separated Usually merged into the network interface layer
Use cases Teaching, analysis, and protocol understanding Network engineering and actual communication

Note that TCP/IP also often uses a five-layer teaching model:

  1. Application layer.
  2. Transport layer.
  3. Network layer.
  4. Data link layer.
  5. Physical layer.

The five-layer model preserves the independence of the physical layer and the data link layer, making it easier to analyze actual network devices and communication processes.

Therefore, the four-layer model and the five-layer model are not contradictory; they simply have different levels of abstraction.

IV. Data Encapsulation in the Network Layering Model

One of the most important mechanisms of network layering is data encapsulation.

When data is passed downward at the sender, each layer adds the corresponding control information according to its own layer's protocol.

The receiver parses it layer by layer in the reverse direction.

1. What Is Data Encapsulation?

Suppose a client wants to send an HTTP request to a server.

The HTTP request is first generated by the application layer.

The transport layer encapsulates the application data into a TCP segment.

The network layer encapsulates the TCP segment into an IP packet.

The data link layer then encapsulates the IP packet into an Ethernet frame.

The physical layer finally converts the frame into a bitstream for transmission.

flowchart TD
    A["Application layer: HTTP data"] --> B["Transport layer: add TCP header"]
    B --> C["Network layer: add IP header"]
    C --> D["Data link layer: add frame header and frame trailer"]
    D --> E["Physical layer: convert to bitstream"]
    E --> F["Transmit over the network medium"]

    style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style B fill:#E8E0F7,stroke:#B6A5D9,color:#4F3B75
    style C fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style D fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style E fill:#F1F3F5,stroke:#C7CDD4,color:#334155
    style F fill:#E0F0FE,stroke:#93BCE8,color:#1E4976

2. Structure After Data Encapsulation

Different layers add different protocol headers.

Layer Encapsulation result Added information
Application layer Application data HTTP request headers, business data, etc.
Transport layer TCP segment Source port, destination port, sequence number, etc.
Network layer IP packet Source IP, destination IP, TTL, etc.
Data link layer Data frame Source MAC, destination MAC, frame check information
Physical layer Bitstream Physical signal encoding

Taking TCP/IP communication as an example:

以太网帧
┌──────────────────────────────────────────────┐
│ Ethernet Header                              │
├──────────────────────────────────────────────┤
│ IP Header                                    │
├──────────────────────────────────────────────┤
│ TCP Header                                   │
├──────────────────────────────────────────────┤
│ HTTP Data                                    │
├──────────────────────────────────────────────┤
│ Ethernet FCS                                 │
└──────────────────────────────────────────────┘

This is only a simplified illustration. The actual frame format, header length, and additional fields vary depending on the protocol version, options, and link technology.

3. What Is a Protocol Data Unit (PDU)?

PDU stands for Protocol Data Unit.

It refers to the unit of data that a protocol at a given layer processes and transmits.

Different layers have different names:

Layer PDU Name
Application layer Data
Transport layer TCP segment / UDP datagram
Network layer IP packet
Data link layer Frame
Physical layer Bit

Note: These names are common teaching and engineering terms; specific protocols may use different names.

4. What is decapsulation?

After the receiver receives data, it needs to process it layer by layer from the bottom up.

For example:

  1. The NIC receives physical signals and recovers the bits.
  2. The data link layer checks the frame and parses the MAC address.
  3. The network layer parses the IP header.
  4. The transport layer delivers data to the corresponding Socket based on the port.
  5. The application layer parses the HTTP request or response.
flowchart TD
    A["Receive physical signal"] --> B["Physical layer recovers bitstream"]
    B --> C["Data link layer parses data frame"]
    C --> D["Network layer parses IP packet"]
    D --> E["Transport layer parses TCP or UDP"]
    E --> F["Deliver to Socket based on port"]
    F --> G["Application layer parses application data"]

    style A fill:#F1F3F5,stroke:#C7CDD4,color:#334155
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style D fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style E fill:#E8E0F7,stroke:#B6A5D9,color:#4F3B75
    style F fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style G fill:#DCEFE5,stroke:#A3CBB4,color:#315C43

V. Peer-Layer Communication and Upper/Lower-Layer Services

There are two important concepts in the network layering model:

  • Peer-layer communication.
  • Upper- and lower-layer service calls.

Understanding them helps avoid confusing logical communication with actual data transmission.

1. What is peer-layer communication?

A given layer on the sender logically communicates with the same layer on the receiver.

For example:

  • Client TCP and server TCP interact through the TCP protocol.
  • Client IP and server IP perform packet processing through the IP protocol.
  • Client HTTP and server HTTP exchange messages according to the HTTP protocol.

This communication is a logical protocol relationship.

In reality, data must pass through the local protocol stack, network links, and intermediate network devices before it can reach the peer.

flowchart TD
    subgraph CLIENT["Client"]
        A1["Application layer"]
        A2["Transport layer"]
        A3["Network layer"]
        A4["Link layer"]
        A1 --> A2
        A2 --> A3
        A3 --> A4
    end

    subgraph NETWORK["Intermediate network"]
        N1["Switches and routers"]
    end

    subgraph SERVER["Server"]
        B4["Link layer"]
        B3["Network layer"]
        B2["Transport layer"]
        B1["Application layer"]
        B4 --> B3
        B3 --> B2
        B2 --> B1
    end

    A4 --> N1
    N1 --> B4
    A1 -.-> B1
    A2 -.-> B2
    A3 -.-> B3

    style CLIENT fill:#F6FAF7,stroke:#DCE9E0,color:#334155
    style NETWORK fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style SERVER fill:#F6FAF7,stroke:#DCE9E0,color:#334155
    style A1 fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style A2 fill:#E8E0F7,stroke:#B6A5D9,color:#4F3B75
    style A3 fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style A4 fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style N1 fill:#F1F3F5,stroke:#C7CDD4,color:#334155
    style B1 fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style B2 fill:#E8E0F7,stroke:#B6A5D9,color:#4F3B75
    style B3 fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style B4 fill:#FFF1D6,stroke:#E8C98B,color:#73551D

The dashed lines in the diagram represent logical protocol relationships between peer layers at the two ends; they do not mean data is transmitted directly between the same layer of the two hosts.

2. What Are Service Calls Between Upper and Lower Layers?

Within the same device, adjacent layers provide services to each other through interfaces.

For example:

  • The application layer calls the TCP Socket interface.
  • TCP uses the sending capability provided by the IP layer.
  • IP uses the link transmission capability provided by the network interface layer.
  • The NIC driver ultimately submits data to the hardware for transmission.

Each layer does not need to understand all implementation details of the lower layer; it only needs to follow the agreed interfaces and service rules.

3. Differences Between Protocols, Services, and Interfaces

Concept Meaning Example
Protocol Rules followed by communicating peers at the same layer TCP, HTTP
Service Capabilities a layer provides to the upper layer TCP reliable transmission
Interface Boundary for invoking services between adjacent layers Socket API

It can be understood this way:

  • A protocol defines how the two parties communicate.
  • A service defines what capabilities this layer can provide.
  • An interface defines how the upper layer uses these capabilities.

For example, HTTP is an application-layer protocol, TCP is a transport-layer protocol, and the Socket API is a programming interface through which applications use network communication capabilities.

6. Which Layer Do Different Network Devices Work At?

Network devices usually involve one or more layers.

Network Device Primary Layer(s) Core Responsibility
NIC Data Link Layer, Physical Layer Send and receive link-layer data
Hub Physical Layer Forward physical signals
Layer 2 Switch Data Link Layer Forward frames based on MAC addresses
Layer 3 Switch Data Link Layer, Network Layer Support switching and IP routing
Router Network Layer Route and forward based on IP addresses
Wireless AP Physical Layer, Data Link Layer Provide wireless access
Firewall Multiple layers Inspect and control network traffic according to rules
Load Balancer Multiple layers Distribute client requests
Application Proxy Application Layer Understand and process application protocols

Note that modern network devices often implement functions at multiple layers simultaneously.

For example, a firewall can filter based on IP, port, and connection state, and can also parse HTTP requests for application-layer inspection.

1. Layer 2 Switch

A Layer 2 switch forwards Ethernet frames based on MAC addresses.

Main process:

  • Learn the source MAC address of received data frames.
  • Map the source MAC address to the receiving port.
  • Look up the destination MAC address.
  • Select the egress port based on the MAC address table.
  • If the destination address is unknown, usually flood within the associated VLAN.

2. Router

A router forwards packets based on IP addresses.

Main process:

  • Receive IP packets.
  • Check the destination IP address.
  • Look up the routing table.
  • Select the next hop and egress interface.
  • Encapsulate the data frame according to the next-hop link information.
  • Send the packet to the next link.

Note that when a router forwards packets, it usually re-encapsulates the link-layer frame.

The IP source and destination addresses generally remain unchanged end to end, but may be translated when mechanisms such as NAT are involved.

3. Forwarding Differences Between Devices at Different Layers

Comparison Item Layer 2 Switch Router
Primary Basis MAC address IP address
Processing Object Ethernet frame IP packet
Core Function Frame forwarding within a LAN Routing between different networks
Main Forwarding Table MAC address table Routing table
Broadcast Domain Usually divided by VLAN Usually isolates Layer 2 broadcast domains on different interfaces

7. A Complete Layered Network Communication Process

The best way to understand network layering is to analyze a real network request.

Assume:

  • Client IP: 192.168.1.10
  • Client default gateway: 192.168.1.1
  • Target server domain name: www.example.com
  • Target server IP: 203.0.113.20
  • Target service port: 443

The destination IP here uses a documentation example address and is only for illustrating the network process.

1. Browser Initiates an HTTPS Request

The user enters in the browser:

https://www.example.com

The browser needs to obtain the IP address of the target server, establish a secure connection, and then send an HTTP request.

2. DNS Resolution

The browser or operating system first checks the DNS cache.

If no usable record is available, obtain the IP address corresponding to the target domain name through a DNS query.

The actual resolution process may pass through the local cache, recursive DNS servers, and authoritative DNS servers.

3. Determine Whether the Target Is on the Local Network

The client uses its own IP address and subnet mask to determine whether the target address belongs to the local subnet.

If the target server is not on the local subnet, the client needs to send the data to the default gateway.

4. Obtain the MAC Address of the Default Gateway

If the client does not yet know the MAC address of the default gateway, it needs to perform an ARP query.

Only after obtaining the gateway MAC address can the client construct the Ethernet frame destined for the gateway.

IPv6, by contrast, uses the Neighbor Discovery Protocol to perform the corresponding link-layer address resolution.

5. Establish a Transport Connection

If HTTP/1.1 or HTTP/2 is used, a TCP connection usually needs to be established first, and then secure communication is set up through TLS.

If HTTP/3 is used, QUIC is used instead; QUIC is based on UDP and integrates the TLS 1.3 secure handshake mechanism.

6. Send the HTTP Request

The browser constructs an HTTP request and hands it to the transport layer for sending.

After being encapsulated by the network layer and the data link layer, the data is sent over the network medium.

7. The Server Processes the Request and Returns a Response

After receiving the data, the server decapsulates it layer by layer.

The application processes the HTTP request and generates the response data.

The response is returned to the client over the network, and the browser parses the content and displays the page.

8. Complete Communication Flow Diagram

flowchart TD
    A["User enters the website domain name"] --> B["Browser checks DNS cache"]
    B --> C{"Is a usable resolution record available?"}
    C -->|Yes| D["Obtain the target IP address"]
    C -->|No| E["Query the DNS server"]
    E --> F{"Is the DNS query successful?"}
    F -->|No| X["Return a domain resolution error"]
    F -->|Yes| D
    D --> G["Determine whether the target is on the local subnet"]
    G --> H{"Is it a local target?"}
    H -->|Yes| I["Resolve the MAC address of the target device"]
    H -->|No| J["Resolve the MAC address of the default gateway"]
    I --> K["Build a link-layer data frame"]
    J --> K
    K --> L["Forward through network devices"]
    L --> M["Establish TCP or QUIC communication"]
    M --> N{"Are the connection and security handshake successful?"}
    N -->|No| Y["Handle the connection failure"]
    N -->|Yes| O["Send the HTTP request"]
    O --> P["The server processes the business request"]
    P --> Q{"Does the server process it successfully?"}
    Q -->|No| R["Return an error response"]
    Q -->|Yes| S["Return a success response"]
    R --> T["The browser parses the HTTP response"]
    S --> T
    T --> U["The browser displays the page"]
    X --> V["Check DNS configuration and network connectivity"]
    Y --> W["Check routing, firewall, and TLS configuration"]

    style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style B fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style C fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style D fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style E fill:#E8E0F7,stroke:#B6A5D9,color:#4F3B75
    style F fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style G fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style H fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style I fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style J fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style K fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style L fill:#F1F3F5,stroke:#C7CDD4,color:#334155
    style M fill:#E8E0F7,stroke:#B6A5D9,color:#4F3B75
    style N fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style O fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style P fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style Q fill:#FFF1D6,stroke:#E8C98B,color:#73551D
    style R fill:#FCE8E8,stroke:#DCA6A6,color:#843F3F
    style S fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style T fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style U fill:#DCEFE5,stroke:#A3CBB4,color:#315C43
    style V fill:#F1F3F5,stroke:#C7CDD4,color:#334155
    style W fill:#F1F3F5,stroke:#C7CDD4,color:#334155
    style X fill:#FCE8E8,stroke:#DCA6A6,color:#843F3F
    style Y fill:#FCE8E8,stroke:#DCA6A6,color:#843F3F