We are talking about a peer to peer network that is decentralized so there is no easy way of knowing the accurate number of full nodes. However, we can still come up with a good estimation.
People already introduced bitnodes.io, what they do is that they simply run a node and list those nodes that are reachable or in other words the nodes that accept incoming connection. This number has always been lower than the total number of nodes that also includes nodes that do not accept incoming connection.
Counting the second group of nodes is harder because
they have to initiate the connection to the counter and they may never connect to that node ever ergo the counter may never know about them.
Think of it this way, there are nodes A, B, C, D, E, F and only A and B are accepting incoming connection. This means when C and D connect to A they will find out about B too (through
gossip protocol) but B will never know about C and D unless they also connect to B since it has no reason to know about them and A doesn't tell others about C and D whereas it does tell everyone about B. Same with E and F that connect to B and A will never know about them.
In this case if node B is a counter node, it would think there is only 3 nodes in total: A, E and F.
On the other hand bitnodes.io type counter only knows about A and B since they only look for "reachable nodes" which are nodes that their "crawler" can connect to so they can never connect to C, D, E or F so they are never counted.
Others have attempted to count all nodes using different techniques:
https://luke.dashjr.org/programs/bitcoin/files/charts/software.htmlhttps://luke.dashjr.org/programs/bitcoin/files/charts/historical.html