idnits 2.17.1 draft-ietf-tsvwg-port-randomization-08.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 seems to contain a disclaimer for pre-RFC5378 work, and may have content which was first submitted before 10 November 2008. The disclaimer is necessary when there are original authors that you have been unable to contact, or if some do not wish to grant the BCP78 rights to the IETF Trust. If you are able to get all authors (current and original) to grant those rights, you can and should remove the disclaimer; otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 31, 2010) is 5072 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: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) ** Downref: Normative reference to an Informational RFC: RFC 1321 ** Obsolete normative reference: RFC 2385 (Obsoleted by RFC 5925) ** Obsolete normative reference: RFC 4960 (Obsoleted by RFC 9260) -- Obsolete informational reference (is this intentional?): RFC 1948 (Obsoleted by RFC 6528) == Outdated reference: A later version (-32) exists of draft-ietf-tsvwg-sctpsocket-22 Summary: 4 errors (**), 0 flaws (~~), 2 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Transport Area Working Group M. Larsen 3 (tsvwg) TietoEnator 4 Internet-Draft F. Gont 5 Intended status: BCP UTN/FRH 6 Expires: December 2, 2010 May 31, 2010 8 Transport Protocol Port Randomization Recommendations 9 draft-ietf-tsvwg-port-randomization-08 11 Abstract 13 During the las few years, awareness has been raised about a number of 14 "blind" attacks that can be performed against the Transmission 15 Control Protocol (TCP) and similar protocols. The consequences of 16 these attacks range from throughput-reduction to broken connections 17 or data corruption. These attacks rely on the attacker's ability to 18 guess or know the five-tuple (Protocol, Source Address, Destination 19 Address, Source Port, Destination Port) that identifies the transport 20 protocol instance to be attacked. This document describes a number 21 of simple and efficient methods for the selection of the client port 22 number, such that the possibility of an attacker guessing the exact 23 value is reduced. While this is not a replacement for cryptographic 24 methods for protecting the transport-protocol instance, the described 25 port number obfuscation algorithms provide improved security/ 26 obfuscation with very little effort and without any key management 27 overhead. The algorithms described in this document are local 28 policies that may be incrementally deployed, and that do not violate 29 the specifications of any of the transport protocols that may benefit 30 from them, such as TCP, UDP, UDP-lite, SCTP, DCCP, and RTP (provided 31 the RTP application explicitly signals the RTP and RTCP port 32 numbers). 34 Status of this Memo 36 This Internet-Draft is submitted in full conformance with the 37 provisions of BCP 78 and BCP 79. 39 Internet-Drafts are working documents of the Internet Engineering 40 Task Force (IETF). Note that other groups may also distribute 41 working documents as Internet-Drafts. The list of current Internet- 42 Drafts is at http://datatracker.ietf.org/drafts/current/. 44 Internet-Drafts are draft documents valid for a maximum of six months 45 and may be updated, replaced, or obsoleted by other documents at any 46 time. It is inappropriate to use Internet-Drafts as reference 47 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on December 2, 2010. 50 Copyright Notice 52 Copyright (c) 2010 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (http://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 This document may contain material from IETF Documents or IETF 66 Contributions published or made publicly available before November 67 10, 2008. The person(s) controlling the copyright in some of this 68 material may not have granted the IETF Trust the right to allow 69 modifications of such material outside the IETF Standards Process. 70 Without obtaining an adequate license from the person(s) controlling 71 the copyright in such materials, this document may not be modified 72 outside the IETF Standards Process, and derivative works of it may 73 not be created outside the IETF Standards Process, except to format 74 it for publication as an RFC or to translate it into languages other 75 than English. 77 Table of Contents 79 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 80 2. Ephemeral Ports . . . . . . . . . . . . . . . . . . . . . . . 7 81 2.1. Traditional Ephemeral Port Range . . . . . . . . . . . . . 7 82 2.2. Ephemeral port selection . . . . . . . . . . . . . . . . . 7 83 2.3. Collision of instance-id's . . . . . . . . . . . . . . . . 9 84 3. Obfuscating the Ephemeral Ports . . . . . . . . . . . . . . . 10 85 3.1. Characteristics of a good ephemeral port obfuscation 86 algorithm . . . . . . . . . . . . . . . . . . . . . . . . 10 87 3.2. Ephemeral port number range . . . . . . . . . . . . . . . 12 88 3.3. Ephemeral Port Obfuscation Algorithms . . . . . . . . . . 12 89 3.3.1. Algorithm 1: Simple port randomization algorithm . . . 12 90 3.3.2. Algorithm 2: Another simple port randomization 91 algorithm . . . . . . . . . . . . . . . . . . . . . . 14 92 3.3.3. Algorithm 3: Simple hash-based algorithm . . . . . . . 15 93 3.3.4. Algorithm 4: Double-hash obfuscation algorithm . . . . 17 94 3.3.5. Algorithm 5: Random-increments port selection 95 algorithm . . . . . . . . . . . . . . . . . . . . . . 19 96 3.4. Secret-key considerations for hash-based port 97 obfuscation algorithms . . . . . . . . . . . . . . . . . . 21 98 3.5. Choosing an ephemeral port obfuscation algorithm . . . . . 22 99 4. Port obfuscation and Network Address Port Translation 100 (NAPT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 101 5. Security Considerations . . . . . . . . . . . . . . . . . . . 25 102 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26 103 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 27 104 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 28 105 8.1. Normative References . . . . . . . . . . . . . . . . . . . 28 106 8.2. Informative References . . . . . . . . . . . . . . . . . . 28 107 Appendix A. Survey of the algorithms in use by some popular 108 implementations . . . . . . . . . . . . . . . . . . . 31 109 A.1. FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . 31 110 A.2. Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 31 111 A.3. NetBSD . . . . . . . . . . . . . . . . . . . . . . . . . . 31 112 A.4. OpenBSD . . . . . . . . . . . . . . . . . . . . . . . . . 31 113 A.5. OpenSolaris . . . . . . . . . . . . . . . . . . . . . . . 31 114 Appendix B. Changes from previous versions of the draft (to 115 be removed by the RFC Editor before publication 116 of this document as a RFC . . . . . . . . . . . . . . 32 117 B.1. Changes from draft-ietf-tsvwg-port-randomization-07 . . . 32 118 B.2. Changes from draft-ietf-tsvwg-port-randomization-06 . . . 32 119 B.3. Changes from draft-ietf-tsvwg-port-randomization-05 . . . 32 120 B.4. Changes from draft-ietf-tsvwg-port-randomization-04 . . . 32 121 B.5. Changes from draft-ietf-tsvwg-port-randomization-03 . . . 32 122 B.6. Changes from draft-ietf-tsvwg-port-randomization-02 . . . 32 123 B.7. Changes from draft-ietf-tsvwg-port-randomization-01 . . . 32 124 B.8. Changes from draft-ietf-tsvwg-port-randomization-00 . . . 33 125 B.9. Changes from draft-larsen-tsvwg-port-randomization-02 . . 33 126 B.10. Changes from draft-larsen-tsvwg-port-randomization-01 . . 33 127 B.11. Changes from draft-larsen-tsvwg-port-randomization-00 . . 33 128 B.12. Changes from draft-larsen-tsvwg-port-randomisation-00 . . 33 129 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 35 131 1. Introduction 133 Recently, awareness has been raised about a number of "blind" attacks 134 (i.e., attacks that can be performed without the need to sniff the 135 packets that correspond to the transport protocol instance to be 136 attacked) that can be performed against the Transmission Control 137 Protocol (TCP) [RFC0793] and similar protocols. The consequences of 138 these attacks range from throughput-reduction to broken connections 139 or data corruption [I-D.ietf-tcpm-icmp-attacks] [RFC4953] [Watson]. 141 All these attacks rely on the attacker's ability to guess or know the 142 five-tuple (Protocol, Source Address, Source port, Destination 143 Address, Destination Port) that identifies the transport protocol 144 instance to be attacked. 146 Services are usually located at fixed, 'well-known' ports [IANA] at 147 the host supplying the service (the server). Client applications 148 connecting to any such service will contact the server by specifying 149 the server IP address and service port number. The IP address and 150 port number of the client are normally left unspecified by the client 151 application and thus chosen automatically by the client networking 152 stack. Ports chosen automatically by the networking stack are known 153 as ephemeral ports [Stevens]. 155 While the server IP address and well-known port and the client IP 156 address may be known by an attacker, the ephemeral port of the client 157 is usually unknown and must be guessed. 159 This document describes a number of algorithms for the selection of 160 ephemeral port numbers, such that the possibility of an off-path 161 attacker guessing the exact value is reduced. They are not a 162 replacement for cryptographic methods of protecting a transport- 163 protocol instance such as IPsec [RFC4301], the TCP MD5 signature 164 option [RFC2385], or the TCP Authentication Option 165 [I-D.ietf-tcpm-tcp-auth-opt]. For example, they do not provide any 166 mitigation in those scenarios in which the attacker is able to sniff 167 the packets that correspond to the transport protocol instance to be 168 attacked. However, the proposed algorithms provide improved 169 obfuscation with very little effort and without any key management 170 overhead. 172 The mechanisms described in this document are local modifications 173 that may be incrementally deployed, and that do not violate the 174 specifications of any of the transport protocols that may benefit 175 from them, such as TCP [RFC0793], UDP [RFC0768], SCTP [RFC4960], DCCP 176 [RFC4340], UDP-lite [RFC3828], and RTP [RFC3550] (provided the RTP 177 application explicitly signals the RTP and RTCP port numbers with 178 e.g.[RFC3605]). 180 Since these mechanisms are obfuscation techniques, focus has been on 181 a reasonable compromise between the level of obfuscation and the ease 182 of implementation. Thus the algorithms must be computationally 183 efficient, and not require substantial state. 185 We note that while the technique of mitigating "blind" attacks by 186 obfuscating the ephemeral port selection is well-known as "port 187 randomization", the goal of the algorithms described in this document 188 is to reduce the chances of an attacker guessing the ephemeral ports 189 selected for new transport protocol instances, rather than to 190 actually produce mathematically random sequences of ephemeral ports. 192 Throughout this document we will use the term "transport-protocol 193 instance" as a general term to refer to an instantiation of a 194 transport protocol (e.g, a "connection" in the case of connection- 195 oriented transport protocols) and the term "instance-id" as a short- 196 handle to refer to the group of values that identify a transport- 197 protocol instance (e.g., in the case of TCP, the five-tuple 198 {Protocol, IP Source Address, TCP Source Port, IP Destination 199 Address, TCP Destination Port}). 201 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 202 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 203 document are to be interpreted as described in RFC 2119 [RFC2119]. 205 2. Ephemeral Ports 207 2.1. Traditional Ephemeral Port Range 209 The Internet Assigned Numbers Authority (IANA) assigns the unique 210 parameters and values used in protocols developed by the Internet 211 Engineering Task Force (IETF), including well-known ports [IANA]. 212 IANA has reserved the following use of the 16-bit port range of TCP 213 and UDP: 215 o The Well Known Ports, 0 through 1023. 217 o The Registered Ports, 1024 through 49151 219 o The Dynamic and/or Private Ports, 49152 through 65535 221 The dynamic port range defined by IANA consists of the 49152-65535 222 range, and is meant for the selection of ephemeral ports. 224 2.2. Ephemeral port selection 226 As each communication instance is identified by the five-tuple 227 {protocol, local IP address, local port, remote IP address, remote 228 port}, the selection of ephemeral port numbers must result in a 229 unique five-tuple. 231 Selection of ephemeral ports such that they result in unique 232 instance-id's (five-tuples) is handled by some implementations by 233 having a per-protocol global 'next_ephemeral' variable that is equal 234 to the previously chosen ephemeral port + 1, i.e. the selection 235 process is: 237 /* Initialization at system boot time. Could be random */ 238 next_ephemeral = min_ephemeral; 240 /* Ephemeral port selection function */ 241 count = max_ephemeral - min_ephemeral + 1; 243 do { 244 port = next_ephemeral; 245 if (next_ephemeral == max_ephemeral) { 246 next_ephemeral = min_ephemeral; 247 } else { 248 next_ephemeral++; 249 } 251 if (check_suitable_port(port)) 252 return port; 254 count--; 256 } while (count > 0); 258 return ERROR; 260 Figure 1 262 Note: 263 check_suitable_port() is a function that checks whether the 264 resulting port number is acceptable as an ephemeral port. That 265 is, it checks whether the resulting port number is unique and may, 266 in addition, check that the port number is not in use for a 267 connection in the LISTEN or CLOSED states and that the port number 268 is not in the list of port numbers that should not be allocated as 269 ephemeral ports. In BSD-derived systems, the 270 check_suitable_port() would correspond to the in_pcblookup_local() 271 function, where all the necessary checks would be performed. 273 This algorithm works adequately provided that the number of 274 transport-protocol instances (for a each transport protocol) that 275 have a life-time longer than it takes to exhaust the total ephemeral 276 port range is small, so that collisions of instance-id's are rare. 278 However, this method has the drawback that the 'next_ephemeral' 279 variable and thus the ephemeral port range is shared between all 280 transport-protocol instances and the next ports chosen by the client 281 are easy to predict. If an attacker operates an "innocent" server to 282 which the client connects, it is easy to obtain a reference point for 283 the current value of the 'next_ephemeral' variable. Additionally, if 284 an attacker could force a client to periodically establish e.g., a 285 new TCP connection to an attacker controlled machine (or through an 286 attacker observable routing path), the attacker could subtract 287 consecutive source port values to obtain the number of outgoing TCP 288 connections established globally by the target host within that time 289 period (up to wrap-around issues and instance-id collisions, of 290 course). 292 2.3. Collision of instance-id's 294 While it is possible for the ephemeral port selection algorithm to 295 verify that the selected port number results in a instance-id that is 296 not currently in use by that system, the resulting instance-id may 297 still be in use at a remote system. For example, consider a scenario 298 in which a client establishes a TCP connection with a remote web 299 server, and the web server performs the active close on the 300 connection. While the state information for this connection will 301 disappear at the client side (that is, the connection will be moved 302 to the fictional CLOSED state), the instance-id will remain in the 303 TIME-WAIT state at the web server for 2*MSL (Maximum Segment 304 Lifetime). If the same client tried to create a new incarnation of 305 the previous connection (that is, a connection with the same 306 instance-id as the one in the TIME_WAIT state at the server), an 307 instance-id "collision" would occur. The effect of these collisions 308 range from connection-establishment failures to TIME-WAIT state 309 assassination (with the potential of data corruption) [RFC1337]. In 310 scenarios in which a specific client establishes TCP connections with 311 a specific service at a server, these problems become evident. 312 Therefore, an ephemeral port selection algorithm should ideally 313 minimize the rate of instance-id collisions. 315 A simple approach to minimize the rate of these collisions would be 316 to choose port numbers incrementally, so that a given port number 317 would not be reused until the rest of the port numbers in ephemeral 318 port range have been used for a transport protocol instance. 319 However, if a single global variable were used to keep track of the 320 last ephemeral port selected, ephemeral port numbers would be 321 trivially predictable, thus making it easier for an off-path attacker 322 to "guess" the instance-id in use by a target transport-protocol 323 instance. Section 3.3.3 and Section 3.3.4 describe algorithms that 324 select port numbers incrementally, while still making it difficult 325 for an off-path attacker to predict the ephemeral ports used for 326 future transport-protocol instances. 328 A simple but inefficient approach to minimize the rate of collisions 329 of instance-id's would be, e.g. in the case of TCP, for both end- 330 points of a TCP connection to keep state about recent connections 331 (e.g., have both end-points end up in the TIME-WAIT state). 333 3. Obfuscating the Ephemeral Ports 335 3.1. Characteristics of a good ephemeral port obfuscation algorithm 337 There are several factors to consider when designing an algorithm for 338 selecting ephemeral ports, which include: 340 o Minimizing the predictability of the ephemeral port numbers used 341 for future transport-protocol instances. 343 o Minimizing collisions of instance-id's 345 o Avoiding conflict with applications that depend on the use of 346 specific port numbers. 348 Given the goal of improving the transport protocol's resistance to 349 attack by obfuscation of the instance-id, it is key to minimize the 350 predictability of the ephemeral ports that will be selected for new 351 transport-protocol instances. While the obvious approach to address 352 this requirement would be to select the ephemeral ports by simply 353 picking a random value within the chosen port number range, this 354 straightforward policy may lead to collisions of instance-id's, which 355 could lead to the interoperability problems (e.g., delays in the 356 establishment of new connections, failures in connection- 357 establishment, or data corruption) discussed in Section 2.3. As 358 discussed in Section 1, it is worth noting that while the technique 359 of mitigating "blind" attacks by obfuscating the ephemeral port 360 election is well-known as "port randomization", the goal of the 361 algorithms described in this document is to reduce the chances of an 362 attacker guessing the ephemeral ports selected for new transport- 363 protocol instances, rather than to actually produce sequences of 364 mathematically random ephemeral port numbers. 366 It is also worth noting that, provided adequate algorithms are in 367 use, the larger the range from which ephemeral ports are selected, 368 the smaller the chances of an attacker are to guess the selected port 369 number. 371 In scenarios in which a specific client establishes transport- 372 protocol instances with a specific service at a server, the problems 373 described in Section 2.3 become evident. A good algorithm to 374 minimize the collisions of instance-id's would consider the time a 375 given five-tuple was last used, and would avoid reusing the last 376 recently used five-tuples. A simple approach to minimize the rate of 377 collisions would be to choose port numbers incrementally, so that a 378 given port number would not be reused until the rest of the port 379 numbers in the ephemeral port range have been used for a transport 380 protocol instance. However, if a single global variable were used to 381 keep track of the last ephemeral port selected, ephemeral port 382 numbers would be trivially predictable. 384 It is important to note that a number of applications rely on binding 385 specific port numbers that may be within the ephemeral ports range. 386 If such an application was run while the corresponding port number 387 was in use, the application would fail. Therefore, ephemeral port 388 selection algorithms avoid using those port numbers. 390 Port numbers that are currently in use by a TCP in the LISTEN state 391 should not be allowed for use as ephemeral ports. If this rule is 392 not complied with, an attacker could potentially "steal" an incoming 393 connection to a local server application in at least two different 394 ways. Firstly, an attacker could issue a connection request to the 395 victim client at roughly the same time the client tries to connect to 396 the victim server application [CPNI-TCP] [I-D.gont-tcp-security]. If 397 the SYN segment corresponding to the attacker's connection request 398 and the SYN segment corresponding to the victim client "cross each 399 other in the network", and provided the attacker is able to know or 400 guess the ephemeral port used by the client, a TCP simultaneous open 401 scenario would take place, and the incoming connection request sent 402 by the client would be matched with the attacker's socket rather than 403 with the victim server application's socket. Secondly, an attacker 404 could specify a more specific socket than the "victim" socket (e.g., 405 specify both the local IP address and the local TCP port), and thus 406 incoming SYN segments matching the attacker's socket would be 407 delivered to the attacker, rather than to the "victim" socket (see 408 Section 10.1 of [CPNI-TCP]). 410 It should be noted that most applications based on popular 411 implementations of the TCP API (such as the Sockets API) perform 412 "passive opens" in three steps. Firstly, the application obtains a 413 file descriptor to be used for inter-process communication (e.g., by 414 issuing a socket() call). Secondly, the application binds the file 415 descriptor to a local TCP port number (e.g., by issuing a bind() 416 call), thus creating a TCP in the fictional CLOSED state. Thirdly, 417 the aforementioned TCP is put in the LISTEN state (e.g., by issuing a 418 listen() call). As a result, with such an implementation of the TCP 419 API, even if port numbers in use for TCPs in the LISTEN state were 420 not allowed for use as ephemeral ports, there is a window of time 421 between the second and the third steps in which an attacker could be 422 allowed to select a port number that would be later used for 423 listening to incoming connections. Therefore, these implementations 424 of the TCP API should enforce a stricter requirement for the 425 allocation of port numbers: port numbers that are in use by a TCP in 426 the LISTEN or CLOSED states should not be allowed for allocation as 427 ephemeral ports [CPNI-TCP] [I-D.gont-tcp-security]. 429 The aforementioned issue do not affect SCTP, since most SCTP 430 implementations do not allow a socket to be bound to the same port 431 number unless a specific socket option (SCTP_REUSE_PORT) is issued on 432 the socket (i.e., this behavior needs to be explititly allowed 433 beforehand). An example of a typical SCTP socket API can be found in 434 [I-D.ietf-tsvwg-sctpsocket]. 436 DCCP is not affected by the exploitation of "simultaneous opens" to 437 "steal" incoming connections, as the server and the client state 438 machines are different [RFC4340]. However, it may be affected by the 439 vector involving binding a more specific socket. As a result, those 440 tuples {local IP address, local port, Service Code} that are in use 441 by a local socket should not be allowed for allocation as ephemeral 442 ports. 444 3.2. Ephemeral port number range 446 As mentioned in Section 2.1, the dynamic ports consist of the range 447 49152-65535. However, ephemeral port selection algorithms should use 448 the whole range 1024-65535. 450 Since this range includes ports numbers assigned by IANA, this may 451 not always be possible, though. A possible workaround for this 452 potential problem would be to maintain a local list of the port 453 numbers that should not be allocated as ephemeral ports. Thus, 454 before allocating a port number, the ephemeral port selection 455 function would check this list, avoiding the allocation of ports that 456 may be needed for specific applications. 458 Ephemeral port selection algorithms SHOULD use the largest possible 459 port range, since this improves obfuscation. 461 3.3. Ephemeral Port Obfuscation Algorithms 463 Ephemeral port selection algorithms SHOULD obfuscate the allocation 464 of their ephemeral ports, since this helps to mitigate a number of 465 attacks that depend on the attacker's ability to guess or know the 466 five-tuple that identifies the transport protocol instance to be 467 attacked. 469 The following subsections describe a number of algorithms that could 470 be implemented in order to obfuscate the selection of ephemeral port 471 numbers. 473 3.3.1. Algorithm 1: Simple port randomization algorithm 475 In order to address the security issues discussed in Section 1 and 476 Section 2.2, a number of systems have implemented simple ephemeral 477 port number randomization, as follows: 479 /* Ephemeral port selection function */ 480 num_ephemeral = max_ephemeral - min_ephemeral + 1; 481 next_ephemeral = min_ephemeral + (random() % num_ephemeral); 482 count = num_ephemeral; 484 do { 485 if(check_suitable_port(port)) 486 return next_ephemeral; 488 if (next_ephemeral == max_ephemeral) { 489 next_ephemeral = min_ephemeral; 490 } else { 491 next_ephemeral++; 492 } 494 count--; 495 } while (count > 0); 497 return ERROR; 499 Figure 2 501 We will refer to this algorithm as 'Algorithm 1'. 503 Note: 504 random() is a function that returns a 32-bit pseudo-random 505 unsigned integer number. Note that the output needs to be 506 unpredictable, and typical implementations of POSIX random() 507 function do not necessarily meet this requirement. See [RFC4086] 508 for randomness requirements for security. 510 All the variables (in this and all the algorithms discussed in 511 this document) are unsigned integers. 513 Since the initially chosen port may already be in use with identical 514 IP addresses and server port, the resulting five-tuple might not be 515 unique. Therefore, multiple ports may have to be tried and verified 516 against all existing transport-protocol instances before a port can 517 be chosen. 519 Web proxy servers, NAPTs [RFC2663], and other middle-boxes aggregate 520 multiple peers into the same port space and thus increase the 521 population of used ephemeral ports, and hence the chances of 522 collisions of instance-id's. However, [Allman] has shown that at 523 least in the network scenarios used for measuring the collision 524 properties of the algorithms described in this document, the 525 collision rate resulting from the use of the aforementioned middle- 526 boxes is nevertheless very low. 528 Since this algorithm performs a completely random port selection 529 (i.e., without taking into account the port numbers previously 530 chosen), it has the potential of reusing port numbers too quickly, 531 thus possibly leading to collisions of instance-id's. Even if a 532 given five-tuple is verified to be unique by the port selection 533 algorithm, the five-tuple might still be in use at the remote system. 534 In such a scenario, a connection request could possibly fail 535 ([Silbersack] describes this problem for the TCP case). 537 This algorithm selects ephemeral port numbers randomly and thus 538 reduces the chances of an attacker of guessing the ephemeral port 539 selected for a target transport-protocol instance. Additionally, it 540 prevents attackers from obtaining the number of outgoing transport- 541 protocol instances (e.g., TCP connections) established by the client 542 in some period of time. 544 3.3.2. Algorithm 2: Another simple port randomization algorithm 546 The following pseudo-code illustrates another algorithm for selecting 547 a random port number, in which in the event a local instance-id 548 collision is detected, another port number is selected randomly: 550 /* Ephemeral port selection function */ 551 num_ephemeral = max_ephemeral - min_ephemeral + 1; 552 next_ephemeral = min_ephemeral + (random() % num_ephemeral); 553 count = num_ephemeral; 555 do { 556 if(check_suitable_port(port)) 557 return next_ephemeral; 559 next_ephemeral = min_ephemeral + (random() % num_ephemeral); 560 count--; 561 } while (count > 0); 563 return ERROR; 565 Figure 3 567 We will refer to this algorithm as 'Algorithm 2'. This algorithm 568 might be unable to select an ephemeral port (i.e., return "ERROR") 569 even if there are port numbers that would result in unique five- 570 tuples, when there are a large number of port numbers already in use. 572 However, the results in [Allman] have shown that in common scenarios, 573 one port choice is enough, and in most cases where more than one 574 choice is needed two choices suffice. Therefore, in those scenarios 575 this would not be problem. 577 3.3.3. Algorithm 3: Simple hash-based algorithm 579 We would like to achieve the port reuse properties of the traditional 580 BSD port selection algorithm (described in Section 2.2), while at the 581 same time achieve the obfuscation properties of Algorithm 1 and 582 Algorithm 2. 584 Ideally, we would like a 'next_ephemeral' value for each set of 585 (local IP address, remote IP addresses, remote port), so that the 586 port reuse frequency is the lowest possible. Each of these 587 'next_ephemeral' variables should be initialized with random values 588 within the ephemeral port range and would thus separate the ephemeral 589 port space of the transport-protocol instances on a "per destination 590 end-point" basis (this "separation of the ephemeral port space" means 591 that transport-protocol instances with different remote end-points 592 will not have different sequences of port numbers; i.e., will not be 593 part of the same ephemeral port sequence as in the case of the 594 traditional BSD ephemeral port selection algorithm). Since we do not 595 want to maintain in memory all these 'next_ephemeral' values, we 596 propose an offset function F(), that can be computed from the local 597 IP address, remote IP address, remote port and a secret key. F() 598 will yield (practically) different values for each set of arguments, 599 i.e.: 601 /* Initialization at system boot time. Could be random. */ 602 next_ephemeral = 0; 604 /* Ephemeral port selection function */ 605 num_ephemeral = max_ephemeral - min_ephemeral + 1; 606 offset = F(local_IP, remote_IP, remote_port, secret_key); 607 count = num_ephemeral; 609 do { 610 port = min_ephemeral + 611 (next_ephemeral + offset) % num_ephemeral; 613 next_ephemeral++; 615 if(check_suitable_port(port)) 616 return port; 618 count--; 620 } while (count > 0); 622 return ERROR; 624 Figure 4 626 We will refer to this algorithm as 'Algorithm 3'. 628 In other words, the function F() provides a "per destination end- 629 point" fixed offset within the global ephemeral port range. Both the 630 'offset' and 'next_ephemeral' variables may take any value within the 631 storage type range since we are restricting the resulting port in a 632 similar way as in the Algorithm 1 (described in Section 3.3.1). This 633 allows us to simply increment the 'next_ephemeral' variable and rely 634 on the unsigned integer to simply wrap-around. 636 The function F() should be a cryptographic hash function like MD5 637 [RFC1321]. The function should use both IP addresses, the remote 638 port and a secret key value to compute the offset. The remote IP 639 address is the primary separator and must be included in the offset 640 calculation. The local IP address and remote port may in some cases 641 be constant and not improve the ephemeral port space separation, 642 however, they should also be included in the offset calculation. 644 Cryptographic algorithms stronger than e.g. MD5 should not be 645 necessary, given that Algorithm #3 is simply an obfuscation 646 technique. The secret should be chosen to be as random as possible 647 (see [RFC4086] for recommendations on choosing secrets). 649 Note that on multiuser systems, the function F() could include user 650 specific information, thereby providing protection not only on a host 651 to host basis, but on a user to service basis. In fact, any 652 identifier of the remote entity could be used, depending on 653 availability and the granularity requested. With SCTP both hostnames 654 and alternative IP addresses may be included in the association 655 negotiation and either of these could be used in the offset function 656 F(). 658 When multiple unique identifiers are available, any of these can be 659 chosen as input to the offset function F() since they all uniquely 660 identify the remote entity. However, in cases like SCTP where the 661 ephemeral port must be unique across all IP address permutations, we 662 should ideally always use the same IP address to get a single 663 starting offset for each association negotiation from a given remote 664 entity to minimize the possibility of collisions. A simple numerical 665 sorting of the IP addresses and always using the numerically lowest 666 could achieve this. However, since most protocols most likely will 667 report the same IP addresses in the same order in each association 668 setup, this sorting is most likely not necessary and the 'first one' 669 can simply be used. 671 The ability of hostnames to uniquely define hosts can be discussed, 672 and since SCTP always includes at least one IP address, we recommend 673 to use this as input to the offset function F() and ignore hostnames 674 chunks when searching for ephemeral ports. 676 It should be noted that, as this algorithm uses a global counter 677 ("next_ephemeral") for selecting ephemeral ports, if an attacker 678 could e.g., force a client to periodically establish a new TCP 679 connections to an attacker controlled machine (or through an attacker 680 observable routing path), the attacker could subtract consecutive 681 source port values to obtain the number of outgoing TCP connections 682 established globally by the target host within that time period (up 683 to wrap-around issues and 5-tuple collisions, of course). 685 3.3.4. Algorithm 4: Double-hash obfuscation algorithm 687 A tradeoff between maintaining a single global 'next_ephemeral' 688 variable and maintaining 2**N 'next_ephemeral' variables (where N is 689 the width of the result of F()) could be achieved as follows. The 690 system would keep an array of TABLE_LENGTH short integers, which 691 would provide a separation of the increment of the 'next_ephemeral' 692 variable. This improvement could be incorporated into Algorithm 3 as 693 follows: 695 /* Initialization at system boot time */ 696 for(i = 0; i < TABLE_LENGTH; i++) 697 table[i] = random() % 65536; 699 /* Ephemeral port selection function */ 700 num_ephemeral = max_ephemeral - min_ephemeral + 1; 701 offset = F(local_IP, remote_IP, remote_port, secret_key1); 702 index = G(local_IP, remote_IP, remote_port, secret_key2); 703 count = num_ephemeral; 705 do { 706 port = min_ephemeral + (offset + table[index]) % num_ephemeral; 707 table[index]++; 709 if(check_suitable_port(port)) 710 return port; 712 count--; 714 } while (count > 0); 716 return ERROR; 718 Figure 5 720 We will refer to this algorithm as 'Algorithm 4'. 722 'table[]' could be initialized with mathematically random values, as 723 indicated by the initialization code in pseudo-code above. The 724 function G() should be a cryptographic hash function like MD5 725 [RFC1321]. It should use both IP addresses, the remote port and a 726 secret key value to compute a value between 0 and (TABLE_LENGTH-1). 727 Alternatively, G() could take as "offset" as input, and perform the 728 exclusive-or (xor) operation between all the bytes in 'offset'. 730 The array 'table[]' assures that successive transport-protocol 731 instances with the same remote end-point will use increasing 732 ephemeral port numbers. However, incrementation of the port numbers 733 is separated into TABLE_LENGTH different spaces, and thus the port 734 reuse frequency will be (probabilistically) lower than that of 735 Algorithm 3. That is, a new tranport-protocol instance with some 736 remote end-point will not necessarily cause the 'next_ephemeral' 737 variable corresponding to other end-points to be incremented. 739 It is interesting to note that the size of 'table[]' does not limit 740 the number of different port sequences, but rather separates the 741 *increments* into TABLE_LENGTH different spaces. The port sequence 742 will result from adding the corresponding entry of 'table[]' to the 743 variable 'offset', which selects the actual port sequence (as in 744 Algorithm 3). [Allman] has found that a TABLE_LENGTH of 10 can 745 result in an improvement over Algorithm 3. Further increasing the 746 TABLE_LENGTH will increase the obfuscation, and possibly further 747 decrease the collision rate. 749 An attacker can perform traffic analysis for any "increment space" 750 into which the attacker has "visibility", namely that the attacker 751 can force the client to establish a transport-protocol instance whose 752 G(offset) identifies the target "increment space". However, the 753 attacker's ability to perform traffic analysis is very reduced when 754 compared to the traditional BSD algorithm (described in Section 2.2) 755 and Algorithm 3. Additionally, an implementation can further limit 756 the attacker's ability to perform traffic analysis by further 757 separating the increment space (that is, using a larger value for 758 TABLE_LENGTH). 760 3.3.5. Algorithm 5: Random-increments port selection algorithm 762 [Allman] introduced another port obfuscation algorithm, which offers 763 a middle ground between the algorithms that select ephemeral ports 764 randomly (such as those described in Section 3.3.1 and 765 Section 3.3.2), and those that offer obfuscation but no randomization 766 (such as those described in Section 3.3.3 and Section 3.3.4). We 767 will refer to this algorithm as 'Algorithm 5'. 769 /* Initialization code at system boot time. */ 770 next_ephemeral = random() % 65536; /* Initialization value */ 771 N = 500; /* Determines the tradeoff */ 773 /* Ephemeral port selection function */ 774 num_ephemeral = max_ephemeral - min_ephemeral + 1; 776 count = num_ephemeral; 778 do { 779 next_ephemeral = next_ephemeral + (random() % N) + 1; 780 port = min_ephemeral + (next_ephemeral % num_ephemeral); 782 if(check_suitable_port(port)) 783 return port; 785 count--; 786 } while (count > 0); 788 return ERROR; 790 Figure 6 792 This algorithm aims at at producing a monotonically-increasing 793 sequence to prevent the collision of instance-id's, while avoiding 794 the use of fixed increments, which would lead to trivially- 795 predictable sequences. The value "N" allows for direct control of 796 the tradeoff between the level of obfuscation and the port reuse 797 frequency. The smaller the value of "N", the more similar this 798 algorithm is to the traditional BSD port selection algorithm 799 (described in Section 2.2. The larger the value of "N", the more 800 similar this algorithm is to the algorithm described in Section 3.3.1 801 of this document. 803 When the port numbers wrap, there is the risk of collisions of 804 instance-id's. Therefore, "N" should be selecting according to the 805 following criteria: 807 o It should maximize the wrapping time of the ephemeral port space 809 o It should minimize collisions of instance-id's 811 o It should maximize obfuscation 813 Clearly, these are competing goals, and the decision of which value 814 of "N" to use is a tradeoff. Therefore, the value of "N" should be 815 configurable so that system administrators can make the tradeoff for 816 themselves. 818 3.4. Secret-key considerations for hash-based port obfuscation 819 algorithms 821 Every complex manipulation (like MD5) is no more secure than the 822 input values, and in the case of ephemeral ports, the secret key. If 823 an attacker is aware of which cryptographic hash function is being 824 used by the victim (which we should expect), and the attacker can 825 obtain enough material (e.g. ephemeral ports chosen by the victim), 826 the attacker may simply search the entire secret key space to find 827 matches. 829 To protect against this, the secret key should be of a reasonable 830 length. Key lengths of 128 bits should be adequate. 832 Another possible mechanism for protecting the secret key is to change 833 it after some time. If the host platform is capable of producing 834 reasonably good random data, the secret key can be changed 835 automatically. 837 Changing the secret will cause abrupt shifts in the chosen ephemeral 838 ports, and consequently collisions may occur. That is, upon changing 839 the secret, the "offset" value (see Section 3.3.3 and Section 3.3.4) 840 used for each destination end-point will be different from that 841 computed with the previous secret, thus leading to the selection of a 842 port number recently used for connecting to the same end-point. 844 Thus the change in secret key should be done with consideration and 845 could be performed whenever one of the following events occur: 847 o The system is being bootstrapped. 849 o Some predefined/random time has expired. 851 o The secret has been used N times (i.e. we consider it insecure). 853 o There are few active transport protocol instances (i.e., 854 possibility of collision is low). 856 o There is little traffic (the performance overhead of collisions is 857 tolerated). 859 o There is enough random data available to change the secret key 860 (pseudo-random changes should not be done). 862 3.5. Choosing an ephemeral port obfuscation algorithm 864 [Allman] is an empirical study of the properties of the algorithms 865 described in this document, which has found that all the algorithms 866 described in this document offer low collision rates -- at most 0.3%. 867 That is, in those network scenarios assessed by [Allman] all of the 868 algorithms described in this document perform well in terms of 869 collisions of instance-id's. However, these results may vary 870 depending on the characteristics of network traffic and the specific 871 network setup. 873 The algorithm described in Section 2.2 is the traditional ephemeral 874 port selection algorithm implemented in BSD-derived systems. It 875 generates a global sequence of ephemeral port numbers, which makes it 876 trivial for an attacker to predict the port number that will be used 877 for a future transport protocol instance. However, it is very 878 simple, and leads to a low port reuse frequency. 880 Algorithm 1 and Algorithm 2 have the advantage that they provide 881 actual randomization of the ephemeral ports. However, they may 882 increase the chances of port number collisions, which could lead to 883 the failure of a connection establishment attempt. [Allman] found 884 that these two algorithms show the largest collision rates (among all 885 the algorithms described in this document). 887 Algorithm 3 provides complete separation in local and remote IP 888 addresses and remote port space, and only limited separation in other 889 dimensions (see Section 3.4). However, implementations should 890 consider the performance impact of computing the cryptographic hash 891 used for the offset. 893 Algorithm 4 improves Algorithm 3, usually leading to a lower port 894 reuse frequency, at the expense of more processor cycles used for 895 computing G(), and additional kernel memory for storing the array 896 'table[]'. 898 Algorithm 5 offers middle ground between the simple randomization 899 algorithms (Algorithm 1 and Algorithm 2) and the hash-based 900 algorithms (Algorithm 3 and Algorithm 4). The upper limit on the 901 random increments (the value "N" in the pseudo-code included in 902 Section 3.3.5 controls the trade-off between randomization and port- 903 reuse frequency. 905 Finally, a special case that may preclude the utilization of 906 Algorithm 3 and Algorithm 4 should be analyzed. There exist some 907 applications that contain the following code sequence: 909 s = socket(); 910 bind(s, IP_address, port = *); 912 Figure 7 914 In some BSD-derived systems, the call to bind() will result in the 915 selection of an ephemeral port number. However, as neither the 916 remote IP address nor the remote port will be available to the 917 ephemeral port selection function, the hash function F() used in 918 Algorithm 3 and Algorithm 4 will not have all the required arguments, 919 and thus the result of the hash function will be impossible to 920 compute. Transport protocols implementing Algorithm 3 or Algorithm 4 921 should consider using Algorithm 2 when facing the scenario just 922 described. 924 An alternative to this behavior would be to implement "lazy binding" 925 in response to the bind() call. That is, selection of an ephemeral 926 port would be delayed until, e.g., connect() or send() are called. 927 Thus, at that point the ephemeral port is actually selected, all the 928 necessary arguments for the hash function F() would be available, and 929 thus Algorithm 3 and Algorithm 4 could still be used in this 930 scenario. This algorithm has been implemented by Linux [Linux]. 932 4. Port obfuscation and Network Address Port Translation (NAPT) 934 Network Address Port Translation (NAPT) translate both the network 935 address and transport-protocol port number, thus allowing the 936 transport identifiers of a number of private hosts to be multiplexed 937 into the transport identifiers of a single external address. 938 [RFC2663] 940 In those scenarios in which a NAPT is present between the two end- 941 points of transport-protocol instance, the obfuscation of the 942 ephemeral ports (from the point of view of the external network) will 943 depend on the ephemeral port selection function at the NAPT. 944 Therefore, NAPTs should consider obfuscating the ephemeral ports by 945 means of any of the algorithms discussed in this document. It should 946 be noted that in some network scenarios, a NAPT may naturally obscure 947 ephemeral port selections simply due to the vast range of services 948 with which it establishes connections and to the overall rate of the 949 traffic [Allman]. 951 Section 3.5 provides guidance in choosing a port obfuscation 952 algorithm. 954 5. Security Considerations 956 Obfuscating ephemeral ports is no replacement for cryptographic 957 mechanisms, such as IPsec [RFC4301], in terms of protecting 958 transport-protocol instances against blind attacks. 960 An eavesdropper, which can monitor the packets that correspond to the 961 transport-protocol instance to be attacked could learn the IP 962 addresses and port numbers in use (and also sequence numbers etc.) 963 and easily perform an attack. Ephemeral port obfuscation does not 964 provide any additional protection against this kind of attacks. In 965 such situations, proper authentication mechanisms such as those 966 described in [RFC4301] should be used. 968 If the local offset function F() results in identical offsets for 969 different inputs at greater frequency than would be expected by 970 chance, the port-offset mechanism proposed in this document would 971 have a reduced effect. 973 If random numbers are used as the only source of the secret key, they 974 should be chosen in accordance with the recommendations given in 975 [RFC4086]. 977 If an attacker uses dynamically assigned IP addresses, the current 978 ephemeral port offset (Algorithm 3 and Algorithm 4) for a given five- 979 tuple can be sampled and subsequently used to attack an innocent peer 980 reusing this address. However, this is only possible until a re- 981 keying happens as described above. Also, since ephemeral ports are 982 only used on the client side (e.g. the one initiating the transport- 983 protocol communication), both the attacker and the new peer need to 984 act as servers in the scenario just described. While servers using 985 dynamic IP addresses exist, they are not very common and with an 986 appropriate re-keying mechanism the effect of this attack is limited. 988 6. IANA Considerations 990 There are no IANA registries within this document. The RFC-Editor 991 can remove this section before publication of this document as an 992 RFC. 994 7. Acknowledgements 996 The offset function was inspired by the mechanism proposed by Steven 997 Bellovin in [RFC1948] for defending against TCP sequence number 998 attacks. 1000 The authors would like to thank (in alphabetical order) Mark Allman, 1001 Jari Arkko, Matthias Bethke, Stephane Bortzmeyer, Brian Carpenter, 1002 Vincent Deffontaines, Ralph Droms, Lars Eggert, Pasi Eronen, Gorry 1003 Fairhurst, Adrian Farrel, Guillermo Gont, Alfred Hoenes, Avshalom 1004 Houri, Charlie Kaufman, Amit Klein, Carlos Pignataro, Tim Polk, 1005 Kacheong Poon, Pasi Sarolahti, Randall Stewart, Joe Touch, Michael 1006 Tuexen, and Dan Wing for their valuable feedback on earlier versions 1007 of this document. 1009 The authors would like to thank FreeBSD's Mike Silbersack for a very 1010 fruitful discussion about ephemeral port selection techniques. 1012 8. References 1014 8.1. Normative References 1016 [RFC0768] Postel, J., "User Datagram Protocol", STD 6, RFC 768, 1017 August 1980. 1019 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 1020 RFC 793, September 1981. 1022 [RFC1321] Rivest, R., "The MD5 Message-Digest Algorithm", RFC 1321, 1023 April 1992. 1025 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1026 Requirement Levels", BCP 14, RFC 2119, March 1997. 1028 [RFC2385] Heffernan, A., "Protection of BGP Sessions via the TCP MD5 1029 Signature Option", RFC 2385, August 1998. 1031 [RFC3550] Schulzrinne, H., Casner, S., Frederick, R., and V. 1032 Jacobson, "RTP: A Transport Protocol for Real-Time 1033 Applications", STD 64, RFC 3550, July 2003. 1035 [RFC3605] Huitema, C., "Real Time Control Protocol (RTCP) attribute 1036 in Session Description Protocol (SDP)", RFC 3605, 1037 October 2003. 1039 [RFC3828] Larzon, L-A., Degermark, M., Pink, S., Jonsson, L-E., and 1040 G. Fairhurst, "The Lightweight User Datagram Protocol 1041 (UDP-Lite)", RFC 3828, July 2004. 1043 [RFC4086] Eastlake, D., Schiller, J., and S. Crocker, "Randomness 1044 Requirements for Security", BCP 106, RFC 4086, June 2005. 1046 [RFC4301] Kent, S. and K. Seo, "Security Architecture for the 1047 Internet Protocol", RFC 4301, December 2005. 1049 [RFC4340] Kohler, E., Handley, M., and S. Floyd, "Datagram 1050 Congestion Control Protocol (DCCP)", RFC 4340, March 2006. 1052 [RFC4960] Stewart, R., "Stream Control Transmission Protocol", 1053 RFC 4960, September 2007. 1055 8.2. Informative References 1057 [FreeBSD] The FreeBSD Project, "http://www.freebsd.org". 1059 [IANA] "IANA Port Numbers", 1060 . 1062 [I-D.ietf-tcpm-icmp-attacks] 1063 Gont, F., "ICMP attacks against TCP", 1064 draft-ietf-tcpm-icmp-attacks-12 (work in progress), 1065 March 2010. 1067 [RFC1337] Braden, B., "TIME-WAIT Assassination Hazards in TCP", 1068 RFC 1337, May 1992. 1070 [RFC1948] Bellovin, S., "Defending Against Sequence Number Attacks", 1071 RFC 1948, May 1996. 1073 [RFC2663] Srisuresh, P. and M. Holdrege, "IP Network Address 1074 Translator (NAT) Terminology and Considerations", 1075 RFC 2663, August 1999. 1077 [RFC4953] Touch, J., "Defending TCP Against Spoofing Attacks", 1078 RFC 4953, July 2007. 1080 [I-D.ietf-tsvwg-sctpsocket] 1081 Stewart, R., Poon, K., Tuexen, M., Yasevich, V., and P. 1082 Lei, "Sockets API Extensions for Stream Control 1083 Transmission Protocol (SCTP)", 1084 draft-ietf-tsvwg-sctpsocket-22 (work in progress), 1085 March 2010. 1087 [Allman] Allman, M., "Comments On Selecting Ephemeral Ports", ACM 1088 Computer Communication Review, 39(2), 2009. 1090 [CPNI-TCP] 1091 Gont, F., "CPNI Technical Note 3/2009: Security Assessment 1092 of the Transmission Control Protocol (TCP)", UK Centre 1093 for the Protection of National Infrastructure, 2009. 1095 [I-D.gont-tcp-security] 1096 Gont, F., "Security Assessment of the Transmission Control 1097 Protocol (TCP)", draft-gont-tcp-security-00 (work in 1098 progress), February 2009. 1100 [Linux] The Linux Project, "http://www.kernel.org". 1102 [NetBSD] The NetBSD Project, "http://www.netbsd.org". 1104 [OpenBSD] The OpenBSD Project, "http://www.openbsd.org". 1106 [OpenSolaris] 1107 OpenSolaris, "http://www.opensolaris.org". 1109 [Silbersack] 1110 Silbersack, M., "Improving TCP/IP security through 1111 randomization without sacrificing interoperability.", 1112 EuroBSDCon 2005 Conference . 1114 [Stevens] Stevens, W., "Unix Network Programming, Volume 1: 1115 Networking APIs: Socket and XTI", Prentice Hall , 1998. 1117 [I-D.ietf-tcpm-tcp-auth-opt] 1118 Touch, J., Mankin, A., and R. Bonica, "The TCP 1119 Authentication Option", draft-ietf-tcpm-tcp-auth-opt-11 1120 (work in progress), March 2010. 1122 [Watson] Watson, P., "Slipping in the Window: TCP Reset Attacks", 1123 CanSecWest 2004 Conference . 1125 Appendix A. Survey of the algorithms in use by some popular 1126 implementations 1128 A.1. FreeBSD 1130 FreeBSD 8.0 implements Algorithm 1, and in response to this document 1131 now uses a 'min_port' of 10000 and a 'max_port' of 65535. [FreeBSD] 1133 A.2. Linux 1135 Linux 2.6.15-53-386 implements Algorithm 3, with MD5 as the hash 1136 algorithm. If the algorithm is faced with the corner-case scenario 1137 described in Section 3.5, Algorithm 1 is used instead [Linux]. 1139 A.3. NetBSD 1141 NetBSD 5.0.1 does not obfuscate its ephemeral port numbers. It 1142 selects ephemeral port numbers from the range 49152-65535, starting 1143 from port 65535, and decreasing the port number for each ephemeral 1144 port number selected [NetBSD]. 1146 A.4. OpenBSD 1148 OpenBSD 4.2 implements Algorithm 1, with a 'min_port' of 1024 and a 1149 'max_port' of 49151. [OpenBSD] 1151 A.5. OpenSolaris 1153 OpenSolaris 2009.06 implements Algorithm 1, with a 'min_port' of 1154 32768 and a 'max_port' of 65535. [OpenSolaris] 1156 Appendix B. Changes from previous versions of the draft (to be removed 1157 by the RFC Editor before publication of this document as a 1158 RFC 1160 B.1. Changes from draft-ietf-tsvwg-port-randomization-07 1162 o Addresses Jari Arkko's DISCUSS. 1164 B.2. Changes from draft-ietf-tsvwg-port-randomization-06 1166 o Fixes the writeo in the port number range. 1168 o Fixes the requirements on the random() function. 1170 o Other miscellaneous edits (resulting from IESG feedback. 1172 B.3. Changes from draft-ietf-tsvwg-port-randomization-05 1174 o Addresses AD review feedback from Lars Eggert. 1176 o Addresses AD review feedback from Lars Eggert. 1178 B.4. Changes from draft-ietf-tsvwg-port-randomization-04 1180 o Fixes nits. 1182 B.5. Changes from draft-ietf-tsvwg-port-randomization-03 1184 o Addresses WGLC comments from Mark Allman. See: 1185 http://www.ietf.org/mail-archive/web/tsvwg/current/msg09149.html 1187 B.6. Changes from draft-ietf-tsvwg-port-randomization-02 1189 o Added clarification of what we mean by "port randomization". 1191 o Addresses feedback sent on-list and off-list by Mark Allman. 1193 o Added references to [Allman] and [CPNI-TCP]. 1195 B.7. Changes from draft-ietf-tsvwg-port-randomization-01 1197 o Added Section 2.3. 1199 o Added discussion of "lazy binding in Section 3.5. 1201 o Added discussion of obtaining the number of outgoing connections. 1203 o Miscellaneous editorial changes 1205 B.8. Changes from draft-ietf-tsvwg-port-randomization-00 1207 o Added Section 3.1. 1209 o Changed Intended Status from "Standards Track" to "BCP". 1211 o Miscellaneous editorial changes. 1213 B.9. Changes from draft-larsen-tsvwg-port-randomization-02 1215 o Draft resubmitted as draft-ietf. 1217 o Included references and text on protocols other than TCP. 1219 o Added the second variant of the simple port randomization 1220 algorithm 1222 o Reorganized the algorithms into different sections 1224 o Miscellaneous editorial changes. 1226 B.10. Changes from draft-larsen-tsvwg-port-randomization-01 1228 o No changes. Draft resubmitted after expiration. 1230 B.11. Changes from draft-larsen-tsvwg-port-randomization-00 1232 o Fixed a bug in expressions used to calculate number of ephemeral 1233 ports 1235 o Added a survey of the algorithms in use by popular TCP 1236 implementations 1238 o The whole document was reorganized 1240 o Miscellaneous editorial changes 1242 B.12. Changes from draft-larsen-tsvwg-port-randomisation-00 1244 o Document resubmitted after original document by M. Larsen expired 1245 in 2004 1247 o References were included to current WG documents of the TCPM WG 1249 o The document was made more general, to apply to all transport 1250 protocols 1252 o Miscellaneous editorial changes 1254 Authors' Addresses 1256 Michael Vittrup Larsen 1257 TietoEnator 1258 Skanderborgvej 232 1259 Aarhus DK-8260 1260 Denmark 1262 Phone: +45 8938 5100 1263 Email: michael.larsen@tietoenator.com 1265 Fernando Gont 1266 Universidad Tecnologica Nacional / Facultad Regional Haedo 1267 Evaristo Carriego 2644 1268 Haedo, Provincia de Buenos Aires 1706 1269 Argentina 1271 Phone: +54 11 4650 8472 1272 Email: fernando@gont.com.ar