idnits 2.17.1 draft-duchene-spring-srv6-socket-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 05, 2018) is 2237 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '0' on line 131 -- Looks like a reference, but probably isn't: '1' on line 134 == Unused Reference: 'RFC2119' is defined on line 190, but no explicit reference was found in the text == Unused Reference: 'RFC8200' is defined on line 195, but no explicit reference was found in the text == Outdated reference: A later version (-26) exists of draft-ietf-6man-segment-routing-header-08 == Outdated reference: A later version (-07) exists of draft-filsfils-spring-srv6-network-programming-04 Summary: 0 errors (**), 0 flaws (~~), 5 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 SPRING Working Group F. Duchene 3 Internet-Draft O. Bonaventure 4 Intended status: Informational UCLouvain 5 Expires: September 6, 2018 March 05, 2018 7 A socket API to control IPv6 Segment Routing 8 draft-duchene-spring-srv6-socket-00 10 Abstract 12 This document proposes a socket API to allow applications to control 13 the utilisation of IPv6 Segment Routing (SRv6). 15 Status of This Memo 17 This Internet-Draft is submitted in full conformance with the 18 provisions of BCP 78 and BCP 79. 20 Internet-Drafts are working documents of the Internet Engineering 21 Task Force (IETF). Note that other groups may also distribute 22 working documents as Internet-Drafts. The list of current Internet- 23 Drafts is at http://datatracker.ietf.org/drafts/current/. 25 Internet-Drafts are draft documents valid for a maximum of six months 26 and may be updated, replaced, or obsoleted by other documents at any 27 time. It is inappropriate to use Internet-Drafts as reference 28 material or to cite them other than as "work in progress." 30 This Internet-Draft will expire on September 6, 2018. 32 Copyright Notice 34 Copyright (c) 2018 IETF Trust and the persons identified as the 35 document authors. All rights reserved. 37 This document is subject to BCP 78 and the IETF Trust's Legal 38 Provisions Relating to IETF Documents 39 (http://trustee.ietf.org/license-info) in effect on the date of 40 publication of this document. Please review these documents 41 carefully, as they describe your rights and restrictions with respect 42 to this document. Code Components extracted from this document must 43 include Simplified BSD License text as described in Section 4.e of 44 the Trust Legal Provisions and are provided without warranty as 45 described in the Simplified BSD License. 47 Table of Contents 49 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 50 2. SRv6 Socket API . . . . . . . . . . . . . . . . . . . . . . . 2 51 2.1. Inserting an Segment Routing Header . . . . . . . . . . . 2 52 3. IANA considerations . . . . . . . . . . . . . . . . . . . . . 5 53 4. Security considerations . . . . . . . . . . . . . . . . . . . 5 54 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 55 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 56 6.1. Normative References . . . . . . . . . . . . . . . . . . 5 57 6.2. Informative References . . . . . . . . . . . . . . . . . 5 58 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 60 1. Introduction 62 Segment Routing [I-D.ietf-spring-segment-routing] was initially 63 defined as a technique to enable network operators to better control 64 the flow of packets inside their network. Most use cases 65 [I-D.ietf-spring-ipv6-use-cases] 66 [I-D.ietf-spring-resiliency-use-cases] 67 [I-D.filsfils-spring-srv6-network-programming] 68 [I-D.ietf-spring-oam-usecase] leverage Segment Routing on routers 69 only. In contrast with the MPLS data plane that is traditionally 70 only supported on routers, the IPv6 Segment Routing Header 71 [I-D.ietf-6man-segment-routing-header] is supported on both routers 72 [SR6Demo] and on endhosts [SR6Linux]. The ability of setting and 73 processing the IPv6 Segment Routing Header on endhosts opens new 74 "end-to-end" use cases for Segment Routing. We can envision networks 75 where clients set the IPv6 Segment Routing Header in all the packets 76 they send to reach a given server along a specific path that depends 77 on the client's or the network policies. 79 In this document, we propose a socket option that enables 80 applications to use the IPv6 Segment Routing Header on a per UDP 81 datagram basis or a per TCP connection basis. 83 2. SRv6 Socket API 85 From an application viewpoint, the interaction with the underlying 86 stack is performed using a socket option. The socket option is set 87 by using "setsockopt()". 89 2.1. Inserting an Segment Routing Header 91 A SRv6 routing header [I-D.ietf-6man-segment-routing-header] can be 92 attached to a socket by calling "setsockopt()" with the option 93 "IPV6_RTHDR". The structure of a SRH is presented in figure 94 Figure 1. 96 struct ipv6_sr_hdr { 97 uint8_t nexthdr; 98 uint8_t hdrlen; 99 uint8_t type; 100 uint8_t segments_left; 101 uint8_t first_segment; 102 uint8_t flags; 103 uint16_t reserved; 105 struct in6_addr segments[0]; 106 }; 108 Figure 1: The SRv6 routing header structure 110 Once the SRH has been attached to the socket, the packets will use 111 the path described in the segments list of the SRH. An example using 112 a TCP connection from 2001:DB8:1111::1 to 2001:DB8:3333::1 and 113 passing through 2001:DB8:2222::1 is shown in figure Figure 2. 115 int fd, err, srh_len, n; 116 struct ipv6_sr_hdr *srh; 117 struct sockaddr_in6 sin6, sin6_bind; 119 srh_len = sizeof(*srh) + 2 * sizeof(struct in6_addr); 120 srh = malloc(srh_len); 122 srh->nexthdr = 0; 123 srh->hdrlen = 4; 124 srh->type = 4; 125 srh->segments_left = 1; 126 srh->first_segment = 1; 127 srh->flags = 0; 128 srh->reserved = 0; 130 /* Space for the destination segment */ 131 memset(&srh->segments[0], 0, sizeof(struct in6_addr)); 132 /* Adding the segment 2001:DB8:2222::1 to the segments list of 133 the SRH */ 134 inet_pton(AF_INET6, "2001:DB8:2222::1", &srh->segments[1]); 136 fd = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); 138 err = setsockopt(fd, IPPROTO_IPV6, IPV6_RTHDR, srh, srh_len); 140 memset(&sin6_bind, 0, sizeof(sin6_bind)); 141 sin6_bind.sin6_family = AF_INET6; 142 inet_pton(AF_INET6, "2001:DB8:1111::1", &sin6_bind.sin6_addr); 144 err = bind(fd, (struct sockaddr *)&sin6_bind, sizeof(sin6_bind)); 146 memset(&sin6, 0, sizeof(sin6)); 147 sin6.sin6_family = AF_INET6; 148 sin6.sin6_port = htons(1234); 149 inet_pton(AF_INET6, "2001:DB8:3333::1", &sin6.sin6_addr); 151 err = connect(fd, (struct sockaddr *)&sin6, sizeof(sin6)); 153 Figure 2: Sample code to establish a TCP connection 155 While figure Figure 2 shows a TCP connection, the same socket option 156 can be applied to UDP sockets. 158 3. IANA considerations 160 There are no IANA considerations in this document. 162 4. Security considerations 164 There are no security considerations in this document. 166 5. Acknowledgements 168 The initial implementation of the socket option was written by David 169 Lebrun [LEBRUN17] 171 6. References 173 6.1. Normative References 175 [I-D.ietf-6man-segment-routing-header] 176 Previdi, S., Filsfils, C., Raza, K., Dukes, D., Leddy, J., 177 Field, B., daniel.voyer@bell.ca, d., 178 daniel.bernier@bell.ca, d., Matsushima, S., Leung, I., 179 Linkova, J., Aries, E., Kosugi, T., Vyncke, E., Lebrun, 180 D., Steinberg, D., and R. Raszuk, "IPv6 Segment Routing 181 Header (SRH)", draft-ietf-6man-segment-routing-header-08 182 (work in progress), January 2018. 184 [I-D.ietf-spring-segment-routing] 185 Filsfils, C., Previdi, S., Ginsberg, L., Decraene, B., 186 Litkowski, S., and R. Shakir, "Segment Routing 187 Architecture", draft-ietf-spring-segment-routing-15 (work 188 in progress), January 2018. 190 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 191 Requirement Levels", BCP 14, RFC 2119, 192 DOI 10.17487/RFC2119, March 1997, . 195 [RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6 196 (IPv6) Specification", STD 86, RFC 8200, 197 DOI 10.17487/RFC8200, July 2017, . 200 6.2. Informative References 202 [I-D.filsfils-spring-srv6-network-programming] 203 Filsfils, C., Li, Z., Leddy, J., daniel.voyer@bell.ca, d., 204 daniel.bernier@bell.ca, d., Steinberg, D., Raszuk, R., 205 Matsushima, S., Lebrun, D., Decraene, B., Peirens, B., 206 Salsano, S., Naik, G., Elmalky, H., Jonnalagadda, P., and 207 M. Sharif, "SRv6 Network Programming", draft-filsfils- 208 spring-srv6-network-programming-04 (work in progress), 209 March 2018. 211 [I-D.ietf-spring-ipv6-use-cases] 212 Brzozowski, J., Leddy, J., Filsfils, C., Maglione, R., and 213 M. Townsley, "IPv6 SPRING Use Cases", draft-ietf-spring- 214 ipv6-use-cases-12 (work in progress), December 2017. 216 [I-D.ietf-spring-oam-usecase] 217 Geib, R., Filsfils, C., Pignataro, C., and N. Kumar, "A 218 Scalable and Topology-Aware MPLS Dataplane Monitoring 219 System", draft-ietf-spring-oam-usecase-10 (work in 220 progress), December 2017. 222 [I-D.ietf-spring-resiliency-use-cases] 223 Filsfils, C., Previdi, S., Decraene, B., and R. Shakir, 224 "Resiliency use cases in SPRING networks", draft-ietf- 225 spring-resiliency-use-cases-12 (work in progress), 226 December 2017. 228 [LEBRUN17] 229 Lebrun, D., "Reaping the Benefits of IPv6 Segment 230 Routing", 2017, . 233 [SR6Demo] Filsfils, C., Clad, F., Camarillo, P., Liste, J., 234 Jonnalagadda, P., Sharif, M., Salsano, S., and A. 235 AbdelSalam, "IPv6 Segment Routing", SIGCOMM'17, Industrial 236 demo , August 2017. 238 [SR6Linux] 239 Lebrun, D. and O. Bonaventure, "Implementing IPv6 Segment 240 Routing in the Linux Kernel.", Applied Networking Research 241 Workshop 2017 , July 2017, 242 . 244 Authors' Addresses 246 Fabien Duchene 247 UCLouvain 249 Email: Fabien.Duchene@uclouvain.be 250 Olivier Bonaventure 251 UCLouvain 253 Email: Olivier.Bonaventure@uclouvain.be