ExposureRoom Home
  Log in Sign Up
Shiv's Website
Shiv Kumar
United States
Friends: 71
Focused on : 2
 
       
                                                             

What is TCP/IP

Not Rated YetNot Rated YetNot Rated YetNot Rated YetNot Rated Yet0votes
January 02, 2008 02:44 PM  Views:43   Favorited:0 Comments:0
Filed Under:  Programming
Tags:  Delphi, Internet
 

Do you really need to know all this?

No, not really. A basic understanding is good enough. You don't need to go really deep into the workings. At any time, if you feel, you're getting in too deep, don't worry. Just skip on to the next article. I put it in simpler terms there.

TCP

TCP is a connection-oriented transport protocol that sends data as an unstructured stream of bytes. By using sequence numbers and acknowledgment messages, TCP can provide a sending node with delivery information about packets transmitted to a destination node. Where data has been lost in transit from source to destination, TCP can retransmit the data until either a timeout condition is reached or until successful delivery has been achieved. TCP can also recognize duplicate messages and will discard them appropriately. If the sending computer is transmitting too fast for the receiving computer, TCP can employ flow control mechanisms to slow data transfer. TCP can also communicate delivery information to the upper-layer protocols and applications it supports.

IP

IP is the primary layer 3 protocol in the Internet suite. In addition to internetwork routing, IP provides error reporting and fragmentation and reassembly of information units called datagrams for transmission over networks with different maximum data unit sizes. IP represents the heart of the Internet protocol suite.

IP addresses are globally unique, 32-bit numbers assigned by the Network Information Center. Globally unique addresses permit IP networks anywhere in the world to communicate with each other.

An IP address is divided into three parts. The first part designates the network address, the second part designates the subnet address, and the third part designates the host address.

IP addressing supports three different network classes. Class A networks are intended mainly for use with a few very large networks, because they provide only 8 bits for the network address field. Class B networks allocate 16 bits, and Class C networks allocate 24 bits for the network address field. Class C networks only provide 8 bits for the host field, however, so the number of hosts per network may be a limiting factor. In all three cases, the leftmost bit(s) indicate the network class. IP addresses are written in dotted decimal format; for example, 24.28.0.1

Ports and Sockets

This section introduces the concepts of port and socket, which are necessary to exactly determine which local process at a given host actually communicates with which process at which remote host using which protocol. If this sounds confusing, consider the following
  1. An application process is assigned a process identifier (process ID) which is likely to be different each time that process is started.
  2. Process IDs differ between each operating system platforms, hence they are not uniform.
  3. A server process can have multiple connections to multiple clients at a time, hence simple connection identifiers would not be unique.
The concept of ports and sockets provides a way to uniformly and uniquely identify connections, and programs and hosts that are engaged in them, irrespective of the specific process IDs.

Ports

Each process that wants to communicate with another processs identifies itself to the TCP/IP protocol suite by one or more ports. A port is a 16-bit number, used by the host-to-host protocol to identify to which higher level protocol or application program(process) it must deliver incoming messages. There are two types of port:

Well-Known Ports

Well-Known ports belong to the standard servers, for example Telnet uses port 23. Well-known port numbers range between 1 and 1023. Well-known port numbers are typically odd, because early systems using the port concept required an odd/even pair of ports for duplex (two-way) operation. Most servers require only a single port. Exceptions are BBOTP server which uses port 67 & 68 and the FTP server, which uses 20 & 21. The well-known ports are controlled and assigned by the Internet central authority (IANA) and on most systems can only be used by system processes or by programs executed by privileged users. The reason for well-known ports is to allow clients to be able to find servers without configuration information.

Ephemeral Ports

Clients do not need well-known port numbers because they initiate communication with servers and the port number they are using is contained in the UDP data grams sent to the server. Each clients process is also allocated a port number as long as it needs it, by the host it is running on. Ephemeral port numbers have values greater than 1023, normally in the range 1024 to 65535. A client can use any number allocated to it, as long as the combination of is unique. Ephemeral ports are not controlled by IANA and on most systems can be used by ordinary user developed programs. Confusion due to two different applications trying to use the same port numbers on one host is avoided by writing those applications to request an available port from TCP/IP. Because this port number is dynamically assigned, it may differ from one invocation of an application to the next. UDP, TCP and ISO TP-4 all use the same port principle. To the extent possible, the same port numbers are used for the same services on top of UDP, TCP and ISO TP-4. Normally, servers will use either TCP or UDP, but there are exceptions. For example, domain name server use both UDP port 53 and TCP port 53.

Sockets

A Socket is a name given to the package of subroutines that provide access to TCP/IP on most systems. A combination of an IP Address and a port is considered a socket.

Summary

TCP and IP were developed by a Department of Defense (DOD) research project to connect a number different networks designed by different vendors into a network of networks (the "Internet"). It was initially successful because it delivered a few basic services that everyone needs (file transfer, electronic mail, remote logon) across a very large number of client and server systems. Several computers in a small department can use TCP/IP (along with other protocols) on a single LAN. The IP component provides routing from the department to the enterprise network, then to regional networks, and finally to the global Internet. On the battlefield a communications network will sustain damage, so the DOD designed TCP/IP to be robust and automatically recover from any node or phone line failure. This design allows the construction of very large networks with less central management. However, because of the automatic recovery, network problems can go undiagnosed and uncorrected for long periods of time.

As with all other communications protocol, TCP/IP is composed of layers:

IP - is responsible for moving packets of data from node to node. IP forwards each packet based on a four byte destination address (the IP number). The Internet authorities assign ranges of numbers to different organizations. The organizations assign groups of their numbers to departments. IP operates on gateway machines that move data from department to organization to region and then around the world. TCP - is responsible for verifying the correct delivery of data from client to server. Data can be lost in the intermediate network. TCP adds support to detect errors or lost data and to trigger retransmission until the data is correctly and completely received.

Comments have been Disabled for this post





Menus

Theme

Privacy Policy  |  Terms Of Service  |  Contact Us  |  Support  |  Help/FAQs  |  News