Data addressed to localhost never leaves the TCP/IP stack on your machine. It's sent to the loopback adapter instead. The loopback adapter is a virtual adapter - any traffic sent its way is sent right back to the caller, inside the stack. Your NIC never sees it.
It's not clear how real the 24.2 Gbps value is - you can see crazy values when you test with small enough datasets. To the extent that it's real, it may reflect your machine's memory bandwidth.
If you want to test the performance of your physical network adapter, or the network it's connected to, you'll need to interact with a host on your network, on a route that adapter is set to handle. If you have only one active physical adapter, that means any other host on your network.