Genuine question.
It looks so closed and complex compared to more traditional comms like wifi or even ethernet.
You could build srsRAN and run a local eNodeB instance to form a local LTE network. Given that it has a radio that operates in the LTE bands, in theory you might be able to build srsRAN for a phone and run the necessary base station software (eNodeB and EPC) on a phone to form an "ad hoc" network. It wouldn't be truly ad hoc in that the network would still have a base station, just that it would be running on phone hardware. srsRAN wouldn't be running as an application, but would be replacing the firmware in the phone's LTE modem.
Edit:
Here is a paper by someone who has built an ad hoc LTE network.
https://arxiv.org/pdf/1802.09262
It does exactly the above: using srsRAN (which used to be called srsLTE) to run local base station software (eNodeB+EPC) to get around the asymmetry in the LTE protocol.
Networking between phones, without a common base station, is hard. Harder than WI-FI, because identity is managed centrally and the frecs in use require a license to name some "simple" problems. Cellular comms are not designed to handle this kind of scenario.
There has been some work to add inter device connectivity lately, to support many interesting use cases. You can find more looking for "sidelink" or "PC5", but you will not find many phones that implement it.
It seems to be mostly focused in vehicular use cases in V2V and V2X scenarios
5G also has a peer mode, and I'm trying to figure out if it can be implemented in userspace or has to be done in firmware.
My idea is that peer mode would be useful for replacing walkie-talkie or mesh messaging like Meshtastic since everyone has a phone. The range is supposed to be around a mile.
However, if I’m not mistaken 5G has V2V comms (Vehicle to Vehicle) specifically designed for self-driving cars, drones and IoT and that is the most “ad hoc” it can get
Because billing.
All the complexity in cellular can be traced back to making the system secure the whole way back to SIM cards because there is actual money at stake if the system gets cracked.