|
July 02, 2012, 11:56:14 PM |
|
In a perfect world, where everyone has a nice and well-defined and reachable single IP address, without NATs and bridges and IPv4/IPv6 split, or the necessity for onion routing, ..., yes, TCP/IP would suffice, and you could determine the source IP directly from the IP socket layer.
Reality is more complex. Some nodes are firewalled and only can or only want to make outgoing connections. Some may have an address they can be reached on that differs from the one they connect with. From the other direction, nodes may be behind a NAT and not know their own public IP, even though they are reachable.
As to why Satoshi did things the way he did - we don't know, and we can't ask. Until quite recently, the values in addrMe and addrYou in version messages were entirely unused. That changed, as they can be useful for discovering which of your (perhaps several) detected addresses people connect on, and as a way to advertize your own address. Whether this was what Satoshi intended to be done with them? No idea...
|