Overclock.net - An Overclocking Community - View Single Post - A guide to the interworkings of the internet
View Single Post
post #7 of (permalink) Old 11-21-2009, 01:08 PM - Thread Starter
Lige
Retired Staff
 
Lige's Avatar
 
Join Date: Jan 2008
Posts: 8,048
Rep: 391 (Unique: 283)
Protocols, OSI and TCP/IP Layer Models, and Packets

Protocols

The OSI Model
The OSI Model was the original foundation of networking as it is known today. The TCP/IP layer is based off of this model. The model's full name is known as the Open Systems Interconnection imitative. There are two contributing factors to this model, the Basic Reference Model and a specific set of Protocols. The OSI Model was developed and is maintained by the International Organization for Standardization. Every layer utilizes its own unique features and brings something different to the table.
OSI Model:
  • Application - This layer in the OSI model, is geared specifically for functions that do not exist in the Presentation or Session layer in regards to protocol implementations. Several of these protocols include:
    Bittorrent,P2P, BOOTP, DHCP, DNS, IMAP, RTP, RPC, SSH, Telnet, VTP, SMTP SMB, OSCAR (AIM), And more
    This layer is present in both the OSI Model and the TCP/IP Model.
  • Presentation - This layer is representative of how the data is formatted, coded, and delivered. It alleivates the need for the Application layer to worry about data, syntax, conversion needs going down the model.
    • Common Application Service Element (CASE) - Usually, common applications are provided with a application specific element that is needed among a variety of programs. In many cases, several CASEs are used by only one application. There are four CASEs that are defined in the OSI Specification, Association Control Service Element, Remote Operations Service Element, Reliable Transfer Service Element, and Commitment, concurrence, and recovery serivce aelements. These all co-ordinate with specific responsibilities in regards to protocols.
      Quote:
      Association control service element (ACSE)—Creates associations between two application entities in preparation for application-to-application communication
      Remote operations service element (ROSE)—Implements a request-reply mechanism that permits various remote operations across an application association established by the ACSE
      Reliable transfer service element (RTSE)—Allows ASEs to reliably transfer messages while preserving the transparency of complex lower-layer facilities
      Commitment, concurrence, and recovery service elements (CCRSE)—Coordinates dialogues among multiple application entities.
    • Specific Application Service Element (SASE) - This sublayer are ASE's that provide a function used only by the corresponding application Process ID. These can include file transfer, database access, or order functions. There is a wide array of what these can provide and what they function with.
  • Session - The session layer is responsible for synchronizing, collaborating, establishing different streams and making sure that the information is kept on a continuing established connection. A prime example of this is when two video conferencing applications are set up and have an established connection. Say for instance you have Skype up, you see the lips moving, but the audio is two or three seconds late. The Session layer helps keep this syncronized when talking. Another prime example is when using Ventrilo, when you key up to talk, the speaker is green, however at times when you have a high ping, the speaker is yellow and it will take a couple of seconds for it to light up as green.
  • Transport - This layer is the basic set of rules of transporting packets to and from their destination.
    Here is a comparison chart taken from wikipedia and implemented into Google Spreadsheets that shows the TCP/IP Protocols and their services and features they offer.

    Google Spreadsheet

    Again taken from wikipedia
    Quote:
    The OSI model defines five classes of connection-mode transport protocols designated class 0 (TP0) to class 4 (TP4). Class 0 contains no error recovery, and was designed for use on network layers that provide error-free connections. Class 4 is closest to TCP, although TCP contains functions, such as the graceful close, which OSI assigns to the Session Layer. All OSI connection-mode protocol classes provide expedited data and preservation of record boundaries. Detailed characteristics of the classes are shown in the following table.


    Google Spreadsheet

  • Network - This layer controls IP Addressing (192.168.1.1, 67.220.212.115, etc), Message Forwading, and Connection-oriented and Connectionless communication. Message forwarding is the use of a router or gateway to forward and send packets between networks. In many textbooks, and even in Cisco classes, this layer is often associated with the Internet Layer. While a helpful way to study, the classification is wrong due to the differences between protocols of the two Models. This is when the data is referred to as a Packet.
  • Datalink - This layer has two sublayers which are important to both Wide Area Networks, and Local Area Networks. The Data Link layer itself allows for data transfer among two adjacent networking nodes or segments. The frame can change depending on how much information the higher layers need to send or add in overhead for TCP.
    • Logical Link Control (LLC) - This upper sub-layer allows multiple protocols to exist within the same network, and to be allowed to flow and be transferred over the same networking media, such as an Network Interface Card. It does this using multiplexing and flow control. This layer is also responsible for error checking, if it is enabled and notified in the request.
    • Media Access Control (MAC)- This lower sub-layer provides physical addressing, and channel access control so that a device can communicate together while multiple devices exist. This typically is used in a Local Area Network (LAN), or Metropolitan Area Network(MAN). The addressing mechanism used here is commonly referred to as the MAC Address or the Physical Address. Since a MAC address is a unique number, there will never be two devices that have the same MAC address unless configured as such.
  • Physical - This layer is associated with hardware, media, signal, and transmission. The Data Unit here used is a bit, a 1 or 0. Probably by far the most complex layer for the OSI model.

The TCP/IP Model
The TCP/IP Layer was created by the United States Department of Defense under the section of DARPANET. Originally evolving from the original basic internet, of which was a wide area network, called Arpanet. In most networking classes I have been in, the first word you will hear associated with this is usually the DoD or the Internet model.
TCP/IP Model:
  • Application Layer - Is responsible for such protocols as; http,e-mail, ftp, p2p, etc.
  • Transport Layer - This layer is responsible for directing packets, error correction, flow and segmentation control, and port addressing.
  • Internet Layer - Is the solution for sending data between one or more networks. This relies heavily on IP Addressing and Routing.
  • Hardware Layer - Converts binary code into a usable signal for traveling across medias such as Cat5e, Copper Cabling, Fiber-Optics, etc.

Dissecting a packet to Overclock.net (large image):



In Hexadecimal form, the beginning of the packet looks like this:
Code:
0000  02 04 4b 14 d6 26 00 13  10 f9 4b 62 08 00 45 00   ..K..&.. ..Kb..E.0010  05 dc 41 c7 40 00 34 06  d1 ff 43 dc d4 73 0a 0a   [email protected] ..C..s..0020  0a fc 00 50 05 0a 54 65  a7 c3 e6 22 0f 89 50 10   ...P..Te ..."..P.0030  1e ae d5 0c 00 00 48 54  54 50 2f 31 2e 31 20 32   ......HT TP/1.1 20040  30 30 20 4f 4b 0d 0a 44  61 74 65 3a 20 54 75 65   00 OK..D ate: Tue0050  2c 20 32 34 20 4e 6f 76  20 32 30 30 39 20 30 37   , 24 Nov  2009 070060  3a 35 31 3a 32 37 20 47  4d 54 0d 0a 53 65 72 76   :51:27 G MT..Serv0070  65 72 3a 20 41 70 61 63  68 65 0d 0a 58 2d 50 6f   er: Apac he..X-Po0080  77 65 72 65 64 2d 42 79  3a 20 50 48 50 2f 35 2e   wered-By : PHP/5.0090  31 2e 36 0d 0a 43 61 63  68 65 2d 43 6f 6e 74 72   1.6..Cac he-Contr00a0  6f 6c 3a 20 70 72 69 76  61 74 65 2c 20 6d 61 78   ol: priv ate, max00b0  2d 61 67 65 3d 30 0d 0a  50 72 61 67 6d 61 3a 20   -age=0.. Pragma: 00c0  70 72 69 76 61 74 65 0d  0a 58 2d 55 41 2d 43 6f   private. .X-UA-Co00d0  6d 70 61 74 69 62 6c 65  3a 20 49 45 3d 37 0d 0a   mpatible : IE=7..00e0  43 6f 6e 74 65 6e 74 2d  45 6e 63 6f 64 69 6e 67   Content- Encoding00f0  3a 20 67 7a 69 70 0d 0a  43 6f 6e 74 65 6e 74 2d   : gzip.. Content-0100  4c 65 6e 67 74 68 3a 20  33 38 35 31 39 0d 0a 45   Length:  38519..E0110  78 70 69 72 65 73 3a 20  54 75 65 2c 20 32 34 20   xpires:  Tue, 24 0120  4e 6f 76 20 32 30 30 39  20 30 37 3a 35 31 3a 32   Nov 2009  07:51:20130  37 20 47 4d 54 0d 0a 43  6f 6e 74 65 6e 74 2d 54   7 GMT..C ontent-T0140  79 70 65 3a 20 74 65 78  74 2f 68 74 6d 6c 3b 20   ype: tex t/html; 0150  63 68 61 72 73 65 74 3d  49 53 4f 2d 38 38 35 39   charset= ISO-88590160  2d 31 0d 0a 0d 0a 1f 8b  08 00 00 00 00 00 00 ff   -1...... ........0170  ec bd 69 77 db d6 d5 06  fa 39 5d ab ff e1 98 69   ..iw.... .9]....i0180  2b 27 15 48 02 e0 28 5b  f2 d5 68 ab d5 54 49 1e   +'.H..([ ..h..TI.0190  da dc 2c 05 24 41 11 16  09 30 00 28 8a e9 7b ff   ..,.$A.. .0.(..{.01a0  fb 7d f6 3e 00 08 90 e0  04 49 89 54 cb 19 4c 82   .}.>.... .I.T..L.01b0  38 f3 3e 7b 1e de be da  3b dd bd fc f7 d9 be e8   8.>{.... ;.......01c0  f8 bd ae 38 fb b8 73 74  b8 2b 72 4a a1 f0 59 df   ...8..st .+rJ..Y.01d0  2d 14 f6 2e f7 c4 97 0f  97 c7 47 42 cd 17 c5 a5   -....... ..GB....01e0  6b d8 9e e5 5b 8e 6d 74  0b 85 fd 93 9c c8 75 7c   k...[.mt ......u|01f0  bf bf 51 28 0c 87 c3 fc  50 cf 3b ee 75 e1 f2 bc   ..Q(.... P.;.u...0200  70 47 7d a9 d4 38 f8 a8  f8 b1 96 f9 96 df ca 6d   pG}..8.. .......m0210  fd f9 4f 6f 79 c4 bb 5e  d7 f6 36 53 fa 51 eb f5   ..Ooy..^ ..6S.Q..0220  ba 6c 9e 13 2d cb dd cc  75 7d 37 27 ba 86 7d bd   .l..-... u}7'..}.0230  99 33 6d d9 81 69 b4 d0  d1 77 6f 5f 29 8a b0 1d   .3m..i.. .wo_)...0240  d1 34 9a 1d 53 74 f0 d4  74 3d a1 28 fc 5b cf f4   .4..St.. t=.(.[..0250  0d 2c ce ef 2b e6 af 03  eb 76 33 77 e6 1a d7 3d   .,..+... .v3w...=0260  23 27 9a 8e ed 9b b6 bf  99 b3 1d 85 5b e6 44 21   #'...... ....[.D!0270  bd c5 fe 5d df 72 4d 2f  d6 44 51 67 be bc 4b 93   ...].rM/ .DQg..K.0280  50 76 d1 b9 eb 74 63 4d  26 47 a1 39 9b 76 6b e6   Pv...tcM &G.9.vk.0290  bc bb 96 7d 23 5c b3 bb  99 6b 1a b6 63 5b 4d 03   ...}#\\.. .k..c[M.02a0  bd 75 5c b3 9d d8 2c e7  d6 74 9b 5d a7 79 93 b7   .u\\...,. .t.].y..02b0  4d bf 40 93 fa d3 5b 5e  b1 6d f4 cc cd 1c 7e b5   [email protected][^ .m....~.02c0  da 23 e5 16 d3 8d 96 5b  e9 fd fd a6 5b 18 5c de   .#.....[ ....[.\\.02d0  1c 7d fe 62 9e 79 d7 e7  7a d1 fe a7 dd 1a 7e dc   .}.b.y.. z.....~.02e0  6b d5 ea e7 95 ff f4 ad  d3 ae f5 f9 e2 e4 d3 4d   k....... .......M02f0  73 33 27 e8 a0 a6 b6 90  56 87 ad 53 2e 47 7d 33   s3'..... V..S.G}30300  d6 b3 6f de f9 05 3a d5  37 a2 d9 31 5c cf f4 37   ..o...:. 7..1\\..70310  0f 2f 4e 95 5a ad 5c 0f  37 2c 3e b9 6b d3 36 5d   ./N.Z.\\. 7,>.k.6]0320  c3 77 70 ac d1 e4 6e 77  06 dd ae e9 5b b6 d0 f3   .wp...nw ....[...0330  b5 7c 49 ee 72 38 05 b9  a6 1b 73 34 74 dc 56 fc   .|I.r8.. ..s4t.V.0340  38 a2 5d b0 ec eb f5 e8  cb f8 93 68 3b ee a0 17   8.]..... ...h;...0350  fb de 74 7a fd 81 6f 62  64 3a f2 f8 a4 5a a6 d7   ..tz..ob d:...Z..0360  74 ad 3e 01 79 6c 5a db  b6 88 ba c5 18 b2 3f d1   t.>.ylZ. ......?.0370  32 6f 1d df 6c 09 df 11  3d e3 ce ea 59 bf d1 6f   2o..l... =...Y..o0380  3e 60 b0 6f ba 18 b2 67  d8 4d 53 38 6d 71 ed 1a   >`.o...g .MS8mq..0390  fd 8e d5 f4 00 a1 98 f8  ba d8 3d fb 88 ff f7 1c   ........ ..=.....03a0  bc ea 36 1c f9 ec 7c fb  58 18 80 07 13 67 36 f2   ..6...|. X....g6.03b0  3b d4 93 d9 f5 4c 0c 35  c0 53 0b 17 af 65 8a 91   ;....L.5 .S...e..03c0  33 70 b1 59 72 f2 e8 cd  33 f3 e1 16 61 19 04 52   3p.Yr... 3...a..R03d0  bb 17 17 e2 c2 1f 75 4d  af 63 9a be bc 04 6f 3d   ......uM .c....o=03e0  7a 20 7c 9c d6 66 8e 0f  a9 e9 61 fb ac 16 00 a4   z |..f.. ..a.....03f0  11 ec f7 15 3d c2 5e 14  7e fc f1 cf 7f fa 51 4c   ....=.^. ~.....QL0400  9c 03 75 4b 8f b9 e7 0d  b1 f6 99 26 f3 c9 32 87   ..uK.... ...&..2.0410  6b 6f e4 33 71 b8 b7 21  d4 12 de 29 fc f9 4f 0d   ko.3q..! ...)..O.0420  a7 35 fa f3 9f fe 8b 9b  d9 30 9a 37 d7 2e ad 60   .5...... .0.7...`0430  43 7c 5f aa 94 2b 95 9d  37 78 dc 74 ba 8e 8b 27   C|_..+.. 7x.t...'0440  6d fe 43 4f da 80 a8 0d  51 ef fb 02 cb 6f 19 b6   m.CO.... Q....o..0450  b1 2e 08 3c 6e f1 77 77  d0 b4 5a f8 7b 4d 7e a0   ...<n.ww ..Z.{M~.0460  cd b4 5b e6 da ba 30 5c  cb e8 ae e3 be 77 6f 01   ..[...0\\ .....wo.0470  31 4d bc e2 01 3f 29 1e  c1 3c f5 d9 33 dc 6b cb   1M...?). .<..3.k.0480  de 10 c5 fe 5d fc 3f fa  a9 6f b4 5a d8 61 fe 0d   ....].?. .o.Z.a..0490  df ff bf 3f ff c9 d8 a0  0b b7 2e 68 ee 57 06 7d   ...?.... ...h.W.}04a0  96 2b 08 a7 aa e1 4f 7d  37 7c f7 d6 02 1e 34 5b   .+....O} 7|....4[04b0  e1 eb c1 d7 79 2d 3a 04  3f 98 f3 86 d1 f4 ad 5b   ....y-:. ?......[04c0  33 6c c9 8f 93 ed 0e 0e  4a a5 62 51 8e 94 ef 1b   3l...... J.bQ....04d0  d7 e6 6a 5b 89 b5 f8 98  98 df 59 17 7d 6c 9e 25   ..j[.... ..Y.}l.%04e0  5b 3f c2 fe 62 a0 bc df  c0 4d 34 dd 94 19 56 6a   [?..b... .M4...Vj04f0  d5 52 4d a7 bd 0e 77 b0  c8 7f e8 89 6c 04 78 c1   .RM...w. ....l.x.0500  c1 78 4e d7 6a c5 60 83  7b 6d 1a 7e 4a 97 e8 70   .xN.j.`. {m.~J..p0510  67 bb 1c ef f2 80 ff d0  13 b9 be 86 d3 6d 3d 2c   g....... .....m=,0520  10 85 d3 c1 c1 49 f8 c8  fb 98 5c 1a 80 8c 61 99   .....I.. ..\\...a.0530  6e 98 d2 32 9b 0e 90 1b  d0 c8 06 50 bc 6d 62 92   n..2.... ...P.mb.0540  b1 be 22 f8 09 ba 4b 05  a0 95 7a 0c e0 8b fb 8b   .."...K. ..z.....0550  41 59 d0 7f 2a 98 1d 1c  54 2a b4 77 53 f3 c5 75   AY..*... T*.wS..u0560  35 5d 2c 37 9a 34 91 d4  94 03 29 97 ca 66 a5 b5   5],7.4.. ..)..f..0570  f0 40 54 ba 80 0f 76 ad  79 17 69 42 b1 23 a1 af   [email protected] y.iB.#..0580  69 67 12 c1 47 bc 51 6c  ef 65 bb d4 cd 4f 6d 1a   ig..G.Ql .e...Om.0590  6d 72 30 7e 78 97 f3 40  e4 34 83 19 db 7c 70 10   [email protected] .4...|p.05a0  9e 7e db 71 d2 20 7b 7c  35 c2 cb 92 1c 9e 9a c5   .~.q. {| 5.......05b0  96 4b 5f 17 2f 37 68 14  5b ae 6c b7 c4 72 83 a6   .K_./7h. [.l..r..05c0  d1 72 83 ef e3 e5 ca 9e  66 2c 97 a1 8a 76 dc e8   .r...... f,...v..05d0  fa ea ba e0 bf b6 19 eb  a5 c0 d0 41 99 fe 89 c3   ........ ...A....05e0  50 b4 19 41 17 9a ec 42  9b d9                     P..A...B ..
Now, you may be thinking that later stuff just looks like a bunch of jibberish, when will [email protected] ever be used in a transmission? Well, surprisingly, that is all a part of the TCP Segment data. Which contains the data transmission of the website. This is only a part of dozens of packets, each one has its similarities and differences.



Lige is offline