> For the complete documentation index, see [llms.txt](https://www.pranaypourkar.co.in/the-programmers-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pranaypourkar.co.in/the-programmers-guide/system-design/performance-engineering/networking-metrics/types-of-delay.md).

# Types of Delay

## Network-Level Delays

### **1. Transmission Delay**

The time required to **push** all bits of a packet into the transmission medium.

#### **Formula**

`Transmission Delay = Packet Size (bits) / Bandwidth (bps)`

{% hint style="info" %}

* **Packet size** – Larger packets take more time to be transmitted.
* **Bandwidth** – Higher bandwidth reduces transmission delay.
  {% endhint %}

#### **Example**

* Sending a **1 MB (8 million bits)** file over a **100 Mbps** network:&#x20;

Transmission Delay = 8,000,000 bits / 100,000,000 bps = 0.08 seconds(80ms)

### 2. Retransmission Delay

Retransmission delay is the time required to **resend lost or corrupted packets** over a network. When a packet fails to reach its destination correctly due to **network congestion, packet loss, or corruption**, it must be retransmitted, introducing additional delay in communication.

#### **Formula**

`Retransmission Delay = Round Trip Time (RTT) + Time to Detect Loss + Backoff Delay (if applicable)`

Where:

* **RTT (Round Trip Time)** = Time for a packet to travel to the destination and back.
* **Time to Detect Loss** = Delay introduced by mechanisms like **ACK timeout** or **duplicate ACK detection**.
* **Backoff Delay** = Extra delay if the system follows an exponential backoff (e.g., TCP).

#### **Causes of Retransmission Delay**

1. **Packet Loss** – Due to congestion, network failures, or buffer overflow.
2. **Corrupted Packets** – Errors caused by interference, bad links, or hardware issues.
3. **High Network Load** – Overloaded routers cause packet drops, leading to retransmission.
4. **TCP Congestion Control** – TCP retransmits lost packets, sometimes introducing extra delay due to **exponential backoff**.
5. **Wireless Interference** – In Wi-Fi and mobile networks, packet loss is common due to weak signals or interference.
6. **Route Fluctuations** – Changing network paths may cause packet reordering, leading to retransmissions.

#### **How Retransmission Works?**

#### **1. TCP Retransmission (Reliable Transport Protocols)**

* TCP detects lost packets via **ACK timeout** or **duplicate ACKs**.
* If an ACK isn’t received within the timeout, TCP **retransmits the packet**.
* Uses **Exponential Backoff** → If loss persists, the retransmission delay increases exponentially.

**Example: TCP Retransmission**

```plaintext
Client: Sends packet [SEQ=100]
Server: (Packet lost)
Client: Waits for ACK, but timeout occurs
Client: Retransmits packet [SEQ=100]
Server: Receives packet, sends ACK
```

#### **2. UDP Retransmission (Application-Level Handling)**

* UDP itself **does not handle retransmissions** (unlike TCP).
* Applications like **VoIP, Video Streaming** use **custom retransmission mechanisms** like **Forward Error Correction (FEC)** or retransmit lost packets based on sequence numbers.

#### **Impact of Retransmission Delay**

<table data-header-hidden><thead><tr><th width="280"></th><th></th></tr></thead><tbody><tr><td><strong>Area Affected</strong></td><td><strong>Impact</strong></td></tr><tr><td><strong>Network Performance</strong></td><td>Increased congestion due to repeated packets</td></tr><tr><td><strong>Application Latency</strong></td><td>Slower response times (especially in TCP-based apps)</td></tr><tr><td><strong>VoIP &#x26; Video Streaming</strong></td><td>Jitter and buffering issues</td></tr><tr><td><strong>Throughput</strong></td><td>Decreased throughput in high-loss networks</td></tr><tr><td><strong>Mobile &#x26; Wireless Networks</strong></td><td>Poor quality due to high packet loss</td></tr></tbody></table>

#### **Optimization Techniques to Reduce Retransmission Delay**

#### **1. Use Forward Error Correction (FEC)**

* Instead of waiting for retransmissions, **send redundant data** to recover lost packets.
* Used in **real-time streaming (VoIP, video calls)** to reduce delay.

#### **2. Optimize TCP Parameters**

* **Reduce TCP Retransmission Timeout (RTO)** → Adjust **timeout** dynamically to detect loss faster.
* **Enable Selective Acknowledgment (SACK)** → Retransmit only **lost packets**, not the entire window.
* **Use TCP Fast Retransmit** → Detect loss early based on **duplicate ACKs** instead of waiting for timeout.

#### **3. Minimize Packet Loss**

* **Use QoS (Quality of Service)** to prioritize critical packets.
* **Increase buffer sizes** to handle high traffic without dropping packets.
* **Optimize network congestion** with **Traffic Shaping** (rate limiting) and **Load Balancing**.

#### **4. Implement Adaptive Retransmission**

* **Adaptive RTO (Retransmission Timeout)** dynamically adjusts retransmission timing based on **network conditions**.
* **Example:** TCP Vegas optimizes retransmission delay by monitoring network latency.

#### **5. Improve Wireless Network Reliability**

* **Use Hybrid ARQ (Automatic Repeat reQuest)** – Combines FEC and retransmissions to minimize delay.
* **Optimize Wi-Fi Channel Selection** – Reducing interference helps lower packet loss.

## **3. Propagation Delay**

The time taken for a data packet to **physically travel** from sender to receiver through the transmission medium.

#### **Formula**

`Propagation Delay = Distance / Propagation Speed`

{% hint style="info" %}

* **Distance between sender and receiver** – Longer distances lead to higher delays.
* **Propagation speed of the medium** – Speed varies for fiber optics, copper cables, and wireless.
  {% endhint %}

#### **Example**

* If a signal travels **3000 km (3,000,000 meters)** through a fiber optic cable (**200,000 km/s**): Propagation Delay = 3,000,000 m / 200,000,000 m/s = 0.015 seconds(15ms)

#### **Typical Propagation Speeds**

| Medium         | Speed (m/s) |
| -------------- | ----------- |
| Fiber Optic    | 2 × 10^8    |
| Copper Cable   | 1.5 × 10^8  |
| Wireless (Air) | 3 × 10^8    |

## **4. Queuing Delay**

The time a packet spends **waiting in a buffer** before it gets transmitted due to network congestion.

#### **Formula**

`Queuing Delay = (Number of Packets in Queue×Packet Size ) / Bandwidth`

{% hint style="info" %}

* **Network congestion** – High traffic causes longer wait times.
* **Queue size** – Limited buffer space can drop packets.
* **Traffic prioritization** – QoS settings can favor important packets.
  {% endhint %}

#### **Example**

* A **VoIP call packet** waiting **10 ms** in a queue due to high network traffic.

**How to Reduce Queuing Delay?**

* Use **Quality of Service (QoS)** to prioritize real-time traffic.
* Increase **network bandwidth**.
* Use **Load Balancers** to distribute traffic across multiple paths.

## 5. Acknowledgment Delay (ACK Delay)

Acknowledgment Delay (ACK Delay) is the time **between receiving a data packet and sending an acknowledgment (ACK) back to the sender**. This delay can occur **intentionally or unintentionally** due to network conditions, protocol configurations, or system processing limitations.

#### **Formula**

`ACK Delay = Processing Time + Intentional Delay + Network Delay`

Where:

* **Processing Time** = Time taken by the receiver to process the packet.
* **Intentional Delay** = Some protocols (e.g., TCP Delayed ACK) introduce a delay before sending ACKs.
* **Network Delay** = Transmission time between sender and receiver.

#### **Causes of Acknowledgment Delay**

1. **TCP Delayed ACK Mechanism**
   * TCP intentionally waits before sending an ACK to reduce overhead.
   * Example: Delayed ACK in TCP **waits up to 200ms** before responding.
2. **Receiver Processing Time**
   * The receiver takes time to validate, process, and queue packets before acknowledging them.
3. **Network Congestion & Buffering**
   * ACK packets might be delayed due to **network congestion or queuing** at routers.
4. **Device Performance**
   * Low-powered devices (IoT, embedded systems) might have **longer processing delays** before sending ACKs.

#### **Impact of Acknowledgment Delay**

<table data-header-hidden data-full-width="true"><thead><tr><th width="287"></th><th></th></tr></thead><tbody><tr><td><strong>Area Affected</strong></td><td><strong>Impact</strong></td></tr><tr><td><strong>TCP Throughput</strong></td><td>High ACK delay reduces efficiency in data transfer.</td></tr><tr><td><strong>Application Responsiveness</strong></td><td>Delayed ACKs slow down real-time communication.</td></tr><tr><td><strong>VoIP &#x26; Streaming</strong></td><td>Increased jitter due to delayed acknowledgments.</td></tr><tr><td><strong>Congestion Control</strong></td><td>Large ACK delays cause retransmissions and poor congestion handling.</td></tr></tbody></table>

#### **Optimization Techniques for Reducing ACK Delay**

1. **Disable TCP Delayed ACK for Low-Latency Applications**
   * Some operating systems allow adjusting or disabling delayed ACKs for better performance.
2. **Use Selective Acknowledgment (SACK)**
   * TCP SACK allows **acknowledging only lost packets**, reducing retransmission overhead.
3. **Optimize Receiver Processing**
   * Improve server processing speed to send ACKs faster.
4. **Use Faster Network Paths**
   * Reduce **latency in acknowledgment transmission** by optimizing routes.

## 6. Congestion Delay

Congestion Delay occurs when **network traffic exceeds available bandwidth**, causing packets to wait in queues at routers, switches, or network interfaces before being transmitted. This delay is a result of network congestion and can significantly impact end-to-end latency.

#### **Formula for Congestion Delay**

`Congestion Delay = Number of Queued Packets × Processing Time per PacketNetwork /  Throughput`

Where:

* **Queued Packets** = Packets waiting to be transmitted.
* **Processing Time per Packet** = Time taken to process each packet at the router or switch.
* **Network Throughput** = Capacity of the network link.

#### **Causes of Congestion Delay**

1. **High Network Traffic**
   * Too many packets being transmitted simultaneously exceed the available bandwidth.
2. **Bottlenecks in the Network Path**
   * Slower links (e.g., 100 Mbps router connected to a 1 Gbps switch) create congestion points.
3. **Limited Buffer Size in Network Devices**
   * If a router’s buffer is full, incoming packets must wait longer or get dropped.
4. **TCP Congestion Control Mechanisms**
   * TCP reduces sending rate in response to congestion, further increasing delay.

#### **Impact of Congestion Delay**

| **Area Affected**      | **Impact**                                   |
| ---------------------- | -------------------------------------------- |
| **Web Browsing**       | Slow page load times.                        |
| **Streaming Services** | Buffering and degraded video/audio quality.  |
| **Online Gaming**      | High latency, lag, and poor user experience. |
| **VoIP Calls**         | Increased jitter and voice distortion.       |

#### **Optimization Techniques for Reducing Congestion Delay**

1. **Increase Network Capacity (Bandwidth Upgrades)**
   * Add more links, upgrade to **higher-speed** networks (e.g., 10G, 100G).
2. **Implement Traffic Prioritization (QoS - Quality of Service)**
   * Assign higher priority to **real-time applications** like VoIP, gaming, and video streaming.
3. **Use Load Balancing**
   * Distribute traffic across multiple servers or network paths to avoid bottlenecks.
4. **Implement Active Queue Management (AQM)**
   * Use **Random Early Detection (RED)** or **Explicit Congestion Notification (ECN)** to drop excess packets before buffers overflow.

## 7. Handoff Delay (in Wireless Networks)

Handoff Delay occurs when a **mobile device moves between different network cells** (Wi-Fi access points or cellular towers) and experiences a delay in re-establishing connectivity. This happens due to the time taken to switch to a new network without packet loss or service interruption.

#### **Formula for Handoff Delay**

`Handoff Delay = Discovery Time + Authentication Time + Reassociation Time`

Where:

* **Discovery Time** = Time taken to detect a new access point or base station.
* **Authentication Time** = Time required for security authentication.
* **Reassociation Time** = Time taken to transfer active sessions to the new network.

#### **Types of Handoff**

1. **Hard Handoff (Break-Before-Make)**
   * The connection **breaks** before establishing a new connection.
   * **Example**: Cellular handoff between 4G and 5G networks.
2. **Soft Handoff (Make-Before-Break)**
   * The new connection is **established before breaking** the old one.
   * **Example**: Seamless VoIP call transition in mobile networks.
3. **Horizontal Handoff**
   * Transition between **the same type of network** (e.g., switching from one Wi-Fi router to another).
4. **Vertical Handoff**
   * Transition between **different types of networks** (e.g., Wi-Fi to 4G/5G).

#### **Impact of Handoff Delay**

| **Application**     | **Effect of High Handoff Delay**                         |
| ------------------- | -------------------------------------------------------- |
| **VoIP Calls**      | Call drop or audio stutter during movement.              |
| **Video Streaming** | Buffering or video quality degradation.                  |
| **Online Gaming**   | High latency spikes leading to lag.                      |
| **IoT Devices**     | Data transmission interruptions affecting smart devices. |

#### **Optimization Techniques for Reducing Handoff Delay**

1. **Use Fast Handoff Protocols (802.11r for Wi-Fi Roaming)**
   * Reduces reassociation time by allowing pre-authentication with nearby access points.
2. **Implement Predictive Handoff Techniques**
   * AI-based systems predict movement patterns and proactively switch networks.
3. **Use Dual Connectivity in Cellular Networks**
   * Maintain simultaneous connections to multiple base stations before switching.
4. **Reduce Authentication Delays with Caching Mechanisms**
   * Store session credentials to speed up authentication.

### 8. DNS Resolution Delay

DNS Resolution Delay is the time taken to **convert a domain name (e.g.,** [**www.google.com**](http://www.google.com)**) into an IP address** before initiating communication. A slow DNS resolution process can delay website loading and API requests.

#### **Formula for DNS Resolution Delay**

`DNS Delay = Query Time + Propagation Time + Processing Time`

Where:

* **Query Time** = Time taken for the request to reach the DNS server.
* **Propagation Time** = Time required for recursive DNS lookups across multiple servers.
* **Processing Time** = Time taken by the DNS server to respond.

#### **Causes of DNS Resolution Delay**

1. **Unoptimized Recursive DNS Queries**
   * DNS queries may go through multiple intermediate servers, increasing resolution time.
2. **High Network Latency to DNS Server**
   * Slow connectivity between client and DNS resolver can add to the delay.
3. **Cache Miss (No Cached DNS Response)**
   * If the requested domain is not in cache, the resolver must fetch it from authoritative DNS servers.
4. **Slow or Overloaded DNS Servers**
   * Public DNS servers (e.g., ISP-provided DNS) may be slow or congested.

#### **Impact of DNS Resolution Delay**

| **Application**     | **Effect of High DNS Delay**           |
| ------------------- | -------------------------------------- |
| **Web Browsing**    | Slow initial page load times.          |
| **API Calls**       | Delays in backend service responses.   |
| **CDN Performance** | Increased latency in content delivery. |
| **Online Gaming**   | Higher ping times affecting gameplay.  |

#### **Optimization Techniques for Reducing DNS Resolution Delay**

1. **Use a Fast Public DNS Resolver**
   * Services like **Google DNS (8.8.8.8)**, **Cloudflare DNS (1.1.1.1)**, or **Quad9 (9.9.9.9)** offer faster resolution.
2. **Enable DNS Caching**
   * Store frequently accessed domain resolutions to **avoid repeated lookups**.
3. **Use Anycast Routing for DNS Queries**
   * Directs requests to the nearest available DNS server, reducing query time.
4. **Reduce Recursive DNS Lookups**
   * Use authoritative name servers with lower lookup dependencies.

## Application-Level Delays

### 1. Software Processing Delay

Software Processing Delay refers to the **time taken by an application to process a request before sending a response**. This delay occurs due to computational tasks, data processing, database interactions, API calls, and various internal operations executed at the application layer.

#### **Formula for Software Processing Delay**

`Software Processing Delay = Computation Time + I/O Time + Inter-Process Communication Time`

Where:

* **Computation Time** = Time taken for CPU-bound processing tasks.
* **I/O Time** = Time spent in reading/writing data from files, databases, or network.
* **Inter-Process Communication Time** = Time taken for process-to-process or service-to-service interactions.

#### **Causes of Software Processing Delay**

#### **1. Heavy Computation Tasks**

* **Cause**: Complex calculations, data encryption, AI/ML inference, and large dataset processing.
* **Example**: Generating reports with millions of records.

#### **2. Inefficient Algorithm Complexity**

* **Cause**: Poorly optimized code with high time complexity (e.g., O(n²) instead of O(n log n)).
* **Example**: Using brute-force search instead of binary search for lookups.

#### **3. Database Query Execution Delay**

* **Cause**: Unoptimized queries, missing indexes, excessive joins, or high latency in distributed databases.
* **Example**: Querying a large table without proper indexing.

#### **4. Remote API Calls (Microservices Communication)**

* **Cause**: Calling external services, waiting for responses, or retrying failed requests.
* **Example**: A payment processing system waiting for a third-party gateway’s response.

#### **5. Garbage Collection (GC) Overhead**

* **Cause**: Frequent or inefficient memory management in languages like Java and Python.
* **Example**: JVM pauses during Full GC cycles.

#### **6. Thread Blocking and Synchronization Issues**

* **Cause**: Threads waiting on locks, mutexes, or semaphores in multithreading applications.
* **Example**: A Java `synchronized` block causing contention.

#### **7. Serialization and Deserialization Overhead**

* **Cause**: Converting objects to JSON/XML and vice versa for inter-service communication.
* **Example**: Converting large Java objects to JSON for REST API responses.

#### **8. Buffering and Caching Issues**

* **Cause**: Lack of caching, excessive disk reads, or cache invalidation issues.
* **Example**: Fetching the same data from the database repeatedly instead of using Redis/Memcached.

#### **Impact of Software Processing Delay**

| **Application**        | **Effect of High Software Processing Delay**  |
| ---------------------- | --------------------------------------------- |
| **Web Applications**   | Slow page load, poor user experience          |
| **REST APIs**          | High response time, affecting client services |
| **Microservices**      | Increased latency in service-to-service calls |
| **Streaming Services** | Buffering and lag in video/audio playback     |
| **E-commerce Apps**    | Slow checkout process, affecting sales        |

#### **Optimization Techniques for Reducing Software Processing Delay**

**1. Optimize Algorithm Efficiency**

* Use time-efficient data structures (e.g., HashMap instead of List for lookups).
* Implement caching mechanisms for repeated computations.

**2. Improve Database Performance**

* Use **Indexes** and **Query Optimization** techniques.
* Implement **Read-Replicas** and **Sharding** for distributed databases.

**3. Reduce API Call Overhead**

* Use **asynchronous APIs** and **batch processing** instead of making multiple synchronous calls.
* Implement **circuit breakers** (e.g., Resilience4j) to prevent cascading failures.

**4. Optimize Memory Usage**

* Tune **Garbage Collection (GC)** settings (e.g., G1GC in Java).
* Avoid unnecessary object creation and large heap allocations.

**5. Use Efficient Serialization Formats**

* Replace **JSON/XML** with faster serialization formats like **Protocol Buffers (Protobuf)** or **MessagePack**.

**6. Implement Multi-threading and Parallel Processing**

* Use **Thread Pools** to handle concurrent requests.
* Utilize frameworks like **Reactive Programming (Spring WebFlux, RxJava)** for non-blocking operations.

**7. Leverage Caching Strategies**

* Use **Redis or Memcached** to cache frequently accessed data.
* Implement **Lazy Loading** to fetch data only when required.

### **2. Serialization Delay**

Serialization delay is the time required to convert data structures (e.g., objects, messages, or packets) into a format suitable for transmission over a network or storage. This process includes **encoding, formatting, and preparing data** before it can be sent.

**Causes of Serialization Delay**

1. **Data Complexity** – Larger and more complex data structures take longer to serialize.
2. **Encoding Format** – JSON, XML, Protocol Buffers, Avro, etc., have different processing speeds.
3. **Hardware Performance** – CPU and memory speed affect serialization time.
4. **Serialization Library** – Different libraries have different efficiencies (e.g., Java’s `ObjectOutputStream` is slower than Protocol Buffers).
5. **Compression Overhead** – If data is compressed during serialization, it increases processing time.

**Example**

In Java, serializing an object using Java's default serialization mechanism:

```java
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;

class Employee implements Serializable {
    private static final long serialVersionUID = 1L;
    String name;
    int id;
    
    Employee(String name, int id) {
        this.name = name;
        this.id = id;
    }
}

public class SerializeExample {
    public static void main(String[] args) {
        try {
            Employee emp = new Employee("John", 101);
            FileOutputStream fileOut = new FileOutputStream("employee.ser");
            ObjectOutputStream out = new ObjectOutputStream(fileOut);
            out.writeObject(emp);
            out.close();
            fileOut.close();
            System.out.println("Serialization completed.");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```

**Serialization Delay in this example** → The time required to convert the `Employee` object into a **binary format** before writing it to disk.

### **3. Deserialization Delay**

Deserialization delay is the time taken to **convert serialized data back into its original object structure**. This process includes **parsing, decoding, and reconstructing objects**.

#### **Causes of Deserialization Delay**

1. **Complexity of Serialized Data** – More fields and nested structures increase delay.
2. **Encoding Format** – JSON and XML are text-based and slower than binary formats like Protocol Buffers.
3. **Hardware Performance** – Slower CPU and memory affect deserialization speed.
4. **Garbage Collection Overhead** – Deserialization creates new objects in memory, impacting performance.
5. **Library Used** – Different frameworks (Jackson, Gson, Protocol Buffers) have varying speeds.

#### **Example**

Continuing from the previous serialization example, deserializing the `Employee` object:

```java
import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class DeserializeExample {
    public static void main(String[] args) {
        try {
            FileInputStream fileIn = new FileInputStream("employee.ser");
            ObjectInputStream in = new ObjectInputStream(fileIn);
            Employee emp = (Employee) in.readObject();
            in.close();
            fileIn.close();
            System.out.println("Deserialization completed: " + emp.name + ", " + emp.id);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```

**Deserialization Delay in this example** → The time required to read the binary file and reconstruct the original `Employee` object.

## System-Level Delays (Hardware & OS-Related)

### 1. Buffering Delay

Buffering Delay is the time **a packet spends waiting in a buffer** before being processed or transmitted. This delay happens when network devices (routers, switches, end devices) temporarily store packets due to **congestion, processing limitations, or bandwidth restrictions**.

#### **Formula for Buffering Delay**

`Buffering Delay = (Queued Packets × Packet Processing Time) / Processing Speed`

Where:

* **Queued Packets** = Number of packets waiting in the buffer.
* **Packet Processing Time** = Time taken to process each packet.
* **Processing Speed** = Speed at which the device can process packets.

#### **Causes of Buffering Delay**

1. **Network Congestion**
   * When multiple packets arrive at a device **faster than they can be processed**, they get queued in a buffer.
2. **Traffic Shaping & Rate Limiting**
   * Some networks intentionally **buffer packets to regulate traffic** and avoid bursts.
3. **Video & Audio Streaming Buffers**
   * Video players buffer content to **avoid playback interruptions** due to network fluctuations.
4. **Router & Switch Queueing**
   * Network devices hold packets in buffers when outgoing links are busy.
5. **Disk & Memory Bottlenecks**
   * In databases and applications, data buffering delays occur when **reading/writing from disk or RAM**.

#### **Impact of Buffering Delay**

<table data-header-hidden data-full-width="false"><thead><tr><th width="231"></th><th></th></tr></thead><tbody><tr><td><strong>Area Affected</strong></td><td><strong>Impact</strong></td></tr><tr><td><strong>Video Streaming</strong></td><td>Too much buffering leads to increased startup time.</td></tr><tr><td><strong>Online Gaming</strong></td><td>High buffering delay causes lag and poor responsiveness.</td></tr><tr><td><strong>Network Performance</strong></td><td>Large buffers introduce excessive delay (bufferbloat issue).</td></tr><tr><td><strong>Cloud Applications</strong></td><td>Delays in data retrieval slow down cloud-based services.</td></tr></tbody></table>

#### **Optimization Techniques for Reducing Buffering Delay**

1. **Use Active Queue Management (AQM)**
   * Algorithms like **RED (Random Early Detection)** **drop packets early** to prevent excessive queuing.
2. **Enable Low-Latency Buffering**
   * Reduce buffer size in applications like VoIP, streaming, and gaming to minimize delay.
3. **Implement Adaptive Bitrate Streaming (ABR)**
   * Dynamically adjust video quality to match available bandwidth, reducing buffering.
4. **Increase Network Bandwidth**
   * Upgrade network capacity to **prevent excessive queuing at routers**.

### **2. Processing Delay**

The time taken by routers, switches, or end devices to **process** an incoming packet before forwarding it.

{% hint style="info" %}

* **Router/switch performance** – More powerful devices process packets faster.
* **Packet header complexity** – Encrypted or large headers require more processing.
* **Network congestion** – Overloaded devices slow down processing.
  {% endhint %}

#### **Example**

* A firewall **inspecting** a packet’s content might introduce **5 ms** of processing delay.

**How to Reduce Processing Delay?**

* Use **faster routers and network devices**.
* Optimize **routing tables** to reduce lookup time.
* Use **stateless packet filtering** instead of deep inspection when security allows.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pranaypourkar.co.in/the-programmers-guide/system-design/performance-engineering/networking-metrics/types-of-delay.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
