TCP/IP: An Internet Protocol
December 18, 2013
•IADT General, Information Technology
• 0 Comments
When you access Facebook on your mobile phone or perform a Google search, you receive content immediately. You can maintain connectivity and have conversations with friends from any location. But have you ever wondered what goes on under the hood of your computer or mobile device? What appears as nearly magical is really the result of an Internet protocol: TCP/IP. Every time you access an application on the Internet, you're most likely using TCP/IP to communicate.
TCP/IP: Why Is It Used?
When two applications talk to each other on the Internet, they exchange data in the form of packets, an envelope containing addressing information and content, much like a regular piece of snail mail. The protocol used to exchange these envelopes needs to guarantee reliability, receipt and, in case of loss or corruption, retransmission. TCP/IP guarantees all of these things.
- Guaranteed Receipt: When you access any Internet application, like Facebook, you establish a permanent connection to the Facebook server and send TCP/IP messages that contain your requests. If you want to add a friend on Facebook, your client Facebook application will send a number of TCP/IP packets that request this action. However, how do you know that your message actually reaches the Facebook servers? The TCP/IP Internet protocol guarantees delivery. When Facebook receives your request, Facebook returns an acknowledgment, an ACK.
- Retransmission: If your client has not received any ACKs from Facebook, your client will retransmit the packets on a schedule. This ensures continuous delivery.
- Error detection: Every packet sent and received, either by the Facebook client or the Facebook server, is checked for errors. Each packet contains a signature of the data contained within it. When a client or a server receives a packet, TCP/IP compares the signature of the data with the data itself. If there are discrepancies, the party that received the corrupted packet will request retransmission.
Example: A Simple TCP/IP Connection
Now you know that TCP/IP is critical to the functioning of the Internet, but how do a client and a server establish a TCP/IP connection? If you're really interested in the complex and vast Internet TCP/IP protocol, you might consider a degree in Information Technology. But here is a brief step-by-step explanation:
- SYN-SENT: The client, such as your Facebook application, sends a SYN request to the server. A SYN request asks the server to establish a connection. The client labels the SYN request with a sequence number, a random number used to make sure that messages are sent and received in order.
- SYN-ACK: The server responds with a SYN-ACK message. The SYN-ACK message contains an ACK, labeled with the sequence number from the previously sent SYN message incremented by one. The client will receive this message and determine if the initial SYN-SENT message was received by checking whether the server incremented the initial sequence number by one.
- ACK: The client sends a final ACK to the server and the connection is established.
Photo credit: Wikimedia Commons