RFC 3489 Procedures

The Oracle® Enterprise Session Border Controller (the STUN server) constructs the Binding Response and populates it with these attributes:

  • MAPPED-ADDRESS and (optionally) XOR-MAPPED-ADDRESS—Containing the source IP address and port from which the server saw the request come
  • SOURCE-ADDRESS—Containing the IP address and port from which the server will send the Binding Response
  • CHANGED-ADDRESS—Containing the STUN server port that has a different address and different port from the ones on which the server request was received

If the Binding Request contains a RESPONSE-ADDRESS attribute, the server adds the REFLECTED-FROM attribute with the IP address and port from which the server saw the request come. Then the server sends the Binding Response to the IP address and port in the RESPONSE-ADDRESS attribute. If the RESPONSE-ADDRESS attribute’s IP address and port are invalid, the server sends a Binding Error Response with an ERROR-CODE attribute reason 400 (Bad Request) to the client.

If the Binding Request contains a CHANGE-REQUEST attribute, the server sends Binding Response from the IP address and port matching the information in the CHANGE-REQUEST. The following variations can occur:

  • If the IP address and port flags are set, the server selects the server port with a different IP address and different port.
  • If only the IP address flag is set, the server selects the server port with a different IP address but with the same port.
  • If only the port flag is set, the server selects the server port with the same IP address but with a different port.

The selected server port appears in the Binding Responses’s SOURCE-ADDRESS attribute. When there is no CHANGE-REQUEST attribute, the server uses the server port on which the Binding Request was received.

Finally, the server encodes the outgoing message and sends it to the client at either:

  • The destination IP address and port in the REPONSE-ADDRESS attribute, if it was present in the Binding Request.
  • The MAPPED-ADDRESS.