Why we are bothering to encrypt our data on a transport level, instead of just doing that on a network level with e.g. IPSec and get rid of the need to to that in upper layers. For example instead of using TLS for HTTP we just use IPsec and no need to do the same handshake stuff for other ports or protocols.
closed as primarily opinion-based by Zac67, user36472, Ron Maupin♦ Feb 4 at 16:38
Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.
Remember that IP was a government/academic collaborative experiment, and the current Internet was never envisioned. IPv4 didn't have anything like what you suggest, and it couldn't be retrofitted (you cannot simply do something like that and break every IP device in existence). What was done, instead, was to use an encrypted tunnel.
On the other hand, IPv6 was built from the start with something like you describe. Unfortunately, it didn't really take off because people were used to the idea of tunneling, rather than encrypting in the original packet. OSPFv3 for IPv6 does as you suggest, and it may be that it becomes more common, but it is very hard to get people to change.