📄 osmod1.02.htm
字号:
<HTML><HEAD>
</HEAD>
<pre>
++++++++++++++++++++++++++++++++++++
+ This tutorial is written by P刎L + Edited By Rek
++++++++++++++++++++++++++++++++++++
+ The OSI-model +
+++++++++++++++++
</pre>
<BODY><BR> <BR> <BR> <BR>
<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>
<P>Have fun... 8) <BR>
<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> <BR>
<P>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<BR>. 7th - layer: Application .>
Services .
<BR>. 6th - layer: Presentation.>
Services .
<BR>. 5th - layer: Session .>
Communication . <BR>. 4th -
layer: Transport .>
Communication . <BR>. 3rd -
layer: Network .>
Communication . <BR>. 2nd -
layer: Data-link .> Physical connections. <BR>. 1st -
layer: Physical .> Physical connections.
<BR><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
<BR>
<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 & connectors belong all to the Physical layer. Devices like
repeaters, hubs & 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 & 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) & 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>- The division of the
binary data stream into discrete packets of a specified length
<BR>- Error detection
<BR>- Error correction
through the retransmission of bad packets
<BR>- 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&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>
<P>TCP Header:
<P>- Source Port
<BR>- Destination Port
<BR>- Sequence number
<BR>- Acknowledgement
number <BR>- Header Length
(Standard 20 Bytes) <BR>-
Flags (syn, ack, psh, fin, rst, urg)
<BR>- Window size
<BR>- Checksum
<P>IP Header:
<P>- IP_v4 or IP_v6
<BR>- Header Length
<BR>- DSF
<BR>- Total Length
<BR>- Identification
<BR>- Flags (Set Fragment
bit or not) <BR>- Fragment
Offset <BR>- TTL
<BR>- Protocol (this case
TCP) <BR>- Header checksum
<BR>- Source IP
<BR>- 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>
<P>Computer
A
Computer B
<BR>==========
==========
<P>1) SYN -->
<BR>2)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -