3.3.4.3 Choosing a Source Address (original) (raw)
When it sends an initial connection request (e.g., a TCP "SYN" segment) or a datagram service request (e.g., a UDP-based query), the transport layer on a multihomed host needs to know which source address to use. If the application does not specify it, the transport layer must ask the IP layer to perform the conceptual mapping:
GET_SRCADDR(remote IP addr, TOS)
-> local IP address
Here TOS is the Type-of-Service value (see Section 3.2.1.6), and the result is the desired source address.
The following rules are suggested for implementing this mapping:
- If the remote Internet address lies on one of the (sub-) nets to which the host is directly connected, a corresponding source address may be chosen, unless the corresponding interface is known to be down.
- The route cache may be consulted, to see if there is an active route to the specified destination network through any network interface; if so, a local IP address corresponding to that interface may be chosen.
- The table of static routes, if any (see Section 3.3.1.2) may be similarly consulted.
- The default gateways may be consulted. If these gateways are assigned to different interfaces, the interface corresponding to the gateway with the highest preference may be chosen.
In the future, there may be a defined way for a multihomed host to ask the gateways on all connected networks for advice about the best network to use for a given destination.