12. IP Header Fields
This section describes how the server sets various fields in the IP header when relaying between the client and the peer, or the reverse. The descriptions in this section apply to (a) when the server sends a UDP datagram to a peer, or (b) when the server sends a Data indication or ChannelData message to the client over a UDP transport. The descriptions in this section do not apply to TURN messages sent from the server to the client over a TCP or TLS transport.
The descriptions below are divided into two behaviors: a preferred behavior and an alternate behavior. A server SHOULD implement the preferred behavior. However, if this is not possible for a particular field, then it SHOULD implement the alternate behavior.
Time to Live (TTL) Field
-
Preferred Behavior: If the incoming value is 0, discard the incoming packet. Otherwise, set the outgoing Time to Live/Hop Count to one less than the incoming value.
-
Alternate Behavior: Set the outgoing value to the default for outgoing packets.
Differentiated Services Code Point (DSCP) Field [RFC2474]
-
Preferred Behavior: Set the outgoing value to the incoming value, unless the server includes a Differentiated Services Classifier and Marker [RFC2474].
-
Alternate Behavior: Set the outgoing value to a fixed value, which by default is Best Effort, but may be configurable.
-
In both cases, if the server is immediately adjacent to a Differentiated Services Classifier and Marker, then in the direction towards the classifier, the DSCP MAY be set to any arbitrary value.
Explicit Congestion Notification (ECN) Field [RFC3168]
-
Preferred Behavior: Set the outgoing value to the incoming value, unless the server is doing Active Queue Management, in which case the incoming ECN field is set to ECT(1) (=0b01) or ECT(0) (=0b10) and the server wishes to indicate that congestion has been experienced, in which case set the outgoing value to CE (=0b11).
-
Alternate Behavior: Set the outgoing value to Not-ECT (=0b00).
IPv4 Fragmentation Fields
-
Preferred Behavior: When the server is sending a packet to a peer in response to a Send indication that contains the DONT-FRAGMENT attribute, set the DF bit in the outgoing IP header to 1. In all other cases when sending an outgoing packet containing application data (e.g., Data indication, ChannelData message, or a Send indication without the DONT-FRAGMENT attribute), copy the DF bit from the DF bit of the incoming packet that contained the application data.
Set the other fragmentation fields (Identification, More Fragments, Fragment Offset) as appropriate for a packet sent by the server.
-
Alternate Behavior: As in Preferred, except always assume the incoming DF bit is 0.
-
In both Preferred and Alternate Behavior, the resulting packet may be too large for the outgoing link. If this is the case, then the normal fragmentation rules apply [RFC1122].
IPv4 Options
-
Preferred Behavior: The outgoing packet is sent without any IPv4 options.
-
Alternate Behavior: Same as Preferred.