Routing.
If you have both an active WiFi connection and an active cellular data connection then your phone had two functional and valid interfaces each with its own gateway (a default route for data that can’t be sent to a local IP address) by which it can send data to the internet.
One, or both of these interfaces likely to have a layer of Network Address Translation sitting between it and the public internet. One or both may have both IPv4 and IPv6.
Most network software uses one of two transport protocols, TCP or UDP.
TCP is stateful and most of the heavy lifting is handled by the operating system. The transmitting party sends a stream of characters and the receiving party receives the stream of characters in the exact order that it is sent. TCP had no concept of message boundaries, it’s simply a stream of symbols from a sender to a receiver.
UDP is stateless. The transmitting party simply sends a message of some size and it either arrives at the receiver intact or it doesn’t.
The sender and receiver are identified by a combination of IP Address and Port, which when used together, form what’s called a *socket*. Communication occurs between sockets, not between physical devices.
A cellular device could in theory use both a socket on a WiFi interface and a socket on a cellular interface to communicate with an application server of some sort but taking advantage of the multiple network paths would require both the client and server software to be aware of the fact that multiple paths exist and that they can be used for improved data transfer.
This is certainly possible, but it puts a lot of heavy lifting on the application developer without providing a lot of benefits.
Latest Answers