How do protocols work (TCP/IP)?

I just read up on TCP/IP and I was wondering, how does it distinguish one protocol from another? and two people are using one protocol on the same network, how does it decide who it goes to? Explanation: If I'm using AIM with an external IP of 123.45.67.89 and my computer is on a router which uses 192.0.0.4 and my friend is 192.0.0.2 If I talk to my mother through AIM and my friend talks to his mother through AIM How do the messages not interfere with one another? Furthermore how does AIM separate it's protocol from another program running on the same port?

Comments

  • You just read up? Read more about it ;)

    There's a number in the header (which is like the envelope of a letter with an address and so on), that says where it came from, where it's going, and what protocol it uses. That protocol is still low-level, like TCP, or UDP. Then there is port information, which tells it which program/task on the computer it should connect to. For example, http is on port 80 as standard. You can add a specific port to a web request, and it'll do the same thing:

    http://www.google.com/

    But there are many other ports, for other things. About 1000 of these are "well known ports" for services like the web and email. Most of the others are random, created on the fly by programs, for each connection to another machine. This is where programs like bittorrent get the numbers like "300 connections".

    So basically, when you talk to someone on AIM, it's directed to port p at computer c, and that port p is something the AIM program on their computer specifically setup for communicating.

    Now, INSIDE that protocol, you have more details, or multiplexing. For example, with the web, only port 80 is used to ask for pages, so each client connecting connects and says what site and what page it wants. IP etc. is available from the connection information itself. Same for AIM: it'll connect and say something like "I'm still typing." or "Please repeat message 37", or "Here's the token you gave me earlier that identifies the conversation we're having right now. I'd like to send a file to you. Can you open another port for it, and tell me the port number?" Something like that. I don't know the AIM protocol, specifically.

  • It's not the Protocol - It's the router

    The Protocol just insures that the data is organized in the same way

    That includes how the packet header is organized

    The sender and intended recipient of each message is recorded in the header of each packet

    So the router can read the header and make sense of it. Once the header is read, the router sends the packet to the correct computer.

Sign In or Register to comment.