Skip to content

Commit 33ff1af

Browse files
authored
TCP according to RFC 9293. (#131)
TCP according to RFC 9293. [Feature] Signed-off-by: Markus Alexander Kuppe <[email protected]>
1 parent 96e03a2 commit 33ff1af

File tree

5 files changed

+434
-1
lines changed

5 files changed

+434
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ Here is a list of specs included in this repository, with links to the relevant
8787
| [RFC 3506: Voucher Transaction System](specifications/byihive) | Santhosh Raju, Cherry G. Mathew, Fransisca Andriani | | | || |
8888
| [TLA⁺ Level Checking](specifications/LevelChecking) | Leslie Lamport | | | | | |
8989
| [Condition-Based Consensus](specifications/cbc_max) | Thanh Hai Tran, Igor Konnov, Josef Widder | | | | | |
90-
| [Yo-Yo Leader Election](specifications/YoYo) | Ludovic Yvoz, Stephan Merz | | | || |
90+
| [Yo-Yo Leader Election](specifications/YoYo) | Ludovic Yvoz, Stephan Merz | | | || |
91+
| [TCP as defined in RFC 9293](specifications/tcp) | Markus Kuppe | | | || |
9192

9293
## Examples Elsewhere
9394
Here is a list of specs stored in locations outside this repository, including submodules.

manifest.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5144,6 +5144,49 @@
51445144
]
51455145
}
51465146
]
5147+
},
5148+
{
5149+
"path": "specifications/tcp",
5150+
"title": "TCP as defined in RFC 9293",
5151+
"description": "Transmission Control Protocol (TCP)",
5152+
"sources": ["https://datatracker.ietf.org/doc/html/rfc9293"],
5153+
"authors": [
5154+
"Markus Kuppe"
5155+
],
5156+
"tags": [],
5157+
"modules": [
5158+
{
5159+
"path": "specifications/tcp/tcp.tla",
5160+
"communityDependencies": [
5161+
"SequencesExt"
5162+
],
5163+
"tlaLanguageVersion": 2,
5164+
"features": [],
5165+
"models": []
5166+
},
5167+
{
5168+
"path": "specifications/tcp/MCtcp.tla",
5169+
"communityDependencies": [],
5170+
"tlaLanguageVersion": 2,
5171+
"features": [],
5172+
"models": [
5173+
{
5174+
"path": "specifications/tcp/MCtcp.cfg",
5175+
"runtime": "00:00:01",
5176+
"size": "small",
5177+
"mode": "exhaustive search",
5178+
"features": [
5179+
"state constraint",
5180+
"liveness"
5181+
],
5182+
"result": "success",
5183+
"distinctStates": 1182,
5184+
"totalStates": 6322,
5185+
"stateDepth": 14
5186+
}
5187+
]
5188+
}
5189+
]
51475190
}
51485191
]
51495192
}

specifications/tcp/MCtcp.cfg

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
CONSTANTS
2+
A = A
3+
B = B
4+
5+
CONSTANT
6+
Peers <- peers
7+
Init <- MCInit
8+
9+
\* Disable symmetry reduction when checking liveness.
10+
\* SYMMETRY
11+
\* Symmetry
12+
13+
SPECIFICATION
14+
Spec
15+
16+
INVARIANT
17+
TypeOK
18+
Inv
19+
20+
PROPERTY
21+
Prop
22+
23+
CONSTRAINT
24+
NoRetransmission
25+
26+
ACTION_CONSTRAINT
27+
SingleActiveOpen

specifications/tcp/MCtcp.tla

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---- MODULE MCtcp ----
2+
EXTENDS tcp, TLC
3+
4+
CONSTANTS A, B
5+
peers == {A, B}
6+
Symmetry == Permutations(peers)
7+
8+
MCInit ==
9+
\* One node starts in the SYN-SENT state, i.e., one node has already received the active open command. The other node
10+
\* is in the listen state, i.e., it has received the passive open command.
11+
\E node \in Peers:
12+
/\ tcb = [p \in Peers |-> TRUE]
13+
/\ connstate = [p \in Peers |-> IF p = node THEN "SYN-SENT" ELSE "LISTEN"]
14+
/\ network = [p \in Peers |-> IF p = node THEN <<>> ELSE << "SYN" >>]
15+
16+
NoRetransmission ==
17+
\A p \in Peers :
18+
\A i \in 1..Len(network[p]) - 1 :
19+
network[p][i] # network[p][i + 1]
20+
21+
SingleActiveOpen ==
22+
\* A real system will allow infinitely many active opens of TCP connections. An
23+
\* explicit state model checker like TLC cannot enumerate infinitely many states.
24+
\* Thus, do not allow multiple active opens (the first active open is implicit in Init).
25+
~ \E local, remote \in Peers:
26+
\/ ACTIVE_OPEN(local, remote)
27+
\/ PASSIVE_OPEN(local, remote)
28+
\/ SEND(local, remote)
29+
30+
=============================================================================
31+
\* Modification History
32+
\* Created Tue Apr 02 10:38:50 PDT 2024 by markus

0 commit comments

Comments
 (0)