Wednesday, November 5, 2008

Basic TCP/IP Layering Concept-1

After two heavy human tendency interpretation posts, I wanted to continue with a light one based on TCP/IP stack. This is the way I interpret TCP/IP.

NOTE: This article is intended for newbeis in Computer Networks with basic understanding of protocols used at various layers. This might help you understand the physical significance of TCP/IP.


Although there are various articles available on net, the reason I decided to write about it is none actually explain the layering and its need. I try to reason out layering here.

I have been studying it for almost 2-3 years now. However, I wasn't sure about significance of layering in TCP unless I worked on a full-fledged project which was a couple of years back. Still on with another one within same field.

The layering concept in TCP/IP is inspired from ISO-OSI model. Though OSI reference stack was never actually implemented per se, it definetly had laid a basic structure for other stacks to develop. TCP/IP is one of those.

TCP/IP basically consists of following layers:

Application Layer (equivalent to Application, Presentation, Session in OSI)
Transport Layer
Internet Layer (equivalent to Network Layer in OSI)
Link Layer

TCP/IP is called so because because it uses Transmission Control Protocol(TCP) at Transport Layer and uses Internet Protocol(IP) at Internet Layer. Note that Internet and IP are different. IP is the protocol which is used to connect various internetworks. Internet is World Wide Web(WWW).

Getting to the layering. This is how the process works: Starting from the application layer down, every layer will attach its own header to the payload. When it reaches lowest layer the data would be sent in form of bits on the path towards destination. Lets say it reaches some intermediate node (router) in the way. This router will strip the link layer header and will have network layer header to deal with. It will look at the destination address in the header and decide where to forward the packet next. It will then again attach the link layer header and forward the packet on the path to its destination. Evry other router in the way will do the same to identify where the packet should be forwarded until it gets to its destination. Once in the destination TCP layer will perform its function and hand it over to appropriate application.
Thus the packet on its journey from source to destination passes through these layers several times.

The reason people went for layering is explained in part 2.

No comments:

Post a Comment