⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osmod1.02.htm

📁 黑客培训教程
💻 HTM
📖 第 1 页 / 共 2 页
字号:


<HTML><HEAD>

</HEAD>

<pre>

                          ++++++++++++++++++++++++++++++++++++ 

                          + This tutorial is written by P刎L + Edited By Rek 

                          ++++++++++++++++++++++++++++++++++++ 

                                   + The OSI-model + 

                                   +++++++++++++++++ 



</pre>

<BODY><BR>&nbsp; <BR>&nbsp; <BR>&nbsp; <BR>&nbsp; 

<P>* Disclaimer <BR>============ 

<P>Off course I take NO responsibility for actions or damage caused by this 

document. All information provided in this tutorial is for educational purpose 

ONLY. 

<P>* Intro <BR>======== 

<P>Well, I've written this tutorial because a friend of mine asked me. I liked 

that because many people would read it and could learn something. Maybe I'll 

write some more tutorials later, but I'm reading lots of tutorials and articles 

myself. So I don't have a lot of time and knowledge to write some good 

tutorials, but I'll try to do my best... (please accept my poor English). I've 

written this tutorial especially for newbies who are interested in 

networking/security and who don't know much about the structure and basics of 

the Internet and its protocols. If you've already some experience with this 

subject I suppose you won't learn much from it though. This document explains 

only the OSI-model in a VERY basic way, so it's easy to understand for newbies. 

If you want to understand the OSI-model completely you'll have to read some more 

tutorials, RFC's and books that you can find on the internet. <BR>&nbsp; 

<P>Have fun... 8) <BR>&nbsp; 

<P>* The OSI-model <BR>=============== 

<P>So, what's the OSI-model? Well in the past, communications between computers 

from different vendors were difficult, because they used different protocols and 

data-formats. So the International Organization for Standardization (ISO) 

developed a communications architecture known as the Open System Interconnection 

(OSI) model that defines standards for linking computers from different vendors. 

The OSI model has been divided into 7 layers, and the second layer contains also 

a few sub-layers (divided by the Institute of Electrical and Electronic 

<BR>Engineers (IEEE) which I won't discuss in this tutorial). Have a look at the 

following table: <BR>&nbsp; <BR>&nbsp; 

<P>&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; 

<BR>. 7th&nbsp; -&nbsp; layer: Application .&gt; 

Services&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . 

<BR>. 6th&nbsp; -&nbsp; layer: Presentation.&gt; 

Services&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . 

<BR>. 5th&nbsp; -&nbsp; layer: Session&nbsp;&nbsp;&nbsp;&nbsp; .&gt; 

Communication&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . <BR>. 4th&nbsp; -&nbsp; 

layer: Transport&nbsp;&nbsp; .&gt; 

Communication&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . <BR>. 3rd&nbsp; -&nbsp; 

layer: Network&nbsp;&nbsp;&nbsp;&nbsp; .&gt; 

Communication&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; . <BR>. 2nd&nbsp; -&nbsp; 

layer: Data-link&nbsp;&nbsp; .&gt; Physical connections. <BR>. 1st&nbsp; -&nbsp; 

layer: Physical&nbsp;&nbsp;&nbsp; .&gt; Physical connections. 

<BR>&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; 

<BR>&nbsp; 

<P>The layers are defined in such a manner so that changes in one layer do not 

require changes in the other layers. The higher layers (5, 6 and 7) are smarter 

than the lower layers; the Application layer can handle the same protocols and 

data-formats used by the other layers, and more. So there is a huge difference 

between the Physical layer and the Application layer. Maybe this isn't clear, 

but you'll (hopefully) understand what I mean after you've read the whole 

document. A request, generated at the top (for example the application Layer) 

travels <BR>down six layers to the bottom, or physical layer. Maybe you'll 

think: "Why are there different layers?" Well, the answer is quite simple: Each 

layer has its own task(s) to perform, let's have a look at the physical layer 

first: 

<P>* The Physical layer (1) <BR>======================== 

<P>This is the simplest layer; it only has to deal with the electrical (and 

optical) connections between devices. Binary data is encoded into impulses 

suitable for transmission over the network medium. For example wires, cables, 

transceivers &amp; connectors belong all to the Physical layer. Devices like 

repeaters, hubs &amp; network cards belong also to this layer. 

<P>* The Data-link layer (2) <BR>========================= 

<P>This layer is a little bit "smarter" than the physical layer, because it 

provides the reliable transfer of data. As the interface between the network 

medium and the higher-level protocols and layers, the data link layer is 

responsible for the final packaging of the upper-level binary data into discrete 

packets before it goes to the physical layer. It sends frames (blocks of data) 

across a network. Ethernet (802.2 &amp; 802.3), Tokenbus (802.4) and Tokenring 

(802.5) are protocols at the Data-link layer. 

<P>* The Network layer (3) <BR>======================= 

<P>The primary task of the network layer is to provide the routing functionality 

by which packets can be sent across the boundaries of the local network segment 

to a destination that may be located on an adjacent network or on one thousands 

of miles away. IP, Internet Protocol, is mostly used for this task. Another 

protocol on the Network layer is IPX, Internet Packet eXchange. The Novell 

incorporation has programmed this protocol and some others too, like SPX 

(Sequence Packet Exchange) &amp; NCP (Netware Core Protocol). These protocols 

have been imported at the Netware Operating System. A few functions that may 

take place at the network layer: 

<P>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The division of the 

binary data stream into discrete packets of a specified length 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error detection 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Error correction 

through the retransmission of bad packets 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Flow control 

<P>* The Transport layer (4) <BR>========================= 

<P>Well, this layer transports data, using protocols like UDP, TCP and/or SPX 

(Sequence Packet eXchange, this one is also used by NetWare, but it&amp;rsquo;s 

in contrast to IPX connection-oriented). The Transport layer is the centre of 

the OSI-model. This layer provides reliable, transparent transfer of data 

between end points, this layer provides also multiplexing, flow control and 

error checking/recovery. 

<P>* The TCP/IP protocol-suite and a few other protocols 

<BR>===================================================== 

<P>Before I'll go on with the fifth layer in the OSI-model, I want to explain 

something about the most common protocols at this moment: TCP/IP. If you already 

know the basics of TCP/IP it's advisable to skip this part and read further 

about the session layer. 

<P>* TCP/IP <BR>======== 

<P>TCP stands for 'Transmission Control Protocol' and almost all computers are 

compatible with this protocol. TCP is connection-based, that means it 

establishes a (constant) connection between two computers and transfers the data 

between the two hosts. A packet contains a header and a data gram. In the data 

gram you'll find the data, in the header(s) of a packet is important information 

mentioned: <BR>&nbsp; 

<P>TCP Header: 

<P>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source Port 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Destination Port 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sequence number 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Acknowledgement 

number <BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header Length 

(Standard 20 Bytes) <BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

Flags (syn, ack, psh, fin, rst, urg) 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Window size 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Checksum 

<P>IP Header: 

<P>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IP_v4 or IP_v6 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header Length 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DSF 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Total Length 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Identification 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Flags (Set Fragment 

bit or not) <BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fragment 

Offset <BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TTL 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Protocol (this case 

TCP) <BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Header checksum 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Source IP 

<BR>-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Destination IP 

<P>If you want to know how a connection is established, please read on... 

<P>First a packet with the SYN-flag has to be send to the destination IP, the 

destination will respond with an ACK(SYN) flag or a packet with the RST-flag. 

I'll explain: SYN stands for SYN-(chronisation), so it's used to 'ask' the 

destination computer to establish a connection, when it's accepted, it replies 

with a packet with the ACK(SYN) flag. ACK stands for ACK-(nowledgement). After 

receiving the packet with the ACK(SYN) flag, the computer sends back an ACK to 

tell the other host the connection is established. This is what we call the 

'Three-Way-Handshake'. If the connection is established and one of the two hosts 

wants to disconnect, it sends a packet with the FIN-flag set (FIN stands for 

FINish). This table will make this (hopefully) a bit clearer: <BR>&nbsp; 

<P>Computer 

A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

Computer B 

<BR>==========&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

========== 

<P>1) SYN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --&gt; 

<BR>2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -