# Don't use the CAP theorem for packet losses

DevFeed: [Don't use the CAP theorem for packet losses](<https://devfeed.tech/articles/don-t-use-the-cap-theorem-for-packet-losses-21685.md>)

Original publisher: [Read original article](<http://blog.thislongrun.com/2015/03/dont-use-cap-theorem-for-packet-losses.html>)

Author: Nicolas Liochon (noreply@blogger.com)

Published: 2015-03-18T15:16:00Z

Content type: article

Language: en

Sources: [Nicolas Liochon](<https://devfeed.tech/sources/nicolas-liochon.md>)

Topics: [CAP theorem](<https://devfeed.tech/topics/cap-theorem.md>), [consistency](<https://devfeed.tech/topics/consistency.md>), [Networks](<https://devfeed.tech/topics/networks.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>)

Tags: [acid](<https://devfeed.tech/tags/acid.md>), [availability](<https://devfeed.tech/tags/availability.md>), [cap-theorem](<https://devfeed.tech/tags/cap-theorem.md>), [consistency](<https://devfeed.tech/tags/consistency.md>), [database](<https://devfeed.tech/tags/database.md>), [distributed-system](<https://devfeed.tech/tags/distributed-system.md>), [durability](<https://devfeed.tech/tags/durability.md>), [ip](<https://devfeed.tech/tags/ip.md>), [latency](<https://devfeed.tech/tags/latency.md>), [messages](<https://devfeed.tech/tags/messages.md>), [network](<https://devfeed.tech/tags/network.md>), [networks](<https://devfeed.tech/tags/networks.md>), [partition](<https://devfeed.tech/tags/partition.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [tcp](<https://devfeed.tech/tags/tcp.md>), [theory](<https://devfeed.tech/tags/theory.md>), [udp](<https://devfeed.tech/tags/udp.md>)

## AI overview

The article explains why ordinary packet loss on IP networks should not automatically be treated as a CAP theorem partition. It distinguishes congestion-related packet loss from the arbitrary message loss assumed by the CAP model and discusses how TCP responds to congestion.

## Source excerpt

In the previous post, we looked at this common saying: "nodes fail, network packets get lost, partitions happen so you need to use CAP to understand your trade-offs." We saw that node failures were not partitions. What about packet losses? Most distributed applications use TCP or UDP on top of IP, and it is well known that IP is an asynchronous protocol and that it can lose packets. So should we use all the results from the theory of asynchronous networks? Must we use CAP to do some trade-offs if we are using a network that can drop packets? The answer is no. The root issue lies in the incompleteness of our description of IP. "IP is an asynchronous protocol and it can lose packets" is true, but incomplete, and this incompleteness is misleading. Let's discuss why. CAP - The usual reminder CAP says that a distributed system cannot be Consistent, Available and Partition tolerant. We use here the definitions from the proof [C2]. Consistent is: [C2] "Atomic, linearizable, consistency [...]. There must exist a total order on all operations such that each operation looks as if it were completed at a single instant. This is equivalent to requiring requests of the distributed shared memory to act as if they were executing on a single node, responding to operations one at a time." Available is: [C2] "For a distributed system to be continuously available, every request received by a non-failing node in the system must result in a response." Partition is: [C2] "The network will be allowed to lose arbitrarily many messages sent from one node to another. When a network is partitioned, all messages sent from nodes in one component of the partition to nodes in another component are lost." How can you lose packets on a network Packet loss happens when a network equipment receives more messages that it can send. Losing packets is common on an IP network. A TCP connection tries to use most of the bandwidth available. It sends nearly as many packets as it can, until it loses some. Losi