TCP / IP Protocol Services

Summary

WHAT IS TCP/IP?

TCP/IP stands for Transmission Control Protocol/Internet Protocol and refers to the two primary protocols in the Internet Suite. The strength of the TCP/IP is its compatibility with nearly any lower-layer network architecture.

The services provided by TCP/IP are equivalent to those provided by the presentation, session, transport, and network layers in the OSI reference model. Recall that the presentation layer prepares application data, the session layer coordinates communications between application endpoints, the transport and network layers address and send data – reliably or not – on a heterogeneous network. The following figure shows how the TCP/IP protocol relates to both the OSI and WinSock models:



From the above figure, TCP/IP is a really a set (or suite) of the following protocols:

TRANSPORT SERVICES

WinSock provides direct access to the most important layer in OSI, the Transport layer. The choice of which Transport service (TCP vs. UDP) WinSock will use is a fundamental design decision.

CONNECTIONLESS SERVICES – UDP

The UDP is a connection-less service. It is also called Datagram Services. Because it is connection-less, it is unreliable. Unreliable means that UDP neither guarantees delivery nor preserves the packet sequence. The UDP is analogous to the Post Service. Delivery is not guaranteed nor is the sequence of delivery. The UDP is simple, easy to use, has low overhead, and is efficient to use.

Although UDP is unreliable, a UDP application need not be unreliable. The application can implement services to provide reliability – To guarantee delivery, the receiving UDP application can send acknowledgment for each datagram received, and the sending UDP application can resend the datagram if an acknowledgment is not received within a certain time period. To guarantee packet sequence, the sending application can also add a timestamp to allow the receiving application to properly reassemble received packets.

The UDP service is ideal in the following scenarios:

CONNECTION-ORIENTED SERVICES - TCP

The TCP is a connection-oriented service, and hence it is reliable. It is also called Stream Service. A TCP connection is a virtual circuit because it appears that it is hardwired (although it is not). The virtual circuit provides reliable data transfer through the following services:

TCP is analogous to a telephone service - you cannot transmit data (talk) before the other party accepts the connection (lifts the receiver). The connection-oriented service is not as simple as the connection-less service. There is overhead in creating/destroying the virtual circuit, acknowledging, retransmitting, and sequencing.

Connection-oriented services are a must for applications that cannot afford to lose data. Although it has more overhead, it is easier to use.

DECIDING ON A TRANSPORT: TCP VS. UDP

One of the most important decisions in a networked application is what transport mechanism will be used. It is important to know as much as possible about the capabilities and limitations of each protocol. First, decide on the requirements of the application, and based on that, determine the protocol to use. The most significant reason to use TCP is that it is easier to write. Rule of thumb: Use TCP unless you have a good reason not to.

NETWORK SERVICES

IP SERVICES

IP services are the key to inter-networking. It provides fragmentation, packet addressing, routing, and packet reassembly.

Packet Addressing allows the transmission of packets from one IP address to another. Packet routing means the selection of a path for transmission. Packet fragmentation and reassembly allows transmission of large data through small packets, and it is this capability that allows connection to different network media.

Most of these services are transparent to a WinSock application, except the IP Address. Any For a networked application to contact another host using TCP, it must use an IP Address. Note that by definition a TCP sockets can only send to and receive from a single socket.

ICMP SERVICES

ICMP is a support protocol that does not transport data. Instead, it delivers control, error, and informational messages between internet hosts.