UDP (Part 2) – How Data Packet Send to Correct Application
As we know that a port is the “communication point” of a computer. There are many applications, each occupying a specific port, running in a computer. Here’s come a question. How data packet send from one computer to the correct application of other computer?
Imagine the following scenario You open a browser in Computer A and request to download a homepage from the server (e.g. http://184.108.40.206).
Here’s what happen:
- Computer A send a request packet (shown as red dots in the above diagram) to server.
- The request packet then travel through the Internet.
- The packet finally arrive the server at IP Address 220.127.116.11.
- The packet get lost at the entry of the server. The packet did not know where to go. There is no any information that tell the packet should go to HTTP Server, FTP Server, FTP Server, or other running applications!
The above scenario is quite similar to sending a letter (packet) to an office (application).
- The letter has only the address of the office (server), but
- The letter has no information of the receiver (port number), for example, Michael Jason
Therefore, the IP address alone cannot send the data packets to the application correctly. The destination of the packet must also included with the IP address, i.e.
Actually the destination indicate the type of service being connected to. In fact we called the destination – a port.
In other words, the data packet must include both the IP address and a port number, i.e.
We should now realize that a port number will be assigned to each type of services or applications (e.g. HTTP, FTP, etc..) running in a computer. This is this basic concept that make multi-tasking of a computer possible.
Tomorrow, let’s see how port numbers are assigned to a computer.