Você está na página 1de 3

OSI Reference Model: Layer 2 Hardware

In my last article, I introduced the Open System Interconnect (OSI) reference model and
discussed it's first layer; the Physical Layer. In this article I will discuss the second layer, the
Data Lin Layer, from a hardware perspecti!e.
"he data lin layer pro!ides functional and procedural methods of transferrin# data
$etween two points. "here are fi!e #eneral functions which the Data Lin layer is responsi$le
for. "hese functions are%
Lo#ical Lin &ontrol
'edia (ccess &ontrol
Data )ramin#
(ddressin#
*rror Detection
Logical Link Control
"he Lo#ical Lin &ontrol (LL&) is usually considered a su$layer of the Data Lin layer
(DLL), as opposed to a function of the DLL. "his LL& su$layer is primarily concerned with
multiple+in# protocols to $e sent o!er 'edia (ccess &ontrol ('(&) su$layer. "he LL& does
this $y splittin# up the data to $e sent into smaller frames and addin# descripti!e information
to these frames, called headers.
Media Access Control
Lie LL&, the 'edia (ccess &ontrol ('(&) is considered a su$layer of the DLL, as opposed
to a function of the DLL. Included in this su$layer is what is nown as the '(& address. "he
'(& address pro!ides this su$layer with a uni,ue identifier so that each networ access
point can communicate with the networ. "he '(& su$layer is also responsi$le for the
actual access to the networ ca$le, or communication medium.
Data Framing
If one were to simply send data out onto the networ medium not much would happen. "he
recei!er has to now how, and when, to read the data. "his can happen in a num$er of ways
and is the sole purpose of framin#. In #eneral terms, framin# or#ani-es the data to $e
transferred and surrounds this data with descripti!e information, called headers. .hat, and
how much, information these headers contain is determined $y the protocol used on the
networ, lie *thernet.
"he structure of a frame adherin# to the *thernet protocol is shown $elow in )i#ure /.
Figure 1: Structure of an *thernet frame (&ourtesy% .iipedia)
Addressing
(ddressin# in layer 0 happens, as I mentioned earlier, with the '(& address of the '(&
su$layer. It is !ery important not to confuse this with networ or IP addressin#. It can $e
helpful to associate the '(& address with a specific networ access point and the networ or
IP address associated with an entire de!ice (i.e. a computer, ser!er, or router).
Speain# of routers, eep in mind that routers operate in layer 1, not layer 0. Switches and
hu$s do operate in layer two, and therefore direct data $ased on layer 0 addressin# ('(&
addresses) and are unaware of IP or networ addressin#. (nd, 2ust so that I don't #et an in$o+
filled with complaints ... yes I now... some routers also include layer 0 functionality. I will
discuss routers with layer 0 functionality in another future article.
Error Detection and Handling
.hene!er data is sent o!er any ind of transmission medium, there e+ists a chance that the
data will not $e recei!ed e+actly as it was sent. "his can $e due to many factors includin#
interference and, in the case of lon# transmissions, si#nal attenuation. So, how can a recei!er
now if the data recei!ed is error free3 "here are se!eral methods that can $e implemented to
accomplish this. Some of these methods are simple and somewhat effecti!e 4 others are
complicated and !ery effecti!e.
Parity $its are an e+ample of an error detection protocol that is simple and, despite its limited
effecti!eness, its use is widespread. ( parity $it, simply put, is an e+tra $it added to a
messa#e. "here are two options for the !alue of this $it. .hich !alue is chosen depends on
the fla!or of parity $it detection that is in use. "hese two fla!ors are e!en and odd parity
detection. If e!en parity is in use, then the parity $it is set to the !alue ('/' or '5') to mae the
num$er of '/'s in the messa#e e!en. Liewise, if odd parity is in use the parity $it is set to the
!alue needed to mae the num$er of '/'s in the messa#e odd.
.hen usin# parity $it error detection the recei!er will chec all '/'s in the frame, includin#
the parity $it. "he recei!er will ha!e a settin# for e!en or odd parity; if the num$er of '/'s in
the frame does not match this settin#, an error is detected. 6ow this is #reat, $ut as I
mentioned earlier the effecti!eness of this error detection method is limited. It is limited
$ecause if there is an e!en num$er of errors in the frame then the e!enness or oddness of the
num$er of '/'s will $e maintained and this method will fail to detect any errors 4 thus the need
for a more ri#orous error detection method.
( checsum error detection method can #i!e us more ri#or especially if used with a parity $it
method. ( checsum method, as its name su##ests, will $asically chec the sum of all the '/'s
in a messa#e and chec that !alue a#ainst the checsum !alue added $y the sender to the
messa#e. .hile a checsum method can pro!ide more ri#or to your error detection efforts,
there are still limitations. )or e+ample, a simple checsum cannot detect an e!en num$er of
errors which sum to -ero, an insertion of $ytes which sum to -ero, or e!en the re7orderin# of
$ytes in the messa#e. .hile there are some more ad!anced implementations of the checsum
method, includin# )letcher's checsum method, I will discuss an e!en more ri#orous method
here.
One of the most ri#orous methods of error detection is the cyclic redundancy chec (&8&).
.hat a &8& does is con!ert the messa#e to a polynomial where the !alue of the coefficients
correspond to the $its in the messa#e and then di!ide that polynomial $y a predetermined, or
standard, polynomial called a ey. "he answer, more specifically the remainder part of the
answer, is what is sent alon# with the messa#e to the recei!er. "he recei!er performs the
same polynomial di!ision with the same ey and then checs the answer. If the answers
match, then the chances are pretty #ood that there were no errors. I say pretty #ood $ecause
there are a lot of possi$le polynomials one could use for a ey and not all polynomials
pro!ide e,ually #ood error detection. (s a #eneral rule, lon#er polynomials pro!ide $etter
error detection $ut the mathematics in!ol!ed with this are ,uite comple+ and as with many
aspects of technolo#y there is some de$ate as to which implementations of this method
pro!ide the $est error detection.
Lastly, I would lie to point out that these error detection methods are not limited to
transmissions of data o!er a networ medium; they can $e used e,ually well in a data stora#e
scenario where one wants to chec that the data has not $een corrupted.
In my ne+t article I will discuss layer 1 of the OSI model. I will also e+plain in a little more
detail why routers (mostly) $elon# in the 1rd layer and not the 0nd.
OSI Reference Model: Layer 2 hardware [http://windownetwor!ing"co#$"

Você também pode gostar