Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

are sockets layer 4 or 5 in OSI model?

 
Randall Twede
Ranch Hand
Posts: 4520
6
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i searched google if found dissagreement about what layer sockets are at. one person said layer 4 http://www.sju.edu/~jhodgson/systems/network.html the other said layer 5 http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=106659
i kind of think it is layer 5 because there are sockets that use TCP and sockets that use UDP. this suggests that sockets are above the transport layer in the session layer.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're sort of at layer 4 and a half. The OSI model, like many models, is just that: a model. When models are useful, they're good; when they're not -- and when you have to sit about and debate how to apply them, they're not -- then they're not good.
Really, you could make the argument that TCP (which is connection oriented -- i.e., it manages sessions) is in layer 5, while UDP (which is connectionless) is in layer 4 with IP. Where does that put TCP sockets? In layer 6? In layer 5, even thougn they're "on top of" TCP?
The OSI network model is useful as far as thinking about layers of abstraction goes, but there's nothing intrinsically "correct" about it, and the truth is that real networking systems have layers that don't correspond to the OSI layers on a one-to-one basis. As the venerable W. Richard Stevens says in "UNIX Network Programming:"

This model... is a guide, not a specification. ... [T]he networks that we consider in this text (TCP/IP, XNS, and SNA) wew developed before the OSI model. ... [R]ealize that no network is implemented exactly as the OSI model shows.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had one networking class that mostly went over my head. The text called sockets the doorway between application and transport layers. I liked this, too: "The application developer has control of everything on the application-layer side of the socket, but has little control of the transport-layer side of the socket." Little control refers to choosing a protocol and maybe setting some protocol parameters.
The book is Computer Networking, Kurose & Ross, Addison Wesley. I found it pretty accessible for the class, but it gets very low level in a hurry.
 
Randall Twede
Ranch Hand
Posts: 4520
6
Java Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ernest,
i hear ya there. i think my teacher emphasizes the OSI model too much perhaps. seems to me that in real life the TCP-IP protocol stack is what i see (i guess because of the predominance of the Internet). the application takes care of presentation and session as well as application layers (at least in web-apps).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!