Add transport-{api,tcp}
[netconf.git] / transport / transport-tcp / src / main / yang / ietf-tcp-common@2022-05-24.yang
1 module ietf-tcp-common {
2   yang-version 1.1;
3   namespace "urn:ietf:params:xml:ns:yang:ietf-tcp-common";
4   prefix tcpcmn;
5
6   organization
7     "IETF NETCONF (Network Configuration) Working Group and the
8      IETF TCP Maintenance and Minor Extensions (TCPM) Working Group";
9
10   contact
11     "WG Web:   https://datatracker.ietf.org/wg/netconf
12                https://datatracker.ietf.org/wg/tcpm
13      WG List:  NETCONF WG list <mailto:netconf@ietf.org>
14                TCPM WG list <mailto:tcpm@ietf.org>
15      Authors:  Kent Watsen <mailto:kent+ietf@watsen.net>
16                Michael Scharf
17                <mailto:michael.scharf@hs-esslingen.de>";
18
19   description
20     "This module defines reusable groupings for TCP commons that
21      can be used as a basis for specific TCP common instances.
22
23      Copyright (c) 2022 IETF Trust and the persons identified
24      as authors of the code. All rights reserved.
25
26      Redistribution and use in source and binary forms, with
27      or without modification, is permitted pursuant to, and
28      subject to the license terms contained in, the Revised
29      BSD License set forth in Section 4.c of the IETF Trust's
30      Legal Provisions Relating to IETF Documents
31      (https://trustee.ietf.org/license-info).
32
33      This version of this YANG module is part of RFC DDDD
34      (https://www.rfc-editor.org/info/rfcDDDD); see the RFC
35      itself for full legal notices.
36
37      The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL',
38      'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED',
39      'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document
40      are to be interpreted as described in BCP 14 (RFC 2119)
41      (RFC 8174) when, and only when, they appear in all
42      capitals, as shown here.";
43
44   revision 2022-05-24 {
45     description
46       "Initial version";
47     reference
48       "RFC DDDD: YANG Groupings for TCP Clients and TCP Servers";
49   }
50
51   // Features
52
53   feature keepalives-supported {
54     description
55       "Indicates that keepalives are supported.";
56   }
57
58   // Groupings
59
60   grouping tcp-common-grouping {
61     description
62       "A reusable grouping for configuring TCP parameters common
63        to TCP connections as well as the operating system as a
64        whole.";
65     container keepalives {
66       if-feature "keepalives-supported";
67       presence
68         "Indicates that keepalives are enabled.  This statement is
69          present so the mandatory descendant nodes do not imply that
70          this node must be configured.";
71       description
72         "Configures the keep-alive policy, to proactively test the
73          aliveness of the TCP peer.  An unresponsive TCP peer is
74          dropped after approximately (idle-time + max-probes
75          * probe-interval) seconds.";
76       leaf idle-time {
77         type uint16 {
78           range "1..max";
79         }
80         units "seconds";
81         mandatory true;
82         description
83           "Sets the amount of time after which if no data has been
84            received from the TCP peer, a TCP-level probe message
85            will be sent to test the aliveness of the TCP peer.
86            Two hours (7200 seconds) is safe value, per RFC 1122.";
87         reference
88           "RFC 1122:
89             Requirements for Internet Hosts -- Communication Layers";
90       }
91       leaf max-probes {
92         type uint16 {
93           range "1..max";
94         }
95         mandatory true;
96         description
97           "Sets the maximum number of sequential keep-alive probes
98            that can fail to obtain a response from the TCP peer
99            before assuming the TCP peer is no longer alive.";
100       }
101       leaf probe-interval {
102         type uint16 {
103           range "1..max";
104         }
105         units "seconds";
106         mandatory true;
107         description
108           "Sets the time interval between failed probes. The interval
109            SHOULD be significantly longer than one second in order to
110            avoid harm on a congested link.";
111       }
112     } // container keepalives
113   } // grouping tcp-common-grouping
114
115 }