Wednesday 9 January 2013

TCP/IP Concepts for Windows Programmers

Everybody claiming to be a Windows Joe should know the basic concepts of TCP/IP.

The TCP/IP "Reference Model"

The TCP/IP "reference model" was based on an older "reference model" known as the OSI Reference Model, which was, in comparison, very complicated, made up of seven layers from the Application to the Physical layer. TCP/IP came and it was simpler: declaring Application, Transport, Internet and Host-to-Network as the four major layers. Understanding the reference model, gives you more idea of the relationship between TCP and IP.

Details of TCP/IP including Three-Way Handshake

After all, that's how the Internet works!  The Internet works thanks to two protocols working in partnership. The first, Transmission Control Protocol, is what establishes the "virtual connection" between two endpoints and ensures smooth data transfer. TCP, if you will, is the "taxi driver" that takes data from A to B.

You can get a sense of round-trip time for TCP using traceroute, or in Windows, tracert. You will notice that TCP is not optimised for performance but for reliability.

A three-way handshake is what initialises the TCP connection (SYN, SYN-ACK and ACK).

What is the relationship between TCP and IP?  The TCP information is transported in IP datagrams, which at the receiver end get processed by IP software and sent to TCP software for "demultiplexing" and further processing. If TCP is the Airway Bill, then IP are the boxes being shipped. Again, refer back to the TCP/IP reference model for renewed conceptual clarity.

TCP Offload Engines and Gigabit Ethernet

One bit of jargon that's gone into fore is "TCP Offload Engine". TCP, being a fairly CPU-intensive protocol, has been embraced by certain network interface cards (NICs) to offload the processing from the main CPU(s). It is used in high-speed network interfaces, such as Gigabit Ethernet (GbE) for moving data at a BILLION BITS PER SECOND.

No comments: