TCP/IP Some Basic Information

The Internet is a network of computers connected together through communication networks. This network consists of cables, fiber optics, satellite, radio and telephone lines. The system has computers of all types and running all type of operating systems. They all use TCP/IP as a common language

TCP/IP is a set of protocols used by computers to communicate on the Internet. A protocol can be thought of as a language - a way of communicating using a common set of terms which are understood by everyone employing them. The TCP/IP set of protocols are also commonly being used on internal networks today partly because they are needed if you want to connect to the Internet and partially because of their flexibility and the features they offer.

The TCP/IP protocol can be thought of as a layered interface were each layer performs different function and each layer only talks to the same layer in the other computer. I will use a four layer approach (there are some disagreements as to how many and how they are separated but that is somewhat academic for basic understanding). Each layer represents a data communication function and may include on any number of different protocols. Thus, protocols such as mail and ftp both use the application layer to interface with user. In this approach the top layer generates the data which needs to be communicated to same layer in the other computer (s) . It sends this information to the lower layer which treats what it got as data and adds headers which contains the information provided by that layer. It then passes it on to the next layer. The next layer sees a stream of data and does not know and does not care whether it was generated on the top layer or the second layer. It does its job and passes it on after having added its information and so on. The same happens in reverse when the data is received.

One Important item to remember when thinking about TCP/IP is that there might be lots of items going on at the same time. As an example a computer might be running a WWW browser, a Telnet session, an ftp session, a chat session, sending or receiving mail and read or post in a news group. All of these processes uses the same winsock and at the same time. The computer might be a server running several of these process or most commonly a client.   

This layered functional approach might be one of the reason the term "Stack" which is often being used. 

The Application Layer: This is the layer with which the user interface as well as user applications. All user interfaces in term of selection, inputs and commands will be picked up by this layer. There are also background information being passed through this layer by applications. This layer does not transport or ship any data to any place except to the transport layer on one side and the user interface and applications on the other side. It does provide the data presentation routines meaning the agreement on how data is to be represented. Furthermore. this application layer "talks to" and "communicate" with the application layer in the other computer.

Transport Layer  This layer provides the end to end delivery of data. Here is were the terms socket and port fits in. These terms are used to describe the path which applications use to communicate.   This is the Internet layer were the TCP/IP really resides. There are two transport layer services here. TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). The first guarantees that data was received as it was sent (error checking) while the second does not. The ports belongs here. This layer provides source and destination ports.   The data streams coming in (and going out) might  be a mixture of different services like ftp, www, Telnet and chat. Thus, means are needed to direct it to the proper application. When you access these type services your applications knows which ports to address to communicate with these services on the other computer. Your computer will be using a completely different set of ports which is then communicated to the other computer to establish a  line of communication. Typically WWW service will be addressed on port 80 for the server. If this server is also running a proxy server, it will need another port and often it may use <IP address>:8080. This signifies that the proxy needs to be addressed at port 8080. The latest version of the Microsoft Winsock will support a maximum of 32767 sockets.

Ports and associated services and protocols - Trivia (something you don't need to know)

Try running netstat -a from a DOS window while connected

Internet Layer This layer isolates the upper layers represented by the preceding layers from the nitty gritty details of addressing and actually delivering the data. This is were IP (The Internet Protocol) resides. This were addressing, routing and delivery of data is handled. All data flows through this level. The details can be found in RFC 791.

One of the items to remember is that the data which appears from the users point of view of being a stream of data is broken up into small packages and sent as packages. Furthermore, when transmitted the packages might actually take different routes. 

Network Access Layer This is the actual hardware interface that makes the communication occur. This level must know what the data looks like in order for it to be physically package and sent properly. It must be able to frame, understand and utilize the addressing schem. It maps the IP addresses into physical addresses used..  This layer is not seen on the higher levels and is commonly ignored by users.  

The diagram below shows how data moves. It starts with the user or the applications interface with the application layer. This layer puts an 'Envelope' around the data it generated and sends it to the lower level which does its stuff and puts another "envelope" around it. This continues to the bottom layer which ships the data to the router.  The router first opens the last envelope then the second one to determined where it is supposed to go and repackage it and sends it back down and out to the computer it was destined for. The receiving computer unpacks (opens the envelopes) in reverse order. Thus each layer in the sending computer communicates with the same layer in the receiving computer and have no idea of what happened or will happen in the other layers.

If all of this is confusing let me try to provide a simple analogy. The Mail system can be thought of in similar terms:

 

 

Next IP addresses and Subnetting

  Computer 1                                 Gateway/Router                         Computer 2

Application               Application
Transport   Transport
Internet Internet Internet
Network Network Network

The Data moves down                 Here it moves up -                      This place unpacks the info that

and additional information            The network and Internet             has been added at the same

is added to the data in each          data is unwrapped in order         level it was added.

layer                                            Then back down and data added

Some key documents RFC (request for comments which applies)

RFC 791 The Internet Protocol

RFC 792   Internet control Message protocol

RFC 793 TCP Transmission Control Protocol

RFC 768 UDP User Datagram Protocol

REC 826 ARP Ethernet Address Resolution Protocol

RFC 894 Transmission of IP Datagrams

RFC 821 SMTP Simple mail transfer Protocol

RFC 854 Telnet

RFC 959 FTP File Transfer Protocols

RFC 1058 RIP Routing Information Protocol

RFC 1035 DNS Domain Name Service

RFC 1094 NFS Network File system

RFC 1180 A TCP/IP Tutorial

 

Copyrighted All rights reserved
Last revised: June 07, 1999
.