October 13, 2013

1.4.7 TCP/IP

TCP/IP

TCP/IP stands for Transmission Control Protocol / Internet Protocol. It is a communication protocol for computers on the Internet (it also operates on intranets and extranets).

TCP/IP is a suite of protocols of which the Transmission Control Protocol and the Internet Protocol are two of the most prominent. Others include: UDP (User Datagram Protocol) – lightweight, “unreliable” communication between applications, ICMP (Internet Control Message Protocol) – for statistics and tracking errors, DHCP (Dynamic Host Configuration Protocol) – for dynamic configuration of devices.

The Internet data communications model is also known as the TCP/IP model.

Like other data communication models, TCP/IP makes it possible for two nodes to exchange information.

TCP

The Transmission Control Protocol works essentially like a two-way virtual pipe. It allows you to both read from and write to the pipe. TCP uses the underlying network infrastructure to connect two end-points (or sockets) together allowing for the reliable exchange of information via the pipe.

TCP is a "reliable" protocol, also known as “connection-oriented”. It is responsible for the delivery of data from source to destination. It detects errors and uses acknowledgements and retransmissions to ensure correct data delivery. Other layers can focus on other things besides reliability, e.g. IP focuses on how to route the packet between nodes.

Here are a list of services that TCP provides:
  • a reliable character stream
  • packages data into segments
  • acknowledges and retransmits to recover lost packets
  • allows multiple connections to a TCP socket
It provides for guaranteed delivery of packets, flow control via ‘window size’ – sequence acknowledgement, avoids data corruption by incorporating checksums, packets re-assembled if the arrive out of order.

Common TCP applications include: HTTP (web), SMTP (email), FTP (file transfer), SSH, IMAP.

IP

Internet Protocol (IP) is a datagram, or connectionless, internetwork service and includes provision for addressing, type-of-service specification, fragmentation and reassembly, and security (via IPSec).

The Internet Protocol's main task is to find the best route over which to send a packet. To that end it adds source and destination addresses to every "datagram", creating an IP packet. It uses protocols such as ARP, RARP, ICMP and RIP to figure out the best route.

Here are a list of features that IP WILL provide:
  • assigning addresses to individual datagrams
  • communicating with nodes and gateways to find the best route
Here are a list of features that IP does NOT provide:
  • a reliable communication facility
  • data delivery or loss acknowledgement
  • error correction or detection for data
  • retransmission of lost datagrams
  • flow control 
So what happens when a datagram is corrupted? Or a network buffer at the destination overflows? With respect to IP, it does not care. The datagram is simply discarded. It is up to the other layers to deal with error correction or retransmission or acknowledgements.

For example, if using TCP at the Transport Layer, it's up to the TCP module at the source to recognize that it didn't receive an acknowledgement for a particular packet or series of packets. If using UDP at the Transport Layer, then we either do not care if a few packets are lost or some other layer, e.g. Application, will be called to resolve the issue.

TCP and IP: Work Better Together

  • TCP takes care of the communication between application software at the source and destination.
  • TCP is responsible for breaking data down into IP packets before they are sent, and for assembling the packets when they arrive back into the original data.
  • TCP checks packets for errors and submits requests for re-transmissions if errors are found.
  • TCP is responsible for verifying the correct delivery of data from source to final destination.
  • IP is responsible for sending the packets to the correct destination.
  • IP takes care of the communication with other computers.
  • IP adds addresses to each packet such that it can be individually routed to the final destination.
  • IP forwards each packet based on a four byte destination (IP) address. IP operates on gateway machines that move data from department to organization to region and then around the world.

References:

No comments:

Post a Comment