zilinlin commited on
Commit
c3edc81
·
verified ·
1 Parent(s): d0cfa41

Upload folder using huggingface_hub

Browse files
PSMs/BGP_state_machine.json ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Idle",
4
+ "Connect",
5
+ "Active",
6
+ "OpenSent",
7
+ "OpenConfirm",
8
+ "Established"
9
+ ],
10
+ "initial_state": "Idle",
11
+ "final_states": [
12
+ "Idle"
13
+ ],
14
+ "transitions": [
15
+ {
16
+ "from": "Idle",
17
+ "to": "Connect",
18
+ "event": "ManualStart",
19
+ "action": "Initiate TCP, start ConnectRetryTimer"
20
+ },
21
+ {
22
+ "from": "Idle",
23
+ "to": "Active",
24
+ "event": "ManualStart_with_PassiveTcpEstablishment",
25
+ "action": "Start listening, reset ConnectRetryCounter"
26
+ },
27
+ {
28
+ "from": "Idle",
29
+ "to": "Active",
30
+ "event": "AutomaticStart_with_PassiveTcpEstablishment",
31
+ "action": "Start listening, reset ConnectRetryCounter"
32
+ },
33
+ {
34
+ "from": "Idle",
35
+ "to": "Idle",
36
+ "event": "AutomaticStop",
37
+ "action": "Do nothing"
38
+ },
39
+ {
40
+ "from": "Idle",
41
+ "to": "Connect",
42
+ "event": "IdleHoldTimer_Expires",
43
+ "action": "Initiate connection after oscillation damping"
44
+ },
45
+ {
46
+ "from": "Connect",
47
+ "to": "Active",
48
+ "event": "TcpConnectionFails",
49
+ "action": "Reset ConnectRetryTimer, listen for incoming connection"
50
+ },
51
+ {
52
+ "from": "Connect",
53
+ "to": "OpenSent",
54
+ "event": "TcpConnectionConfirmed",
55
+ "action": "Send OPEN, start HoldTimer"
56
+ },
57
+ {
58
+ "from": "Connect",
59
+ "to": "OpenSent",
60
+ "event": "DelayOpenTimer_Expires",
61
+ "action": "Send OPEN, start HoldTimer"
62
+ },
63
+ {
64
+ "from": "Connect",
65
+ "to": "Idle",
66
+ "event": "ConnectRetryTimer_Expires",
67
+ "action": "Reset ConnectRetryCounter, release resources"
68
+ },
69
+ {
70
+ "from": "Active",
71
+ "to": "Connect",
72
+ "event": "TcpConnection_Valid",
73
+ "action": "Initiate TCP connection"
74
+ },
75
+ {
76
+ "from": "Active",
77
+ "to": "Idle",
78
+ "event": "TcpConnectionFails",
79
+ "action": "Reset ConnectRetryCounter, release resources"
80
+ },
81
+ {
82
+ "from": "Active",
83
+ "to": "OpenSent",
84
+ "event": "DelayOpenTimer_Expires",
85
+ "action": "Send OPEN, start HoldTimer"
86
+ },
87
+ {
88
+ "from": "Active",
89
+ "to": "Idle",
90
+ "event": "ConnectRetryTimer_Expires",
91
+ "action": "Reset ConnectRetryCounter, release resources"
92
+ },
93
+ {
94
+ "from": "OpenSent",
95
+ "to": "OpenConfirm",
96
+ "event": "BGPOpen",
97
+ "action": "Send KEEPALIVE, start HoldTimer"
98
+ },
99
+ {
100
+ "from": "OpenSent",
101
+ "to": "Idle",
102
+ "event": "TcpConnectionFails",
103
+ "action": "Reset ConnectRetryCounter, release resources"
104
+ },
105
+ {
106
+ "from": "OpenSent",
107
+ "to": "Idle",
108
+ "event": "BGPOpenMsgErr",
109
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
110
+ },
111
+ {
112
+ "from": "OpenSent",
113
+ "to": "Idle",
114
+ "event": "OpenCollisionDump",
115
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
116
+ },
117
+ {
118
+ "from": "OpenConfirm",
119
+ "to": "Established",
120
+ "event": "KeepAliveMsg",
121
+ "action": "Restart HoldTimer"
122
+ },
123
+ {
124
+ "from": "OpenConfirm",
125
+ "to": "Idle",
126
+ "event": "HoldTimer_Expires",
127
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
128
+ },
129
+ {
130
+ "from": "OpenConfirm",
131
+ "to": "Idle",
132
+ "event": "NotifMsgVerErr",
133
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
134
+ },
135
+ {
136
+ "from": "Established",
137
+ "to": "Idle",
138
+ "event": "ManualStop",
139
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
140
+ },
141
+ {
142
+ "from": "Established",
143
+ "to": "Idle",
144
+ "event": "AutomaticStop",
145
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
146
+ },
147
+ {
148
+ "from": "Established",
149
+ "to": "Idle",
150
+ "event": "HoldTimer_Expires",
151
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
152
+ },
153
+ {
154
+ "from": "Established",
155
+ "to": "Idle",
156
+ "event": "NotifMsgVerErr",
157
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
158
+ },
159
+ {
160
+ "from": "Established",
161
+ "to": "Idle",
162
+ "event": "TcpConnectionFails",
163
+ "action": "Reset ConnectRetryCounter, release resources"
164
+ },
165
+ {
166
+ "from": "Established",
167
+ "to": "Idle",
168
+ "event": "UpdateMsgErr",
169
+ "action": "Send NOTIFICATION, reset ConnectRetryCounter, release resources"
170
+ }
171
+ ]
172
+ }
PSMs/DCCP_state_machine.json ADDED
@@ -0,0 +1,169 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "CLOSED",
4
+ "LISTEN",
5
+ "REQUEST",
6
+ "RESPOND",
7
+ "PARTOPEN",
8
+ "OPEN",
9
+ "CLOSEREQ",
10
+ "CLOSING",
11
+ "TIMEWAIT"
12
+ ],
13
+ "initial_state": "CLOSED",
14
+ "final_states": [
15
+ "CLOSED"
16
+ ],
17
+ "transitions": [
18
+ {
19
+ "from": "CLOSED",
20
+ "event": "active open",
21
+ "action": "Send REQUEST",
22
+ "to": "REQUEST"
23
+ },
24
+ {
25
+ "from": "CLOSED",
26
+ "event": "passive open",
27
+ "action": "",
28
+ "to": "LISTEN"
29
+ },
30
+ {
31
+ "from": "LISTEN",
32
+ "event": "receive REQUEST",
33
+ "action": "send RESPONSE",
34
+ "to": "RESPOND"
35
+ },
36
+ {
37
+ "from": "LISTEN",
38
+ "event": "timeout",
39
+ "action": "timeout",
40
+ "to": "CLOSED"
41
+ },
42
+ {
43
+ "from": "RESPOND",
44
+ "event": "receive ACK or DATAACK",
45
+ "action": "",
46
+ "to": "OPEN"
47
+ },
48
+ {
49
+ "from": "RESPOND",
50
+ "event": "timeout",
51
+ "action": "timeout",
52
+ "to": "CLOSED"
53
+ },
54
+ {
55
+ "from": "RESPOND",
56
+ "event": "",
57
+ "action": "send DATA",
58
+ "to": "RESPOND"
59
+ },
60
+ {
61
+ "from": "REQUEST",
62
+ "event": "receive RESPONSE",
63
+ "action": "send ACK",
64
+ "to": "PARTOPEN"
65
+ },
66
+ {
67
+ "from": "REQUEST",
68
+ "event": "receive RESET?",
69
+ "action": "reset DCCP",
70
+ "to": "CLOSED"
71
+ },
72
+ {
73
+ "from": "REQUEST",
74
+ "event": "timeout",
75
+ "action": "timeout",
76
+ "to": "CLOSED"
77
+ },
78
+ {
79
+ "from": "PARTOPEN",
80
+ "event": "receive packet",
81
+ "action": "send ACK!",
82
+ "to": "OPEN"
83
+ },
84
+ {
85
+ "from": "PARTOPEN",
86
+ "event": "receive CLOSEREQ?",
87
+ "action": "send CLOSE!",
88
+ "to": "CLOSING"
89
+ },
90
+ {
91
+ "from": "PARTOPEN",
92
+ "event": "active close",
93
+ "action": "",
94
+ "to": "CLOSING"
95
+ },
96
+ {
97
+ "from": "PARTOPEN",
98
+ "event": "",
99
+ "action": "send DATAACK",
100
+ "to": "PARTOPEN"
101
+ },
102
+ {
103
+ "from": "PARTOPEN",
104
+ "event": "timeout",
105
+ "action": "timeout",
106
+ "to": "CLOSED"
107
+ },
108
+ {
109
+ "from": "PARTOPEN",
110
+ "event": "receive RESET",
111
+ "action": "send RESET",
112
+ "to": "CLOSED"
113
+ },
114
+ {
115
+ "from": "OPEN",
116
+ "event": "receive data_ack",
117
+ "action": "",
118
+ "to": "OPEN"
119
+ },
120
+ {
121
+ "from": "OPEN",
122
+ "event": "active close",
123
+ "action": "send CLOSEREQ",
124
+ "to": "CLOSEREQ"
125
+ },
126
+ {
127
+ "from": "OPEN",
128
+ "event": "active close",
129
+ "action": "send close",
130
+ "to": "CLOSING"
131
+ },
132
+ {
133
+ "from": "OPEN",
134
+ "event": "receive closeReq",
135
+ "action": "send close",
136
+ "to": "CLOSING"
137
+ },
138
+ {
139
+ "from": "OPEN",
140
+ "event": "receive CLOSE",
141
+ "action": "send RESET",
142
+ "to": "CLOSED"
143
+ },
144
+ {
145
+ "from": "CLOSEREQ",
146
+ "event": "receive CLOSE",
147
+ "action": "send RESET?",
148
+ "to": "CLOSED"
149
+ },
150
+ {
151
+ "from": "CLOSING",
152
+ "event": "receive Reset",
153
+ "action": "",
154
+ "to": "TIMEWAIT"
155
+ },
156
+ {
157
+ "from": "CLOSING",
158
+ "event": "receive Close",
159
+ "action": "Send RESET?",
160
+ "to": "CLOSED"
161
+ },
162
+ {
163
+ "from": "TIMEWAIT",
164
+ "event": "receive Close",
165
+ "action": "send RESET",
166
+ "to": "CLOSED"
167
+ }
168
+ ]
169
+ }
PSMs/DHCP_state_machine.json ADDED
@@ -0,0 +1,130 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "INIT",
4
+ "INIT-REBOOT",
5
+ "REBOOTING",
6
+ "SELECTING",
7
+ "REQUESTING",
8
+ "BOUND",
9
+ "RENEWING",
10
+ "REBINDING"
11
+ ],
12
+ "initial_state": "INIT",
13
+ "final_states": [],
14
+ "transitions": [
15
+ {
16
+ "from": "INIT",
17
+ "event": "",
18
+ "action": "Send DHCPDISCOVER",
19
+ "to": "SELECTING"
20
+ },
21
+ {
22
+ "from": "SELECTING",
23
+ "event": "Select offer",
24
+ "action": "Send DHCPREQUEST",
25
+ "to": "REQUESTING"
26
+ },
27
+ {
28
+ "from": "SELECTING",
29
+ "event": "receive DHCPOFFER",
30
+ "action": "Collect replies",
31
+ "to": "SELECTING"
32
+ },
33
+ {
34
+ "from": "REQUESTING",
35
+ "event": "receive DHCPACK",
36
+ "action": "Record lease Set timers",
37
+ "to": "BOUND"
38
+ },
39
+ {
40
+ "from": "REQUESTING",
41
+ "event": "receive DHCPACK (not accept)",
42
+ "action": "Send DHCPDECLINE",
43
+ "to": "INIT"
44
+ },
45
+ {
46
+ "from": "REQUESTING",
47
+ "event": "receive DHCPNAK",
48
+ "action": "Discard offer",
49
+ "to": "INIT"
50
+ },
51
+ {
52
+ "from": "REQUESTING",
53
+ "event": "receive DHCPOFFER",
54
+ "action": "Discard",
55
+ "to": "REQUESTING"
56
+ },
57
+ {
58
+ "from": "INIT-REBOOT",
59
+ "event": "",
60
+ "action": "Send DHCPREQUEST",
61
+ "to": "REBOOTING"
62
+ },
63
+ {
64
+ "from": "REBOOTING",
65
+ "event": "receive DHCPACK",
66
+ "action": "Record lease Set timers T1 T2",
67
+ "to": "BOUND"
68
+ },
69
+ {
70
+ "from": "REBOOTING",
71
+ "event": "receive DHCPNAK",
72
+ "action": "Restart",
73
+ "to": "INIT"
74
+ },
75
+ {
76
+ "from": "BOUND",
77
+ "event": "timer T1 expires",
78
+ "action": "Send DHCPREQUEST",
79
+ "to": "RENEWING"
80
+ },
81
+ {
82
+ "from": "BOUND",
83
+ "event": "receive DHCPOFFER",
84
+ "action": "Discard",
85
+ "to": "BOUND"
86
+ },
87
+ {
88
+ "from": "BOUND",
89
+ "event": "receive DHCPACK",
90
+ "action": "Discard",
91
+ "to": "BOUND"
92
+ },
93
+ {
94
+ "from": "BOUND",
95
+ "event": "receive DHCPNAK",
96
+ "action": "Discard",
97
+ "to": "BOUND"
98
+ },
99
+ {
100
+ "from": "RENEWING",
101
+ "event": "Receive DHCPACK",
102
+ "action": "Record lease; Set timers T1, T2",
103
+ "to": "BOUND"
104
+ },
105
+ {
106
+ "from": "RENEWING",
107
+ "event": "timer T2 expires",
108
+ "action": "send Broadcast DHCPREQUEST",
109
+ "to": "REBINDING"
110
+ },
111
+ {
112
+ "from": "RENEWING",
113
+ "event": "receive DHCPNAK",
114
+ "action": "Halt network",
115
+ "to": "INIT"
116
+ },
117
+ {
118
+ "from": "REBINDING",
119
+ "event": "receive DHCPACK",
120
+ "action": "Record lease; Set timers T1, T2",
121
+ "to": "BOUND"
122
+ },
123
+ {
124
+ "from": "REBINDING",
125
+ "event": "receive DHCPNAK",
126
+ "action": "Halt network",
127
+ "to": "INIT"
128
+ }
129
+ ]
130
+ }
PSMs/FTP_state_machine.json ADDED
@@ -0,0 +1,164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Disconnected",
4
+ "Connected",
5
+ "Authenticated",
6
+ "Need_Account",
7
+ "Accounted",
8
+ "Data_Connection_Ready",
9
+ "Data_Transfer",
10
+ "Restart_Point_Set",
11
+ "Awaiting_RNTO",
12
+ "Logged_Out"
13
+ ],
14
+ "initial_state": "Disconnected",
15
+ "final_states": [
16
+ "Logged_Out"
17
+ ],
18
+ "transitions": [
19
+ {
20
+ "from": "Disconnected",
21
+ "event": "receive USER",
22
+ "action": "reply 331",
23
+ "to": "Connected"
24
+ },
25
+ {
26
+ "from": "Connected",
27
+ "event": "receive PASS",
28
+ "action": "reply 230",
29
+ "to": "Authenticated"
30
+ },
31
+ {
32
+ "from": "Connected",
33
+ "event": "receive PASS",
34
+ "action": "reply 530",
35
+ "to": "Disconnected"
36
+ },
37
+ {
38
+ "from": "Connected",
39
+ "event": "receive PASS",
40
+ "action": "reply 332",
41
+ "to": "Need_Account"
42
+ },
43
+ {
44
+ "from": "Need_Account",
45
+ "event": "receive ACCT",
46
+ "action": "reply 230",
47
+ "to": "Accounted"
48
+ },
49
+ {
50
+ "from": "Need_Account",
51
+ "event": "receive ACCT",
52
+ "action": "reply 332",
53
+ "to": "Need_Account"
54
+ },
55
+ {
56
+ "from": "Authenticated",
57
+ "event": "receive ACCT",
58
+ "action": "reply 230",
59
+ "to": "Accounted"
60
+ },
61
+ {
62
+ "from": "Authenticated",
63
+ "event": "receive ACCT",
64
+ "action": "reply 332",
65
+ "to": "Authenticated"
66
+ },
67
+ {
68
+ "from": "Authenticated",
69
+ "event": "receive PASV",
70
+ "action": "reply 227",
71
+ "to": "Data_Connection_Ready"
72
+ },
73
+ {
74
+ "from": "Authenticated",
75
+ "event": "receive PORT",
76
+ "action": "reply 200",
77
+ "to": "Data_Connection_Ready"
78
+ },
79
+ {
80
+ "from": "Data_Connection_Ready",
81
+ "event": "receive RETR",
82
+ "action": "reply 150",
83
+ "to": "Data_Transfer"
84
+ },
85
+ {
86
+ "from": "Data_Connection_Ready",
87
+ "event": "receive STOR",
88
+ "action": "reply 150",
89
+ "to": "Data_Transfer"
90
+ },
91
+ {
92
+ "from": "Data_Connection_Ready",
93
+ "event": "receive APPE",
94
+ "action": "reply 150",
95
+ "to": "Data_Transfer"
96
+ },
97
+ {
98
+ "from": "Data_Transfer",
99
+ "event": "Transfer Complete",
100
+ "action": "reply 226",
101
+ "to": "Authenticated"
102
+ },
103
+ {
104
+ "from": "Data_Transfer",
105
+ "event": "receive QUIT",
106
+ "action": "reply 221",
107
+ "to": "Logged_Out"
108
+ },
109
+ {
110
+ "from": "Authenticated",
111
+ "event": "receive REST",
112
+ "action": "reply 350",
113
+ "to": "Restart_Point_Set"
114
+ },
115
+ {
116
+ "from": "Restart_Point_Set",
117
+ "event": "receive RETR",
118
+ "action": "reply 150",
119
+ "to": "Data_Transfer"
120
+ },
121
+ {
122
+ "from": "Restart_Point_Set",
123
+ "event": "receive STOR",
124
+ "action": "reply 150",
125
+ "to": "Data_Transfer"
126
+ },
127
+ {
128
+ "from": "Restart_Point_Set",
129
+ "event": "receive APPE",
130
+ "action": "reply 150",
131
+ "to": "Data_Transfer"
132
+ },
133
+ {
134
+ "from": "Authenticated",
135
+ "event": "receive RNFR",
136
+ "action": "reply 350",
137
+ "to": "Awaiting_RNTO"
138
+ },
139
+ {
140
+ "from": "Awaiting_RNTO",
141
+ "event": "receive RNTO",
142
+ "action": "reply 250",
143
+ "to": "Authenticated"
144
+ },
145
+ {
146
+ "from": "Authenticated",
147
+ "event": "receive QUIT",
148
+ "action": "reply 221",
149
+ "to": "Logged_Out"
150
+ },
151
+ {
152
+ "from": "Accounted",
153
+ "event": "receive QUIT",
154
+ "action": "reply 221",
155
+ "to": "Logged_Out"
156
+ },
157
+ {
158
+ "from": "Restart_Point_Set",
159
+ "event": "receive QUIT",
160
+ "action": "reply 221",
161
+ "to": "Logged_Out"
162
+ }
163
+ ]
164
+ }
PSMs/IMAP_state_machine.json ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Connection_Established_Server_Greeting",
4
+ "Not_Authenticated",
5
+ "Authenticated",
6
+ "Selected",
7
+ "Logout"
8
+ ],
9
+ "initial_state": "Connection_Established_Server_Greeting",
10
+ "final_states": [
11
+ "Logout"
12
+ ],
13
+ "transitions": [
14
+ {
15
+ "from": "Connection_Established_Server_Greeting",
16
+ "event": "connect without pre-authentication",
17
+ "action": "Send OK greeting",
18
+ "to": "Not_Authenticated"
19
+ },
20
+ {
21
+ "from": "Connection_Established_Server_Greeting",
22
+ "event": "Connects with pre-authentication",
23
+ "action": "Send PREAUTH greeting",
24
+ "to": "Authenticated"
25
+ },
26
+ {
27
+ "from": "Connection_Established_Server_Greeting",
28
+ "event": "Connection reject",
29
+ "action": "Send BYE greeting",
30
+ "to": "Logout"
31
+ },
32
+ {
33
+ "from": "Not_Authenticated",
34
+ "event": "Sends LOGIN or AUTHENTICATE command",
35
+ "action": "Sends LOGIN or AUTHENTICATE command",
36
+ "to": "Authenticated"
37
+ },
38
+ {
39
+ "from": "Not_Authenticated",
40
+ "event": "Sends LOGOUT or server shutdown",
41
+ "action": "Close connection",
42
+ "to": "Logout"
43
+ },
44
+ {
45
+ "from": "Authenticated",
46
+ "event": "Sends SELECT or EXAMINE command",
47
+ "action": "Sends SELECT or EXAMINE command",
48
+ "to": "Selected"
49
+ },
50
+ {
51
+ "from": "Authenticated",
52
+ "event": "Sends LOGOUT or server shutdown",
53
+ "action": "Close connection",
54
+ "to": "Logout"
55
+ },
56
+ {
57
+ "from": "Authenticated",
58
+ "event": "Send requests mailbox listing",
59
+ "action": "List mailbox",
60
+ "to": "Authenticated"
61
+ },
62
+ {
63
+ "from": "Selected",
64
+ "event": "Sends CLOSE, UNSELECT, or SELECT/EXAMINE fails",
65
+ "action": "Sends CLOSE, UNSELECT, or SELECT/EXAMINE fails",
66
+ "to": "Authenticated"
67
+ },
68
+ {
69
+ "from": "Selected",
70
+ "event": "Client manages messages",
71
+ "action": "Read/write/delete messages",
72
+ "to": "Selected"
73
+ },
74
+ {
75
+ "from": "Selected",
76
+ "event": "Sends LOGOUT or server shutdown",
77
+ "action": "Close connection",
78
+ "to": "Logout"
79
+ }
80
+ ]
81
+ }
PSMs/MQTT_state_machine.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Disconnected",
4
+ "Waiting for Token",
5
+ "Token Requested",
6
+ "Token Received",
7
+ "Awaiting CONNACK",
8
+ "Authenticating",
9
+ "Token Validating",
10
+ "Connected",
11
+ "Session Resumed",
12
+ "Unauthorized",
13
+ "Reauthenticating",
14
+ "Session Terminated"
15
+ ],
16
+ "initial_state": "Disconnected",
17
+ "final_states": ["Session Terminated"],
18
+ "transitions": [
19
+ {
20
+ "from": "Disconnected",
21
+ "to": "Waiting for Token",
22
+ "event": "Client initiates connection",
23
+ "action": "Start TLS handshake"
24
+ },
25
+ {
26
+ "from": "Waiting for Token",
27
+ "to": "Token Requested",
28
+ "event": "Request token from AS",
29
+ "action": "Send token request (HTTPS/PSK/RPK)"
30
+ },
31
+ {
32
+ "from": "Token Requested",
33
+ "to": "Token Received",
34
+ "event": "Token received from AS",
35
+ "action": "Store JWT/CWT token"
36
+ },
37
+ {
38
+ "from": "Token Requested",
39
+ "to": "Disconnected",
40
+ "event": "Token request timeout/error",
41
+ "action": "Retry or terminate"
42
+ },
43
+ {
44
+ "from": "Token Received",
45
+ "to": "Authenticating",
46
+ "event": "Send CONNECT/AUTH packet",
47
+ "action": "Include token in 'authz-info' topic"
48
+ },
49
+ {
50
+ "from": "Authenticating",
51
+ "to": "Awaiting CONNACK",
52
+ "event": "Token uploaded",
53
+ "action": "Wait for broker response"
54
+ },
55
+ {
56
+ "from": "Awaiting CONNACK",
57
+ "to": "Token Validating",
58
+ "event": "Broker processes token",
59
+ "action": "Validate token (introspection)"
60
+ },
61
+ {
62
+ "from": "Token Validating",
63
+ "to": "Connected",
64
+ "event": "Token valid",
65
+ "action": "Send CONNACK(Success)"
66
+ },
67
+ {
68
+ "from": "Token Validating",
69
+ "to": "Unauthorized",
70
+ "event": "Token invalid/expired",
71
+ "action": "Send CONNACK(Not Authorized)"
72
+ },
73
+ {
74
+ "from": "Connected",
75
+ "to": "Session Resumed",
76
+ "event": "CONNECT(CleanSession=0)",
77
+ "action": "Resume prior session"
78
+ },
79
+ {
80
+ "from": "Session Resumed",
81
+ "to": "Connected",
82
+ "event": "Session validated",
83
+ "action": "Send CONNACK(Session Present=1)"
84
+ },
85
+ {
86
+ "from": "Session Resumed",
87
+ "to": "Session Terminated",
88
+ "event": "Session invalid",
89
+ "action": "Send DISCONNECT"
90
+ },
91
+ {
92
+ "from": "Connected",
93
+ "to": "Reauthenticating",
94
+ "event": "Token expired",
95
+ "action": "Send AUTH packet"
96
+ },
97
+ {
98
+ "from": "Reauthenticating",
99
+ "to": "Token Validating",
100
+ "event": "Broker validates new token",
101
+ "action": "Process AUTH/CONNACK"
102
+ },
103
+ {
104
+ "from": "Reauthenticating",
105
+ "to": "Unauthorized",
106
+ "event": "Reauthentication failed",
107
+ "action": "Send DISCONNECT"
108
+ },
109
+ {
110
+ "from": "Connected",
111
+ "to": "Session Terminated",
112
+ "event": "DISCONNECT received/sent",
113
+ "action": "Cleanup session"
114
+ },
115
+ {
116
+ "from": "Unauthorized",
117
+ "to": "Session Terminated",
118
+ "event": "DISCONNECT sent",
119
+ "action": "Close connection"
120
+ }
121
+ ]
122
+ }
PSMs/NNTP_state_machine.json ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Initial_Connection",
4
+ "Service_Available",
5
+ "Connection_Closed",
6
+ "Posting_Allowed",
7
+ "Posting_Prohibited",
8
+ "Group_Selected",
9
+ "Article_Selected",
10
+ "Reading_Headers",
11
+ "Reading_Body",
12
+ "Posting_Article"
13
+ ],
14
+ "initial_state": "Initial_Connection",
15
+ "final_states": [
16
+ "Connection_Closed"
17
+ ],
18
+ "transitions": [
19
+ {
20
+ "from": "Initial_Connection",
21
+ "event": "Receive 200",
22
+ "action": "Set service available",
23
+ "to": "Service_Available"
24
+ },
25
+ {
26
+ "from": "Initial_Connection",
27
+ "event": "Receive 201",
28
+ "action": "Set posting prohibited",
29
+ "to": "Posting_Prohibited"
30
+ },
31
+ {
32
+ "from": "Initial_Connection",
33
+ "event": "Receive 502",
34
+ "action": "Close connection",
35
+ "to": "Connection_Closed"
36
+ },
37
+ {
38
+ "from": "Initial_Connection",
39
+ "event": "Receive 400",
40
+ "action": "Close connection",
41
+ "to": "Connection_Closed"
42
+ },
43
+ {
44
+ "from": "Service_Available",
45
+ "event": "MODE READER",
46
+ "action": "Switch to reader mode",
47
+ "to": "Posting_Allowed"
48
+ },
49
+ {
50
+ "from": "Posting_Prohibited",
51
+ "event": "MODE READER",
52
+ "action": "Switch to reader mode",
53
+ "to": "Posting_Allowed"
54
+ },
55
+ {
56
+ "from": "Posting_Allowed",
57
+ "event": "GROUP <group_name>",
58
+ "action": "Select newsgroup",
59
+ "to": "Group_Selected"
60
+ },
61
+ {
62
+ "from": "Group_Selected",
63
+ "event": "ARTICLE <article_id>",
64
+ "action": "Fetch article",
65
+ "to": "Article_Selected"
66
+ },
67
+ {
68
+ "from": "Group_Selected",
69
+ "event": "POST",
70
+ "action": "Start article posting",
71
+ "to": "Posting_Article"
72
+ },
73
+ {
74
+ "from": "Article_Selected",
75
+ "event": "HEAD <article_id>",
76
+ "action": "Read headers",
77
+ "to": "Reading_Headers"
78
+ },
79
+ {
80
+ "from": "Article_Selected",
81
+ "event": "BODY <article_id>",
82
+ "action": "Read body",
83
+ "to": "Reading_Body"
84
+ },
85
+ {
86
+ "from": "Reading_Headers",
87
+ "event": "QUIT",
88
+ "action": "Close connection",
89
+ "to": "Connection_Closed"
90
+ },
91
+ {
92
+ "from": "Reading_Body",
93
+ "event": "QUIT",
94
+ "action": "Close connection",
95
+ "to": "Connection_Closed"
96
+ },
97
+ {
98
+ "from": "Posting_Article",
99
+ "event": "Receive 240",
100
+ "action": "Article posted successfully",
101
+ "to": "Group_Selected"
102
+ },
103
+ {
104
+ "from": "Posting_Article",
105
+ "event": "Receive 441",
106
+ "action": "Posting failed",
107
+ "to": "Group_Selected"
108
+ },
109
+ {
110
+ "from": "Group_Selected",
111
+ "event": "QUIT",
112
+ "action": "Close connection",
113
+ "to": "Connection_Closed"
114
+ }
115
+ ]
116
+ }
PSMs/POP3_state_machine.json ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "AUTHORIZATION",
4
+ "TRANSACTION",
5
+ "UPDATE"
6
+ ],
7
+ "initial_state": "AUTHORIZATION",
8
+ "final_states": [
9
+ "UPDATE"
10
+ ],
11
+ "transitions": [
12
+ {
13
+ "from": "AUTHORIZATION",
14
+ "event": "send greeting",
15
+ "action": "reply +OK POP3 server ready",
16
+ "to": "AUTHORIZATION"
17
+ },
18
+ {
19
+ "from": "AUTHORIZATION",
20
+ "event": "receive USER",
21
+ "action": "reply request password",
22
+ "to": "AUTHORIZATION"
23
+ },
24
+ {
25
+ "from": "AUTHORIZATION",
26
+ "event": "receive PASS",
27
+ "action": "cond check password",
28
+ "to": "AUTHORIZATION"
29
+ },
30
+ {
31
+ "from": "AUTHORIZATION",
32
+ "event": "cond valid USER/PASS",
33
+ "action": "set authenticated true",
34
+ "to": "TRANSACTION"
35
+ },
36
+ {
37
+ "from": "AUTHORIZATION",
38
+ "event": "receive APOP",
39
+ "action": "cond check digest",
40
+ "to": "AUTHORIZATION"
41
+ },
42
+ {
43
+ "from": "AUTHORIZATION",
44
+ "event": "cond valid APOP",
45
+ "action": "set authenticated true",
46
+ "to": "TRANSACTION"
47
+ },
48
+ {
49
+ "from": "AUTHORIZATION",
50
+ "event": "cond open maildrop failed",
51
+ "action": "reply -ERR and release lock",
52
+ "to": "AUTHORIZATION"
53
+ },
54
+ {
55
+ "from": "AUTHORIZATION",
56
+ "event": "receive QUIT",
57
+ "action": "reply +OK and close TCP",
58
+ "to": "UPDATE"
59
+ },
60
+ {
61
+ "from": "TRANSACTION",
62
+ "event": "receive STAT",
63
+ "action": "reply message count size",
64
+ "to": "TRANSACTION"
65
+ },
66
+ {
67
+ "from": "TRANSACTION",
68
+ "event": "receive LIST",
69
+ "action": "reply scan listing",
70
+ "to": "TRANSACTION"
71
+ },
72
+ {
73
+ "from": "TRANSACTION",
74
+ "event": "receive RETR",
75
+ "action": "reply full message",
76
+ "to": "TRANSACTION"
77
+ },
78
+ {
79
+ "from": "TRANSACTION",
80
+ "event": "receive DELE",
81
+ "action": "set message deleted",
82
+ "to": "TRANSACTION"
83
+ },
84
+ {
85
+ "from": "TRANSACTION",
86
+ "event": "receive NOOP",
87
+ "action": "reply OK",
88
+ "to": "TRANSACTION"
89
+ },
90
+ {
91
+ "from": "TRANSACTION",
92
+ "event": "receive RSET",
93
+ "action": "reset deleted flags",
94
+ "to": "TRANSACTION"
95
+ },
96
+ {
97
+ "from": "TRANSACTION",
98
+ "event": "receive QUIT",
99
+ "action": "set session closing",
100
+ "to": "UPDATE"
101
+ },
102
+ {
103
+ "from": "UPDATE",
104
+ "event": "cond deleted messages exist",
105
+ "action": "delete marked messages",
106
+ "to": "UPDATE"
107
+ },
108
+ {
109
+ "from": "UPDATE",
110
+ "event": "cond cleanup complete",
111
+ "action": "release lock and close TCP",
112
+ "to": "UPDATE"
113
+ },
114
+ {
115
+ "from": "UPDATE",
116
+ "event": "timeout 5s",
117
+ "action": "close TCP connection",
118
+ "to": "UPDATE"
119
+ }
120
+ ]
121
+ }
122
+
PSMs/PPP_state_machine.json ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Initial",
4
+ "Starting",
5
+ "Closed",
6
+ "Stopped",
7
+ "Closing",
8
+ "Stopping",
9
+ "ReqSent",
10
+ "AckRcvd",
11
+ "AckSent",
12
+ "Opened"
13
+ ],
14
+ "initial_state": "Initial",
15
+ "final_states": [
16
+ "Initial"
17
+ ],
18
+ "transitions": [
19
+ {
20
+ "from": "Initial",
21
+ "to": "Closed",
22
+ "event": "receive lower layer up (Up)",
23
+ "action": "send This-Layer-Up (tlu)"
24
+ },
25
+ {
26
+ "from": "Initial",
27
+ "to": "Starting",
28
+ "event": "receive administrative Open (Open)",
29
+ "action": "send This-Layer-Started (tls)"
30
+ },
31
+ {
32
+ "from": "Starting",
33
+ "to": "ReqSent",
34
+ "event": "receive lower layer up (Up)",
35
+ "action": "send Initialize-Restart-Count (irc), send Configure-Request (scr)"
36
+ },
37
+ {
38
+ "from": "Closed",
39
+ "to": "Initial",
40
+ "event": "receive lower layer down (Down)",
41
+ "action": "send This-Layer-Finished (tlf)"
42
+ },
43
+ {
44
+ "from": "Closed",
45
+ "to": "ReqSent",
46
+ "event": "receive administrative Open (Open)",
47
+ "action": "send Initialize-Restart-Count (irc), send Configure-Request (scr)"
48
+ },
49
+ {
50
+ "from": "Closed",
51
+ "to": "Closed",
52
+ "event": "receive administrative Close (Close)",
53
+ "action": ""
54
+ },
55
+ {
56
+ "from": "Stopped",
57
+ "to": "Starting",
58
+ "event": "receive lower layer up (Up)",
59
+ "action": "send This-Layer-Started (tls)"
60
+ },
61
+ {
62
+ "from": "Stopped",
63
+ "to": "Closed",
64
+ "event": "receive administrative Close (Close)",
65
+ "action": "send This-Layer-Finished (tlf)"
66
+ },
67
+ {
68
+ "from": "ReqSent",
69
+ "to": "Closing",
70
+ "event": "receive administrative Close (Close)",
71
+ "action": "send Terminate-Request (str), send Initialize-Restart-Count (irc)"
72
+ },
73
+ {
74
+ "from": "ReqSent",
75
+ "to": "Stopping",
76
+ "event": "receive Terminate-Request (RTR)",
77
+ "action": "send Terminate-Request (str)"
78
+ },
79
+ {
80
+ "from": "ReqSent",
81
+ "to": "ReqSent",
82
+ "event": "timeout counter > 0 (TO+)",
83
+ "action": "send Configure-Request (scr)"
84
+ },
85
+ {
86
+ "from": "ReqSent",
87
+ "to": "Stopped",
88
+ "event": "timeout counter expired (TO-)",
89
+ "action": "send This-Layer-Finished (tlf)"
90
+ },
91
+ {
92
+ "from": "ReqSent",
93
+ "to": "AckRcvd",
94
+ "event": "receive Configure-Ack (RCA)",
95
+ "action": "send Initialize-Restart-Count (irc)"
96
+ },
97
+ {
98
+ "from": "ReqSent",
99
+ "to": "AckSent",
100
+ "event": "receive Configure-Request (RCR+)",
101
+ "action": "send Configure-Ack (sca)"
102
+ },
103
+ {
104
+ "from": "AckRcvd",
105
+ "to": "Closing",
106
+ "event": "receive administrative Close (Close)",
107
+ "action": "send Terminate-Request (str), send Initialize-Restart-Count (irc)"
108
+ },
109
+ {
110
+ "from": "AckRcvd",
111
+ "to": "Opened",
112
+ "event": "receive Configure-Request (RCR+)",
113
+ "action": "send Configure-Ack (sca), send This-Layer-Up (tlu)"
114
+ },
115
+ {
116
+ "from": "AckRcvd",
117
+ "to": "ReqSent",
118
+ "event": "receive Configure-Nak/Rej (RCN)",
119
+ "action": "send Configure-Request (scr)"
120
+ },
121
+ {
122
+ "from": "AckSent",
123
+ "to": "Closing",
124
+ "event": "receive administrative Close (Close)",
125
+ "action": "send Terminate-Request (str), send Initialize-Restart-Count (irc)"
126
+ },
127
+ {
128
+ "from": "AckSent",
129
+ "to": "Opened",
130
+ "event": "receive Configure-Ack (RCA)",
131
+ "action": "send This-Layer-Up (tlu)"
132
+ },
133
+ {
134
+ "from": "AckSent",
135
+ "to": "ReqSent",
136
+ "event": "receive Configure-Request (RCR-)",
137
+ "action": "send Configure-Request (scr)"
138
+ },
139
+ {
140
+ "from": "Opened",
141
+ "to": "Closing",
142
+ "event": "receive administrative Close (Close)",
143
+ "action": "send Terminate-Request (str), send Initialize-Restart-Count (irc)"
144
+ },
145
+ {
146
+ "from": "Opened",
147
+ "to": "Stopping",
148
+ "event": "receive Terminate-Request (RTR)",
149
+ "action": "send Terminate-Request (str)"
150
+ },
151
+ {
152
+ "from": "Stopping",
153
+ "to": "Stopped",
154
+ "event": "receive Terminate-Ack (RTA)",
155
+ "action": "send This-Layer-Finished (tlf)"
156
+ },
157
+ {
158
+ "from": "Stopping",
159
+ "to": "Stopping",
160
+ "event": "timeout counter > 0 (TO+)",
161
+ "action": "send Terminate-Request (str)"
162
+ },
163
+ {
164
+ "from": "Stopping",
165
+ "to": "Stopped",
166
+ "event": "timeout counter expired (TO-)",
167
+ "action": "send This-Layer-Finished (tlf)"
168
+ },
169
+ {
170
+ "from": "Closing",
171
+ "to": "Closed",
172
+ "event": "receive Terminate-Ack (RTA)",
173
+ "action": "send This-Layer-Finished (tlf)"
174
+ },
175
+ {
176
+ "from": "Closing",
177
+ "to": "Closed",
178
+ "event": "timeout counter expired (TO-)",
179
+ "action": "send This-Layer-Finished (tlf)"
180
+ }
181
+ ]
182
+ }
PSMs/PPTP_state_machine.json ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Idle",
4
+ "Wait Control Reply",
5
+ "Collision Handling",
6
+ "Established",
7
+ "Wait Stop Reply",
8
+ "Wait Incoming Reply",
9
+ "Wait Outgoing Reply",
10
+ "Wait Connect",
11
+ "Wait Disconnect"
12
+ ],
13
+ "initial_state": "Idle",
14
+ "final_states": [
15
+ "Idle"
16
+ ],
17
+ "transitions": [
18
+ {
19
+ "from": "Established",
20
+ "to": "Wait Disconnect",
21
+ "event": "Local Terminate",
22
+ "action": "Send Call Clear Request"
23
+ },
24
+ {
25
+ "from": "Wait Disconnect",
26
+ "to": "Idle",
27
+ "event": "Timeout (60s)",
28
+ "action": "Close TCP and release resources"
29
+ },
30
+ {
31
+ "from": "Idle",
32
+ "to": "Wait Control Reply",
33
+ "event": "TCP Open Indication",
34
+ "action": "Send Start Control Connection Request"
35
+ },
36
+ {
37
+ "from": "Wait Control Reply",
38
+ "to": "Collision Handling",
39
+ "event": "Collision Detected",
40
+ "action": "Handle collision (higher IP wins)"
41
+ },
42
+ {
43
+ "from": "Collision Handling",
44
+ "to": "Wait Control Reply",
45
+ "event": "TCP Termination from loser",
46
+ "action": "Accept winner request"
47
+ },
48
+ {
49
+ "from": "Collision Handling",
50
+ "to": "Established",
51
+ "event": "Receive Start Control Connection Reply (Version OK)",
52
+ "action": "Accept winner connection"
53
+ },
54
+ {
55
+ "from": "Wait Control Reply",
56
+ "to": "Established",
57
+ "event": "Receive Start Control Connection Reply (Version OK)",
58
+ "action": "Establish control connection"
59
+ },
60
+ {
61
+ "from": "Wait Control Reply",
62
+ "to": "Wait Stop Reply",
63
+ "event": "Receive Start Control Connection Reply (Version Not OK)",
64
+ "action": "Send Stop Control Connection Request"
65
+ },
66
+ {
67
+ "from": "Wait Control Reply",
68
+ "to": "Idle",
69
+ "event": "Timeout (60s)",
70
+ "action": "Close TCP"
71
+ },
72
+ {
73
+ "from": "Established",
74
+ "to": "Wait Stop Reply",
75
+ "event": "Local Terminate",
76
+ "action": "Send Stop Control Connection Request"
77
+ },
78
+ {
79
+ "from": "Established",
80
+ "to": "Wait Stop Reply",
81
+ "event": "Receive Stop Control Connection Request",
82
+ "action": "Send Stop Control Connection Reply"
83
+ },
84
+ {
85
+ "from": "Wait Stop Reply",
86
+ "to": "Idle",
87
+ "event": "Receive Stop Control Connection Reply",
88
+ "action": "Close TCP, return to Idle"
89
+ },
90
+ {
91
+ "from": "Idle",
92
+ "to": "Wait Incoming Reply",
93
+ "event": "Receive Incoming Call Request",
94
+ "action": "Send Incoming Call Reply"
95
+ },
96
+ {
97
+ "from": "Wait Incoming Reply",
98
+ "to": "Wait Connect",
99
+ "event": "Receive Incoming Call Reply (Accept)",
100
+ "action": "Wait for Incoming Call Connected"
101
+ },
102
+ {
103
+ "from": "Wait Connect",
104
+ "to": "Established",
105
+ "event": "Receive Incoming Call Connected",
106
+ "action": "Confirm session establishment"
107
+ },
108
+ {
109
+ "from": "Wait Incoming Reply",
110
+ "to": "Idle",
111
+ "event": "Receive Incoming Call Reply (Reject)",
112
+ "action": "Return to Idle"
113
+ },
114
+ {
115
+ "from": "Idle",
116
+ "to": "Wait Outgoing Reply",
117
+ "event": "Send Outgoing Call Request",
118
+ "action": "Wait for PAC response"
119
+ },
120
+ {
121
+ "from": "Wait Outgoing Reply",
122
+ "to": "Established",
123
+ "event": "Receive Outgoing Call Reply (No Error)",
124
+ "action": "Establish call"
125
+ },
126
+ {
127
+ "from": "Wait Outgoing Reply",
128
+ "to": "Idle",
129
+ "event": "Receive Outgoing Call Reply (Error)",
130
+ "action": "Return to Idle"
131
+ }
132
+ ]
133
+ }
PSMs/RTSP_state_machine.json ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": ["Init", "Ready", "Play"],
3
+ "initial_state": "Init",
4
+ "final_states": [],
5
+ "transitions": [
6
+ {
7
+ "from": "Init",
8
+ "event": "cond default",
9
+ "action": "send SETUP; reply NRM=1, RP=0.0",
10
+ "to": "Ready"
11
+ },
12
+ {
13
+ "from": "Init",
14
+ "event": "cond Needs Redirect",
15
+ "action": "send SETUP; reply 3rr Redirect",
16
+ "to": "Init"
17
+ },
18
+ {
19
+ "from": "Init",
20
+ "event": "cond No Session hdr",
21
+ "action": "send S -> C: REDIRECT; reply Terminate all SES",
22
+ "to": "Init"
23
+ },
24
+ {
25
+ "from": "Ready",
26
+ "event": "cond New URI",
27
+ "action": "send SETUP; reply NRM +=1",
28
+ "to": "Ready"
29
+ },
30
+ {
31
+ "from": "Ready",
32
+ "event": "cond URI Setup prior",
33
+ "action": "send SETUP; reply Change transport param",
34
+ "to": "Ready"
35
+ },
36
+ {
37
+ "from": "Ready",
38
+ "event": "cond Prs URI",
39
+ "action": "send TEARDOWN; reply No session hdr, NRM = 0",
40
+ "to": "Init"
41
+ },
42
+ {
43
+ "from": "Ready",
44
+ "event": "cond md URI,NRM=1",
45
+ "action": "send TEARDOWN; reply No Session hdr, NRM = 0",
46
+ "to": "Init"
47
+ },
48
+ {
49
+ "from": "Ready",
50
+ "event": "cond md URI,NRM>1",
51
+ "action": "send TEARDOWN; reply Session hdr, NRM -= 1",
52
+ "to": "Ready"
53
+ },
54
+ {
55
+ "from": "Ready",
56
+ "event": "cond Prs URI, No range",
57
+ "action": "send PLAY; reply Play from RP",
58
+ "to": "Play"
59
+ },
60
+ {
61
+ "from": "Ready",
62
+ "event": "cond Prs URI, Range",
63
+ "action": "send PLAY; reply According to range",
64
+ "to": "Play"
65
+ },
66
+ {
67
+ "from": "Ready",
68
+ "event": "cond md URI, NRM=1, Range",
69
+ "action": "send PLAY; reply According to range",
70
+ "to": "Play"
71
+ },
72
+ {
73
+ "from": "Ready",
74
+ "event": "cond md URI, NRM=1",
75
+ "action": "send PLAY; reply Play from RP",
76
+ "to": "Play"
77
+ },
78
+ {
79
+ "from": "Ready",
80
+ "event": "cond Prs URI",
81
+ "action": "send PAUSE; reply Return PP",
82
+ "to": "Ready"
83
+ },
84
+ {
85
+ "from": "Ready",
86
+ "event": "cond Terminate-Reason",
87
+ "action": "send SC:REDIRECT; reply Set RedP",
88
+ "to": "Ready"
89
+ },
90
+ {
91
+ "from": "Ready",
92
+ "event": "cond No Terminate-Reason time parameter",
93
+ "action": "send SC:REDIRECT; reply Session is removed",
94
+ "to": "Init"
95
+ },
96
+ {
97
+ "from": "Ready",
98
+ "event": "cond default",
99
+ "action": "timeout",
100
+ "to": "Init"
101
+ },
102
+ {
103
+ "from": "Ready",
104
+ "event": "cond default",
105
+ "action": "cond RedP reached; reply TEARDOWN of session",
106
+ "to": "Init"
107
+ },
108
+ {
109
+ "from": "Play",
110
+ "event": "cond Prs URI",
111
+ "action": "send PAUSE; reply Set RP to present point",
112
+ "to": "Ready"
113
+ },
114
+ {
115
+ "from": "Play",
116
+ "event": "cond All media",
117
+ "action": "set Set RP = End of media",
118
+ "to": "Play"
119
+ },
120
+ {
121
+ "from": "Play",
122
+ "event": "cond default",
123
+ "action": "set Set RP = End of range",
124
+ "to": "Play"
125
+ },
126
+ {
127
+ "from": "Play",
128
+ "event": "cond Prs URI, No range",
129
+ "action": "send PLAY; reply Play from present point",
130
+ "to": "Play"
131
+ },
132
+ {
133
+ "from": "Play",
134
+ "event": "cond Prs URI, Range",
135
+ "action": "send PLAY; reply According to range",
136
+ "to": "Play"
137
+ },
138
+ {
139
+ "from": "Play",
140
+ "event": "cond default",
141
+ "action": "send SC:PLAY_NOTIFY; reply 200",
142
+ "to": "Play"
143
+ },
144
+ {
145
+ "from": "Play",
146
+ "event": "cond New URI",
147
+ "action": "send SETUP; reply 455",
148
+ "to": "Play"
149
+ },
150
+ {
151
+ "from": "Play",
152
+ "event": "cond md URI",
153
+ "action": "send SETUP; reply 455",
154
+ "to": "Play"
155
+ },
156
+ {
157
+ "from": "Play",
158
+ "event": "cond md URI, IFI",
159
+ "action": "send SETUP; reply Change transport param.",
160
+ "to": "Play"
161
+ },
162
+ {
163
+ "from": "Play",
164
+ "event": "cond Prs URI",
165
+ "action": "send TEARDOWN; reply No session hdr",
166
+ "to": "Init"
167
+ },
168
+ {
169
+ "from": "Play",
170
+ "event": "cond md URI,NRM=1",
171
+ "action": "send TEARDOWN; reply No Session hdr, NRM=0",
172
+ "to": "Init"
173
+ },
174
+ {
175
+ "from": "Play",
176
+ "event": "cond md URI",
177
+ "action": "send TEARDOWN; reply 455",
178
+ "to": "Play"
179
+ },
180
+ {
181
+ "from": "Play",
182
+ "event": "cond Terminate Reason with Time parameter",
183
+ "action": "send SC:REDIRECT; reply Set RedP",
184
+ "to": "Play"
185
+ },
186
+ {
187
+ "from": "Play",
188
+ "event": "cond default",
189
+ "action": "send SC:REDIRECT; reply Session is removed",
190
+ "to": "Init"
191
+ },
192
+ {
193
+ "from": "Play",
194
+ "event": "cond default",
195
+ "action": "cond RedP reached; reply TEARDOWN of session",
196
+ "to": "Init"
197
+ },
198
+ {
199
+ "from": "Play",
200
+ "event": "cond default",
201
+ "action": "timeout; reply Stop Media playout",
202
+ "to": "Init"
203
+ }
204
+ ]
205
+ }
PSMs/SIP_state_machine.json ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Calling",
4
+ "Proceeding",
5
+ "Completed",
6
+ "Confirmed",
7
+ "Terminated"
8
+ ],
9
+ "initial_state": "Calling",
10
+ "final_states": [
11
+ "Terminated"
12
+ ],
13
+ "transitions": [
14
+ {
15
+ "from": "Calling",
16
+ "event": "timeout Timer A",
17
+ "action": "send INVITE",
18
+ "to": "Calling"
19
+ },
20
+ {
21
+ "from": "Calling",
22
+ "event": "receive 1xx",
23
+ "action": "send 1xx to TU",
24
+ "to": "Proceeding"
25
+ },
26
+ {
27
+ "from": "Calling",
28
+ "event": "receive 2xx",
29
+ "action": "send 2xx to TU",
30
+ "to": "Terminated"
31
+ },
32
+ {
33
+ "from": "Calling",
34
+ "event": "timeout Timer B or Transport Error",
35
+ "action": "inform TU",
36
+ "to": "Terminated"
37
+ },
38
+ {
39
+ "from": "Calling",
40
+ "event": "receive 300-699",
41
+ "action": "send ACK, send response to TU",
42
+ "to": "Completed"
43
+ },
44
+ {
45
+ "from": "Proceeding",
46
+ "event": "receive 2xx",
47
+ "action": "send 2xx to TU",
48
+ "to": "Terminated"
49
+ },
50
+ {
51
+ "from": "Proceeding",
52
+ "event": "receive 300-699",
53
+ "action": "send ACK, send response to TU",
54
+ "to": "Completed"
55
+ },
56
+ {
57
+ "from": "Proceeding",
58
+ "event": "receive 1xx",
59
+ "action": "send 1xx to TU",
60
+ "to": "Proceeding"
61
+ },
62
+ {
63
+ "from": "Proceeding",
64
+ "event": "receive INVITE",
65
+ "action": "send response",
66
+ "to": "Proceeding"
67
+ },
68
+ {
69
+ "from": "Proceeding",
70
+ "event": "receive Transport Error",
71
+ "action": "inform TU",
72
+ "to": "Terminated"
73
+ },
74
+ {
75
+ "from": "Completed",
76
+ "event": "timeout Timer D",
77
+ "action": "",
78
+ "to": "Terminated"
79
+ },
80
+ {
81
+ "from": "Completed",
82
+ "event": "receive 300-699",
83
+ "action": "send ACK",
84
+ "to": "Completed"
85
+ },
86
+ {
87
+ "from": "Completed",
88
+ "event": "receive Transport Error",
89
+ "action": "inform TU",
90
+ "to": "Terminated"
91
+ },
92
+ {
93
+ "from": "Completed",
94
+ "event": "receive ACK",
95
+ "action": "",
96
+ "to": "Confirmed"
97
+ },
98
+ {
99
+ "from": "Confirmed",
100
+ "event": "timeout Timer I",
101
+ "action": "",
102
+ "to": "Terminated"
103
+ },
104
+ {
105
+ "from": "Proceeding",
106
+ "event": "receive 101-199 from TU",
107
+ "action": "send response",
108
+ "to": "Proceeding"
109
+ },
110
+ {
111
+ "from": "Proceeding",
112
+ "event": "receive 300-699 from TU",
113
+ "action": "send response",
114
+ "to": "Completed"
115
+ },
116
+ {
117
+ "from": "Completed",
118
+ "event": "timeout Timer G",
119
+ "action": "send response",
120
+ "to": "Completed"
121
+ },
122
+ {
123
+ "from": "Completed",
124
+ "event": "receive INVITE",
125
+ "action": "send response",
126
+ "to": "Completed"
127
+ },
128
+ {
129
+ "from": "Completed",
130
+ "event": "timeout Timer H or Transport Error",
131
+ "action": "inform TU",
132
+ "to": "Terminated"
133
+ }
134
+ ]
135
+ }
PSMs/SMTP_state_machine.json ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "Connection Established",
4
+ "Greeted",
5
+ "Mail Transaction Started",
6
+ "Recipient Specified",
7
+ "Data Entry",
8
+ "Message Accepted",
9
+ "Session Terminated"
10
+ ],
11
+ "initial_state": "Connection Established",
12
+ "final_states": [
13
+ "Session Terminated"
14
+ ],
15
+ "transitions": [
16
+ {
17
+ "from": "Connection Established",
18
+ "event": "receive EHLO or HELO after 220 greeting",
19
+ "action": "send HELO",
20
+ "to": "Greeted"
21
+ },
22
+ {
23
+ "from": "Greeted",
24
+ "event": "receive MAIL FROM",
25
+ "action": "send MAIL FROM",
26
+ "to": "Mail Transaction Started"
27
+ },
28
+ {
29
+ "from": "Mail Transaction Started",
30
+ "event": "receive RCPT TO",
31
+ "action": "send RCPT TO",
32
+ "to": "Recipient Specified"
33
+ },
34
+ {
35
+ "from": "Recipient Specified",
36
+ "event": "receive DATA",
37
+ "action": "send DATA 354",
38
+ "to": "Data Entry"
39
+ },
40
+ {
41
+ "from": "Data Entry",
42
+ "event": "cond message ended with <CRLF>.<CRLF>",
43
+ "action": "send message body",
44
+ "to": "Message Accepted"
45
+ },
46
+ {
47
+ "from": "Message Accepted",
48
+ "event": "receive QUIT",
49
+ "action": "send QUIT",
50
+ "to": "Session Terminated"
51
+ },
52
+ {
53
+ "from": "Greeted",
54
+ "event": "receive RSET",
55
+ "action": "send RSET",
56
+ "to": "Greeted"
57
+ },
58
+ {
59
+ "from": "Mail Transaction Started",
60
+ "event": "receive RSET",
61
+ "action": "send RSET",
62
+ "to": "Greeted"
63
+ },
64
+ {
65
+ "from": "Recipient Specified",
66
+ "event": "receive RSET",
67
+ "action": "send RSET",
68
+ "to": "Greeted"
69
+ },
70
+ {
71
+ "from": "Data Entry",
72
+ "event": "receive RSET before message is complete",
73
+ "action": "send RSET",
74
+ "to": "Greeted"
75
+ },
76
+ {
77
+ "from": "Message Accepted",
78
+ "event": "receive RSET",
79
+ "action": "send RSET",
80
+ "to": "Greeted"
81
+ },
82
+ {
83
+ "from": "Greeted",
84
+ "event": "receive VRFY",
85
+ "action": "send VRFY",
86
+ "to": "Greeted"
87
+ },
88
+ {
89
+ "from": "Greeted",
90
+ "event": "receive EXPN",
91
+ "action": "send EXPN; reply 250",
92
+ "to": "Greeted"
93
+ },
94
+ {
95
+ "from": "Mail Transaction Started",
96
+ "event": "receive VRFY or EXPN",
97
+ "action": "send VRFY; send EXPN",
98
+ "to": "Mail Transaction Started"
99
+ },
100
+ {
101
+ "from": "Recipient Specified",
102
+ "event": "receive VRFY or EXPN",
103
+ "action": "send VRFY; send EXPN",
104
+ "to": "Recipient Specified"
105
+ },
106
+ {
107
+ "from": "Data Entry",
108
+ "event": "receive VRFY or EXPN",
109
+ "action": "send VRFY; send EXPN",
110
+ "to": "Data Entry"
111
+ },
112
+ {
113
+ "from": "Message Accepted",
114
+ "event": "receive VRFY or EXPN",
115
+ "action": "send VRFY; send EXPN",
116
+ "to": "Message Accepted"
117
+ },
118
+ {
119
+ "from": "Connection Established",
120
+ "event": "receive QUIT",
121
+ "action": "send QUIT",
122
+ "to": "Session Terminated"
123
+ },
124
+ {
125
+ "from": "Greeted",
126
+ "event": "receive QUIT",
127
+ "action": "send QUIT",
128
+ "to": "Session Terminated"
129
+ },
130
+ {
131
+ "from": "Mail Transaction Started",
132
+ "event": "receive QUIT",
133
+ "action": "send QUIT",
134
+ "to": "Session Terminated"
135
+ },
136
+ {
137
+ "from": "Recipient Specified",
138
+ "event": "receive QUIT",
139
+ "action": "send QUIT",
140
+ "to": "Session Terminated"
141
+ },
142
+ {
143
+ "from": "Data Entry",
144
+ "event": "receive QUIT before finishing data",
145
+ "action": "send QUIT",
146
+ "to": "Session Terminated"
147
+ }
148
+ ]
149
+ }
PSMs/TCP_state_machine.json ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "states": [
3
+ "CLOSED",
4
+ "LISTEN",
5
+ "SYN_SENT",
6
+ "SYN_RCVD",
7
+ "ESTAB",
8
+ "FIN_WAIT-1",
9
+ "FIN_WAIT-2",
10
+ "CLOSING",
11
+ "TIME-WAIT",
12
+ "CLOSE_WAIT",
13
+ "LAST-ACK"
14
+ ],
15
+ "initial_state": "CLOSED",
16
+ "final_states": [
17
+ "CLOSED"
18
+ ],
19
+ "transitions": [
20
+ {
21
+ "from": "CLOSED",
22
+ "event": "passive OPEN",
23
+ "action": "create TCB",
24
+ "to": "LISTEN"
25
+ },
26
+ {
27
+ "from": "CLOSED",
28
+ "event": "active OPEN",
29
+ "action": "create TCB; send SYN",
30
+ "to": "SYN_SENT"
31
+ },
32
+ {
33
+ "from": "LISTEN",
34
+ "event": "receive SYN",
35
+ "action": "send SYN, ACK",
36
+ "to": "SYN_RCVD"
37
+ },
38
+ {
39
+ "from": "LISTEN",
40
+ "event": "send SYN",
41
+ "action": "send SYN",
42
+ "to": "SYN_SENT"
43
+ },
44
+ {
45
+ "from": "LISTEN",
46
+ "event": "CLOSE",
47
+ "action": "delete TCB",
48
+ "to": "CLOSED"
49
+ },
50
+ {
51
+ "from": "SYN_SENT",
52
+ "event": "receive SYN",
53
+ "action": "send SYN, ACK",
54
+ "to": "SYN_RCVD"
55
+ },
56
+ {
57
+ "from": "SYN_SENT",
58
+ "event": "receive SYN, ACK",
59
+ "action": "send ACK",
60
+ "to": "ESTAB"
61
+ },
62
+ {
63
+ "from": "SYN_SENT",
64
+ "event": "CLOSE",
65
+ "action": "delete TCB",
66
+ "to": "CLOSED"
67
+ },
68
+ {
69
+ "from": "SYN_RCVD",
70
+ "event": "receive ACK of SYN",
71
+ "action": "",
72
+ "to": "ESTAB"
73
+ },
74
+ {
75
+ "from": "SYN_RCVD",
76
+ "event": "CLOSE",
77
+ "action": "send FIN",
78
+ "to": "FIN_WAIT-1"
79
+ },
80
+ {
81
+ "from": "SYN_RCVD",
82
+ "event": "rcv RST (note1)",
83
+ "action": "",
84
+ "to": "LISTEN"
85
+ },
86
+ {
87
+ "from": "ESTAB",
88
+ "event": "CLOSE",
89
+ "action": "send FIN",
90
+ "to": "FIN_WAIT-1"
91
+ },
92
+ {
93
+ "from": "ESTAB",
94
+ "event": "receive FIN",
95
+ "action": "send ACK",
96
+ "to": "CLOSE_WAIT"
97
+ },
98
+ {
99
+ "from": "FIN_WAIT-1",
100
+ "event": "receive FIN",
101
+ "action": "send ACK",
102
+ "to": "CLOSING"
103
+ },
104
+ {
105
+ "from": "FIN_WAIT-1",
106
+ "event": "receive ACK of FIN",
107
+ "action": "",
108
+ "to": "FIN_WAIT-2"
109
+ },
110
+ {
111
+ "from": "FIN_WAIT-2",
112
+ "event": "receive FIN",
113
+ "action": "send ACK",
114
+ "to": "TIME-WAIT"
115
+ },
116
+ {
117
+ "from": "CLOSING",
118
+ "event": "receive ACK of FIN",
119
+ "action": "",
120
+ "to": "TIME-WAIT"
121
+ },
122
+ {
123
+ "from": "TIME-WAIT",
124
+ "event": "Timeout=2MSL",
125
+ "action": "delete TCB",
126
+ "to": "CLOSED"
127
+ },
128
+ {
129
+ "from": "CLOSE_WAIT",
130
+ "event": "CLOSE",
131
+ "action": "send FIN",
132
+ "to": "LAST-ACK"
133
+ },
134
+ {
135
+ "from": "LAST-ACK",
136
+ "event": "receive ACK of FIN",
137
+ "action": "delete TCB",
138
+ "to": "CLOSED"
139
+ }
140
+ ]
141
+ }
RFCChunks/BGP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/DCCP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/DHCP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/FTP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/IMAP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/MQTT_segments.json ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "section_number": "1.",
4
+ "section_name": "Introduction",
5
+ "tag": "Section 1. Introduction",
6
+ "content": "This document specifies a profile for the ACE framework [RFC9200].\n In this profile, Clients and Servers (Brokers) use MQTT to exchange\n Application Messages. The protocol relies on TLS for communication\n security between entities. The MQTT protocol interactions are\n described based on the MQTT v5.0 OASIS Standard\n [MQTT-OASIS-Standard-v5]. Since it is expected that MQTT deployments\n will continue to support MQTT v3.1.1 Clients, this document also\n describes a reduced set of protocol interactions for the MQTT v3.1.1\n OASIS Standard [MQTT-OASIS-Standard-v3.1.1]. However, MQTT v5.0 is\n the RECOMMENDED version, as it works more naturally with ACE-style\n authentication and authorization.\n MQTT is a publish-subscribe protocol, and after connecting to the\n MQTT Server (Broker), a Client can publish and subscribe to multiple\n topics. The Broker, which acts as the Resource Server (RS), is\n responsible for distributing messages published by the publishers to\n their subscribers. In the rest of the document, the terms \"RS\",\n \"MQTT Server\", and \"Broker\" are used interchangeably.\n Messages are published under a Topic Name, and subscribers subscribe\n to the Topic Names to receive the corresponding messages. The Broker\n uses the Topic Name in a published message to determine which\n subscribers to relay the messages to. In this document, topics (more\n specifically, Topic Names) are treated as resources. The Clients are\n assumed to have identified the publish/subscribe topics of interest\n out of band (topic discovery is not a feature of the MQTT protocol).\n A Resource Owner can preconfigure policies at the Authorization\n Server (AS) that give Clients publish or subscribe permissions to\n different topics.\n Clients prove their permission to publish and subscribe to topics\n hosted on an MQTT Broker using an access token that is bound to a\n Proof-of-Possession (PoP) key. This document describes how to\n authorize the following exchanges between the Clients and the Broker.\n * connection requests from the Clients to the Broker\n * publish requests from the Clients to the Broker and from the\n Broker to the Clients\n * subscribe requests from the Clients to the Broker\n Clients use the MQTT PUBLISH packet to publish to a topic. The\n mechanisms specified in this document do not protect the Payload of\n the PUBLISH packet from the Broker. Hence, the Payload is not signed\n or encrypted specifically for the subscribers. This functionality\n may be implemented using the proposal outlined in the ACE Pub-Sub\n Profile [ACE-PUBSUB-PROFILE].\n To provide communication confidentiality and Broker authentication to\n the MQTT Clients, TLS is used, and TLS 1.3 [RFC8446] is RECOMMENDED.\n This document makes the same assumptions as Section 4 of the ACE\n framework [RFC9200] regarding Client and RS registration with the AS\n for setting up the keying material. While the Client-Broker\n exchanges are only over MQTT, the required Client-AS and RS-AS\n interactions are described for HTTPS-based communication [RFC9110],\n using the \"application/ace+json\" content type and, unless otherwise\n specified, JSON encoding. The token MAY be an opaque reference to\n authorization information or a JSON Web Token (JWT) [RFC7519]. For\n JWTs, this document follows [RFC7800] for PoP semantics for JWTs, and\n the mechanisms for providing and verifying PoP are detailed in\n Section 2.2. The Client-AS and RS-AS exchanges MAY also use\n protocols other than HTTP, e.g., Constrained Application Protocol\n (CoAP) [RFC7252] or MQTT. It is recommended that TLS is used to\n secure these communication channels between Client-AS and RS-AS. To\n reduce the protocol memory and bandwidth requirements,\n implementations MAY also use the \"application/ace+cbor\" content type,\n Concise Binary Object Representation (CBOR) encoding [RFC8949], CBOR\n Web Tokens (CWTs) [RFC8392], and associated PoP semantics. For more\n information, see \"Proof-of-Possession Key Semantics for CBOR Web\n Tokens (CWTs)\" [RFC8747]. A JWT uses JSON Object Signing and\n Encryption (JOSE), while a CWT uses CBOR Object Signing and\n Encryption (COSE) [RFC9052] for security protection.\n1.1. Requirements Language\n The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\",\n \"SHOULD\", \"SHOULD NOT\", \"RECOMMENDED\", \"NOT RECOMMENDED\", \"MAY\", and\n \"OPTIONAL\" in this document are to be interpreted as described in\n BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all\n capitals, as shown here.\n1.2. ACE-Related Terminology\n Certain security-related terms, such as \"authentication\",\n \"authorization\", \"data confidentiality\", \"(data) integrity\", \"message\n authentication code\" (MAC), and \"verify\", are taken from [RFC4949].\n The terminology for entities in the architecture is defined in OAuth\n 2.0 [RFC6749], such as \"Client\" (C), \"Resource Server\" (RS), and\n \"Authorization Server\" (AS).\n The term \"resource\" is used to refer to an MQTT Topic Name, which is\n defined in Section 1.3. Hence, the \"Resource Owner\" is any entity\n that can authoritatively speak for the topic. This document also\n defines a Client Authorization Server for Clients that are not able\n to support HTTP.\n Client Authorization Server (CAS)\n An entity that prepares and endorses authentication and\n authorization data for a Client and communicates to the AS\n using HTTPS.\n1.3. MQTT-Related Terminology\n The document describes message exchanges as MQTT protocol\n interactions. The Clients are MQTT Clients, which connect to the\n Broker to publish and subscribe to Application Messages (which are\n labeled with their topics). For additional information, please refer\n to the MQTT v5.0 OASIS Standard [MQTT-OASIS-Standard-v5] or MQTT\n v3.1.1 OASIS Standard [MQTT-OASIS-Standard-v3.1.1].\n Broker \n The Server in MQTT. It acts as an intermediary between the\n Clients that publish Application Messages and the Clients\n that made Subscriptions. The Broker acts as the Resource\n Server for the Clients.\n Client \n A device or program that uses MQTT.\n Network Connection\n A construct provided by the underlying transport protocol\n that is being used by MQTT. It connects the Client to the\n Server. It provides the means to send an ordered, lossless\n stream of bytes in both directions. This document uses TLS\n as the transport protocol.\n Session\n A stateful interaction between a Client and a Broker. Some\n Sessions last only as long as the Network Connection; others\n can span multiple Network Connections.\n Application Message\n The data carried by the MQTT protocol. The data has an\n associated Quality-of-Service (QoS) level and Topic Name.\n MQTT Control Packet\n The MQTT protocol operates by exchanging a series of MQTT\n Control Packets. Each packet is composed of a Fixed Header,\n a Variable Header (depending on the Control Packet type), and\n a Payload.\n UTF-8-encoded string\n A string prefixed with a two-byte-length field that gives the\n number of bytes in a UTF-8-encoded string itself. Unless\n stated otherwise, all UTF-8-encoded strings can have any\n length in the range 0 to 65535 bytes.\n Binary Data\n Binary Data is represented by a two-byte-length field, which\n indicates the number of data bytes, followed by that number\n of bytes. Thus, the length of Binary Data is limited to the\n range of 0 to 65535 bytes.\n Variable Byte Integer\n A Variable Byte Integer is encoded using an encoding scheme\n that uses a single byte for values up to 127. For larger\n values, the least significant seven bits of each byte encode\n the data, and the most significant bit is used to indicate\n whether there are bytes following in the representation.\n Thus, each byte encodes 128 values and a \"continuation bit\".\n The maximum number of bytes in the Variable Byte Integer\n field is four.\n QoS level\n The level of assurance for the delivery of an Application\n Message. The QoS level can be 0-2, where 0 indicates \"At\n most once delivery\", 1 indicates \"At least once delivery\",\n and 2 indicates \"Exactly once delivery\".\n Property\n The last field of the Variable Header is a set of properties\n for several MQTT Control Packets (e.g., CONNECT and CONNACK).\n A property consists of an Identifier that defines its usage\n and data type, followed by a value. The Identifier is\n encoded as a Variable Byte Integer. For example, the\n \"Authentication Data\" property uses the identifier 22.\n Topic Name\n The label attached to an Application Message, which is\n matched to a Subscription.\n Subscription\n A Subscription comprises a Topic Filter and a maximum QoS. A\n Subscription is associated with a single Session.\n Topic Filter\n An expression that indicates interest in one or more Topic\n Names. Topic Filters may include wildcards.\n MQTT sends various Control Packets across a Network Connection. The\n following is not an exhaustive list, and the Control Packets that are\n not relevant for authorization are not explained. For instance,\n these include the PUBREL and PUBCOMP packets used in the 4-step\n handshake required for QoS level 2.\n CONNECT\n The Client requests to connect to the Broker. This is the\n first packet sent by a Client.\n CONNACK\n The Broker connection acknowledgment. CONNACK packets\n contain return codes that indicate either a success or an\n error state in response to a Client's CONNECT packet.\n AUTH \n An AUTH Control Packet is sent from the Client to the Broker\n or from the Broker to the Client as part of an extended\n authentication exchange. AUTH properties include the\n Authentication Method and Authentication Data. The\n Authentication Method is set in the CONNECT packet, and\n consequent AUTH packets follow the same Authentication\n Method. The contents of the Authentication Data are defined\n by the Authentication Method.\n PUBLISH\n Publish request sent from a publishing Client to the Broker\n or from the Broker to a subscribing Client.\n PUBACK \n Response to a PUBLISH request with QoS level 1. PUBACK can\n be sent from the Broker to a Client or from a Client to the\n Broker.\n PUBREC \n Response to a PUBLISH request with QoS level 2. PUBREC can\n be sent from the Broker to a Client or from a Client to the\n Broker.\n SUBSCRIBE\n Subscribe request sent from a Client.\n SUBACK \n Subscribe acknowledgment from the Broker to the Client.\n PINGREQ\n A ping request sent from a Client to the Broker. It signals\n to the Broker that the Client is alive and is used to confirm\n that the Broker is also alive. The \"Keep Alive\" period is\n set in the CONNECT packet.\n PINGRESP\n Response sent by the Broker to the Client in response to\n PINGREQ. It indicates the Broker is alive.\n DISCONNECT\n The DISCONNECT packet is the final MQTT Control Packet sent\n from the Client or the Broker. It indicates the reason why\n the Network Connection is being closed. If the Network\n Connection is closed without the Client first sending a\n DISCONNECT packet with reason code 0x00 (Normal\n disconnection) and the MQTT Connection has a Will Message,\n the Will Message is published.\n Will \n If the Network Connection is not closed normally, the Broker\n sends a last Will Message for the Client if the Client\n provided one in its CONNECT packet. Situations in which the\n Will Message is published include, but are not limited to,\n the following:\n * an I/O error or network failure detected by the Broker,\n * the Client fails to communicate within the Keep Alive\n period,\n * the Client closes the Network Connection without first\n sending a DISCONNECT packet with reason code 0x00 (Normal\n disconnection), and\n * the Broker closes the Network Connection without first\n receiving a DISCONNECT packet with reason code 0x00\n (Normal disconnection).\n If the Will Flag is set in the CONNECT flags, then the\n Payload of the CONNECT packet includes information about the\n Will. The information consists of the Will Properties, Will\n Topic, and Will Payload fields."
7
+ },
8
+ {
9
+ "section_number": "2.",
10
+ "section_name": "Authorizing Connection Requests",
11
+ "tag": "Section 2. Authorizing Connection Requests",
12
+ "content": "This section specifies how Client connections are authorized by the\n AS and verified by the MQTT Broker. Figure 1 shows the basic\n protocol flows during connection setup. The token request and\n response use the token endpoint at the AS, specified for HTTP-based\n interactions in Section 5.8 of the ACE framework [RFC9200]. Steps\n (D) and (E) are optional and use the introspection endpoint specified\n in Section 5.9 of the ACE framework [RFC9200]. The discussion in\n this document assumes that the Client and the Broker use HTTPS to\n communicate with the AS via these endpoints. The Client and the\n Broker use MQTT to communicate between them. The C-AS and Broker-AS\n communications MAY be implemented using protocols other than HTTPS,\n e.g., CoAP or MQTT. Whatever protocol is used for the C-AS and\n Broker-AS communications MUST provide mutual authentication,\n confidentiality protection, and integrity protection.\n If the Client is resource constrained or does not support HTTPS, a\n separate Client Authorization Server may carry out the token request\n on behalf of the Client (Figure 1, steps (A) and (B)) and, later,\n onboard the Client with the token. The interactions between a Client\n and its Client Authorization Server for token onboarding and support\n for MQTT-based token requests at the AS are out of the scope of this\n document.\n +---------------------+\n | Client |\n | |\n +---(A) Token request------| Client - |\n | | Authorization |\n | +-(B) Access token-----> Server Interface |\n | | | (HTTPS) |\n | | |_____________________|\n | | | |\n +--v-------------+ | Pub/Sub Interface |\n | Authorization | | (MQTT over TLS) |\n | Server | +----------------^----+\n |________________| | |\n | ^ (C) Connection (F) Connection\n | | request + response\n | | access token |\n | | | |\n | | +---v--------------+\n | | | Broker |\n | | | (MQTT over TLS) |\n | | |__________________|\n | +(D) Introspection-----| |\n | request (optional)| RS-AS interface |\n | | (HTTPS) |\n +-(E) Introspection-------->|__________________|\n response (optional)\n Figure 1: Connection Setup\n2.1. Client Token Request to the Authorization Server (AS)\n The first step in the protocol flow (Figure 1, step (A)) is the token\n acquisition by the Client from the AS. The Client and the AS MUST\n perform mutual authentication. The Client requests an access token\n from the AS, as described in Section 5.8.1 of the ACE framework\n [RFC9200]. The document follows the procedures defined in\n Section 3.2.1 of the DTLS profile [RFC9202] for raw public keys\n (RPKs) [RFC7250]) and in Section 3.3.1 of [RFC7250] for pre-shared\n keys (PSKs). However, the content type of the request is set to\n \"application/ace+json\", and the AS uses JSON in the Payload of its\n responses to the Client and the RS. As explained earlier,\n implementations MAY also use the \"application/ace+cbor\" content type.\n On receipt of the token request, the AS verifies the request. If the\n AS successfully verifies the access token request and authorizes the\n Client for the indicated audience (i.e., RS) and scopes (i.e.,\n publish/subscribe permissions over topics, as described in\n Section 2.3), the AS issues an access token (Figure 1, step (B)).\n The response includes the parameters described in Section 5.8.2 of\n the ACE framework [RFC9200]. For RPKs, the parameters are as\n described in Section 3.2.1 of the DTLS profile [RFC9202]. For PSKs,\n the document follows Section 3.3.1 of the DTLS profile [RFC9202]. In\n both cases, if the response contains an \"ace_profile\" parameter, this\n parameter is set to \"mqtt_tls\". The returned token is a Proof-of-\n Possession (PoP) token by default.\n This document follows [RFC7800] for PoP semantics for JWTs (CWTs MAY\n also be used). The AS includes a \"cnf\" (confirmation) parameter in\n the PoP token to declare that the Client possesses a particular key\n and the RS can cryptographically confirm that the Client has\n possession of that key, as described in [RFC9201].\n Note that the contents of the web tokens (including the \"cnf\"\n parameter) are to be consumed by the RS and not the Client (the\n Client obtains the key information in a different manner). The RPK\n case is handled as described in Section 3.2.1 of the DTLS profile\n [RFC9202]. For the PSK case, the referenced procedures apply, with\n the following exceptions to accommodate JWT and JOSE use. In this\n case, the AS adds a \"cnf\" parameter to the Access Information\n carrying a JSON Web Key (JWK) [RFC7517] object that contains either\n the symmetric key itself or a key identifier that can be used by the\n RS to determine the secret key it shares with the Client. The JWT is\n created as explained in Section 7 of [RFC7519], and the JWT MUST\n include a JSON Web Encryption (JWE) [RFC7516]. If a CWT/COSE is\n used, this information MUST be inside the \"COSE_Key\" object and MUST\n be encrypted using a \"COSE_Encrypt0\" structure.\n The AS returns error responses for JSON-based interactions following\n Section 5.2 of [RFC6749]. When CBOR is used, the interactions MUST\n implement the procedure described in Section 5.8.3 of the ACE\n framework [RFC9200].\n2.2. Client Connection Request to the Broker (C)\n2.2.1. Overview of Client-RS Authentication Methods over TLS and MQTT\n Unless the Client publishes and subscribes to only public topics, the\n Client and the Broker MUST perform mutual authentication. The Client\n MUST authenticate to the Broker either over MQTT or TLS before\n performing any other action. For MQTT, the options are \"None\" and\n \"ace\". For TLS, the options are \"Anon\" for an anonymous client, and\n \"Known(RPK/PSK)\" for RPKs and PSKs, respectively. The \"None\" and\n \"Anon\" options do not provide client authentication but can be used\n either during authentication or in combination with authentication at\n the other layer. When the Client uses TLS:Anon,MQTT:None, the Client\n can only publish or subscribe to public topics. Thus, the client\n authentication procedures involve the following possible\n combinations:\n TLS:Anon,MQTT:None:\n This option is used only for the topics that do not require\n authorization, including the \"authz-info\" topic. Publishing\n to the \"authz-info\" topic is described in Section 2.2.2.\n TLS:Anon,MQTT:ace:\n The token is transported inside the CONNECT packet and MUST\n be validated using one of the methods described in\n Section 2.2.2. This option also supports a tokenless\n connection request for AS discovery. As per the ACE\n framework [RFC9200], a separate step is needed to determine\n whether the discovered AS URI is authorized to act as an AS.\n TLS:Known(RPK/PSK),MQTT:none:\n This specification supports client authentication with TLS\n with RPKs and PSKs, following the procedures described in the\n DTLS profile [RFC9202]. For the RPK, the Client MUST have\n published the token to the \"authz-info\" topic. For the PSK,\n the token MAY be published to the \"authz-info\" topic or MAY\n be, alternatively, provided as a \"PSK identity\" (e.g., an\n \"identity\" in the \"identities\" field in the Client's\n \"pre_shared_key\" extension in TLS 1.3).\n TLS:Known(RPK/PSK),MQTT:ace:\n This option SHOULD NOT be chosen as the token transported in\n the CONNECT packet and overwrites any permissions passed\n during the TLS authentication.\n It is RECOMMENDED that the Client implements TLS:Anon,MQTT:ace as the\n first choice when working with protected topics. However, MQTT\n v3.1.1 Clients that do not prefer to overload the User Name and\n Password fields for ACE (as described in Section 6) MAY implement\n TLS:Known(RPK/PSK),MQTT:none and, consequently, TLS:Anon,MQTT:None to\n submit their token to \"authz-info\".\n The Broker MUST support TLS:Anon,MQTT:ace. To support Clients with\n different capabilities, the Broker MAY provide multiple client\n authentication options, e.g., support TLS:Known(RPK),MQTT:none and\n TLS:Anon,MQTT:None, to enable RPK-based client authentication.\n The Client MUST authenticate the Broker during the TLS handshake. If\n the Client authentication uses TLS:Known(RPK/PSK), then the Broker is\n authenticated using the respective method. Otherwise, to\n authenticate the Broker, the Client MUST validate a public key from\n an X.509 certificate or an RPK from the Broker against the \"rs_cnf\"\n parameter in the token response, which contains information about the\n public key used by the RS to authenticate if the token type is \"pop\"\n and asymmetric keys are used as defined in [RFC9201]. The AS MAY\n include the thumbprint of the RS's X.509 certificate in the \"rs_cnf\"\n (thumbprint, as defined in [RFC9360]). In this case, the Client MUST\n validate the RS certificate against this thumbprint.\n2.2.2. authz-info: The Authorization Information Topic\n In the cases when the Client must transport the token to the Broker\n first, the Client connects to the Broker to publish its token to the\n \"authz-info\" topic. The \"authz-info\" topic MUST only be published\n (i.e., the Clients are not allowed to subscribe to it). \"authz-info\"\n is not protected, and hence, the Client uses the TLS:Anon,MQTT:None\n option over a TLS connection. After publishing the token, the Client\n disconnects from the Broker and is expected to reconnect using client\n authentication over TLS (i.e., TLS:Known(RPK/PSK),MQTT:none).\n The Broker stores and indexes all tokens received to the \"authz-info\"\n topic in its key store (similar to the DTLS profile for ACE\n [RFC9202]). This profile follows the recommendation of\n Section 5.10.1 of the ACE framework [RFC9200] and expects that the\n Broker stores only one token per PoP key, and any other token linked\n to the same key overwrites an existing token.\n The Broker MUST verify the validity of the token (i.e., through local\n validation or introspection if the token is a reference), as\n described in Section 2.2.5. If the token is not valid, the Broker\n MUST discard the token.\n Depending on the QoS level of the PUBLISH packet, the Broker returns\n the error response as a PUBACK, PUBREC, or DISCONNECT packet. If the\n QoS level is equal to 0, and the token is not valid, or if the claims\n cannot be obtained in the case of an introspected token, the Broker\n MUST send a DISCONNECT packet with reason code 0x87 (Not authorized).\n If the PUBLISH Payload does not parse to a token, the Broker MUST\n send a DISCONNECT with reason code 0x99 (Payload format invalid).\n If the QoS level of the PUBLISH packet is greater than or equal to 1,\n and the token is not valid, or the claims cannot be obtained in the\n case of an introspected token, the Broker MUST send reason code 0x87\n (Not authorized) in the PUBACK or PUBREC. If the PUBLISH Payload\n does not parse to a token, the PUBACK/PUBREC reason code is 0x99\n (Payload format invalid).\n When the Broker sends the \"Not authorized\" response, it must be noted\n that this corresponds to the token being not valid and not that the\n actual PUBLISH packet was not authorized. Given that the \"authz-\n info\" is a public topic, this response is not expected to cause\n confusion.\n2.2.3. Client Authentication over TLS\n This document supports TLS with raw public keys (RPKs) [RFC7250] and\n with pre-shared keys (PSKs). The TLS session setup follows the DTLS\n profile for ACE [RFC9202], as the profile applies to TLS equally well\n [RFC9430]. When there are exceptions to the DTLS profile, these are\n explicitly stated in the document. If TLS 1.2 is used, [RFC7925]\n describes how TLS can be used for constrained devices, alongside\n recommended cipher suites. Additionally, TLS 1.2 implementations\n MUST use the \"Extended Main Secret\" extension (terminology adopted\n from [TLS-bis]) to incorporate the handshake transcript into the main\n secret [RFC7627]. TLS implementations SHOULD use the Server Name\n Indication (SNI) [RFC6066] and Application-Layer Protocol Negotiation\n (ALPN) [RFC7301] extensions so the TLS handshake authenticates as\n much of the protocol context as possible.\n2.2.3.1. Raw Public Key Mode\n This document follows the procedures defined in Section 3.2.2 of the\n DTLS profile for ACE [RFC9202] with the following exceptions. The\n Client MUST upload the access token to the Broker using the method\n specified in Section 2.2.2 before initiating the handshake.\n2.2.3.2. Pre-Shared Key Mode\n This document follows the procedures defined in Section 3.3.2 of the\n DTLS profile for ACE [RFC9202] with the following exceptions.\n To use TLS 1.3 with pre-shared keys, the Client utilizes the PSK\n extension specified in [RFC8446] using the key conveyed in the \"cnf\"\n parameter of the AS response. The same key is bound to the access\n token in the \"cnf\" claim. The Client can upload the token, as\n specified in Section 2.2.2, before initiating the handshake. When\n using a previously uploaded token, the Client MUST indicate during\n the handshake which previously uploaded access token it intends to\n use. To do so, it MUST create a \"COSE_Key\" or \"JWK\" structure with\n the \"kid\" that was conveyed in the \"rs_cnf\" claim in the token\n response from the AS and the key type \"symmetric\". This structure is\n then included as the only element in the \"cnf\" structure and the\n encoded value of that \"cnf\" structure used as a PSK identity in TLS.\n As an alternative to the access token upload, the Client can provide\n the most recent access token, JWT or CWT, as a PSK identity.\n In contrast to the DTLS profile for ACE [RFC9202], a Client MAY omit\n support for the cipher suites TLS_PSK_WITH_AES_128_CCM_8 and\n TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8. For TLS 1.2, however, a client\n MUST support TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256 for PSKs [RFC8442]\n and TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 for RPKs [RFC8422], as\n recommended in [RFC9325] (and adjusted to be a PSK cipher suite as\n appropriate).\n2.2.4. Client Authentication over MQTT\n2.2.4.1. Transporting the Access Token inside the MQTT CONNECT\n This section describes how the Client transports the token to the\n Broker inside the CONNECT packet. If this method is used, the Client\n TLS connection is expected to be anonymous, and the Broker is\n authenticated during the TLS connection setup. The approach\n described in this section is similar to an earlier proposal by\n Fremantle, et al. [Fremantle14].\n After sending the CONNECT packet, the Client MUST wait to receive the\n CONNACK packet from the Broker. The only packets it is allowed to\n send are DISCONNECT or AUTH that are in response to the Broker AUTH.\n Similarly, except for a DISCONNECT and AUTH response from the Client,\n the Broker MUST NOT process any packets before sending a CONNACK\n packet.\n Figure 2 shows the structure of the MQTT CONNECT packet used in MQTT\n v5.0. A CONNECT packet is composed of a Fixed Header, a Variable\n Header, and a Payload The Fixed Header contains the Control Packet\n Type (CPT), Reserved, and Remaining Length fields. The Remaining\n Length is a Variable Byte Integer that represents the number of bytes\n remaining within the current Control Packet, including data in the\n Variable Header and the Payload. The Variable Header contains the\n Protocol Name, Protocol Level, Connect flags, Keep Alive, and\n Properties fields. The Connect flags in the Variable Header specify\n the properties of the MQTT Session. It also indicates the presence\n or absence of some fields in the Payload. The Payload contains one\n or more encoded fields, namely a unique Client Identifier for the\n Client, a Will Topic, Will Payload, User Name, and Password. All but\n the Client Identifier can be omitted depending on the flags in the\n Variable Header. The Client Identifier identifies the Client to the\n Broker and, therefore, is unique for each Client. It must be noted\n that the Client Identifier is an unauthenticated identifier used\n within the MQTT protocol and so is not bound to the access token.\n 0 8 16\n +---------------------------+\n |Protocol name length = 4 |\n +---------------------------+\n | 'M' 'Q' |\n +---------------------------+\n | 'T' 'T' |\n +---------------------------+\n |Proto.level=5|Connect flags|\n +---------------------------+\n | Keep alive |\n +---------------------------+\n | CONNECT Properties Length |\n | (up to 4 bytes) |\n +---------------------------+\n | ( ..Other properties..) |\n +---------------------------+\n | Authentication Method |\n | (0x15) | Len |\n | Len | 'a' |\n | 'c' | 'e' |\n +---------------------------+\n | Authentication Data |\n | (0x16) | Len |\n | Len | token |\n | or token + PoP data |\n +---------------------------+\n Figure 2: MQTT v5 CONNECT Variable Header with Authentication\n Method Property for ACE\n The CONNECT flags are User Name, Password, Will Retain, Will QoS,\n Will Flag, Clean Start, and Reserved. Table 1 shows how the flags\n MUST be set to use AUTH packets for authentication and authorization,\n i.e., the User Name Flag and Password Flag MUST be set to 0. An MQTT\n v5.0 Broker MAY also support token transport using the User Name and\n Password to provide a security option for MQTT v3.1.1 Clients, as\n described in Section 6.\n +===========+==========+========+======+======+=======+==========+\n | User Name | Password | Will | Will | Will | Clean | Reserved |\n | Flag | Flag | Retain | QoS | Flag | Start | |\n +===========+==========+========+======+======+=======+==========+\n | 0 | 0 | X | X X | X | X | 0 |\n +-----------+----------+--------+------+------+-------+----------+\n Table 1: CONNECT Flags for AUTH\n The Will Flag indicates that a Will Message needs to be sent. The\n Client MAY set the Will Flag as desired (marked as \"X\" in Table 1).\n If the Will Flag is set to 1, the Broker MUST check that the token\n allows the publication of the Will Message (i.e., the Will Topic\n Filter is in the scope array). The check is performed against the\n token scope described in Section 2.3. If the Will authorization\n fails, the connection is refused, as described in Section 2.4.1. If\n the Broker accepts the connection request, the Broker stores the Will\n Message and publishes it when the Network Connection is closed\n according to Will QoS, Will Retain parameters, and MQTT Will\n management rules. To avoid publishing the Will Messages in the case\n of temporary network disconnections, the Client specifies a Will\n Delay Interval in the Will Properties. Section 5 explains how the\n Broker deals with the retained messages in further detail.\n In MQTT v5.0, the Client signals a new Session (i.e., that the\n Session does not continue an existing Session) by setting the Clean\n Start flag to 1 in the CONNECT packet. In this profile, the Client\n SHOULD always start with a new Session. The Broker MAY also signal\n that it does not support the continuation of an existing Session by\n setting the Session Expiry Interval to 0 in the CONNACK. If the\n Broker starts a new Session, the Broker MUST set the Session Present\n flag to 0 in the CONNACK packet to signal this to the Client.\n The Broker MAY support continuing an existing Session, e.g., if the\n Broker requires it for QoS reasons. In this case, if a CONNECT\n packet is received with Clean Start set to 0, and there is a Session\n associated with the Client Identifier, the Broker MUST resume\n communications with the Client based on the state from the existing\n Session. In its response, the Broker MUST set the Session Present\n flag to 1 in the CONNACK packet to signal the continuation of an\n existing Session to the Client. The Session State stored by the\n Client and the Broker is described in Section 5.\n When reconnecting to a Broker that supports continuing existing\n Sessions, the Client MUST still provide a token in addition to using\n the same Client Identifier and setting the Clean Start to 0. The\n Broker MUST still perform PoP validation on the provided token. If\n the token matches the stored state, the Broker MAY skip introspecting\n a token-by-reference and use the stored introspection result. The\n Broker MUST also verify the Client is authorized to receive or send\n MQTT packets that are pending transmission. When a Client connects\n with a long Session Expiry Interval, the Broker may need to maintain\n the Client's MQTT Session State after it disconnects for an extended\n period. Brokers SHOULD implement administrative policies to limit\n misuse.\n Note that, according to the MQTT standard, the Broker uses the Client\n Identifier to identify the Session State. In the case of a Client\n Identifier collision, a Client may take over another Client's\n Session. Given that the Broker MUST associate the Client with a\n valid token, a Client will only send or receive messages to its\n authorized topics. Therefore, while this issue is not expected to\n affect security, it may affect QoS (i.e., PUBLISH or QoS messages\n saved for Client A may be delivered to a Client B). In addition, if\n this Client Identifier represents a Client already connected to the\n Broker, the Broker sends a DISCONNECT packet to the existing Client\n with reason code 0x8E (Session taken over) and closes the connection\n to the Client.\n2.2.4.2. Authentication Using the AUTH Property\n Figure 2 shows the Authentication Method and Authentication Data\n fields when the client authenticates using the AUTH property. The\n Client MUST set the Authentication Method as a property of a CONNECT\n packet by using the property identifier 21 (0x15). This is followed\n by a UTF-8-encoded string containing the name of the Authentication\n Method, which MUST be set to \"ace\". If the Broker does not support\n this profile, it sends a CONNACK packet with reason code 0x8C (Bad\n authentication method).\n The Authentication Method is followed by the Authentication Data,\n which has a property identifier 22 (0x16) and is Binary Data. Based\n on the Authentication Data, the Broker MUST support both options\n below:\n * proof of possession using a challenge from the TLS session\n * proof of possession via a Broker-generated challenge/response\n2.2.4.2.1. Proof of Possession Using a Challenge from the TLS Session\n +-----------------------------------------------------------------+\n |Authentication|Token Length|Token |MAC or Signature |\n |Data Length | | |(over TLS exporter content) |\n +-----------------------------------------------------------------+\n Figure 3: Authentication Data for PoP Based on TLS Exporter Content\n For this option, the Authentication Data inside the Client's CONNECT\n packet MUST contain the two-byte integer token length, the token, and\n the keyed message digest (MAC) or the Client signature (as shown in\n Figure 3). The Proof-of-Possession key in the token is used to\n calculate the keyed message digest (MAC) or the Client signature\n based on the content obtained from the TLS exporter ([RFC5705] for\n TLS 1.2 and Section 7.5 of [RFC8446] for TLS 1.3). This content is\n exported from the TLS session using the exporter label \"EXPORTER-ACE-\n MQTT-Sign-Challenge\", an empty context, and a length of 32 bytes.\n The token is also validated, as described in Section 2.2.5, and the\n Broker responds with a CONNACK packet with the appropriate response\n code. The Client cannot reauthenticate using this method during the\n same TLS session (see Section 4).\n2.2.4.2.2. Proof of Possession via Broker-generated Challenge/Response\n +------------------------------------+\n |Authentication|Token Length|Token |\n |Data Length | | |\n +------------------------------------+\n Figure 4: Authentication Data to Initiate PoP Based on Challenge/\n Response\n +--------------------------+\n |Authentication|RS Nonce |\n |Data Length |(8 bytes) |\n +--------------------------+\n Figure 5: Authentication Data for Broker Challenge\n For this option, the Broker follows a Broker-generated challenge/\n response protocol. If the Authentication Data inside the Client's\n CONNECT contains only the two-byte integer token length and the token\n (as shown in Figure 4), the Broker MUST respond with an AUTH packet\n with the authenticated reason code set to 0x18 (Continue\n Authentication). The Broker also uses this method if the\n Authentication Data does not contain a token, but the Broker has a\n token stored for the connecting Client.\n The Broker continues authentication using an AUTH packet that\n contains the Authentication Method and the Authentication Data. The\n Authentication Method MUST be set to \"ace\", and the Authentication\n Data MUST NOT be empty and MUST contain an 8-byte RS nonce as a\n challenge for the Client (Figure 5).\n +---------------------------------------------------------+\n |Authentication|Client Nonce |MAC or Signature |\n |Data Length |(8 bytes) |(over RS nonce+Client nonce)|\n +---------------------------------------------------------+\n Figure 6: Authentication Data for the Client Challenge Response\n The Client responds to this with an AUTH packet with reason code 0x18\n (Continue Authentication). Similarly, the Client packet sets the\n Authentication Method to \"ace\". The Authentication Data in the\n Client's response is formatted as shown in Figure 6 and includes the\n 8-byte Client nonce and the signature or MAC computed over the RS\n nonce concatenated with the Client nonce using PoP key in the token.\n Next, the token is validated as described in Section 2.2.5. The\n success case is illustrated in Figure 7. The Client MAY also\n reauthenticate using this challenge-response flow, as described in\n Section 4.\n Client Broker\n | |\n |<===========>| TLS connection setup\n | |\n | |\n +------------>| CONNECT with Authentication Data\n | | contains only token\n | |\n <-------------+ AUTH 0x18 (Cont. Authentication)\n | | 8-byte RS nonce as challenge\n | |\n |------------>| AUTH 0x18 (Cont. Authentication)\n | | 8-byte Client nonce + signature/MAC\n | |\n | |---+ Token validation\n | | | (may involve introspection)\n | |<--+\n | |\n |<------------+ CONNACK 0x00 (Success)\n Figure 7: PoP Challenge/Response Flow - Success\n2.2.5. Broker Token Validation\n The Broker MUST verify the validity of the token either locally\n (e.g., in the case of a self-contained token) or MAY send a request\n to the introspection endpoint of the AS (as described for HTTP-based\n interactions in Section 5.9 of the ACE framework [RFC9200]). The\n Broker MUST verify the claims in the access token according to the\n rules set in Section 5.10.1.1 of the ACE framework [RFC9200].\n To authenticate the Client, the Broker validates the signature or the\n MAC, depending on how the PoP protocol is implemented. For self-\n contained tokens, the Broker MUST process the security protection of\n the token first, as specified by the respective token format, i.e., a\n CWT uses COSE, while a JWT uses JOSE. For a token-by-reference, the\n Broker uses the \"cnf\" structure returned as a result of token\n introspection, as specified in [RFC7519]. HMAC-SHA-256 (HS256)\n [RFC6234] and Ed25519 [RFC8032] are mandatory to implement for the\n Broker. The Client MUST implement at least one of them depending on\n the choice of symmetric or asymmetric validation. Validation of the\n signature or MAC MUST fail if the signature algorithm is set to\n \"none\" when the key used for the signature algorithm cannot be\n determined or the computed and received signature/MAC do not match.\n The Broker MUST check if the access token is still valid, if it is\n the intended destination (i.e., the audience) of the token, and if\n the token was issued by an authorized Authorization Server. If the\n Client is using TLS RPK mode to authenticate to the Broker, the AS\n constructs the access token so that the Broker can associate the\n access token with the Client's public key. The \"cnf\" claim MUST\n contain either the Client's RPK or, if the key is already known by\n the Broker (e.g., from previous communication), a reference to it.\n2.3. Token Scope and Authorization\n The scope field contains the publish and subscribe permissions for\n the Client. Therefore, the token or its introspection result MUST be\n cached to allow a Client's future PUBLISH and SUBSCRIBE messages.\n During the CONNECT, if the Will Flag is set to 1, the Broker MUST\n also authorize the publication of the Will Topic and Will Message\n using the token's scope field. The Broker uses the scope to match\n against the Topic Name in a PUBLISH packet (including Will Topic in\n the CONNECT) or a Topic Filter in a SUBSCRIBE packet.\n The scope in the token is a single value. For a JWT, the single\n scope is a base64url-encoded string with any padding characters\n removed, which has an internal structure of a JSON array. For a CWT,\n this information is represented in CBOR. The internal structure\n follows the Authorization Information Format (AIF) for ACE [RFC9237].\n Using the Concise Data Definition Language (CDDL) [RFC8610], the\n specific data model for MQTT is:\n AIF-MQTT = AIF-Generic<mqtt-topic-filter, mqtt-permissions>\n AIF-Generic<Toid, Tperm> = [* [Toid, Tperm]]\n mqtt-topic-filter = tstr ; as per Section 4.7 of MQTT v5.0\n mqtt-permissions = [+permission]\n permission = \"pub\"/\"sub\"\n Figure 8: AIF-MQTT Data Model\n Topic Filters are implemented according to Section 4.7 of the MQTT\n v5.0 OASIS Standard [MQTT-OASIS-Standard-v5]. By default, Wildcard\n Subscriptions are supported, and so, the Topic Filter may include\n special wildcard characters. The multi-level wildcard, \"#\", matches\n any number of levels within a topic, and the single-level wildcard,\n \"+\", matches one topic level. The Broker MAY signal in the CONNACK\n explicitly whether Wildcard Subscriptions are supported by returning\n a CONNACK property \"Wildcard Subscription Available\". A value of 0\n means that Wildcard Subscriptions are not supported. A value of 1\n means Wildcard Subscriptions are supported.\n Following this model, an example scope may contain:\n [[\"topic1\",[\"pub\",\"sub\"]],[\"topic2/#\",[\"pub\"]],[\"+/topic3\",[\"sub\"]]]\n Figure 9: Example Scope\n This access token gives publish (\"pub\") and subscribe (\"sub\")\n permissions to the \"topic1\", publish permission to all the subtopics\n of \"topic2\", and subscribe permission to all \"topic3\", skipping one\n level.\n If the scope is empty, the Broker records no permissions for the\n Client for any topic. In this case, the Client is not able to\n publish or subscribe to any protected topics. The non-empty scope is\n used to authorize the Will Topic, if provided, in the CONNECT packet,\n during connection setup and, if the connection request succeeds, the\n Topic Names or Topic Filters requested in the future PUBLISH and\n SUBSCRIBE packets. For the authorization to succeed, the Broker MUST\n verify that the Topic Name or Topic Filter in question is either an\n exact match to or a subset of at least one \"topic_filter\" in the\n scope.\n2.4. Broker Response to Client Connection Request\n Based on the validation result (obtained either via local inspection\n or using the introspection interface of the AS), the Broker MUST send\n a CONNACK packet to the Client.\n2.4.1. Unauthorized Request and the Optional Authorization Server\n Discovery\n Authentication can fail for the following reasons:\n * if the Client does not provide a valid token,\n * the Client omits the Authentication Data field and the Broker has\n no token stored for the Client,\n * the token or Authentication data are malformed, or\n * if the Will Flag is set, the authorization checks for the Will\n Topic fails.\n The Broker responds with the CONNACK reason code 0x87 (Not\n Authorized) or any other applicable reason code.\n The Broker MAY also trigger AS discovery and include a User Property\n (identified as property type 38 (0x26)) in the CONNACK for the AS\n Request Creation Hints. The User Property is a UTF-8 string pair,\n composed of a name and a value. The name of the User Property MUST\n be set to \"ace_as_hint\". The value of the User Property is a UTF-\n 8-encoded JSON object containing the mandatory \"AS\" parameter and the\n optional parameters \"audience\", \"kid\", \"cnonce\", and \"scope\", as\n defined in Section 5.3 of the ACE framework [RFC9200].\n2.4.2. Authorization Success\n On success, the reason code of the CONNACK is 0x00 (Success). If the\n Broker starts a new Session, it MUST also set Session Present to 0 in\n the CONNACK packet to signal a new Session to the Client. Otherwise,\n it MUST set Session Present to 1.\n Having accepted the connection, the Broker MUST be prepared to store\n the token during the connection and after disconnection for future\n use. If the token is not self-contained and the Broker uses token\n introspection, it MAY cache the validation result to authorize the\n subsequent PUBLISH and SUBSCRIBE packets. PUBLISH and SUBSCRIBE\n packets, which are sent after a connection setup, do not contain\n access tokens. If the introspection result is not cached, the Broker\n needs to introspect the saved token for each request. The Broker\n SHOULD also use a cache timeout to introspect tokens regularly. The\n timeout value is specific to the application and should be chosen to\n reduce the risk of using stale introspection responses."
13
+ },
14
+ {
15
+ "section_number": "3.",
16
+ "section_name": "Authorizing PUBLISH and SUBSCRIBE Packets",
17
+ "tag": "Section 3. Authorizing PUBLISH and SUBSCRIBE Packets",
18
+ "content": "Using the cached token or its introspection result, the Broker uses\n the scope field to match against the Topic Name in a PUBLISH packet\n or a Topic Filter in a SUBSCRIBE packet.\n3.1. PUBLISH Packets from the Publisher Client to the Broker\n On receiving the PUBLISH packet, the Broker MUST use the type of\n packet (i.e., PUBLISH) and the Topic Name in the packet header to\n match against the scope array items in the cached token or its\n introspection result. Following the example in Section 2.3, the\n Client sending a PUBLISH packet for \"topic2/a\" would be allowed, as\n the scope array includes the [\"topic2/#\",[\"pub\"]].\n If the Client is allowed to publish to the topic, the Broker\n publishes the message to all valid subscribers of the topic. In the\n case of an authorization failure, the Broker MUST return an error if\n the Client has set the QoS level of the PUBLISH packet to greater\n than or equal to 1. Depending on the QoS level, the Broker responds\n with either a PUBACK or PUBREC packet with reason code 0x87 (Not\n authorized). On receiving an acknowledgment with 0x87 (Not\n authorized), the Client MAY reauthenticate by providing a new token,\n as described in Section 4.\n For QoS level 0, the Broker sends a DISCONNECT packet with reason\n code 0x87 (Not authorized) and closes the Network Connection. Note\n that the server-side DISCONNECT is a new feature of MQTT v5.0 (in\n MQTT v3.1.1, the server needs to drop the connection).\n For all QoS levels, the Broker MAY return 0x80 (Unspecified error) if\n they do not want to leak the Topic Names to unauthorized clients.\n3.2. PUBLISH Packets from the Broker to the Subscriber Clients\n To forward PUBLISH packets to the subscribing Clients, the Broker\n identifies all the subscribers that have valid matching Topic\n Subscriptions to the Topic Name of the PUBLISH packet (i.e., the\n tokens are valid, and token scopes allow a Subscription to this\n particular Topic Name). The Broker forwards the PUBLISH packet to\n all the valid subscribers.\n The Broker MUST NOT forward messages to unauthorized subscribers. To\n avoid silently dropping messages, the Broker MUST close the Network\n Connection and SHOULD inform the affected subscribers. In this case,\n the only way to inform a client would be sending a DISCONNECT packet.\n Therefore, the Broker SHOULD send a DISCONNECT packet with reason\n code 0x87 (Not authorized) before closing the Network Connection to\n these clients.\n3.3. Authorizing SUBSCRIBE Packets\n In MQTT, a SUBSCRIBE packet is sent from a Client to the Broker to\n create one or more Subscriptions to one or more topics. The\n SUBSCRIBE packet may contain multiple Topic Filters. The Topic\n Filters may include wildcard characters.\n On receiving the SUBSCRIBE packet, the Broker MUST use the type of\n packet (i.e., SUBSCRIBE) and the Topic Filter in the packet header to\n match against the scope field of the stored token or introspection\n result. The Topic Filters MUST be an exact match to or be a subset\n of at least one of the \"topic_filter\" fields in the scope array found\n in the Client's token. For example, if the Client sends a SUBSCRIBE\n request for topic \"a/b/*\" and has a token that permits \"a/*\", this is\n a valid SUBSCRIBE request, as \"a/b/*\" is a subset of \"a/*\". (The\n process is similar to a Broker matching the Topic Name in a PUBLISH\n packet against the Subscriptions known to the Server.)\n As a response to the SUBSCRIBE packet, the Broker issues a SUBACK\n packet. For each Topic Filter, the SUBACK packet includes a return\n code matching the QoS level for the corresponding Topic Filter. In\n the case of failure, the return code is 0x87, indicating that the\n Client is not authorized. The Broker MAY return 0x80 (Unspecified\n error) if they do not want to leak the Topic Names to unauthorized\n clients. A reason code is returned for each Topic Filter.\n Therefore, the Client may receive success codes for a subset of its\n Topic Filters while being unauthorized for the rest."
19
+ },
20
+ {
21
+ "section_number": "4.",
22
+ "section_name": "Token Expiration, Update, and Reauthentication",
23
+ "tag": "Section 4. Token Expiration, Update, and Reauthentication",
24
+ "content": "The Broker MUST check for token expiration whenever a CONNECT,\n PUBLISH, or SUBSCRIBE packet is received or sent. The Broker SHOULD\n check for token expiration on receiving a PINGREQ packet. The Broker\n MAY also check for token expiration periodically, e.g., every hour.\n This may allow for early detection of a token expiry.\n The token expiration is checked by checking the \"exp\" claim of a JWT\n or introspection response or via performing an introspection request\n with the AS, as described in Section 5.9 of the ACE framework\n [RFC9200]. Token expirations may trigger the Broker to send PUBACK,\n SUBACK, and DISCONNECT packets with the return code set to \"Not\n authorized\". After sending a DISCONNECT packet, the Network\n Connection is closed, and no more messages can be sent.\n The Client MAY reauthenticate a response to PUBACK and SUBACK, which\n signal loss of authorization. The Clients MAY also proactively\n update their tokens, i.e., before they receive a packet with a \"Not\n authorized\" return code. To start reauthentication, the Client MUST\n send an AUTH packet with reason code 0x19 (Reauthentication). The\n Client MUST set the Authentication Method as \"ace\" and transport the\n new token in the Authentication Data. If reauthenticating during the\n current TLS session, the Client MUST NOT use the method described in\n Section 2.2.4.2.1, i.e., proof of possession using a challenge from\n the TLS session, to avoid reusing the same challenge value from the\n TLS-Exporter. Note that this means that servers will either need to\n record in the session ticket or database entry whether the TLS-\n Exporter-derived challenge was used or always deny use of the TLS-\n Exporter-derived challenge for resumed sessions. In TLS 1.3, the\n resumed connection would have a new exporter value, but the\n requirement is phrased this way for simplicity. For\n reauthentications in the same TLS-session, the Client MUST use the\n challenge-response PoP, as defined in Section 2.2.4.2.2. The Broker\n accepts reauthentication requests if the Client has already submitted\n a token (may be expired), for which it performed proof of possession.\n Otherwise, the Broker MUST deny the request. If the reauthentication\n fails, the Broker MUST send a DISCONNECT packet with reason code 0x87\n (Not Authorized)."
25
+ },
26
+ {
27
+ "section_number": "5.",
28
+ "section_name": "Handling Disconnections and Retained Messages",
29
+ "tag": "Section 5. Handling Disconnections and Retained Messages",
30
+ "content": "In the case of a Client DISCONNECT, if the Session Expiry Interval is\n set to 0, the Broker doesn't store the Session State but MUST keep\n the retained messages. If the Broker stores the Session State, the\n state MAY include the token and its introspection result (for\n reference tokens) in addition to the MQTT Session State. The MQTT\n Session State is identified by the Client Identifier and includes the\n following:\n * the Client Subscriptions,\n * messages with QoS levels 1 and 2, which have not been completely\n acknowledged or are pending transmission to the Client, and\n * if the Session is currently not connected, the time at which the\n Session will end and the Session State will be discarded.\n The token/introspection state is not part of the MQTT Session State,\n and PoP validation is required for each new connection, regardless of\n whether existing MQTT Sessions are continued.\n The messages to be retained are indicated to the Broker by setting a\n RETAIN flag in a PUBLISH packet. This way, the publisher signals to\n the Broker to store the most recent message for the associated topic.\n Hence, the new subscribers can receive the last sent message from the\n publisher for that particular topic without waiting for the next\n PUBLISH packet. The Broker MUST continue publishing the retained\n messages as long as the associated tokens are valid. In the MQTT\n standard, if QoS is 0 for the PUBLISH packet, the Broker may discard\n the retained message any time. For QoS > 1, the message expiry\n interval dictates how long the retained message is kept. However, it\n is important that the Broker avoids sending messages indefinitely for\n the Clients that never update their tokens (i.e., the Client connects\n briefly with a valid token, sends a PUBLISH packet with the RETAIN\n flag set to 1 and QoS > 1, disconnects, and never connects again).\n Therefore, the Broker MUST use the minimum of the token expiry and\n message expiry interval to discard a retained message.\n In case of disconnections due to network errors or server\n disconnection due to a protocol error (which includes authorization\n errors), the Will Message is sent if the Client supplied a Will in\n the CONNECT packet. The Client's token scope array MUST include the\n Will Topic. The Will Message MUST be published to the Will Topic,\n regardless of whether the corresponding token has expired (as it has\n been validated and accepted during CONNECT)."
31
+ },
32
+ {
33
+ "section_number": "6.",
34
+ "section_name": "Reduced Protocol Interactions for MQTT v3.1.1",
35
+ "tag": "Section 6. Reduced Protocol Interactions for MQTT v3.1.1",
36
+ "content": "This section describes a reduced set of protocol interactions for the\n MQTT v3.1.1 Clients. An MQTT v5.0 Broker MAY implement these\n interactions for the MQTT v3.1.1 Clients; the flows described in this\n section are NOT RECOMMENDED for use by MQTT v5.0 Clients. Brokers\n that do not support MQTT v3.1.1 Clients return a CONNACK packet with\n reason code 0x84 (Unsupported Protocol Version) in response to the\n connection requests.\n6.1. Token Transport\n As in MQTT v5.0, the token MAY either be transported before, by\n publishing to the \"authz-info\" topic, or inside the CONNECT packet.\n If the Client provided the token via the \"authz-info\" topic and will\n not update the token in the CONNECT packet, it MUST authenticate over\n TLS. The Broker SHOULD still be prepared to store the Client access\n token for future use (regardless of the method of transport).\n In MQTT v3.1.1, after the Client has published to the \"authz-info\"\n topic, the Broker cannot communicate the result of the token\n validation because PUBACK reason codes or server-side DISCONNECT\n packets are not supported. In any case, the subsequent TLS handshake\n would fail without a valid token, which can prompt the Client to\n obtain a valid token.\n To transport the token to the Broker inside the CONNECT packet, the\n Client uses the User Name and Password fields. Figure 10 shows the\n structure of the MQTT CONNECT packet.\n 0 8 16\n +---------------------------+\n |Protocol name length = 4 |\n +---------------------------+\n | 'M' 'Q' |\n +---------------------------+\n | 'T' 'T' |\n +---------------------------+\n |Proto.level=5|Connect flags|\n +---------------------------+\n | Keep alive |\n +---------------------------+\n | Payload |\n | Client Identifier |\n | (UTF-8-encoded string) |\n | User Name as access token |\n | (UTF-8-encoded string) |\n | Password for signature/MAC|\n | (Binary Data) |\n +---------------------------+\n Figure 10: MQTT CONNECT Variable Header Using a User Name and\n Password for ACE\n Table 2 shows how the MQTT connect flags MUST be set to initiate a\n connection with the Broker.\n +================+==========+========+======+======+=======+=======+\n | User Name Flag | Password | Will | Will | Will | Clean | Rsvd. |\n | | Flag | Retain | QoS | Flag | | |\n +================+==========+========+======+======+=======+=======+\n | 1 | 1 | X | X X | X | X | 0 |\n +----------------+----------+--------+------+------+-------+-------+\n Table 2: MQTT CONNECT Flags (Rsvd. = Reserved)\n The Client SHOULD set the Clean flag to 1 to always start a new\n Session. If the Clean flag is set to 0, the Broker MUST resume\n communications with the Client based on the state from the current\n Session (as identified by the Client Identifier). If there is no\n Session associated with the Client Identifier, the Broker MUST create\n a new Session. The Broker MUST set the Session Present flag in the\n CONNACK packet accordingly, i.e., 0 to indicate a new Session to the\n Client and 1 to indicate that the existing Session is continued. The\n Broker MUST still perform PoP validation on the provided Client\n token. MQTT v3.1.1 does not use a Session Expiry Interval, and the\n Client expects that the Broker maintains the Session State after it\n disconnects. However, the stored Session State can be discarded as a\n result of administrator action or policies (e.g., defining an\n automated response based on storage capabilities), and Brokers SHOULD\n implement administrative policies to limit misuse.\n The Client MAY set the Will Flag as desired (marked as \"X\" in\n Table 2). User Name and Password flags MUST be set to 1 to ensure\n that the Payload of the CONNECT packet includes both the User Name\n and Password fields. The MQTT User Name is a UTF-8-encoded string,\n and the MQTT Password is Binary Data.\n The CONNECT in MQTT v3.1.1 does not have a field to indicate the\n Authentication Method. To signal that the User Name field contains\n an ACE token, this field MUST be prefixed with the keyword \"ace\",\n i.e., the User Name field is a concatenation of 'a', 'c', 'e', and\n the access token represented as:\n 'U+0061'||'U+0063'||'U+0065'||UTF-8(access token)\n Figure 11: User Name in CONNECT\n To this end, the access token MUST be encoded with base64url,\n omitting the \"=\" padding characters [RFC4648].\n The Password field MUST be set to the keyed message digest (MAC) or\n signature associated with the access token for PoP. The Client MUST\n apply the PoP key on the challenge derived from the TLS session, as\n described in Section 2.2.4.2.1.\n6.2. Handling Authorization Errors\n Error handling is more primitive in MQTT v3.1.1 due to not having\n appropriate error fields, error codes, and server-side DISCONNECTs.\n Therefore, the Broker will disconnect on almost any error and may not\n keep the Session State, necessitating that clients make a greater\n effort to ensure that tokens remain valid and do not attempt to\n publish to topics that they do not have permissions for. The\n following lists how the Broker responds to specific errors.\n CONNECT without a token:\n The tokenless CONNECT attempt MUST fail. This is because the\n challenge-response-based PoP is not possible for MQTT v3.1.1.\n It is also not possible to support AS discovery since a\n CONNACK packet in MQTT v3.1.1 does not include a means to\n provide additional information to the Client. Therefore, AS\n discovery needs to take place out of band.\n Client-Broker PUBLISH authorization failure:\n In the case of a failure, it is not possible to return an\n error in MQTT v3.1.1. Acknowledgment messages only indicate\n success. In the case of an authorization error, the Broker\n MUST ignore the PUBLISH packet and disconnect the Client.\n Also, as DISCONNECT packets are only sent from a Client to\n the Broker, the server disconnection needs to take place\n below the application layer.\n SUBSCRIBE authorization failure:\n In the SUBACK packet, the return code is 0x80, indicating\n failure for the unauthorized topic(s). Note that, in both\n MQTT versions, a reason code is returned for each Topic\n Filter.\n Broker-Client PUBLISH authorization failure:\n When the Broker is forwarding PUBLISH packets to the\n subscribed Clients, it may discover that some of the\n subscribers are no longer authorized due to expired tokens.\n These token expirations MUST lead to disconnecting the Client\n rather than silently dropping messages."
37
+ },
38
+ {
39
+ "section_number": "7.",
40
+ "section_name": "IANA Considerations",
41
+ "tag": "Section 7. IANA Considerations",
42
+ "content": "7.1. TLS Exporter Labels Registration\n This document registers \"EXPORTER-ACE-MQTT-Sign-Challenge\"\n (introduced in Section 2.2.4.2.1 in this document) in the \"TLS\n Exporter Labels\" registry [RFC8447].\n Recommended: N\n DTLS-OK: N\n Reference: RFC 9431\n7.2. Media Type Registration\n This document registers the \"application/ace+json\" media type for\n messages of the protocols defined in this document carrying\n parameters encoded in JSON.\n Type name: application\n Subtype name: ace+json\n Required parameters: N/A\n Optional parameters: N/A\n Encoding considerations: Encoding considerations are identical to\n those specified for the \"application/json\" media type.\n Security considerations: Section 8 of RFC 9431\n Interoperability considerations: none\n Published specification: RFC 9431\n Applications that use this media type: This media type is intended\n for Authorization-Server-Client and Authorization-Server-Resource-\n Server communication as part of the ACE framework using JSON\n encoding, as specified in RFC 9431.\n Fragment identifier considerations: none\n Additional information:\n Deprecated alias names for this type: none\n Magic number(s): none\n File extension(s): none\n Macintosh file type code(s): none\n Person & email address to contact for further information:\n Cigdem Sengul <csengul@acm.org>\n Intended usage: COMMON\n Restrictions on usage: none\n Author: Cigdem Sengul <csengul@acm.org>\n Change controller: IETF\n7.3. ACE OAuth Profile Registration\n The following registrations have been made in the \"ACE Profiles\"\n registry, following the procedure specified in [RFC9200].\n Name: mqtt_tls\n Description: Profile for delegating Client authentication and\n authorization using MQTT for the Client and Broker (RS)\n interactions and HTTP for the AS interactions. TLS is used for\n confidentiality and integrity protection and server\n authentication. Client authentication can be provided either via\n TLS or using in-band PoP validation at the MQTT application layer.\n CBOR Value: 3\n Reference: RFC 9431\n7.4. AIF\n For the media types \"application/aif+cbor\" and \"application/\n aif+json\", defined in Section 5.1 of [RFC9237], IANA has registered\n the following entries for the two media type parameters Toid and\n Tperm in the respective subregistry defined in Section 5.2 of\n [RFC9237] within the \"Media Type Sub-Parameter Registries\".\n For Toid:\n Name: mqtt-topic-filter\n Description/Specification: Topic Filter, as defined in\n Section 2.3 of RFC 9431.\n Reference: RFC 9431, Section 2.3\n For Tperm:\n Name: mqtt-permissions\n Description/Specification: Permissions for the MQTT Client, as\n defined in Section 2.3 of RFC 9431. Tperm is an array of one\n or more text strings that each have a value of either \"pub\" or\n \"sub\".\n Reference: RFC 9431, Section 2.3"
43
+ },
44
+ {
45
+ "section_number": "8.",
46
+ "section_name": "Security Considerations",
47
+ "tag": "Section 8. Security Considerations",
48
+ "content": "This document specifies a profile for the Authentication and\n Authorization for Constrained Environments (ACE) framework [RFC9200].\n Therefore, the security considerations outlined in [RFC9200] apply to\n this work.\n In addition, the security considerations outlined in the MQTT v5.0\n OASIS Standard [MQTT-OASIS-Standard-v5] and MQTT v3.1.1 OASIS\n Standard [MQTT-OASIS-Standard-v3.1.1] apply. Mainly, this document\n provides an authorization solution for MQTT, the responsibility of\n which is left to the specific implementation in the MQTT standards.\n In the following, we comment on a few relevant issues based on the\n current MQTT specifications.\n After the Broker validates an access token and accepts a connection\n from a client, it caches the token to authorize a Client's publish\n and subscribe requests in an ongoing Session. The Broker does not\n cache any tokens that cannot be validated. If a Client's permissions\n get revoked, but the access token has not expired, the Broker may\n still grant publish/subscribe to revoked topics. If the Broker\n caches the token introspection responses, then the Broker SHOULD use\n a reasonable cache timeout to introspect tokens regularly. The\n timeout value is application specific and should be chosen to reduce\n the risk of using stale introspection responses. When permissions\n change dynamically, it is expected that the AS also follows a\n reasonable expiration strategy for the access tokens.\n The Broker may monitor Client behavior to detect potential security\n problems, especially those affecting availability. These include\n repeated token transfer attempts to the public \"authz-info\" topic,\n repeated connection attempts, abnormal terminations, and Clients that\n connect but do not send any data. If the Broker supports the public\n \"authz-info\" topic, described in Section 2.2.2, then this may be\n vulnerable to a DDoS attack, where many Clients use the \"authz-info\"\n public topic to transport tokens that are not meant to be used and\n that the Broker may need to store until they expire.\n For MQTT v5.0, when a Client connects with a long Session Expiry\n Interval, the Broker may need to maintain the Client's MQTT Session\n State after it disconnects for an extended period. For MQTT v3.1.1,\n the Session State may need to be stored indefinitely, as it does not\n have a Session Expiry Interval feature. The Broker SHOULD implement\n administrative policies to limit misuse by the Client resulting from\n continuing existing Sessions."
49
+ },
50
+ {
51
+ "section_number": "9.",
52
+ "section_name": "Privacy Considerations",
53
+ "tag": "Section 9. Privacy Considerations",
54
+ "content": "The privacy considerations outlined in [RFC9200] apply to this work.\n In MQTT, the Broker is a central trusted party and may forward\n potentially sensitive information between Clients. The mechanisms\n defined in this document do not protect the contents of the PUBLISH\n packet from the Broker, and hence, the content of the PUBLISH packet\n is not signed or encrypted separately for the subscribers. This\n functionality may be implemented using the proposal outlined in the\n ACE Pub-Sub Profile [ACE-PUBSUB-PROFILE]. However, this solution\n would still not provide privacy for other fields of the packet, such\n as Topic Name."
55
+ },
56
+ {
57
+ "section_number": "10.",
58
+ "section_name": "References",
59
+ "tag": "Section 10. References",
60
+ "content": "10.1. Normative References\n [MQTT-OASIS-Standard-v3.1.1]\n Banks, A., Ed. and R. Gupta, Ed., \"MQTT Version 3.1.1 Plus\n Errata 01\", OASIS Standard, December 2015,\n <https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-\n v3.1.1.html>.\n [MQTT-OASIS-Standard-v5]\n Banks, A., Ed., Briggs, E., Ed., Borgendale, K., Ed., and\n R. Gupta, Ed., \"MQTT Version 5.0\", OASIS Standard, March\n 2019, <https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-\n v5.0.html>.\n [RFC2119] Bradner, S., \"Key words for use in RFCs to Indicate\n Requirement Levels\", BCP 14, RFC 2119,\n <https://www.rfc-editor.org/info/rfc2119>.\n [RFC4648] Josefsson, S., \"The Base16, Base32, and Base64 Data\n <https://www.rfc-editor.org/info/rfc4648>.\n [RFC5705] Rescorla, E., \"Keying Material Exporters for Transport\n Layer Security (TLS)\", RFC 5705, DOI 10.17487/RFC5705,\n [RFC6066] Eastlake 3rd, D., \"Transport Layer Security (TLS)\n Extensions: Extension Definitions\", RFC 6066,\n <https://www.rfc-editor.org/info/rfc6066>.\n [RFC6234] Eastlake 3rd, D. and T. Hansen, \"US Secure Hash Algorithms\n (SHA and SHA-based HMAC and HKDF)\", RFC 6234,\n <https://www.rfc-editor.org/info/rfc6234>.\n [RFC6749] Hardt, D., Ed., \"The OAuth 2.0 Authorization Framework\",\n <https://www.rfc-editor.org/info/rfc6749>.\n [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J.,\n Weiler, S., and T. Kivinen, \"Using Raw Public Keys in\n Transport Layer Security (TLS) and Datagram Transport\n Layer Security (DTLS)\", RFC 7250, DOI 10.17487/RFC7250,\n [RFC7301] Friedl, S., Popov, A., Langley, A., and E. Stephan,\n \"Transport Layer Security (TLS) Application-Layer Protocol\n Negotiation Extension\", RFC 7301, DOI 10.17487/RFC7301,\n [RFC7516] Jones, M. and J. Hildebrand, \"JSON Web Encryption (JWE)\",\n <https://www.rfc-editor.org/info/rfc7516>.\n [RFC7517] Jones, M., \"JSON Web Key (JWK)\", RFC 7517,\n <https://www.rfc-editor.org/info/rfc7517>.\n [RFC7519] Jones, M., Bradley, J., and N. Sakimura, \"JSON Web Token\n <https://www.rfc-editor.org/info/rfc7519>.\n [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A.,\n Langley, A., and M. Ray, \"Transport Layer Security (TLS)\n Session Hash and Extended Master Secret Extension\",\n <https://www.rfc-editor.org/info/rfc7627>.\n [RFC7800] Jones, M., Bradley, J., and H. Tschofenig, \"Proof-of-\n Possession Key Semantics for JSON Web Tokens (JWTs)\",\n <https://www.rfc-editor.org/info/rfc7800>.\n [RFC8032] Josefsson, S. and I. Liusvaara, \"Edwards-Curve Digital\n Signature Algorithm (EdDSA)\", RFC 8032,\n <https://www.rfc-editor.org/info/rfc8032>.\n [RFC8174] Leiba, B., \"Ambiguity of Uppercase vs Lowercase in RFC\n 2119 Key Words\", BCP 14, RFC 8174, DOI 10.17487/RFC8174,\n [RFC8422] Nir, Y., Josefsson, S., and M. Pegourie-Gonnard, \"Elliptic\n Curve Cryptography (ECC) Cipher Suites for Transport Layer\n Security (TLS) Versions 1.2 and Earlier\", RFC 8422,\n <https://www.rfc-editor.org/info/rfc8422>.\n [RFC8442] Mattsson, J. and D. Migault, \"ECDHE_PSK with AES-GCM and\n AES-CCM Cipher Suites for TLS 1.2 and DTLS 1.2\", RFC 8442,\n <https://www.rfc-editor.org/info/rfc8442>.\n [RFC8446] Rescorla, E., \"The Transport Layer Security (TLS) Protocol\n <https://www.rfc-editor.org/info/rfc8446>.\n [RFC8610] Birkholz, H., Vigano, C., and C. Bormann, \"Concise Data\n Definition Language (CDDL): A Notational Convention to\n Express Concise Binary Object Representation (CBOR) and\n JSON Data Structures\", RFC 8610, DOI 10.17487/RFC8610,\n [RFC8747] Jones, M., Seitz, L., Selander, G., Erdtman, S., and H.\n Tschofenig, \"Proof-of-Possession Key Semantics for CBOR\n Web Tokens (CWTs)\", RFC 8747, DOI 10.17487/RFC8747, March\n 2020, <https://www.rfc-editor.org/info/rfc8747>.\n [RFC9052] Schaad, J., \"CBOR Object Signing and Encryption (COSE):\n Structures and Process\", STD 96, RFC 9052,\n <https://www.rfc-editor.org/info/rfc9052>.\n [RFC9110] Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke,\n Ed., \"HTTP Semantics\", STD 97, RFC 9110,\n <https://www.rfc-editor.org/info/rfc9110>.\n [RFC9200] Seitz, L., Selander, G., Wahlstroem, E., Erdtman, S., and\n H. Tschofenig, \"Authentication and Authorization for\n Constrained Environments Using the OAuth 2.0 Framework\n <https://www.rfc-editor.org/info/rfc9200>.\n [RFC9201] Seitz, L., \"Additional OAuth Parameters for Authentication\n and Authorization for Constrained Environments (ACE)\",\n <https://www.rfc-editor.org/info/rfc9201>.\n [RFC9202] Gerdes, S., Bergmann, O., Bormann, C., Selander, G., and\n L. Seitz, \"Datagram Transport Layer Security (DTLS)\n Profile for Authentication and Authorization for\n Constrained Environments (ACE)\", RFC 9202,\n <https://www.rfc-editor.org/info/rfc9202>.\n [RFC9237] Bormann, C., \"An Authorization Information Format (AIF)\n for Authentication and Authorization for Constrained\n Environments (ACE)\", RFC 9237, DOI 10.17487/RFC9237,\n [RFC9360] Schaad, J., \"CBOR Object Signing and Encryption (COSE):\n Header Parameters for Carrying and Referencing X.509\n Certificates\", RFC 9360, DOI 10.17487/RFC9360, February\n 2023, <https://www.rfc-editor.org/info/rfc9360>.\n [RFC9430] Bergmann, O., Preu\u00df Mattsson, J., and G. Selander,\n \"Extension of the Datagram Transport Layer Security (DTLS)\n Profile for Authentication and Authorization for\n Constrained Environments (ACE) to Transport Layer Security\n <https://www.rfc-editor.org/info/rfc9430>.\n10.2. Informative References\n [ACE-PUBSUB-PROFILE]\n Palombini, F., Sengul, C., and M. Tiloca, \"Publish-\n Subscribe Profile for Authentication and Authorization for\n Constrained Environments (ACE)\", Work in Progress,\n Internet-Draft, draft-ietf-ace-pubsub-profile-06, 13 March\n 2023, <https://datatracker.ietf.org/doc/html/draft-ietf-\n ace-pubsub-profile-06>.\n [Fremantle14]\n Fremantle, P., Aziz, B., Kopecky, J., and P. Scott,\n \"Federated Identity and Access Management for the Internet\n of Things\", International Workshop on Secure Internet of\n Things, DOI 10.1109/SIoT.2014.8, September 2014,\n <https://dx.doi.org/10.1109/SIoT.2014.8>.\n [RFC4949] Shirey, R., \"Internet Security Glossary, Version 2\",\n <https://www.rfc-editor.org/info/rfc4949>.\n [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, \"The Constrained\n Application Protocol (CoAP)\", RFC 7252,\n <https://www.rfc-editor.org/info/rfc7252>.\n [RFC7925] Tschofenig, H., Ed. and T. Fossati, \"Transport Layer\n Security (TLS) / Datagram Transport Layer Security (DTLS)\n Profiles for the Internet of Things\", RFC 7925,\n <https://www.rfc-editor.org/info/rfc7925>.\n [RFC8392] Jones, M., Wahlstroem, E., Erdtman, S., and H. Tschofenig,\n \"CBOR Web Token (CWT)\", RFC 8392, DOI 10.17487/RFC8392,\n [RFC8447] Salowey, J. and S. Turner, \"IANA Registry Updates for TLS\n <https://www.rfc-editor.org/info/rfc8447>.\n [RFC8949] Bormann, C. and P. Hoffman, \"Concise Binary Object\n Representation (CBOR)\", STD 94, RFC 8949,\n <https://www.rfc-editor.org/info/rfc8949>.\n [RFC9325] Sheffer, Y., Saint-Andre, P., and T. Fossati,\n \"Recommendations for Secure Use of Transport Layer\n Security (TLS) and Datagram Transport Layer Security\n (DTLS)\", BCP 195, RFC 9325, DOI 10.17487/RFC9325, November\n 2022, <https://www.rfc-editor.org/info/rfc9325>.\n [TLS-bis] Rescorla, E., \"The Transport Layer Security (TLS) Protocol\n Version 1.3\", Work in Progress, Internet-Draft, draft-\n ietf-tls-rfc8446bis-09, 7 July 2023,\n <https://datatracker.ietf.org/doc/html/draft-ietf-tls-\n rfc8446bis-09>."
61
+ },
62
+ {
63
+ "section_number": "Appendix A.",
64
+ "section_name": "Checklist for Profile Requirements",
65
+ "tag": "Section Appendix A. Checklist for Profile Requirements",
66
+ "content": "Based on the requirements on profiles for the ACE framework\n [RFC9200], this document fulfills the following:\n * Optional AS discovery: AS discovery is supported with the MQTT\n v5.0 described in Section 2.2.\n * The communication protocol between the Client and Broker (RS):\n MQTT\n * The security protocol between the Client and RS: TLS\n * Client and RS mutual authentication: Several options are possible\n and described in Section 2.2.1.\n * Proof-of-possession protocols: Both symmetric and asymmetric keys\n are supported, as specified in Section 2.2.4.2.\n * Content-Format: For the HTTPS interactions with AS, \"application/\n ace+json\".\n * Unique profile identifier: mqtt_tls\n * Token introspection: The RS uses the HTTPS introspection interface\n of the AS.\n * Token request: The Client or its Client AS uses the HTTPS token\n endpoint of the AS.\n * authz-info endpoint: It MAY be supported using the method\n described in Section 2.2.2 but is not protected other than by the\n TLS channel between the Client and RS.\n * Token transport: Via the \"authz-info\" topic, TLS with PSKs\n (provided as a PSK identity), or in the MQTT CONNECT packet for\n both versions of MQTT. The AUTH extensions can also be used for\n authentication and reauthentication for MQTT v5.0, as described in\n Sections 2.2 and 4.\nAcknowledgments\n The authors would like to thank Ludwig Seitz for his review and his\n input on the authorization information endpoint; Benjamin Kaduk for\n his review, insightful comments, and contributions to resolving\n issues; and Carsten Bormann for his review and revisions to the AIF-\n MQTT data model. The authors would like to thank Paul Fremantle for\n the initial discussions on MQTT v5.0 support.\nAuthors' Addresses\n Cigdem Sengul\n Brunel University\n Dept. of Computer Science\n Uxbridge\n UB8 3PH\n United Kingdom\n Email: csengul@acm.org\n Anthony Kirby\n Oxbotica\n 1a Milford House\n Mayfield Road, Summertown\n Oxford\n OX2 7EL\n United Kingdom\n Email: anthony@anthony.org"
67
+ }
68
+ ]
RFCChunks/NNTP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/POP3_segments.json ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "section_number": "1.",
4
+ "section_name": "Introduction",
5
+ "tag": "Section 1. Introduction",
6
+ "content": "On certain types of smaller nodes in the Internet it is often\n impractical to maintain a message transport system (MTS). For\n example, a workstation may not have sufficient resources (cycles,\n disk space) in order to permit a SMTP server [RFC821] and associated\n local mail delivery system to be kept resident and continuously\n running. Similarly, it may be expensive (or impossible) to keep a\n personal computer interconnected to an IP-style network for long\n amounts of time (the node is lacking the resource known as\n \"connectivity\").\n Despite this, it is often very useful to be able to manage mail on\n these smaller nodes, and they often support a user agent (UA) to aid\n the tasks of mail handling. To solve this problem, a node which can\n support an MTS entity offers a maildrop service to these less endowed\n nodes. The Post Office Protocol - Version 3 (POP3) is intended to\n permit a workstation to dynamically access a maildrop on a server\n host in a useful fashion. Usually, this means that the POP3 protocol\n is used to allow a workstation to retrieve mail that the server is\n holding for it.\n POP3 is not intended to provide extensive manipulation operations of\n mail on the server; normally, mail is downloaded and then deleted. A\n more advanced (and complex) protocol, IMAP4, is discussed in\n [RFC1730].\n For the remainder of this memo, the term \"client host\" refers to a\n host making use of the POP3 service, while the term \"server host\"\n refers to a host which offers the POP3 service."
7
+ },
8
+ {
9
+ "section_number": "2.",
10
+ "section_name": "A Short Digression",
11
+ "tag": "Section 2. A Short Digression",
12
+ "content": "This memo does not specify how a client host enters mail into the\n transport system, although a method consistent with the philosophy of\n this memo is presented here:\n When the user agent on a client host wishes to enter a message\n into the transport system, it establishes an SMTP connection to\n its relay host and sends all mail to it. This relay host could\n be, but need not be, the POP3 server host for the client host. Of\n course, the relay host must accept mail for delivery to arbitrary\n recipient addresses, that functionality is not required of all\n SMTP servers."
13
+ },
14
+ {
15
+ "section_number": "3.",
16
+ "section_name": "Basic Operation",
17
+ "tag": "Section 3. Basic Operation",
18
+ "content": "Initially, the server host starts the POP3 service by listening on\n TCP port 110. When a client host wishes to make use of the service,\n it establishes a TCP connection with the server host. When the\n connection is established, the POP3 server sends a greeting. The\n client and POP3 server then exchange commands and responses\n (respectively) until the connection is closed or aborted.\n Commands in the POP3 consist of a case-insensitive keyword, possibly\n followed by one or more arguments. All commands are terminated by a\n CRLF pair. Keywords and arguments consist of printable ASCII\n characters. Keywords and arguments are each separated by a single\n SPACE character. Keywords are three or four characters long. Each\n argument may be up to 40 characters long.\n Responses in the POP3 consist of a status indicator and a keyword\n possibly followed by additional information. All responses are\n terminated by a CRLF pair. Responses may be up to 512 characters\n long, including the terminating CRLF. There are currently two status\n indicators: positive (\"+OK\") and negative (\"-ERR\"). Servers MUST\n send the \"+OK\" and \"-ERR\" in upper case.\n Responses to certain commands are multi-line. In these cases, which\n are clearly indicated below, after sending the first line of the\n response and a CRLF, any additional lines are sent, each terminated\n by a CRLF pair. When all lines of the response have been sent, a\n final line is sent, consisting of a termination octet (decimal code\n 046, \".\") and a CRLF pair. If any line of the multi-line response\n begins with the termination octet, the line is \"byte-stuffed\" by\n pre-pending the termination octet to that line of the response.\n Hence a multi-line response is terminated with the five octets\n \"CRLF.CRLF\". When examining a multi-line response, the client checks\n to see if the line begins with the termination octet. If so and if\n octets other than CRLF follow, the first octet of the line (the\n termination octet) is stripped away. If so and if CRLF immediately\n follows the termination character, then the response from the POP\n server is ended and the line containing \".CRLF\" is not considered\n part of the multi-line response.\n A POP3 session progresses through a number of states during its\n lifetime. Once the TCP connection has been opened and the POP3\n server has sent the greeting, the session enters the AUTHORIZATION\n state. In this state, the client must identify itself to the POP3\n server. Once the client has successfully done this, the server\n acquires resources associated with the client's maildrop, and the\n session enters the TRANSACTION state. In this state, the client\n requests actions on the part of the POP3 server. When the client has\n issued the QUIT command, the session enters the UPDATE state. In\n this state, the POP3 server releases any resources acquired during\n the TRANSACTION state and says goodbye. The TCP connection is then\n closed.\n A server MUST respond to an unrecognized, unimplemented, or\n syntactically invalid command by responding with a negative status\n indicator. A server MUST respond to a command issued when the\n session is in an incorrect state by responding with a negative status\n indicator. There is no general method for a client to distinguish\n between a server which does not implement an optional command and a\n server which is unwilling or unable to process the command.\n A POP3 server MAY have an inactivity autologout timer. Such a timer\n MUST be of at least 10 minutes' duration. The receipt of any command\n from the client during that interval should suffice to reset the\n autologout timer. When the timer expires, the session does NOT enter\n the UPDATE state--the server should close the TCP connection without\n removing any messages or sending any response to the client."
19
+ },
20
+ {
21
+ "section_number": "4.",
22
+ "section_name": "The AUTHORIZATION State",
23
+ "tag": "Section 4. The AUTHORIZATION State",
24
+ "content": "Once the TCP connection has been opened by a POP3 client, the POP3\n server issues a one line greeting. This can be any positive\n response. An example might be:\n S: +OK POP3 server ready\n The POP3 session is now in the AUTHORIZATION state. The client must\n now identify and authenticate itself to the POP3 server. Two\n possible mechanisms for doing this are described in this document,\n the USER and PASS command combination and the APOP command. Both\n mechanisms are described later in this document. Additional\n authentication mechanisms are described in [RFC1734]. While there is\n no single authentication mechanism that is required of all POP3\n servers, a POP3 server must of course support at least one\n authentication mechanism.\n Once the POP3 server has determined through the use of any\n authentication command that the client should be given access to the\n appropriate maildrop, the POP3 server then acquires an exclusive-\n access lock on the maildrop, as necessary to prevent messages from\n being modified or removed before the session enters the UPDATE state.\n If the lock is successfully acquired, the POP3 server responds with a\n positive status indicator. The POP3 session now enters the\n TRANSACTION state, with no messages marked as deleted. If the\n maildrop cannot be opened for some reason (for example, a lock can\n not be acquired, the client is denied access to the appropriate\n maildrop, or the maildrop cannot be parsed), the POP3 server responds\n with a negative status indicator. (If a lock was acquired but the\n POP3 server intends to respond with a negative status indicator, the\n POP3 server must release the lock prior to rejecting the command.)\n After returning a negative status indicator, the server may close the\n connection. If the server does not close the connection, the client\n may either issue a new authentication command and start again, or the\n client may issue the QUIT command.\n After the POP3 server has opened the maildrop, it assigns a message-\n number to each message, and notes the size of each message in octets.\n The first message in the maildrop is assigned a message-number of\n \"1\", the second is assigned \"2\", and so on, so that the nth message\n in a maildrop is assigned a message-number of \"n\". In POP3 commands\n and responses, all message-numbers and message sizes are expressed in\n base-10 (i.e., decimal).\n Here is the summary for the QUIT command when used in the\n AUTHORIZATION state:\n QUIT\n Arguments: none\n Restrictions: none\n Possible Responses:\n +OK\n Examples:\n C: QUIT\n S: +OK dewey POP3 server signing off"
25
+ },
26
+ {
27
+ "section_number": "5.",
28
+ "section_name": "The TRANSACTION State",
29
+ "tag": "Section 5. The TRANSACTION State",
30
+ "content": "Once the client has successfully identified itself to the POP3 server\n and the POP3 server has locked and opened the appropriate maildrop,\n the POP3 session is now in the TRANSACTION state. The client may now\n issue any of the following POP3 commands repeatedly. After each\n command, the POP3 server issues a response. Eventually, the client\n issues the QUIT command and the POP3 session enters the UPDATE state.\n Here are the POP3 commands valid in the TRANSACTION state:\n STAT\n Arguments: none\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n The POP3 server issues a positive response with a line\n containing information for the maildrop. This line is\n called a \"drop listing\" for that maildrop.\n In order to simplify parsing, all POP3 servers are\n required to use a certain format for drop listings. The\n positive response consists of \"+OK\" followed by a single\n space, the number of messages in the maildrop, a single\n space, and the size of the maildrop in octets. This memo\n makes no requirement on what follows the maildrop size.\n Minimal implementations should just end that line of the\n response with a CRLF pair. More advanced implementations\n may include other information.\n NOTE: This memo STRONGLY discourages implementations\n from supplying additional information in the drop\n listing. Other, optional, facilities are discussed\n later on which permit the client to parse the messages\n in the maildrop.\n Note that messages marked as deleted are not counted in\n either total.\n Possible Responses:\n +OK nn mm\n Examples:\n C: STAT\n S: +OK 2 320\n LIST [msg]\n Arguments:\n a message-number (optional), which, if present, may NOT\n refer to a message marked as deleted\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n If an argument was given and the POP3 server issues a\n positive response with a line containing information for\n that message. This line is called a \"scan listing\" for\n that message.\n If no argument was given and the POP3 server issues a\n positive response, then the response given is multi-line.\n After the initial +OK, for each message in the maildrop,\n the POP3 server responds with a line containing\n information for that message. This line is also called a\n \"scan listing\" for that message. If there are no\n messages in the maildrop, then the POP3 server responds\n with no scan listings--it issues a positive response\n followed by a line containing a termination octet and a\n CRLF pair.\n In order to simplify parsing, all POP3 servers are\n required to use a certain format for scan listings. A\n scan listing consists of the message-number of the\n message, followed by a single space and the exact size of\n the message in octets. Methods for calculating the exact\n size of the message are described in the \"Message Format\"\n section below. This memo makes no requirement on what\n follows the message size in the scan listing. Minimal\n implementations should just end that line of the response\n with a CRLF pair. More advanced implementations may\n include other information, as parsed from the message.\n NOTE: This memo STRONGLY discourages implementations\n from supplying additional information in the scan\n listing. Other, optional, facilities are discussed\n later on which permit the client to parse the messages\n in the maildrop.\n Note that messages marked as deleted are not listed.\n Possible Responses:\n +OK scan listing follows\n -ERR no such message\n Examples:\n C: LIST\n S: +OK 2 messages (320 octets)\n S: 1 120\n S: 2 200\n S: .\n ...\n C: LIST 2\n S: +OK 2 200\n ...\n C: LIST 3\n S: -ERR no such message, only 2 messages in maildrop\n RETR msg\n Arguments:\n a message-number (required) which may NOT refer to a\n message marked as deleted\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n If the POP3 server issues a positive response, then the\n response given is multi-line. After the initial +OK, the\n POP3 server sends the message corresponding to the given\n message-number, being careful to byte-stuff the termination\n character (as with all multi-line responses).\n Possible Responses:\n +OK message follows\n -ERR no such message\n Examples:\n C: RETR 1\n S: +OK 120 octets\n S: <the POP3 server sends the entire message here>\n S: .\n DELE msg\n Arguments:\n a message-number (required) which may NOT refer to a\n message marked as deleted\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n The POP3 server marks the message as deleted. Any future\n reference to the message-number associated with the message\n in a POP3 command generates an error. The POP3 server does\n not actually delete the message until the POP3 session\n enters the UPDATE state.\n Possible Responses:\n +OK message deleted\n -ERR no such message\n Examples:\n C: DELE 1\n S: +OK message 1 deleted\n ...\n C: DELE 2\n S: -ERR message 2 already deleted\n NOOP\n Arguments: none\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n The POP3 server does nothing, it merely replies with a\n positive response.\n Possible Responses:\n +OK\n Examples:\n C: NOOP\n S: +OK\n RSET\n Arguments: none\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n If any messages have been marked as deleted by the POP3\n server, they are unmarked. The POP3 server then replies\n with a positive response.\n Possible Responses:\n +OK\n Examples:\n C: RSET\n S: +OK maildrop has 2 messages (320 octets)"
31
+ },
32
+ {
33
+ "section_number": "6.",
34
+ "section_name": "The UPDATE State",
35
+ "tag": "Section 6. The UPDATE State",
36
+ "content": "When the client issues the QUIT command from the TRANSACTION state,\n the POP3 session enters the UPDATE state. (Note that if the client\n issues the QUIT command from the AUTHORIZATION state, the POP3\n session terminates but does NOT enter the UPDATE state.)\n If a session terminates for some reason other than a client-issued\n QUIT command, the POP3 session does NOT enter the UPDATE state and\n MUST not remove any messages from the maildrop.\n QUIT\n Arguments: none\n Restrictions: none\n Discussion:\n The POP3 server removes all messages marked as deleted\n from the maildrop and replies as to the status of this\n operation. If there is an error, such as a resource\n shortage, encountered while removing messages, the\n maildrop may result in having some or none of the messages\n marked as deleted be removed. In no case may the server\n remove any messages not marked as deleted.\n Whether the removal was successful or not, the server\n then releases any exclusive-access lock on the maildrop\n and closes the TCP connection.\n Possible Responses:\n +OK\n -ERR some deleted messages not removed\n Examples:\n C: QUIT\n S: +OK dewey POP3 server signing off (maildrop empty)\n ...\n C: QUIT\n S: +OK dewey POP3 server signing off (2 messages left)\n ..."
37
+ },
38
+ {
39
+ "section_number": "7.",
40
+ "section_name": "Optional POP3 Commands",
41
+ "tag": "Section 7. Optional POP3 Commands",
42
+ "content": "The POP3 commands discussed above must be supported by all minimal\n implementations of POP3 servers.\n The optional POP3 commands described below permit a POP3 client\n greater freedom in message handling, while preserving a simple POP3\n server implementation.\n NOTE: This memo STRONGLY encourages implementations to support\n these commands in lieu of developing augmented drop and scan\n listings. In short, the philosophy of this memo is to put\n intelligence in the part of the POP3 client and not the POP3\n server.\n TOP msg n\n Arguments:\n a message-number (required) which may NOT refer to to a\n message marked as deleted, and a non-negative number\n of lines (required)\n Restrictions:\n may only be given in the TRANSACTION state\n Discussion:\n If the POP3 server issues a positive response, then the\n response given is multi-line. After the initial +OK, the\n POP3 server sends the headers of the message, the blank\n line separating the headers from the body, and then the\n number of lines of the indicated message's body, being\n careful to byte-stuff the termination character (as with\n all multi-line responses).\n Note that if the number of lines requested by the POP3\n client is greater than than the number of lines in the\n body, then the POP3 server sends the entire message.\n Possible Responses:\n +OK top of message follows\n -ERR no such message\n Examples:\n C: TOP 1 10\n S: +OK\n S: <the POP3 server sends the headers of the\n message, a blank line, and the first 10 lines\n of the body of the message>\n S: .\n ...\n C: TOP 100 3\n S: -ERR no such message\n UIDL [msg]\n Arguments:\n a message-number (optional), which, if present, may NOT\n refer to a message marked as deleted\n Restrictions:\n may only be given in the TRANSACTION state.\n Discussion:\n If an argument was given and the POP3 server issues a positive\n response with a line containing information for that message.\n This line is called a \"unique-id listing\" for that message.\n If no argument was given and the POP3 server issues a positive\n response, then the response given is multi-line. After the\n initial +OK, for each message in the maildrop, the POP3 server\n responds with a line containing information for that message.\n This line is called a \"unique-id listing\" for that message.\n In order to simplify parsing, all POP3 servers are required to\n use a certain format for unique-id listings. A unique-id\n listing consists of the message-number of the message,\n followed by a single space and the unique-id of the message.\n No information follows the unique-id in the unique-id listing.\n The unique-id of a message is an arbitrary server-determined\n string, consisting of one to 70 characters in the range 0x21\n to 0x7E, which uniquely identifies a message within a\n maildrop and which persists across sessions. This\n persistence is required even if a session ends without\n entering the UPDATE state. The server should never reuse an\n unique-id in a given maildrop, for as long as the entity\n using the unique-id exists.\n Note that messages marked as deleted are not listed.\n While it is generally preferable for server implementations\n to store arbitrarily assigned unique-ids in the maildrop,\n this specification is intended to permit unique-ids to be\n calculated as a hash of the message. Clients should be able\n to handle a situation where two identical copies of a\n message in a maildrop have the same unique-id.\n Possible Responses:\n +OK unique-id listing follows\n -ERR no such message\n Examples:\n C: UIDL\n S: +OK\n S: 1 whqtswO00WBw418f9t5JxYwZ\n S: 2 QhdPYR:00WBw1Ph7x7\n S: .\n ...\n C: UIDL 2\n S: +OK 2 QhdPYR:00WBw1Ph7x7\n ...\n C: UIDL 3\n S: -ERR no such message, only 2 messages in maildrop\n USER name\n Arguments:\n a string identifying a mailbox (required), which is of\n significance ONLY to the server\n Restrictions:\n may only be given in the AUTHORIZATION state after the POP3\n greeting or after an unsuccessful USER or PASS command\n Discussion:\n To authenticate using the USER and PASS command\n combination, the client must first issue the USER\n command. If the POP3 server responds with a positive\n status indicator (\"+OK\"), then the client may issue\n either the PASS command to complete the authentication,\n or the QUIT command to terminate the POP3 session. If\n the POP3 server responds with a negative status indicator\n (\"-ERR\") to the USER command, then the client may either\n issue a new authentication command or may issue the QUIT\n command.\n The server may return a positive response even though no\n such mailbox exists. The server may return a negative\n response if mailbox exists, but does not permit plaintext\n password authentication.\n Possible Responses:\n +OK name is a valid mailbox\n -ERR never heard of mailbox name\n Examples:\n C: USER frated\n S: -ERR sorry, no mailbox for frated here\n ...\n C: USER mrose\n S: +OK mrose is a real hoopy frood\n PASS string\n Arguments:\n a server/mailbox-specific password (required)\n Restrictions:\n may only be given in the AUTHORIZATION state immediately\n after a successful USER command\n Discussion:\n When the client issues the PASS command, the POP3 server\n uses the argument pair from the USER and PASS commands to\n determine if the client should be given access to the\n appropriate maildrop.\n Since the PASS command has exactly one argument, a POP3\n server may treat spaces in the argument as part of the\n password, instead of as argument separators.\n Possible Responses:\n +OK maildrop locked and ready\n -ERR invalid password\n -ERR unable to lock maildrop\n Examples:\n C: USER mrose\n S: +OK mrose is a real hoopy frood\n C: PASS secret\n S: -ERR maildrop already locked\n ...\n C: USER mrose\n S: +OK mrose is a real hoopy frood\n C: PASS secret\n S: +OK mrose's maildrop has 2 messages (320 octets)\n APOP name digest\n Arguments:\n a string identifying a mailbox and a MD5 digest string\n (both required)\n Restrictions:\n may only be given in the AUTHORIZATION state after the POP3\n greeting or after an unsuccessful USER or PASS command\n Discussion:\n Normally, each POP3 session starts with a USER/PASS\n exchange. This results in a server/user-id specific\n password being sent in the clear on the network. For\n intermittent use of POP3, this may not introduce a sizable\n risk. However, many POP3 client implementations connect to\n the POP3 server on a regular basis -- to check for new\n mail. Further the interval of session initiation may be on\n the order of five minutes. Hence, the risk of password\n capture is greatly enhanced.\n An alternate method of authentication is required which\n provides for both origin authentication and replay\n protection, but which does not involve sending a password\n in the clear over the network. The APOP command provides\n this functionality.\n A POP3 server which implements the APOP command will\n include a timestamp in its banner greeting. The syntax of\n the timestamp corresponds to the `msg-id' in [RFC822], and\n MUST be different each time the POP3 server issues a banner\n greeting. For example, on a UNIX implementation in which a\n separate UNIX process is used for each instance of a POP3\n server, the syntax of the timestamp might be:\n <process-ID.clock@hostname>\n where `process-ID' is the decimal value of the process's\n PID, clock is the decimal value of the system clock, and\n hostname is the fully-qualified domain-name corresponding\n to the host where the POP3 server is running.\n The POP3 client makes note of this timestamp, and then\n issues the APOP command. The `name' parameter has\n identical semantics to the `name' parameter of the USER\n command. The `digest' parameter is calculated by applying\n the MD5 algorithm [RFC1321] to a string consisting of the\n timestamp (including angle-brackets) followed by a shared\n secret. This shared secret is a string known only to the\n POP3 client and server. Great care should be taken to\n prevent unauthorized disclosure of the secret, as knowledge\n of the secret will allow any entity to successfully\n masquerade as the named user. The `digest' parameter\n itself is a 16-octet value which is sent in hexadecimal\n format, using lower-case ASCII characters.\n When the POP3 server receives the APOP command, it verifies\n the digest provided. If the digest is correct, the POP3\n server issues a positive response, and the POP3 session\n enters the TRANSACTION state. Otherwise, a negative\n response is issued and the POP3 session remains in the\n AUTHORIZATION state.\n Note that as the length of the shared secret increases, so\n does the difficulty of deriving it. As such, shared\n secrets should be long strings (considerably longer than\n the 8-character example shown below).\n Possible Responses:\n +OK maildrop locked and ready\n -ERR permission denied\n Examples:\n S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>\n C: APOP mrose c4c9334bac560ecc979e58001b3e22fb\n S: +OK maildrop has 1 message (369 octets)\n In this example, the shared secret is the string `tan-\n staaf'. Hence, the MD5 algorithm is applied to the string\n <1896.697170952@dbc.mtview.ca.us>tanstaaf\n which produces a digest value of\n c4c9334bac560ecc979e58001b3e22fb"
43
+ },
44
+ {
45
+ "section_number": "8.",
46
+ "section_name": "Scaling and Operational Considerations",
47
+ "tag": "Section 8. Scaling and Operational Considerations",
48
+ "content": "Since some of the optional features described above were added to the\n POP3 protocol, experience has accumulated in using them in large-\n scale commercial post office operations where most of the users are\n unrelated to each other. In these situations and others, users and\n vendors of POP3 clients have discovered that the combination of using\n the UIDL command and not issuing the DELE command can provide a weak\n version of the \"maildrop as semi-permanent repository\" functionality\n normally associated with IMAP. Of course the other capabilities of\n IMAP, such as polling an existing connection for newly arrived\n messages and supporting multiple folders on the server, are not\n present in POP3.\n When these facilities are used in this way by casual users, there has\n been a tendency for already-read messages to accumulate on the server\n without bound. This is clearly an undesirable behavior pattern from\n the standpoint of the server operator. This situation is aggravated\n by the fact that the limited capabilities of the POP3 do not permit\n efficient handling of maildrops which have hundreds or thousands of\n messages.\n Consequently, it is recommended that operators of large-scale multi-\n user servers, especially ones in which the user's only access to the\n maildrop is via POP3, consider such options as:\n * Imposing a per-user maildrop storage quota or the like.\n A disadvantage to this option is that accumulation of messages may\n result in the user's inability to receive new ones into the\n maildrop. Sites which choose this option should be sure to inform\n users of impending or current exhaustion of quota, perhaps by\n inserting an appropriate message into the user's maildrop.\n * Enforce a site policy regarding mail retention on the server.\n Sites are free to establish local policy regarding the storage and\n retention of messages on the server, both read and unread. For\n example, a site might delete unread messages from the server after\n 60 days and delete read messages after 7 days. Such message\n deletions are outside the scope of the POP3 protocol and are not\n considered a protocol violation.\n Server operators enforcing message deletion policies should take\n care to make all users aware of the policies in force.\n Clients must not assume that a site policy will automate message\n deletions, and should continue to explicitly delete messages using\n the DELE command when appropriate.\n It should be noted that enforcing site message deletion policies\n may be confusing to the user community, since their POP3 client\n may contain configuration options to leave mail on the server\n which will not in fact be supported by the server.\n One special case of a site policy is that messages may only be\n downloaded once from the server, and are deleted after this has\n been accomplished. This could be implemented in POP3 server\n software by the following mechanism: \"following a POP3 login by a\n client which was ended by a QUIT, delete all messages downloaded\n during the session with the RETR command\". It is important not to\n delete messages in the event of abnormal connection termination\n (ie, if no QUIT was received from the client) because the client\n may not have successfully received or stored the messages.\n Servers implementing a download-and-delete policy may also wish to\n disable or limit the optional TOP command, since it could be used\n as an alternate mechanism to download entire messages."
49
+ },
50
+ {
51
+ "section_number": "9.",
52
+ "section_name": "POP3 Command Summary",
53
+ "tag": "Section 9. POP3 Command Summary",
54
+ "content": "Minimal POP3 Commands:\n USER name valid in the AUTHORIZATION state\n PASS string\n QUIT\n STAT valid in the TRANSACTION state\n LIST [msg]\n RETR msg\n DELE msg\n NOOP\n RSET\n QUIT\n Optional POP3 Commands:\n APOP name digest valid in the AUTHORIZATION state\n TOP msg n valid in the TRANSACTION state\n UIDL [msg]\n POP3 Replies:\n +OK\n -ERR\n Note that with the exception of the STAT, LIST, and UIDL commands,\n the reply given by the POP3 server to any command is significant\n only to \"+OK\" and \"-ERR\". Any text occurring after this reply\n may be ignored by the client."
55
+ },
56
+ {
57
+ "section_number": "10.",
58
+ "section_name": "Example POP3 Session",
59
+ "tag": "Section 10. Example POP3 Session",
60
+ "content": "S: <wait for connection on TCP port 110>\n C: <open connection>\n S: +OK POP3 server ready <1896.697170952@dbc.mtview.ca.us>\n C: APOP mrose c4c9334bac560ecc979e58001b3e22fb\n S: +OK mrose's maildrop has 2 messages (320 octets)\n C: STAT\n S: +OK 2 320\n C: LIST\n S: +OK 2 messages (320 octets)\n S: 1 120\n S: 2 200\n S: .\n C: RETR 1\n S: +OK 120 octets\n S: <the POP3 server sends message 1>\n S: .\n C: DELE 1\n S: +OK message 1 deleted\n C: RETR 2\n S: +OK 200 octets\n S: <the POP3 server sends message 2>\n S: .\n C: DELE 2\n S: +OK message 2 deleted\n C: QUIT\n S: +OK dewey POP3 server signing off (maildrop empty)\n C: <close connection>\n S: <wait for next connection>"
61
+ },
62
+ {
63
+ "section_number": "11.",
64
+ "section_name": "Message Format",
65
+ "tag": "Section 11. Message Format",
66
+ "content": "All messages transmitted during a POP3 session are assumed to conform\n to the standard for the format of Internet text messages [RFC822].\n It is important to note that the octet count for a message on the\n server host may differ from the octet count assigned to that message\n due to local conventions for designating end-of-line. Usually,\n during the AUTHORIZATION state of the POP3 session, the POP3 server\n can calculate the size of each message in octets when it opens the\n maildrop. For example, if the POP3 server host internally represents\n end-of-line as a single character, then the POP3 server simply counts\n each occurrence of this character in a message as two octets. Note\n that lines in the message which start with the termination octet need\n not (and must not) be counted twice, since the POP3 client will\n remove all byte-stuffed termination characters when it receives a\n multi-line response."
67
+ },
68
+ {
69
+ "section_number": "12.",
70
+ "section_name": "References",
71
+ "tag": "Section 12. References",
72
+ "content": "[RFC821] Postel, J., \"Simple Mail Transfer Protocol\", STD 10, RFC\n 821, USC/Information Sciences Institute, August 1982.\n [RFC822] Crocker, D., \"Standard for the Format of ARPA-Internet Text\n [RFC1321] Rivest, R., \"The MD5 Message-Digest Algorithm\", RFC 1321,\n MIT Laboratory for Computer Science, April 1992.\n [RFC1730] Crispin, M., \"Internet Message Access Protocol - Version\n [RFC1734] Myers, J., \"POP3 AUTHentication command\", RFC 1734,\n Carnegie Mellon, December 1994."
73
+ },
74
+ {
75
+ "section_number": "13.",
76
+ "section_name": "Security Considerations",
77
+ "tag": "Section 13. Security Considerations",
78
+ "content": "It is conjectured that use of the APOP command provides origin\n identification and replay protection for a POP3 session.\n Accordingly, a POP3 server which implements both the PASS and APOP\n commands should not allow both methods of access for a given user;\n that is, for a given mailbox name, either the USER/PASS command\n sequence or the APOP command is allowed, but not both.\n Further, note that as the length of the shared secret increases, so\n does the difficulty of deriving it.\n Servers that answer -ERR to the USER command are giving potential\n attackers clues about which names are valid.\n Use of the PASS command sends passwords in the clear over the\n network.\n Use of the RETR and TOP commands sends mail in the clear over the\n network.\n Otherwise, security issues are not discussed in this memo."
79
+ },
80
+ {
81
+ "section_number": "14.",
82
+ "section_name": "Acknowledgements",
83
+ "tag": "Section 14. Acknowledgements",
84
+ "content": "The POP family has a long and checkered history. Although primarily\n a minor revision to RFC 1460, POP3 is based on the ideas presented in\n RFCs 918, 937, and 1081.\n In addition, Alfred Grimstad, Keith McCloghrie, and Neil Ostroff\n provided significant comments on the APOP command."
85
+ },
86
+ {
87
+ "section_number": "15.",
88
+ "section_name": "Authors' Addresses",
89
+ "tag": "Section 15. Authors' Addresses",
90
+ "content": "John G. Myers\n Carnegie-Mellon University\n 5000 Forbes Ave\n Pittsburgh, PA 15213\n EMail: jgm+@cmu.edu\n Marshall T. Rose\n Dover Beach Consulting, Inc.\n 420 Whisman Court\n Mountain View, CA 94043-2186\n EMail: mrose@dbc.mtview.ca.us"
91
+ },
92
+ {
93
+ "section_number": "Appendix A.",
94
+ "section_name": "Differences from RFC 1725",
95
+ "tag": "Section Appendix A. Differences from RFC 1725",
96
+ "content": "This memo is a revision to RFC 1725, a Draft Standard. It makes the\n following changes from that document:\n - clarifies that command keywords are case insensitive.\n - specifies that servers must send \"+OK\" and \"-ERR\" in\n upper case.\n - specifies that the initial greeting is a positive response,\n instead of any string which should be a positive response.\n - clarifies behavior for unimplemented commands.\n - makes the USER and PASS commands optional.\n - clarified the set of possible responses to the USER command.\n - reverses the order of the examples in the USER and PASS\n commands, to reduce confusion.\n - clarifies that the PASS command may only be given immediately\n after a successful USER command.\n - clarified the persistence requirements of UIDs and added some\n implementation notes.\n - specifies a UID length limitation of one to 70 octets.\n - specifies a status indicator length limitation\n of 512 octets, including the CRLF.\n - clarifies that LIST with no arguments on an empty mailbox\n returns success.\n - adds a reference from the LIST command to the Message Format\n section\n - clarifies the behavior of QUIT upon failure\n - clarifies the security section to not imply the use of the\n USER command with the APOP command.\n - adds references to RFCs 1730 and 1734\n - clarifies the method by which a UA may enter mail into the\n transport system.\n - clarifies that the second argument to the TOP command is a\n number of lines.\n - changes the suggestion in the Security Considerations section\n for a server to not accept both PASS and APOP for a given user\n from a \"must\" to a \"should\".\n - adds a section on scaling and operational considerations"
97
+ },
98
+ {
99
+ "section_number": "Appendix B.",
100
+ "section_name": "Command Index",
101
+ "tag": "Section Appendix B. Command Index",
102
+ "content": "APOP ....................................................... 15\n DELE ....................................................... 8\n LIST ....................................................... 6\n NOOP ....................................................... 9\n PASS ....................................................... 14\n QUIT ....................................................... 5\n QUIT ....................................................... 10\n RETR ....................................................... 8\n RSET ....................................................... 9\n STAT ....................................................... 6\n TOP ........................................................ 11\n UIDL ....................................................... 12\n USER ....................................................... 13"
103
+ }
104
+ ]
RFCChunks/PPP_segments.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "section_number": "1.",
4
+ "section_name": "Introduction",
5
+ "tag": "Section 1. Introduction",
6
+ "content": "The Point-to-Point Protocol is designed for simple links which\n transport packets between two peers. These links provide full-duplex\n simultaneous bi-directional operation, and are assumed to deliver\n packets in order. It is intended that PPP provide a common solution\n for easy connection of a wide variety of hosts, bridges and routers\n [1].\n Encapsulation\n The PPP encapsulation provides for multiplexing of different\n network-layer protocols simultaneously over the same link. The\n PPP encapsulation has been carefully designed to retain\n compatibility with most commonly used supporting hardware.\n Only 8 additional octets are necessary to form the encapsulation\n when used within the default HDLC-like framing. In environments\n where bandwidth is at a premium, the encapsulation and framing may\n be shortened to 2 or 4 octets.\n To support high speed implementations, the default encapsulation\n uses only simple fields, only one of which needs to be examined\n for demultiplexing. The default header and information fields\n fall on 32-bit boundaries, and the trailer may be padded to an\n arbitrary boundary.\n Link Control Protocol\n In order to be sufficiently versatile to be portable to a wide\n variety of environments, PPP provides a Link Control Protocol\n (LCP). The LCP is used to automatically agree upon the\n encapsulation format options, handle varying limits on sizes of\n packets, detect a looped-back link and other common\n misconfiguration errors, and terminate the link. Other optional\n facilities provided are authentication of the identity of its peer\n on the link, and determination when a link is functioning properly\n and when it is failing.\n Network Control Protocols\n Point-to-Point links tend to exacerbate many problems with the\n current family of network protocols. For instance, assignment and\n management of IP addresses, which is a problem even in LAN\n environments, is especially difficult over circuit-switched\n point-to-point links (such as dial-up modem servers). These\n problems are handled by a family of Network Control Protocols\n (NCPs), which each manage the specific needs required by their\n respective network-layer protocols. These NCPs are defined in\n companion documents.\n Configuration\n It is intended that PPP links be easy to configure. By design,\n the standard defaults handle all common configurations. The\n implementor can specify improvements to the default configuration,\n which are automatically communicated to the peer without operator\n intervention. Finally, the operator may explicitly configure\n options for the link which enable the link to operate in\n environments where it would otherwise be impossible.\n This self-configuration is implemented through an extensible\n option negotiation mechanism, wherein each end of the link\n describes to the other its capabilities and requirements.\n Although the option negotiation mechanism described in this\n document is specified in terms of the Link Control Protocol (LCP),\n the same facilities are designed to be used by other control\n protocols, especially the family of NCPs.\n1.1. Specification of Requirements\n In this document, several words are used to signify the requirements\n of the specification. These words are often capitalized.\n MUST This word, or the adjective \"required\", means that the\n definition is an absolute requirement of the specification.\n MUST NOT This phrase means that the definition is an absolute\n prohibition of the specification.\n SHOULD This word, or the adjective \"recommended\", means that there\n may exist valid reasons in particular circumstances to\n ignore this item, but the full implications must be\n understood and carefully weighed before choosing a\n different course.\n MAY This word, or the adjective \"optional\", means that this\n item is one of an allowed set of alternatives. An\n implementation which does not include this option MUST be\n prepared to interoperate with another implementation which\n does include the option.\n1.2. Terminology\n This document frequently uses the following terms:\n datagram The unit of transmission in the network layer (such as IP).\n A datagram may be encapsulated in one or more packets\n passed to the data link layer.\n frame The unit of transmission at the data link layer. A frame\n may include a header and/or a trailer, along with some\n number of units of data.\n packet The basic unit of encapsulation, which is passed across the\n interface between the network layer and the data link\n layer. A packet is usually mapped to a frame; the\n exceptions are when data link layer fragmentation is being\n performed, or when multiple packets are incorporated into a\n single frame.\n peer The other end of the point-to-point link.\n silently discard\n The implementation discards the packet without further\n processing. The implementation SHOULD provide the\n capability of logging the error, including the contents of\n the silently discarded packet, and SHOULD record the event\n in a statistics counter."
7
+ },
8
+ {
9
+ "section_number": "2.",
10
+ "section_name": "PPP Encapsulation",
11
+ "tag": "Section 2. PPP Encapsulation",
12
+ "content": "The PPP encapsulation is used to disambiguate multiprotocol\n datagrams. This encapsulation requires framing to indicate the\n beginning and end of the encapsulation. Methods of providing framing\n are specified in companion documents.\n A summary of the PPP encapsulation is shown below. The fields are\n transmitted from left to right.\n +----------+-------------+---------+\n | Protocol | Information | Padding |\n | 8/16 bits| * | * |\n +----------+-------------+---------+\n Protocol Field\n The Protocol field is one or two octets, and its value identifies\n the datagram encapsulated in the Information field of the packet.\n The field is transmitted and received most significant octet\n first.\n The structure of this field is consistent with the ISO 3309\n extension mechanism for address fields. All Protocols MUST be\n odd; the least significant bit of the least significant octet MUST\n equal \"1\". Also, all Protocols MUST be assigned such that the\n least significant bit of the most significant octet equals \"0\".\n Frames received which don't comply with these rules MUST be\n treated as having an unrecognized Protocol.\n Protocol field values in the \"0***\" to \"3***\" range identify the\n network-layer protocol of specific packets, and values in the\n \"8***\" to \"b***\" range identify packets belonging to the\n associated Network Control Protocols (NCPs), if any.\n Protocol field values in the \"4***\" to \"7***\" range are used for\n protocols with low volume traffic which have no associated NCP.\n Protocol field values in the \"c***\" to \"f***\" range identify\n packets as link-layer Control Protocols (such as LCP).\n Up-to-date values of the Protocol field are specified in the most\n recent \"Assigned Numbers\" RFC [2]. This specification reserves\n the following values:\n Value (in hex) Protocol Name\n 0001 Padding Protocol\n 0003 to 001f reserved (transparency inefficient)\n 007d reserved (Control Escape)\n 00cf reserved (PPP NLPID)\n 00ff reserved (compression inefficient)\n 8001 to 801f unused\n 807d unused\n 80cf unused\n 80ff unused\n c021 Link Control Protocol\n c023 Password Authentication Protocol\n c025 Link Quality Report\n c223 Challenge Handshake Authentication Protocol\n Developers of new protocols MUST obtain a number from the Internet\n Assigned Numbers Authority (IANA), at IANA@isi.edu.\n Information Field\n The Information field is zero or more octets. The Information\n field contains the datagram for the protocol specified in the\n Protocol field.\n The maximum length for the Information field, including Padding,\n but not including the Protocol field, is termed the Maximum\n Receive Unit (MRU), which defaults to 1500 octets. By\n negotiation, consenting PPP implementations may use other values\n for the MRU.\n Padding\n On transmission, the Information field MAY be padded with an\n arbitrary number of octets up to the MRU. It is the\n responsibility of each protocol to distinguish padding octets from\n real information."
13
+ },
14
+ {
15
+ "section_number": "3.",
16
+ "section_name": "PPP Link Operation",
17
+ "tag": "Section 3. PPP Link Operation",
18
+ "content": "3.1. Overview\n In order to establish communications over a point-to-point link, each\n end of the PPP link MUST first send LCP packets to configure and test\n the data link. After the link has been established, the peer MAY be\n authenticated.\n Then, PPP MUST send NCP packets to choose and configure one or more\n network-layer protocols. Once each of the chosen network-layer\n protocols has been configured, datagrams from each network-layer\n protocol can be sent over the link.\n The link will remain configured for communications until explicit LCP\n or NCP packets close the link down, or until some external event\n occurs (an inactivity timer expires or network administrator\n intervention).\n3.2. Phase Diagram\n In the process of configuring, maintaining and terminating the\n point-to-point link, the PPP link goes through several distinct\n phases which are specified in the following simplified state diagram:\n +------+ +-----------+ +--------------+\n | | UP | | OPENED | | SUCCESS/NONE\n | Dead |------->| Establish |---------->| Authenticate |--+\n | | | | | | |\n +------+ +-----------+ +--------------+ |\n ^ | | |\n | FAIL | FAIL | |\n +<--------------+ +----------+ |\n | | |\n | +-----------+ | +---------+ |\n | DOWN | | | CLOSING | | |\n +------------| Terminate |<---+<----------| Network |<-+\n | | | |\n +-----------+ +---------+\n Not all transitions are specified in this diagram. The following\n semantics MUST be followed.\n3.3. Link Dead (physical-layer not ready)\n The link necessarily begins and ends with this phase. When an\n external event (such as carrier detection or network administrator\n configuration) indicates that the physical-layer is ready to be used,\n PPP will proceed to the Link Establishment phase.\n During this phase, the LCP automaton (described later) will be in the\n Initial or Starting states. The transition to the Link Establishment\n phase will signal an Up event to the LCP automaton.\n Implementation Note:\n Typically, a link will return to this phase automatically after\n the disconnection of a modem. In the case of a hard-wired link,\n this phase may be extremely short -- merely long enough to detect\n the presence of the device.\n3.4. Link Establishment Phase\n The Link Control Protocol (LCP) is used to establish the connection\n through an exchange of Configure packets. This exchange is complete,\n and the LCP Opened state entered, once a Configure-Ack packet\n (described later) has been both sent and received.\n All Configuration Options are assumed to be at default values unless\n altered by the configuration exchange. See the chapter on LCP\n Configuration Options for further discussion.\n It is important to note that only Configuration Options which are\n independent of particular network-layer protocols are configured by\n LCP. Configuration of individual network-layer protocols is handled\n by separate Network Control Protocols (NCPs) during the Network-Layer\n Protocol phase.\n Any non-LCP packets received during this phase MUST be silently\n discarded.\n The receipt of the LCP Configure-Request causes a return to the Link\n Establishment phase from the Network-Layer Protocol phase or\n Authentication phase.\n3.5. Authentication Phase\n On some links it may be desirable to require a peer to authenticate\n itself before allowing network-layer protocol packets to be\n exchanged.\n By default, authentication is not mandatory. If an implementation\n desires that the peer authenticate with some specific authentication\n protocol, then it MUST request the use of that authentication\n protocol during Link Establishment phase.\n Authentication SHOULD take place as soon as possible after link\n establishment. However, link quality determination MAY occur\n concurrently. An implementation MUST NOT allow the exchange of link\n quality determination packets to delay authentication indefinitely.\n Advancement from the Authentication phase to the Network-Layer\n Protocol phase MUST NOT occur until authentication has completed. If\n authentication fails, the authenticator SHOULD proceed instead to the\n Link Termination phase.\n Only Link Control Protocol, authentication protocol, and link quality\n monitoring packets are allowed during this phase. All other packets\n received during this phase MUST be silently discarded.\n Implementation Notes:\n An implementation SHOULD NOT fail authentication simply due to\n timeout or lack of response. The authentication SHOULD allow some\n method of retransmission, and proceed to the Link Termination\n phase only after a number of authentication attempts has been\n exceeded.\n The implementation responsible for commencing Link Termination\n phase is the implementation which has refused authentication to\n its peer.\n3.6. Network-Layer Protocol Phase\n Once PPP has finished the previous phases, each network-layer\n protocol (such as IP, IPX, or AppleTalk) MUST be separately\n configured by the appropriate Network Control Protocol (NCP).\n Each NCP MAY be Opened and Closed at any time.\n Implementation Note:\n Because an implementation may initially use a significant amount\n of time for link quality determination, implementations SHOULD\n avoid fixed timeouts when waiting for their peers to configure a\n NCP.\n After a NCP has reached the Opened state, PPP will carry the\n corresponding network-layer protocol packets. Any supported\n network-layer protocol packets received when the corresponding NCP is\n not in the Opened state MUST be silently discarded.\n Implementation Note:\n While LCP is in the Opened state, any protocol packet which is\n unsupported by the implementation MUST be returned in a Protocol-\n Reject (described later). Only protocols which are supported are\n silently discarded.\n During this phase, link traffic consists of any possible combination\n of LCP, NCP, and network-layer protocol packets.\n3.7. Link Termination Phase\n PPP can terminate the link at any time. This might happen because of\n the loss of carrier, authentication failure, link quality failure,\n the expiration of an idle-period timer, or the administrative closing\n of the link.\n LCP is used to close the link through an exchange of Terminate\n packets. When the link is closing, PPP informs the network-layer\n protocols so that they may take appropriate action.\n After the exchange of Terminate packets, the implementation SHOULD\n signal the physical-layer to disconnect in order to enforce the\n termination of the link, particularly in the case of an\n authentication failure. The sender of the Terminate-Request SHOULD\n disconnect after receiving a Terminate-Ack, or after the Restart\n counter expires. The receiver of a Terminate-Request SHOULD wait for\n the peer to disconnect, and MUST NOT disconnect until at least one\n Restart time has passed after sending a Terminate-Ack. PPP SHOULD\n proceed to the Link Dead phase.\n Any non-LCP packets received during this phase MUST be silently\n discarded.\n Implementation Note:\n The closing of the link by LCP is sufficient. There is no need\n for each NCP to send a flurry of Terminate packets. Conversely,\n the fact that one NCP has Closed is not sufficient reason to cause\n the termination of the PPP link, even if that NCP was the only NCP\n currently in the Opened state."
19
+ },
20
+ {
21
+ "section_number": "4.",
22
+ "section_name": "The Option Negotiation Automaton",
23
+ "tag": "Section 4. The Option Negotiation Automaton",
24
+ "content": "The finite-state automaton is defined by events, actions and state\n transitions. Events include reception of external commands such as\n Open and Close, expiration of the Restart timer, and reception of\n packets from a peer. Actions include the starting of the Restart\n timer and transmission of packets to the peer.\n Some types of packets -- Configure-Naks and Configure-Rejects, or\n Code-Rejects and Protocol-Rejects, or Echo-Requests, Echo-Replies and\n Discard-Requests -- are not differentiated in the automaton\n descriptions. As will be described later, these packets do indeed\n serve different functions. However, they always cause the same\n transitions.\n Events Actions\n Up = lower layer is Up tlu = This-Layer-Up\n Down = lower layer is Down tld = This-Layer-Down\n Open = administrative Open tls = This-Layer-Started\n Close= administrative Close tlf = This-Layer-Finished\n TO+ = Timeout with counter > 0 irc = Initialize-Restart-Count\n TO- = Timeout with counter expired zrc = Zero-Restart-Count\n RCR+ = Receive-Configure-Request (Good) scr = Send-Configure-Request\n RCR- = Receive-Configure-Request (Bad)\n RCA = Receive-Configure-Ack sca = Send-Configure-Ack\n RCN = Receive-Configure-Nak/Rej scn = Send-Configure-Nak/Rej\n RTR = Receive-Terminate-Request str = Send-Terminate-Request\n RTA = Receive-Terminate-Ack sta = Send-Terminate-Ack\n RUC = Receive-Unknown-Code scj = Send-Code-Reject\n RXJ+ = Receive-Code-Reject (permitted)\n or Receive-Protocol-Reject\n RXJ- = Receive-Code-Reject (catastrophic)\n or Receive-Protocol-Reject\n RXR = Receive-Echo-Request ser = Send-Echo-Reply\n or Receive-Echo-Reply\n or Receive-Discard-Request\n4.1. State Transition Table\n The complete state transition table follows. States are indicated\n horizontally, and events are read vertically. State transitions and\n actions are represented in the form action/new-state. Multiple\n actions are separated by commas, and may continue on succeeding lines\n as space requires; multiple actions may be implemented in any\n convenient order. The state may be followed by a letter, which\n indicates an explanatory footnote. The dash ('-') indicates an\n illegal transition.\n | State\n | 0 1 2 3 4 5\nEvents| Initial Starting Closed Stopped Closing Stopping\n------+-----------------------------------------------------------\n Up | 2 irc,scr/6 - - - -\n Down | - - 0 tls/1 0 1\n Open | tls/1 1 irc,scr/6 3r 5r 5r\n Close| 0 tlf/0 2 2 4 4\n |\n TO+ | - - - - str/4 str/5\n TO- | - - - - tlf/2 tlf/3\n |\n RCR+ | - - sta/2 irc,scr,sca/8 4 5\n RCR- | - - sta/2 irc,scr,scn/6 4 5\n RCA | - - sta/2 sta/3 4 5\n RCN | - - sta/2 sta/3 4 5\n |\n RTR | - - sta/2 sta/3 sta/4 sta/5\n RTA | - - 2 3 tlf/2 tlf/3\n |\n RUC | - - scj/2 scj/3 scj/4 scj/5\n RXJ+ | - - 2 3 4 5\n RXJ- | - - tlf/2 tlf/3 tlf/2 tlf/3\n |\n RXR | - - 2 3 4 5\n | State\n | 6 7 8 9\nEvents| Req-Sent Ack-Rcvd Ack-Sent Opened\n------+-----------------------------------------\n Up | - - - -\n Down | 1 1 1 tld/1\n Open | 6 7 8 9r\n Close|irc,str/4 irc,str/4 irc,str/4 tld,irc,str/4\n |\n TO+ | scr/6 scr/6 scr/8 -\n TO- | tlf/3p tlf/3p tlf/3p -\n |\n RCR+ | sca/8 sca,tlu/9 sca/8 tld,scr,sca/8\n RCR- | scn/6 scn/7 scn/6 tld,scr,scn/6\n RCA | irc/7 scr/6x irc,tlu/9 tld,scr/6x\n RCN |irc,scr/6 scr/6x irc,scr/8 tld,scr/6x\n |\n RTR | sta/6 sta/6 sta/6 tld,zrc,sta/5\n RTA | 6 6 8 tld,scr/6\n |\n RUC | scj/6 scj/7 scj/8 scj/9\n RXJ+ | 6 6 8 9\n RXJ- | tlf/3 tlf/3 tlf/3 tld,irc,str/5\n |\n RXR | 6 7 8 ser/9\n The states in which the Restart timer is running are identifiable by\n the presence of TO events. Only the Send-Configure-Request, Send-\n Terminate-Request and Zero-Restart-Count actions start or re-start\n the Restart timer. The Restart timer is stopped when transitioning\n from any state where the timer is running to a state where the timer\n is not running.\n The events and actions are defined according to a message passing\n architecture, rather than a signalling architecture. If an action is\n desired to control specific signals (such as DTR), additional actions\n are likely to be required.\n [p] Passive option; see Stopped state discussion.\n [r] Restart option; see Open event discussion.\n [x] Crossed connection; see RCA event discussion.\n4.2. States\n Following is a more detailed description of each automaton state.\n Initial\n In the Initial state, the lower layer is unavailable (Down), and\n no Open has occurred. The Restart timer is not running in the\n Initial state.\n Starting\n The Starting state is the Open counterpart to the Initial state.\n An administrative Open has been initiated, but the lower layer is\n still unavailable (Down). The Restart timer is not running in the\n Starting state.\n When the lower layer becomes available (Up), a Configure-Request\n is sent.\n Closed\n In the Closed state, the link is available (Up), but no Open has\n occurred. The Restart timer is not running in the Closed state.\n Upon reception of Configure-Request packets, a Terminate-Ack is\n sent. Terminate-Acks are silently discarded to avoid creating a\n loop.\n Stopped\n The Stopped state is the Open counterpart to the Closed state. It\n is entered when the automaton is waiting for a Down event after\n the This-Layer-Finished action, or after sending a Terminate-Ack.\n The Restart timer is not running in the Stopped state.\n Upon reception of Configure-Request packets, an appropriate\n response is sent. Upon reception of other packets, a Terminate-\n Ack is sent. Terminate-Acks are silently discarded to avoid\n creating a loop.\n Rationale:\n The Stopped state is a junction state for link termination,\n link configuration failure, and other automaton failure modes.\n These potentially separate states have been combined.\n There is a race condition between the Down event response (from\n the This-Layer-Finished action) and the Receive-Configure-\n Request event. When a Configure-Request arrives before the\n Down event, the Down event will supercede by returning the\n automaton to the Starting state. This prevents attack by\n repetition.\n Implementation Option:\n After the peer fails to respond to Configure-Requests, an\n implementation MAY wait passively for the peer to send\n Configure-Requests. In this case, the This-Layer-Finished\n action is not used for the TO- event in states Req-Sent, Ack-\n Rcvd and Ack-Sent.\n This option is useful for dedicated circuits, or circuits which\n have no status signals available, but SHOULD NOT be used for\n switched circuits.\n Closing\n In the Closing state, an attempt is made to terminate the\n connection. A Terminate-Request has been sent and the Restart\n timer is running, but a Terminate-Ack has not yet been received.\n Upon reception of a Terminate-Ack, the Closed state is entered.\n Upon the expiration of the Restart timer, a new Terminate-Request\n is transmitted, and the Restart timer is restarted. After the\n Restart timer has expired Max-Terminate times, the Closed state is\n entered.\n Stopping\n The Stopping state is the Open counterpart to the Closing state.\n A Terminate-Request has been sent and the Restart timer is\n running, but a Terminate-Ack has not yet been received.\n Rationale:\n The Stopping state provides a well defined opportunity to\n terminate a link before allowing new traffic. After the link\n has terminated, a new configuration may occur via the Stopped\n or Starting states.\n Request-Sent\n In the Request-Sent state an attempt is made to configure the\n connection. A Configure-Request has been sent and the Restart\n timer is running, but a Configure-Ack has not yet been received\n nor has one been sent.\n Ack-Received\n In the Ack-Received state, a Configure-Request has been sent and a\n Configure-Ack has been received. The Restart timer is still\n running, since a Configure-Ack has not yet been sent.\n Ack-Sent\n In the Ack-Sent state, a Configure-Request and a Configure-Ack\n have both been sent, but a Configure-Ack has not yet been\n received. The Restart timer is running, since a Configure-Ack has\n not yet been received.\n Opened\n In the Opened state, a Configure-Ack has been both sent and\n received. The Restart timer is not running.\n When entering the Opened state, the implementation SHOULD signal\n the upper layers that it is now Up. Conversely, when leaving the\n Opened state, the implementation SHOULD signal the upper layers\n that it is now Down.\n4.3. Events\n Transitions and actions in the automaton are caused by events.\n Up\n This event occurs when a lower layer indicates that it is ready to\n carry packets.\n Typically, this event is used by a modem handling or calling\n process, or by some other coupling of the PPP link to the physical\n media, to signal LCP that the link is entering Link Establishment\n phase.\n It also can be used by LCP to signal each NCP that the link is\n entering Network-Layer Protocol phase. That is, the This-Layer-Up\n action from LCP triggers the Up event in the NCP.\n Down\n This event occurs when a lower layer indicates that it is no\n longer ready to carry packets.\n Typically, this event is used by a modem handling or calling\n process, or by some other coupling of the PPP link to the physical\n media, to signal LCP that the link is entering Link Dead phase.\n It also can be used by LCP to signal each NCP that the link is\n leaving Network-Layer Protocol phase. That is, the This-Layer-\n Down action from LCP triggers the Down event in the NCP.\n Open\n This event indicates that the link is administratively available\n for traffic; that is, the network administrator (human or program)\n has indicated that the link is allowed to be Opened. When this\n event occurs, and the link is not in the Opened state, the\n automaton attempts to send configuration packets to the peer.\n If the automaton is not able to begin configuration (the lower\n layer is Down, or a previous Close event has not completed), the\n establishment of the link is automatically delayed.\n When a Terminate-Request is received, or other events occur which\n cause the link to become unavailable, the automaton will progress\n to a state where the link is ready to re-open. No additional\n administrative intervention is necessary.\n Implementation Option:\n Experience has shown that users will execute an additional Open\n command when they want to renegotiate the link. This might\n indicate that new values are to be negotiated.\n Since this is not the meaning of the Open event, it is\n suggested that when an Open user command is executed in the\n Opened, Closing, Stopping, or Stopped states, the\n implementation issue a Down event, immediately followed by an\n Up event. Care must be taken that an intervening Down event\n cannot occur from another source.\n The Down followed by an Up will cause an orderly renegotiation\n of the link, by progressing through the Starting to the\n Request-Sent state. This will cause the renegotiation of the\n link, without any harmful side effects.\n Close\n This event indicates that the link is not available for traffic;\n that is, the network administrator (human or program) has\n indicated that the link is not allowed to be Opened. When this\n event occurs, and the link is not in the Closed state, the\n automaton attempts to terminate the connection. Futher attempts\n to re-configure the link are denied until a new Open event occurs.\n Implementation Note:\n When authentication fails, the link SHOULD be terminated, to\n prevent attack by repetition and denial of service to other\n users. Since the link is administratively available (by\n definition), this can be accomplished by simulating a Close\n event to the LCP, immediately followed by an Open event. Care\n must be taken that an intervening Close event cannot occur from\n another source.\n The Close followed by an Open will cause an orderly termination\n of the link, by progressing through the Closing to the Stopping\n state, and the This-Layer-Finished action can disconnect the\n link. The automaton waits in the Stopped or Starting states\n for the next connection attempt.\n Timeout (TO+,TO-)\n This event indicates the expiration of the Restart timer. The\n Restart timer is used to time responses to Configure-Request and\n Terminate-Request packets.\n The TO+ event indicates that the Restart counter continues to be\n greater than zero, which triggers the corresponding Configure-\n Request or Terminate-Request packet to be retransmitted.\n The TO- event indicates that the Restart counter is not greater\n than zero, and no more packets need to be retransmitted.\n Receive-Configure-Request (RCR+,RCR-)\n This event occurs when a Configure-Request packet is received from\n the peer. The Configure-Request packet indicates the desire to\n open a connection and may specify Configuration Options. The\n Configure-Request packet is more fully described in a later\n section.\n The RCR+ event indicates that the Configure-Request was\n acceptable, and triggers the transmission of a corresponding\n Configure-Ack.\n The RCR- event indicates that the Configure-Request was\n unacceptable, and triggers the transmission of a corresponding\n Configure-Nak or Configure-Reject.\n Implementation Note:\n These events may occur on a connection which is already in the\n Opened state. The implementation MUST be prepared to\n immediately renegotiate the Configuration Options.\n Receive-Configure-Ack (RCA)\n This event occurs when a valid Configure-Ack packet is received\n from the peer. The Configure-Ack packet is a positive response to\n a Configure-Request packet. An out of sequence or otherwise\n invalid packet is silently discarded.\n Implementation Note:\n Since the correct packet has already been received before\n reaching the Ack-Rcvd or Opened states, it is extremely\n unlikely that another such packet will arrive. As specified,\n all invalid Ack/Nak/Rej packets are silently discarded, and do\n not affect the transitions of the automaton.\n However, it is not impossible that a correctly formed packet\n will arrive through a coincidentally-timed cross-connection.\n It is more likely to be the result of an implementation error.\n At the very least, this occurance SHOULD be logged.\n Receive-Configure-Nak/Rej (RCN)\n This event occurs when a valid Configure-Nak or Configure-Reject\n packet is received from the peer. The Configure-Nak and\n Configure-Reject packets are negative responses to a Configure-\n Request packet. An out of sequence or otherwise invalid packet is\n silently discarded.\n Implementation Note:\n Although the Configure-Nak and Configure-Reject cause the same\n state transition in the automaton, these packets have\n significantly different effects on the Configuration Options\n sent in the resulting Configure-Request packet.\n Receive-Terminate-Request (RTR)\n This event occurs when a Terminate-Request packet is received.\n The Terminate-Request packet indicates the desire of the peer to\n close the connection.\n Implementation Note:\n This event is not identical to the Close event (see above), and\n does not override the Open commands of the local network\n administrator. The implementation MUST be prepared to receive\n a new Configure-Request without network administrator\n intervention.\n Receive-Terminate-Ack (RTA)\n This event occurs when a Terminate-Ack packet is received from the\n peer. The Terminate-Ack packet is usually a response to a\n Terminate-Request packet. The Terminate-Ack packet may also\n indicate that the peer is in Closed or Stopped states, and serves\n to re-synchronize the link configuration.\n Receive-Unknown-Code (RUC)\n This event occurs when an un-interpretable packet is received from\n the peer. A Code-Reject packet is sent in response.\n Receive-Code-Reject, Receive-Protocol-Reject (RXJ+,RXJ-)\n This event occurs when a Code-Reject or a Protocol-Reject packet\n is received from the peer.\n The RXJ+ event arises when the rejected value is acceptable, such\n as a Code-Reject of an extended code, or a Protocol-Reject of a\n NCP. These are within the scope of normal operation. The\n implementation MUST stop sending the offending packet type.\n The RXJ- event arises when the rejected value is catastrophic,\n such as a Code-Reject of Configure-Request, or a Protocol-Reject\n of LCP! This event communicates an unrecoverable error that\n terminates the connection.\n Receive-Echo-Request, Receive-Echo-Reply, Receive-Discard-Request\n (RXR)\n This event occurs when an Echo-Request, Echo-Reply or Discard-\n Request packet is received from the peer. The Echo-Reply packet\n is a response to an Echo-Request packet. There is no reply to an\n Echo-Reply or Discard-Request packet.\n4.4. Actions\n Actions in the automaton are caused by events and typically indicate\n the transmission of packets and/or the starting or stopping of the\n Restart timer.\n Illegal-Event (-)\n This indicates an event that cannot occur in a properly\n implemented automaton. The implementation has an internal error,\n which should be reported and logged. No transition is taken, and\n the implementation SHOULD NOT reset or freeze.\n This-Layer-Up (tlu)\n This action indicates to the upper layers that the automaton is\n entering the Opened state.\n Typically, this action is used by the LCP to signal the Up event\n to a NCP, Authentication Protocol, or Link Quality Protocol, or\n MAY be used by a NCP to indicate that the link is available for\n its network layer traffic.\n This-Layer-Down (tld)\n This action indicates to the upper layers that the automaton is\n leaving the Opened state.\n Typically, this action is used by the LCP to signal the Down event\n to a NCP, Authentication Protocol, or Link Quality Protocol, or\n MAY be used by a NCP to indicate that the link is no longer\n available for its network layer traffic.\n This-Layer-Started (tls)\n This action indicates to the lower layers that the automaton is\n entering the Starting state, and the lower layer is needed for the\n link. The lower layer SHOULD respond with an Up event when the\n lower layer is available.\n This results of this action are highly implementation dependent.\n This-Layer-Finished (tlf)\n This action indicates to the lower layers that the automaton is\n entering the Initial, Closed or Stopped states, and the lower\n layer is no longer needed for the link. The lower layer SHOULD\n respond with a Down event when the lower layer has terminated.\n Typically, this action MAY be used by the LCP to advance to the\n Link Dead phase, or MAY be used by a NCP to indicate to the LCP\n that the link may terminate when there are no other NCPs open.\n This results of this action are highly implementation dependent.\n Initialize-Restart-Count (irc)\n This action sets the Restart counter to the appropriate value\n (Max-Terminate or Max-Configure). The counter is decremented for\n each transmission, including the first.\n Implementation Note:\n In addition to setting the Restart counter, the implementation\n MUST set the timeout period to the initial value when Restart\n timer backoff is used.\n Zero-Restart-Count (zrc)\n This action sets the Restart counter to zero.\n Implementation Note:\n This action enables the FSA to pause before proceeding to the\n desired final state, allowing traffic to be processed by the\n peer. In addition to zeroing the Restart counter, the\n implementation MUST set the timeout period to an appropriate\n value.\n Send-Configure-Request (scr)\n A Configure-Request packet is transmitted. This indicates the\n desire to open a connection with a specified set of Configuration\n Options. The Restart timer is started when the Configure-Request\n packet is transmitted, to guard against packet loss. The Restart\n counter is decremented each time a Configure-Request is sent.\n Send-Configure-Ack (sca)\n A Configure-Ack packet is transmitted. This acknowledges the\n reception of a Configure-Request packet with an acceptable set of\n Configuration Options.\n Send-Configure-Nak (scn)\n A Configure-Nak or Configure-Reject packet is transmitted, as\n appropriate. This negative response reports the reception of a\n Configure-Request packet with an unacceptable set of Configuration\n Options.\n Configure-Nak packets are used to refuse a Configuration Option\n value, and to suggest a new, acceptable value. Configure-Reject\n packets are used to refuse all negotiation about a Configuration\n Option, typically because it is not recognized or implemented.\n The use of Configure-Nak versus Configure-Reject is more fully\n described in the chapter on LCP Packet Formats.\n Send-Terminate-Request (str)\n A Terminate-Request packet is transmitted. This indicates the\n desire to close a connection. The Restart timer is started when\n the Terminate-Request packet is transmitted, to guard against\n packet loss. The Restart counter is decremented each time a\n Terminate-Request is sent.\n Send-Terminate-Ack (sta)\n A Terminate-Ack packet is transmitted. This acknowledges the\n reception of a Terminate-Request packet or otherwise serves to\n synchronize the automatons.\n Send-Code-Reject (scj)\n A Code-Reject packet is transmitted. This indicates the reception\n of an unknown type of packet.\n Send-Echo-Reply (ser)\n An Echo-Reply packet is transmitted. This acknowledges the\n reception of an Echo-Request packet.\n4.5. Loop Avoidance\n The protocol makes a reasonable attempt at avoiding Configuration\n Option negotiation loops. However, the protocol does NOT guarantee\n that loops will not happen. As with any negotiation, it is possible\n to configure two PPP implementations with conflicting policies that\n will never converge. It is also possible to configure policies which\n do converge, but which take significant time to do so. Implementors\n should keep this in mind and SHOULD implement loop detection\n mechanisms or higher level timeouts.\n4.6. Counters and Timers\n Restart Timer\n There is one special timer used by the automaton. The Restart\n timer is used to time transmissions of Configure-Request and\n Terminate-Request packets. Expiration of the Restart timer causes\n a Timeout event, and retransmission of the corresponding\n Configure-Request or Terminate-Request packet. The Restart timer\n MUST be configurable, but SHOULD default to three (3) seconds.\n Implementation Note:\n The Restart timer SHOULD be based on the speed of the link.\n The default value is designed for low speed (2,400 to 9,600\n bps), high switching latency links (typical telephone lines).\n Higher speed links, or links with low switching latency, SHOULD\n have correspondingly faster retransmission times.\n Instead of a constant value, the Restart timer MAY begin at an\n initial small value and increase to the configured final value.\n Each successive value less than the final value SHOULD be at\n least twice the previous value. The initial value SHOULD be\n large enough to account for the size of the packets, twice the\n round trip time for transmission at the link speed, and at\n least an additional 100 milliseconds to allow the peer to\n process the packets before responding. Some circuits add\n another 200 milliseconds of satellite delay. Round trip times\n for modems operating at 14,400 bps have been measured in the\n range of 160 to more than 600 milliseconds.\n Max-Terminate\n There is one required restart counter for Terminate-Requests.\n Max-Terminate indicates the number of Terminate-Request packets\n sent without receiving a Terminate-Ack before assuming that the\n peer is unable to respond. Max-Terminate MUST be configurable,\n but SHOULD default to two (2) transmissions.\n Max-Configure\n A similar counter is recommended for Configure-Requests. Max-\n Configure indicates the number of Configure-Request packets sent\n without receiving a valid Configure-Ack, Configure-Nak or\n Configure-Reject before assuming that the peer is unable to\n respond. Max-Configure MUST be configurable, but SHOULD default\n to ten (10) transmissions.\n Max-Failure\n A related counter is recommended for Configure-Nak. Max-Failure\n indicates the number of Configure-Nak packets sent without sending\n a Configure-Ack before assuming that configuration is not\n converging. Any further Configure-Nak packets for peer requested\n options are converted to Configure-Reject packets, and locally\n desired options are no longer appended. Max-Failure MUST be\n configurable, but SHOULD default to five (5) transmissions."
25
+ },
26
+ {
27
+ "section_number": "5.",
28
+ "section_name": "LCP Packet Formats",
29
+ "tag": "Section 5. LCP Packet Formats",
30
+ "content": "There are three classes of LCP packets:\n 1. Link Configuration packets used to establish and configure a\n link (Configure-Request, Configure-Ack, Configure-Nak and\n Configure-Reject).\n 2. Link Termination packets used to terminate a link (Terminate-\n Request and Terminate-Ack).\n 3. Link Maintenance packets used to manage and debug a link\n (Code-Reject, Protocol-Reject, Echo-Request, Echo-Reply, and\n Discard-Request).\n In the interest of simplicity, there is no version field in the LCP\n packet. A correctly functioning LCP implementation will always\n respond to unknown Protocols and Codes with an easily recognizable\n LCP packet, thus providing a deterministic fallback mechanism for\n implementations of other versions.\n Regardless of which Configuration Options are enabled, all LCP Link\n Configuration, Link Termination, and Code-Reject packets (codes 1\n through 7) are always sent as if no Configuration Options were\n negotiated. In particular, each Configuration Option specifies a\n default value. This ensures that such LCP packets are always\n recognizable, even when one end of the link mistakenly believes the\n link to be open.\n Exactly one LCP packet is encapsulated in the PPP Information field,\n where the PPP Protocol field indicates type hex c021 (Link Control\n Protocol).\n A summary of the Link Control Protocol packet format is shown below.\n The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Data ...\n +-+-+-+-+\n Code\n The Code field is one octet, and identifies the kind of LCP\n packet. When a packet is received with an unknown Code field, a\n Code-Reject packet is transmitted.\n Up-to-date values of the LCP Code field are specified in the most\n recent \"Assigned Numbers\" RFC [2]. This document concerns the\n following values:\n 1 Configure-Request\n 2 Configure-Ack\n 3 Configure-Nak\n 4 Configure-Reject\n 5 Terminate-Request\n 6 Terminate-Ack\n 7 Code-Reject\n 8 Protocol-Reject\n 9 Echo-Request\n 10 Echo-Reply\n 11 Discard-Request\n Identifier\n The Identifier field is one octet, and aids in matching requests\n and replies. When a packet is received with an invalid Identifier\n field, the packet is silently discarded without affecting the\n automaton.\n Length\n The Length field is two octets, and indicates the length of the\n LCP packet, including the Code, Identifier, Length and Data\n fields. The Length MUST NOT exceed the MRU of the link.\n Octets outside the range of the Length field are treated as\n padding and are ignored on reception. When a packet is received\n with an invalid Length field, the packet is silently discarded\n without affecting the automaton.\n Data\n The Data field is zero or more octets, as indicated by the Length\n field. The format of the Data field is determined by the Code\n field.\n5.1. Configure-Request\n Description\n An implementation wishing to open a connection MUST transmit a\n Configure-Request. The Options field is filled with any desired\n changes to the link defaults. Configuration Options SHOULD NOT be\n included with default values.\n Upon reception of a Configure-Request, an appropriate reply MUST\n be transmitted.\n A summary of the Configure-Request packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Options ...\n +-+-+-+-+\n Code\n 1 for Configure-Request.\n Identifier\n The Identifier field MUST be changed whenever the contents of the\n Options field changes, and whenever a valid reply has been\n received for a previous request. For retransmissions, the\n Identifier MAY remain unchanged.\n Options\n The options field is variable in length, and contains the list of\n zero or more Configuration Options that the sender desires to\n negotiate. All Configuration Options are always negotiated\n simultaneously. The format of Configuration Options is further\n described in a later chapter.\n5.2. Configure-Ack\n Description\n If every Configuration Option received in a Configure-Request is\n recognizable and all values are acceptable, then the\n implementation MUST transmit a Configure-Ack. The acknowledged\n Configuration Options MUST NOT be reordered or modified in any\n way.\n On reception of a Configure-Ack, the Identifier field MUST match\n that of the last transmitted Configure-Request. Additionally, the\n Configuration Options in a Configure-Ack MUST exactly match those\n of the last transmitted Configure-Request. Invalid packets are\n silently discarded.\n A summary of the Configure-Ack packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Options ...\n +-+-+-+-+\n Code\n 2 for Configure-Ack.\n Identifier\n The Identifier field is a copy of the Identifier field of the\n Configure-Request which caused this Configure-Ack.\n Options\n The Options field is variable in length, and contains the list of\n zero or more Configuration Options that the sender is\n acknowledging. All Configuration Options are always acknowledged\n simultaneously.\n5.3. Configure-Nak\n Description\n If every instance of the received Configuration Options is\n recognizable, but some values are not acceptable, then the\n implementation MUST transmit a Configure-Nak. The Options field\n is filled with only the unacceptable Configuration Options from\n the Configure-Request. All acceptable Configuration Options are\n filtered out of the Configure-Nak, but otherwise the Configuration\n Options from the Configure-Request MUST NOT be reordered.\n Options which have no value fields (boolean options) MUST use the\n Configure-Reject reply instead.\n Each Configuration Option which is allowed only a single instance\n MUST be modified to a value acceptable to the Configure-Nak\n sender. The default value MAY be used, when this differs from the\n requested value.\n When a particular type of Configuration Option can be listed more\n than once with different values, the Configure-Nak MUST include a\n list of all values for that option which are acceptable to the\n Configure-Nak sender. This includes acceptable values that were\n present in the Configure-Request.\n Finally, an implementation may be configured to request the\n negotiation of a specific Configuration Option. If that option is\n not listed, then that option MAY be appended to the list of Nak'd\n Configuration Options, in order to prompt the peer to include that\n option in its next Configure-Request packet. Any value fields for\n the option MUST indicate values acceptable to the Configure-Nak\n sender.\n On reception of a Configure-Nak, the Identifier field MUST match\n that of the last transmitted Configure-Request. Invalid packets\n are silently discarded.\n Reception of a valid Configure-Nak indicates that when a new\n Configure-Request is sent, the Configuration Options MAY be\n modified as specified in the Configure-Nak. When multiple\n instances of a Configuration Option are present, the peer SHOULD\n select a single value to include in its next Configure-Request\n packet.\n Some Configuration Options have a variable length. Since the\n Nak'd Option has been modified by the peer, the implementation\n MUST be able to handle an Option length which is different from\n the original Configure-Request.\n A summary of the Configure-Nak packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Options ...\n +-+-+-+-+\n Code\n 3 for Configure-Nak.\n Identifier\n The Identifier field is a copy of the Identifier field of the\n Configure-Request which caused this Configure-Nak.\n Options\n The Options field is variable in length, and contains the list of\n zero or more Configuration Options that the sender is Nak'ing.\n All Configuration Options are always Nak'd simultaneously.\n5.4. Configure-Reject\n Description\n If some Configuration Options received in a Configure-Request are\n not recognizable or are not acceptable for negotiation (as\n configured by a network administrator), then the implementation\n MUST transmit a Configure-Reject. The Options field is filled\n with only the unacceptable Configuration Options from the\n Configure-Request. All recognizable and negotiable Configuration\n Options are filtered out of the Configure-Reject, but otherwise\n the Configuration Options MUST NOT be reordered or modified in any\n way.\n On reception of a Configure-Reject, the Identifier field MUST\n match that of the last transmitted Configure-Request.\n Additionally, the Configuration Options in a Configure-Reject MUST\n be a proper subset of those in the last transmitted Configure-\n Request. Invalid packets are silently discarded.\n Reception of a valid Configure-Reject indicates that when a new\n Configure-Request is sent, it MUST NOT include any of the\n Configuration Options listed in the Configure-Reject.\n A summary of the Configure-Reject packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Options ...\n +-+-+-+-+\n Code\n 4 for Configure-Reject.\n Identifier\n The Identifier field is a copy of the Identifier field of the\n Configure-Request which caused this Configure-Reject.\n Options\n The Options field is variable in length, and contains the list of\n zero or more Configuration Options that the sender is rejecting.\n All Configuration Options are always rejected simultaneously.\n5.5. Terminate-Request and Terminate-Ack\n Description\n LCP includes Terminate-Request and Terminate-Ack Codes in order to\n provide a mechanism for closing a connection.\n An implementation wishing to close a connection SHOULD transmit a\n Terminate-Request. Terminate-Request packets SHOULD continue to\n be sent until Terminate-Ack is received, the lower layer indicates\n that it has gone down, or a sufficiently large number have been\n transmitted such that the peer is down with reasonable certainty.\n Upon reception of a Terminate-Request, a Terminate-Ack MUST be\n transmitted.\n Reception of an unelicited Terminate-Ack indicates that the peer\n is in the Closed or Stopped states, or is otherwise in need of\n re-negotiation.\n A summary of the Terminate-Request and Terminate-Ack packet formats\n is shown below. The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Data ...\n +-+-+-+-+\n Code\n 5 for Terminate-Request;\n 6 for Terminate-Ack.\n Identifier\n On transmission, the Identifier field MUST be changed whenever the\n content of the Data field changes, and whenever a valid reply has\n been received for a previous request. For retransmissions, the\n Identifier MAY remain unchanged.\n On reception, the Identifier field of the Terminate-Request is\n copied into the Identifier field of the Terminate-Ack packet.\n Data\n The Data field is zero or more octets, and contains uninterpreted\n data for use by the sender. The data may consist of any binary\n value. The end of the field is indicated by the Length.\n5.6. Code-Reject\n Description\n Reception of a LCP packet with an unknown Code indicates that the\n peer is operating with a different version. This MUST be reported\n back to the sender of the unknown Code by transmitting a Code-\n Reject.\n Upon reception of the Code-Reject of a code which is fundamental\n to this version of the protocol, the implementation SHOULD report\n the problem and drop the connection, since it is unlikely that the\n situation can be rectified automatically.\n A summary of the Code-Reject packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Rejected-Packet ...\n +-+-+-+-+-+-+-+-+\n Code\n 7 for Code-Reject.\n Identifier\n The Identifier field MUST be changed for each Code-Reject sent.\n Rejected-Packet\n The Rejected-Packet field contains a copy of the LCP packet which\n is being rejected. It begins with the Information field, and does\n not include any Data Link Layer headers nor an FCS. The\n Rejected-Packet MUST be truncated to comply with the peer's\n established MRU.\n5.7. Protocol-Reject\n Description\n Reception of a PPP packet with an unknown Protocol field indicates\n that the peer is attempting to use a protocol which is\n unsupported. This usually occurs when the peer attempts to\n configure a new protocol. If the LCP automaton is in the Opened\n state, then this MUST be reported back to the peer by transmitting\n a Protocol-Reject.\n Upon reception of a Protocol-Reject, the implementation MUST stop\n sending packets of the indicated protocol at the earliest\n opportunity.\n Protocol-Reject packets can only be sent in the LCP Opened state.\n Protocol-Reject packets received in any state other than the LCP\n Opened state SHOULD be silently discarded.\n A summary of the Protocol-Reject packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Rejected-Protocol | Rejected-Information ...\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Code\n 8 for Protocol-Reject.\n Identifier\n The Identifier field MUST be changed for each Protocol-Reject\n sent.\n Rejected-Protocol\n The Rejected-Protocol field is two octets, and contains the PPP\n Protocol field of the packet which is being rejected.\n Rejected-Information\n The Rejected-Information field contains a copy of the packet which\n is being rejected. It begins with the Information field, and does\n not include any Data Link Layer headers nor an FCS. The\n Rejected-Information MUST be truncated to comply with the peer's\n established MRU.\n5.8. Echo-Request and Echo-Reply\n Description\n LCP includes Echo-Request and Echo-Reply Codes in order to provide\n a Data Link Layer loopback mechanism for use in exercising both\n directions of the link. This is useful as an aid in debugging,\n link quality determination, performance testing, and for numerous\n other functions.\n Upon reception of an Echo-Request in the LCP Opened state, an\n Echo-Reply MUST be transmitted.\n Echo-Request and Echo-Reply packets MUST only be sent in the LCP\n Opened state. Echo-Request and Echo-Reply packets received in any\n state other than the LCP Opened state SHOULD be silently\n discarded.\n A summary of the Echo-Request and Echo-Reply packet formats is shown\n below. The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Magic-Number |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Data ...\n +-+-+-+-+\n Code\n 9 for Echo-Request;\n 10 for Echo-Reply.\n Identifier\n On transmission, the Identifier field MUST be changed whenever the\n content of the Data field changes, and whenever a valid reply has\n been received for a previous request. For retransmissions, the\n Identifier MAY remain unchanged.\n On reception, the Identifier field of the Echo-Request is copied\n into the Identifier field of the Echo-Reply packet.\n Magic-Number\n The Magic-Number field is four octets, and aids in detecting links\n which are in the looped-back condition. Until the Magic-Number\n Configuration Option has been successfully negotiated, the Magic-\n Number MUST be transmitted as zero. See the Magic-Number\n Configuration Option for further explanation.\n Data\n The Data field is zero or more octets, and contains uninterpreted\n data for use by the sender. The data may consist of any binary\n value. The end of the field is indicated by the Length.\n5.9. Discard-Request\n Description\n LCP includes a Discard-Request Code in order to provide a Data\n Link Layer sink mechanism for use in exercising the local to\n remote direction of the link. This is useful as an aid in\n debugging, performance testing, and for numerous other functions.\n Discard-Request packets MUST only be sent in the LCP Opened state.\n On reception, the receiver MUST silently discard any Discard-\n Request that it receives.\n A summary of the Discard-Request packet format is shown below. The\n fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Code | Identifier | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Magic-Number |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Data ...\n +-+-+-+-+\n Code\n 11 for Discard-Request.\n Identifier\n The Identifier field MUST be changed for each Discard-Request\n sent.\n Magic-Number\n The Magic-Number field is four octets, and aids in detecting links\n which are in the looped-back condition. Until the Magic-Number\n Configuration Option has been successfully negotiated, the Magic-\n Number MUST be transmitted as zero. See the Magic-Number\n Configuration Option for further explanation.\n Data\n The Data field is zero or more octets, and contains uninterpreted\n data for use by the sender. The data may consist of any binary\n value. The end of the field is indicated by the Length."
31
+ },
32
+ {
33
+ "section_number": "6.",
34
+ "section_name": "LCP Configuration Options",
35
+ "tag": "Section 6. LCP Configuration Options",
36
+ "content": "LCP Configuration Options allow negotiation of modifications to the\n default characteristics of a point-to-point link. If a Configuration\n Option is not included in a Configure-Request packet, the default\n value for that Configuration Option is assumed.\n Some Configuration Options MAY be listed more than once. The effect\n of this is Configuration Option specific, and is specified by each\n such Configuration Option description. (None of the Configuration\n Options in this specification can be listed more than once.)\n The end of the list of Configuration Options is indicated by the\n Length field of the LCP packet.\n Unless otherwise specified, all Configuration Options apply in a\n half-duplex fashion; typically, in the receive direction of the link\n from the point of view of the Configure-Request sender.\n Design Philosophy\n The options indicate additional capabilities or requirements of\n the implementation that is requesting the option. An\n implementation which does not understand any option SHOULD\n interoperate with one which implements every option.\n A default is specified for each option which allows the link to\n correctly function without negotiation of the option, although\n perhaps with less than optimal performance.\n Except where explicitly specified, acknowledgement of an option\n does not require the peer to take any additional action other than\n the default.\n It is not necessary to send the default values for the options in\n a Configure-Request.\n A summary of the Configuration Option format is shown below. The\n fields are transmitted from left to right.\n 0 1\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length | Data ...\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Type\n The Type field is one octet, and indicates the type of\n Configuration Option. Up-to-date values of the LCP Option Type\n field are specified in the most recent \"Assigned Numbers\" RFC [2].\n This document concerns the following values:\n 0 RESERVED\n 1 Maximum-Receive-Unit\n 3 Authentication-Protocol\n 4 Quality-Protocol\n 5 Magic-Number\n 7 Protocol-Field-Compression\n 8 Address-and-Control-Field-Compression\n Length\n The Length field is one octet, and indicates the length of this\n Configuration Option including the Type, Length and Data fields.\n If a negotiable Configuration Option is received in a Configure-\n Request, but with an invalid or unrecognized Length, a Configure-\n Nak SHOULD be transmitted which includes the desired Configuration\n Option with an appropriate Length and Data.\n Data\n The Data field is zero or more octets, and contains information\n specific to the Configuration Option. The format and length of\n the Data field is determined by the Type and Length fields.\n When the Data field is indicated by the Length to extend beyond\n the end of the Information field, the entire packet is silently\n discarded without affecting the automaton.\n6.1. Maximum-Receive-Unit (MRU)\n Description\n This Configuration Option may be sent to inform the peer that the\n implementation can receive larger packets, or to request that the\n peer send smaller packets.\n The default value is 1500 octets. If smaller packets are\n requested, an implementation MUST still be able to receive the\n full 1500 octet information field in case link synchronization is\n lost.\n Implementation Note:\n This option is used to indicate an implementation capability.\n The peer is not required to maximize the use of the capacity.\n For example, when a MRU is indicated which is 2048 octets, the\n peer is not required to send any packet with 2048 octets. The\n peer need not Configure-Nak to indicate that it will only send\n smaller packets, since the implementation will always require\n support for at least 1500 octets.\n A summary of the Maximum-Receive-Unit Configuration Option format is\n shown below. The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length | Maximum-Receive-Unit |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Type\n 1\n Length\n 4\n Maximum-Receive-Unit\n The Maximum-Receive-Unit field is two octets, and specifies the\n maximum number of octets in the Information and Padding fields.\n It does not include the framing, Protocol field, FCS, nor any\n transparency bits or bytes.\n6.2. Authentication-Protocol\n Description\n On some links it may be desirable to require a peer to\n authenticate itself before allowing network-layer protocol packets\n to be exchanged.\n This Configuration Option provides a method to negotiate the use\n of a specific protocol for authentication. By default,\n authentication is not required.\n An implementation MUST NOT include multiple Authentication-\n Protocol Configuration Options in its Configure-Request packets.\n Instead, it SHOULD attempt to configure the most desirable\n protocol first. If that protocol is Configure-Nak'd, then the\n implementation SHOULD attempt the next most desirable protocol in\n the next Configure-Request.\n The implementation sending the Configure-Request is indicating\n that it expects authentication from its peer. If an\n implementation sends a Configure-Ack, then it is agreeing to\n authenticate with the specified protocol. An implementation\n receiving a Configure-Ack SHOULD expect the peer to authenticate\n with the acknowledged protocol.\n There is no requirement that authentication be full-duplex or that\n the same protocol be used in both directions. It is perfectly\n acceptable for different protocols to be used in each direction.\n This will, of course, depend on the specific protocols negotiated.\n A summary of the Authentication-Protocol Configuration Option format\n is shown below. The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length | Authentication-Protocol |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Data ...\n +-+-+-+-+\n Type\n 3\n Length\n >= 4\n Authentication-Protocol\n The Authentication-Protocol field is two octets, and indicates the\n authentication protocol desired. Values for this field are always\n the same as the PPP Protocol field values for that same\n authentication protocol.\n Up-to-date values of the Authentication-Protocol field are\n specified in the most recent \"Assigned Numbers\" RFC [2]. Current\n values are assigned as follows:\n Value (in hex) Protocol\n c023 Password Authentication Protocol\n c223 Challenge Handshake Authentication Protocol\n Data\n The Data field is zero or more octets, and contains additional\n data as determined by the particular protocol.\n6.3. Quality-Protocol\n Description\n On some links it may be desirable to determine when, and how\n often, the link is dropping data. This process is called link\n quality monitoring.\n This Configuration Option provides a method to negotiate the use\n of a specific protocol for link quality monitoring. By default,\n link quality monitoring is disabled.\n The implementation sending the Configure-Request is indicating\n that it expects to receive monitoring information from its peer.\n If an implementation sends a Configure-Ack, then it is agreeing to\n send the specified protocol. An implementation receiving a\n Configure-Ack SHOULD expect the peer to send the acknowledged\n protocol.\n There is no requirement that quality monitoring be full-duplex or\n that the same protocol be used in both directions. It is\n perfectly acceptable for different protocols to be used in each\n direction. This will, of course, depend on the specific protocols\n negotiated.\n A summary of the Quality-Protocol Configuration Option format is\n shown below. The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length | Quality-Protocol |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Data ...\n +-+-+-+-+\n Type\n 4\n Length\n >= 4\n Quality-Protocol\n The Quality-Protocol field is two octets, and indicates the link\n quality monitoring protocol desired. Values for this field are\n always the same as the PPP Protocol field values for that same\n monitoring protocol.\n Up-to-date values of the Quality-Protocol field are specified in\n the most recent \"Assigned Numbers\" RFC [2]. Current values are\n assigned as follows:\n Value (in hex) Protocol\n c025 Link Quality Report\n Data\n The Data field is zero or more octets, and contains additional\n data as determined by the particular protocol.\n6.4. Magic-Number\n Description\n This Configuration Option provides a method to detect looped-back\n links and other Data Link Layer anomalies. This Configuration\n Option MAY be required by some other Configuration Options such as\n the Quality-Protocol Configuration Option. By default, the\n Magic-Number is not negotiated, and zero is inserted where a\n Magic-Number might otherwise be used.\n Before this Configuration Option is requested, an implementation\n MUST choose its Magic-Number. It is recommended that the Magic-\n Number be chosen in the most random manner possible in order to\n guarantee with very high probability that an implementation will\n arrive at a unique number. A good way to choose a unique random\n number is to start with a unique seed. Suggested sources of\n uniqueness include machine serial numbers, other network hardware\n addresses, time-of-day clocks, etc. Particularly good random\n number seeds are precise measurements of the inter-arrival time of\n physical events such as packet reception on other connected\n networks, server response time, or the typing rate of a human\n user. It is also suggested that as many sources as possible be\n used simultaneously.\n When a Configure-Request is received with a Magic-Number\n Configuration Option, the received Magic-Number is compared with\n the Magic-Number of the last Configure-Request sent to the peer.\n If the two Magic-Numbers are different, then the link is not\n looped-back, and the Magic-Number SHOULD be acknowledged. If the\n two Magic-Numbers are equal, then it is possible, but not certain,\n that the link is looped-back and that this Configure-Request is\n actually the one last sent. To determine this, a Configure-Nak\n MUST be sent specifying a different Magic-Number value. A new\n Configure-Request SHOULD NOT be sent to the peer until normal\n processing would cause it to be sent (that is, until a Configure-\n Nak is received or the Restart timer runs out).\n Reception of a Configure-Nak with a Magic-Number different from\n that of the last Configure-Nak sent to the peer proves that a link\n is not looped-back, and indicates a unique Magic-Number. If the\n Magic-Number is equal to the one sent in the last Configure-Nak,\n the possibility of a looped-back link is increased, and a new\n Magic-Number MUST be chosen. In either case, a new Configure-\n Request SHOULD be sent with the new Magic-Number.\n If the link is indeed looped-back, this sequence (transmit\n Configure-Request, receive Configure-Request, transmit Configure-\n Nak, receive Configure-Nak) will repeat over and over again. If\n the link is not looped-back, this sequence might occur a few\n times, but it is extremely unlikely to occur repeatedly. More\n likely, the Magic-Numbers chosen at either end will quickly\n diverge, terminating the sequence. The following table shows the\n probability of collisions assuming that both ends of the link\n select Magic-Numbers with a perfectly uniform distribution:\n Number of Collisions Probability\n -------------------- ---------------------\n 1 1/2**32 = 2.3 E-10\n 2 1/2**32**2 = 5.4 E-20\n 3 1/2**32**3 = 1.3 E-29\n Good sources of uniqueness or randomness are required for this\n divergence to occur. If a good source of uniqueness cannot be\n found, it is recommended that this Configuration Option not be\n enabled; Configure-Requests with the option SHOULD NOT be\n transmitted and any Magic-Number Configuration Options which the\n peer sends SHOULD be either acknowledged or rejected. In this\n case, looped-back links cannot be reliably detected by the\n implementation, although they may still be detectable by the peer.\n If an implementation does transmit a Configure-Request with a\n Magic-Number Configuration Option, then it MUST NOT respond with a\n Configure-Reject when it receives a Configure-Request with a\n Magic-Number Configuration Option. That is, if an implementation\n desires to use Magic Numbers, then it MUST also allow its peer to\n do so. If an implementation does receive a Configure-Reject in\n response to a Configure-Request, it can only mean that the link is\n not looped-back, and that its peer will not be using Magic-\n Numbers. In this case, an implementation SHOULD act as if the\n negotiation had been successful (as if it had instead received a\n Configure-Ack).\n The Magic-Number also may be used to detect looped-back links\n during normal operation, as well as during Configuration Option\n negotiation. All LCP Echo-Request, Echo-Reply, and Discard-\n Request packets have a Magic-Number field. If Magic-Number has\n been successfully negotiated, an implementation MUST transmit\n these packets with the Magic-Number field set to its negotiated\n Magic-Number.\n The Magic-Number field of these packets SHOULD be inspected on\n reception. All received Magic-Number fields MUST be equal to\n either zero or the peer's unique Magic-Number, depending on\n whether or not the peer negotiated a Magic-Number.\n Reception of a Magic-Number field equal to the negotiated local\n Magic-Number indicates a looped-back link. Reception of a Magic-\n Number other than the negotiated local Magic-Number, the peer's\n negotiated Magic-Number, or zero if the peer didn't negotiate one,\n indicates a link which has been (mis)configured for communications\n with a different peer.\n Procedures for recovery from either case are unspecified, and may\n vary from implementation to implementation. A somewhat\n pessimistic procedure is to assume a LCP Down event. A further\n Open event will begin the process of re-establishing the link,\n which can't complete until the looped-back condition is\n terminated, and Magic-Numbers are successfully negotiated. A more\n optimistic procedure (in the case of a looped-back link) is to\n begin transmitting LCP Echo-Request packets until an appropriate\n Echo-Reply is received, indicating a termination of the looped-\n back condition.\n A summary of the Magic-Number Configuration Option format is shown\n below. The fields are transmitted from left to right.\n 0 1 2 3\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length | Magic-Number\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Magic-Number (cont) |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Type\n 5\n Length\n 6\n Magic-Number\n The Magic-Number field is four octets, and indicates a number\n which is very likely to be unique to one end of the link. A\n Magic-Number of zero is illegal and MUST always be Nak'd, if it is\n not Rejected outright.\n6.5. Protocol-Field-Compression (PFC)\n Description\n This Configuration Option provides a method to negotiate the\n compression of the PPP Protocol field. By default, all\n implementations MUST transmit packets with two octet PPP Protocol\n fields.\n PPP Protocol field numbers are chosen such that some values may be\n compressed into a single octet form which is clearly\n distinguishable from the two octet form. This Configuration\n Option is sent to inform the peer that the implementation can\n receive such single octet Protocol fields.\n As previously mentioned, the Protocol field uses an extension\n mechanism consistent with the ISO 3309 extension mechanism for the\n Address field; the Least Significant Bit (LSB) of each octet is\n used to indicate extension of the Protocol field. A binary \"0\" as\n the LSB indicates that the Protocol field continues with the\n following octet. The presence of a binary \"1\" as the LSB marks\n the last octet of the Protocol field. Notice that any number of\n \"0\" octets may be prepended to the field, and will still indicate\n the same value (consider the two binary representations for 3,\n 00000011 and 00000000 00000011).\n When using low speed links, it is desirable to conserve bandwidth\n by sending as little redundant data as possible. The Protocol-\n Field-Compression Configuration Option allows a trade-off between\n implementation simplicity and bandwidth efficiency. If\n successfully negotiated, the ISO 3309 extension mechanism may be\n used to compress the Protocol field to one octet instead of two.\n The large majority of packets are compressible since data\n protocols are typically assigned with Protocol field values less\n than 256.\n Compressed Protocol fields MUST NOT be transmitted unless this\n Configuration Option has been negotiated. When negotiated, PPP\n implementations MUST accept PPP packets with either double-octet\n or single-octet Protocol fields, and MUST NOT distinguish between\n them.\n The Protocol field is never compressed when sending any LCP\n packet. This rule guarantees unambiguous recognition of LCP\n packets.\n When a Protocol field is compressed, the Data Link Layer FCS field\n is calculated on the compressed frame, not the original\n uncompressed frame.\n A summary of the Protocol-Field-Compression Configuration Option\n format is shown below. The fields are transmitted from left to\n right.\n 0 1\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Type\n 7\n Length\n 2\n6.6. Address-and-Control-Field-Compression (ACFC)\n Description\n This Configuration Option provides a method to negotiate the\n compression of the Data Link Layer Address and Control fields. By\n default, all implementations MUST transmit frames with Address and\n Control fields appropriate to the link framing.\n Since these fields usually have constant values for point-to-point\n links, they are easily compressed. This Configuration Option is\n sent to inform the peer that the implementation can receive\n compressed Address and Control fields.\n If a compressed frame is received when Address-and-Control-Field-\n Compression has not been negotiated, the implementation MAY\n silently discard the frame.\n The Address and Control fields MUST NOT be compressed when sending\n any LCP packet. This rule guarantees unambiguous recognition of\n LCP packets.\n When the Address and Control fields are compressed, the Data Link\n Layer FCS field is calculated on the compressed frame, not the\n original uncompressed frame.\n A summary of the Address-and-Control-Field-Compression configuration\n option format is shown below. The fields are transmitted from left\n to right.\n 0 1\n 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n | Type | Length |\n +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n Type\n 8\n Length\n 2\nSecurity Considerations\n Security issues are briefly discussed in sections concerning the\n Authentication Phase, the Close event, and the Authentication-\n Protocol Configuration Option.\nReferences\n [1] Perkins, D., \"Requirements for an Internet Standard Point-to-\n Point Protocol\", RFC 1547, Carnegie Mellon University,\n December 1993.\n [2] Reynolds, J., and Postel, J., \"Assigned Numbers\", STD 2, RFC\n 1340, USC/Information Sciences Institute, July 1992.\nAcknowledgements\n This document is the product of the Point-to-Point Protocol Working\n Group of the Internet Engineering Task Force (IETF). Comments should\n be submitted to the ietf-ppp@merit.edu mailing list.\n Much of the text in this document is taken from the working group\n requirements [1]; and RFCs 1171 & 1172, by Drew Perkins while at\n Carnegie Mellon University, and by Russ Hobby of the University of\n California at Davis.\n William Simpson was principally responsible for introducing\n consistent terminology and philosophy, and the re-design of the phase\n and negotiation state machines.\n Many people spent significant time helping to develop the Point-to-\n Point Protocol. The complete list of people is too numerous to list,\n but the following people deserve special thanks: Rick Adams, Ken\n Adelman, Fred Baker, Mike Ballard, Craig Fox, Karl Fox, Phill Gross,\n Kory Hamzeh, former WG chair Russ Hobby, David Kaufman, former WG\n chair Steve Knowles, Mark Lewis, former WG chair Brian Lloyd, John\n LoVerso, Bill Melohn, Mike Patton, former WG chair Drew Perkins, Greg\n Satz, John Shriver, Vernon Schryver, and Asher Waldfogel.\n Special thanks to Morning Star Technologies for providing computing\n resources and network access support for writing this specification.\nChair's Address\n The working group can be contacted via the current chair:\n Fred Baker\n Advanced Computer Communications\n 315 Bollay Drive\n Santa Barbara, California 93117\n fbaker@acc.com\nEditor's Address\n Questions about this memo can also be directed to:\n William Allen Simpson\n Daydreamer\n Computer Systems Consulting Services\n 1384 Fontaine\n Madison Heights, Michigan 48071\n Bill.Simpson@um.cc.umich.edu\n bsimpson@MorningStar.com"
37
+ }
38
+ ]
RFCChunks/PPTP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/RTSP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/SIP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/SMTP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
RFCChunks/TCP_segments.json ADDED
The diff for this file is too large to render. See raw diff
 
readme.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # RFC Protocol State Machine Benchmark
2
+
3
+ This dataset is designed for benchmarking the extraction of protocol state machines (PSMs) from RFC documents. It contains protocol specification chunks and their corresponding ground truth PSMs, making it suitable for evaluating large language models (LLMs) on structured information extraction tasks.
4
+
5
+ ## Dataset Structure
6
+
7
+ The dataset is organized into two main directories:
8
+
9
+ ### **1. RFCChunks**
10
+ Contains chunked RFC documents for each protocol, designed to provide LLMs with manageable portions of long technical specifications. Each file is named using the format:
11
+
12
+ {protocol}_segments.json
13
+
14
+ ### **2. PSMs**
15
+ Contains the ground truth protocol state machines for each protocol, providing the expected output for evaluation. Each file is named using the format:
16
+
17
+ {protocol}_state_machine.json
18
+
19
+ ## License
20
+ This dataset is released under the MIT license, allowing for use, distribution, and modification with proper attribution.