Packet travelling in layers

3

I want to know how a network packet travels through different layers, i.e. from the physical layer to the presentation layer in Linux systems.

Are there any detailed articles or books on this topic with code?

ranjit

Posted 2010-09-28T18:24:34.990

Reputation: 39

Ummm... sorry to be harsh but.. something is wrong - you failed to google, yet you answered and upvoted hotei's answer on OSI?! OSI is the key to understanding the different layers...you should not have to worry about the layers - let the network layer take care of it for you, OSI layer 4... – t0mm13b – 2010-09-28T21:22:38.167

Answers

2

The OSI layer model isn't how networking is actually programmed. You might check this book if you're interested in C code samples:

http://www.amazon.com/Unix-Network-Programming-Sockets-Networking/dp/0131411551/ref=sr_1_1?s=gateway&ie=UTF8&qid=1285699272&sr=8-1

hotei

Posted 2010-09-28T18:24:34.990

Reputation: 3 645

This book is not what I exactly wanted. It is mostly on tcp/ip. I want codes for other layers also. – ranjit – 2010-09-28T18:58:04.830

By other layers you mean ...? – hotei – 2010-09-28T20:39:01.677

0

not cheap, but one of the definite classics. Richad Stevens: "TCP/IP Illustrated Vol.1 The Protocols". Very thorough, covers of course also UDP, ICMP, etc. pp.

If your're into programming, there's also "TCP/IP Illustrated Vol. 2 The Implementation" by Gary Wright.

knitti

Posted 2010-09-28T18:24:34.990

Reputation: 871

0

7 Application
6 Presentation
5 Session
4 Transport
3 Network
2 Data
1 Physical

TCP / IP combines certain layers

7-5 Application
4   Transport
3   Internetwork
2-1 Network Access

Conceptually the OSI model looks like this

7 Application---- ------------- Application
6 Presentation--- ------------- Presentation
5 Session-------- ------------- Session
4 Transport------ ------------- Transport
3 Network-------- ---Network--- Network
2 Data----------- ---Data------ Data
1 Physical------- ---Physical-- Physical

Each send layer appears to communicate transparently to the corresponding receive layer. In routed networks (middle column) the same is true.

As a packet descends from 7 to 1 each layer attaches header information that the layer below sees as a Protocol Data Unit. As the packet ascends the the model each layer removes the header.

dbasnett

Posted 2010-09-28T18:24:34.990

Reputation: 459