Our work on Cognitive Packet Networks (CPN) has designed, implemented and tested packet networks which adapt their routes using reinforcement learning, based on on-line measurements and random neural networks that are distributed at selected routers. The “routing oracles” in CPN are recurrent Random Neural Networks (RNN) located at routers or SDN controllers, whose state can be determined uniquely from input data and prior RNN weights. The choice of network paths is driven by an objective or “goal” which includes broad quality of service criteria such as delay, loss, energy and security. The implementation remains compatible with the IP protocol. Different experimental results will be presented on several test-beds, as well as in the framework of on an intercontinental overlay network, and also separately through an implementation in SDN. We will also outline how similar ideas have been tested for task allocation in the Fog or Cloud. The work has resulted in several PhD dissertations and post-doctoral projects, EU FP7 (CASCADAS) and H2020 (SerIoT) projects, some patents, and publications in mainstream journals and conferences (Proceedings of the IEEE, Communications ACM, IEEE JSAC, ICC, MASCOTS, IEEE Trans. Cloud Computing, etc.).