Sockets
What I currently vaguely understand is that you can transfer bits in series or parallel basically and the first several hundred or thousand ports or so are reserved for stuff. One such port references the device itself, don't remember what it is. Just to sort of help you know what misconceptions I probably already have.
In order for two computers to communicate over the internet, they must send their data through sockets. The process goes as follows: 1) One of the computers takes on the role of the server. It opens up a socket, binds it to a port, and then the socket will listen for incoming connections. A server program can only listen to one port at a time. 2) The other computer must take on the role of the client. It opens up a socket and tries to connect to an IP address for a particular port. If a person wants to connect to "www.google.com", they must first do a DNS (domain name system) look up to get the IP address. 3) The server socket will recognize the client connection, and then it will create a new socket specifically for the incoming connection. At the socket level, there are no rules as to how data should be sent. All that is being sent is raw bytes between the computers. For sockets to properly communicate with each other, both computers must agree to use a protocol.
Is the socket or port a physical thing, I suppose, what do you call the holes on the computer to plug in things?
Ports and sockets are not physical things.
Ok, so is this an overview of more things you're planning on explaining in depth or am I free to ask questions?
You can ask whatever question you want regarding sockets.
Can you elaborate on what a DNS lookup is and what an IP address is?
DNS look up will take a host name e.g. "www.google.com", and figure out what IP address it corresponds to e.g. "74.125.224.177".
Once you have an IP address and have chosen a port, you are ready to connect directly to the server. Every modem connected to the internet has its own IP address. If your computer is connected to the internet directly without a modem, then it would have its own IP address.
If you have a router, this can sometimes cause issues for server sockets, because many devices are connected with the same IP. The router will not know which device to send the data to. For this reason, routers have port forwarding features so that you can specify the device to forward data to.
There is no problem in the case of client connections though, because the routers knows who is asking for what, then it knows what replies belong to whom.
I see, so it's based off of the modem, not so much the device. The problem is really only possibly between my specific device and the router not the router and the server. Ok. How does data get transferred safely across the internet? Also, is it too broad of a question to ask how this relates to Wi-Fi and Bluetooth?
Data gets sent through the internet via modems talking to each other. A modem will ask modems in its proximity, using an IP address, where the destination computer is. I don't know how the technical details on how it works, but basically the data is leap frogged across multiple modems to get to the final destination. Thus, whenever you are communicating to a server, any modem along the way will also be able to listen in on the connection and see what the parties are saying to each other. This is why encryption is important in keeping the data private.
Wi-Fi and blue tooth are just sending and receiving to radio waves (electro magnetic waves) and then interpreting the data. That is all they are doing.
So it's sending frequency and/or amplitude modulated waves or is it somehow acting more like sending bursts of bits?
That's a bit too technical for this topic, and I'm not sure.
Basically, it's not computer science, it's computer engineering. That's hardware level question.
Alright, well essentially I'm planning on turning an android device into a substitute for a laptop touch pad over wifi. I wouldn't need to understand more than this as far as sockets are concerned?
Well, any two devices will communicate with each other via sockets. I don't understand your question
Sure, I think you just answered it actually. Seems to make sense over all. Is there anything extra you feel like you should add that you think I might be missing?
No, there are many topics related to Sockets, but they have their own place.
There's a lot more to internet (and computer communication in general) than one might think. Have a look at the OSI model, its different standards and protocols for a complete explanation. http://en.wikipedia.org/wiki/OSI_model
But the application developer like @wio wrote usually doesn't have to concern himself with more than server/client sockets.
Thanks, that was interesting @Lyrae . I'm really looking for a good, holistic understanding of how computers operate inside and out.
Join our real-time social learning platform and learn together with your friends!