You are on page 1of 31

Layer 2 - Concepts

• data sent out on a network is from a source


and is going to a destination
• the data link layer of the OSI model provides
access to the networking media and physical
transmission across the media
• the data link layer also handles error
notification, network topology, and flow
control
Layer 2
• Layer 1 cannot communicate with the upper-level
layers; Layer 2 does that with Logical Link Control
(LLC)
• Layer 1 cannot name or identify computers; Layer 2
uses an addressing (or naming) process
• Layer 1 can only describe streams of bits; Layer 2
uses framing to organize or group the bits
• Layer 1 cannot decide which computer will transmit
binary data from a group that are all trying to
transmit at the same time. Layer 2 uses a system
called Media Access Control (MAC)
LAN Standards
• IEEE standards (including
IEEE 802.3 and IEEE 802.5)
are the predominant and
best known LAN standards
in the world today
• IEEE standards involve only
the two lowest layers,
therefore the data link layer
is broken into two parts
– the technology-independent
802.2 LLC standard
– the specific, technology-
dependent parts that
incorporate Layer 1
connectivity
LAN Standards
• The IEEE divides the OSI data link
layer into two separate sublayers.
Recognized IEEE sublayers are:
– Media Access Control (MAC) (transitions
down to media)
– Logical Link Control (LLC) (transitions up
to the network layer)
IEEE model vs. OSI model

• IEEE standard
– it defines its own layer (LLC), including its own
Protocol Data Unit (PDU)
– the MAC layer standards, 802.3 and 802.5, cross
over the Layer 2/Layer 1 interface
• NIC is where the Layer 2 MAC address
resides
– in many technologies the NIC also has the
transceiver (a Layer 1 device) built into it and
connects directly to the physical medium
– it would be accurate to characterize the NIC as
both a Layer 1 and a Layer 2 device
Logical Link  Control (LLC)
• logical link sublayer allows part of the data link layer
to function independently from existing technologies
• LLC takes the network protocol data, an IP packet,
and adds more control information to help deliver the
IP packet to its destination
• adds two addressing components of the 802.2
specification - the Destination Service Access Point
(DSAP) and the Source Service Access Point (SSAP)
• This repackaged IP packet then travels to the MAC
sublayer for handling by the required specific
technology for further encapsulation and data
Logical Link  Control (LLC)

• LLC sublayer of the data link layer


manages communications between
devices over a single link on a network
• LLC is defined in the IEEE 802.2
specification and supports both
connectionless and connection-
oriented services
MAC sublayers
• Media Access Control (MAC) sublayer deals
with the protocols that a host follows in order
to access the physical media
• IEEE 802.3 frames begin with an alternating
pattern of 1s and 0s called the Preamble:
tells a receiving station that a frame is
coming.
• Followed by the destination and source
physical address fields. Aka MAC address
layer addresses.
Layer 2 Concepts
Layer 2 has four main concepts that you must
learn:
1. Layer 2 communicates with the upper-level layers
through Logical Link Control (LLC).
2. Layer 2 uses a flat addressing convention (Naming
refers to the assignment of unique identifiers -
addresses).
3. Layer 2 uses framing to organize or group the data.
4. Layer 2 uses Media Access Control (MAC) to choose
which computer will transmit binary data, from a
group in which all computers are trying to transmit at
the same time
Hexadecimal numbers
• Decimal numbers express a Base 10
system
• Binary numbers express a Base 2
system
• Hexadecimal (hex) or base 16 system
• Hex is a shorthand method for
representing the 8-bit bytes that are
stored in the computer system
MAC Addresses
• MAC addresses are 48 bits in length and are
expressed as twelve hexadecimal digits
• first six hexadecimal digits, which are
administered by the IEEE, identify the
manufacturer or vendor and thus comprise
the Organizational Unique Identifier (OUI)
• remaining six hexadecimal digits comprise
the interface serial number, or another value
administered by the specific vendor
Basic hexadecimal (hex)
numbering
• Hexadecimal is a
Base 16 numbering
system that is used
to represent MAC
addresses
• 0,1,2,3,4,5,6,7,8,9,a,
b,c,d,e,f
• Conversions
Data link layer MAC identifiers

• at the data link layer, a header, and


possibly a trailer, is added to upper
layer data
• header and trailer contain control
information intended for the data link
layer entity in the destination system
MAC Addresses
• Media Access Control address (or MAC
address), the physical address is located on
the Network Interface Card (NIC)
• the hardware manufacturer assigns a
physical address to each NIC
• if the NIC is replaced the physical address of
the station would change to that of the new
MAC address
– 0000.0c12.3456
– 00-00-0c-12-34-56
How NICs use MACs
• when one device wants to send data to another device, it can
open a communication pathway to the other device by using its
MAC address
• a source device sends data out on a network, the data carries
the MAC address of its intended destination
• the NIC in each device on the network checks to see if its MAC
address matches the physical destination address carried by
the data frame. If there is no match, the NIC discards the data
frame
• When the data passes its destination station, the NIC for that
station makes a copy, takes the data out of the envelope and
gives it to the computer
Layer 2
Encapsulation and decapsulation
• An important part of both encapsulation
and decapsulation is the addition of
source and destination MAC addresses
• Information cannot be properly sent or
delivered on a network without these
addresses
Limitations of MAC addressing

• MAC addresses do have one major


disadvantage: they have no structure,
and are considered flat address spaces
Framing
• Helps obtain essential information that could
not, otherwise, be obtained with coded bit
streams alone
– which computers are communicating with one
another
– when communication between individual
computers begins and when it terminates
– a record of errors that occurred during the
communication
– whose turn it is to "talk" in a computer
"conversation"
Frame format diagram
• frame format
diagram
– shows different
groupings of bits
(fields) that
perform other
functions
Generic frame format
• single generic
frame has
sections called
fields
• each field is
composed of
bytes
Generic frame format
• Frame start fields - beginning signaling
sequence of bytes
• Address fields - naming information
such as the name of the source
computer (MAC address) and the
name of the destination computer
(MAC address)
Generic frame format
• Length/type fields
– a length field specifies the exact length of
a frame
– type field which specifies the Layer 3
protocol making the sending request
– Or this field doesn’t exist at all
Generic frame format
• Data fields - data package you want to
deliver has two parts
– the message you want to send
– the encapsulated bytes that you want to
arrive at the destination computer
• padding bytes - added so that the
frames have a minimum length for
timing purposes
Generic frame format
• LLC bytes are also included with the
data field in the IEEE standard frames
– Logical Link Control (LLC) sub-layer takes
the network protocol data, an IP packet,
and adds control information to help
deliver that IP packet to its destination
Generic frame format
• Frame Check Sequence (FCS)
– field contains a number that is calculated by the
source computer and is based on the data in the
frame
– the destination computer receives the frame, it
recalculates the FCS number and compares it
with the FCS number included in the frame
– if the numbers are different, an error is assumed,
the frame is discarded, and the source is asked
to retransmit
Generic frame format
There are three primary ways to calculate the
Frame Check Sequence number:
– cyclic redundancy check (CRC) - performs
polynomial calculations on the data
– two-dimensional parity - adds an 8th bit that
makes an 8 bit sequence have an odd or even
number of binary 1's
– Internet checksum - adds the values of all of the
data bits to arrive at a sum
Generic frame format
• Stop frame field - a formal byte
sequence referred to as an end-frame
delimiter
Definition of MAC
• Media Access Control (MAC) refers to
protocols that determine which computer on
a shared-medium environment (collision
domain) is allowed to transmit the data
• Two broad categories of Media Access
Control:
– deterministic (taking turns)
– non-deterministic (first come, first served).
Deterministic MAC protocols
• Token Ring - special data token
circulates around the ring
• When a host wants to transmit, it
seizes the token, transmits the data for
a limited time, and then places the
token back in the ring
Non-deterministic MAC protocols
• CSMA/CD - Carrier Sense Multiple Access
with Collision Detection
– Everyone on the system listens for quiet, at which
time it’s OK to transmit
– If two people talk at the same time, a collision
occurs, and neither person can transmit
– Everyone else on the system also hears the
collision, waits for silence, and then tries to
transmit
Layer 2 technologies
• Three common technologies. They all specify Layer
2 issues (e.g. LLC, naming, framing, and MAC), as
well as Layer 1 signaling components and media
issues
– Ethernet - logical bus topology (information flow is on a
linear bus) and physical star or extended star (wired as a
star)
– Token Ring - logical ring topology (in other words,
information flow is controlled in a ring) and a physical star
topology (in other words, it is wired as a star) 
– FDDI - logical ring topology (information flow is controlled
in a ring) and physical dual-ring topology (wired as a dual-
ring)

You might also like