Lecture 25 DCN Mac Frame Format
Lecture 25 DCN Mac Frame Format
Lecture 25 DCN Mac Frame Format
Lecture Focus:
Data Link Layer
MAC Frame Format
Data Link Layer
Framing
Main functions of the data link layer:
Framing
Flow control
Error control
Software implemented protocols that provide smooth
and reliable transmission of frames between nodes
Media Access Methods
Framing deals with how to organize the bits that are carried
by the physical layer.
The data link layer packs bits into frames, so that each
frame is distinguishable from another.
Data Link Layer
Framing
Types of Framing
Fixed-Size Framing
Variable-Size Framing
Character-oriented approach
Bit-oriented approach
Data Link Layer
Framing
Types of Framing Variable-Size Framing : Character-oriented approach
Any pattern used for the flag could also be part of the
information.
If this happens, the receiver, when it encounters this pattern in the
middle of the data, thinks it has reached the end of the frame.
Data Link Layer
Framing
Types of Framing Variable-Size Framing : Character-oriented approach
Byte-stuffing:
To fix this problem, a byte-stuffing strategy was added to
character-oriented framing.
In byte stuffing (or character stuffing), a special byte is
added to the data section of the frame when there is a
character with the same pattern as the flag.
The data section is stuffed with an extra byte.
This byte is usually called the escape character (ESC),
which has a predefined bit pattern.
Whenever the receiver encounters the ESC character, it
removes it from the data section and treats the next
character as data, not a delimiting flag.
In byte stuffing, we add 1 extra byte whenever there is a flag or escape character in the text.
Data Link Layer
Framing
Types of Framing Variable-Size Framing : Character-oriented approach
Byte-stuffing:
Byte stuffing by the escape character allows the presence
of the flag in the data section of the frame, but it creates
another problem.
What happens if the text contains one or more escape
characters followed by a flag? The receiver removes the
escape character, but keeps the flag, which is incorrectly
interpreted as the end of the frame.
To solve this problem, the escape characters that are part
of the text must also be marked by another escape
character. In other words, if the escape character is part
of the text, an extra one is added to show that the second
one is part of the text.
Data Link Layer
Framing
Types of Framing Variable-Size Framing : Character-oriented approach
Flag Flag
Data Link Layer
Framing
Types of Framing Variable-Size Framing : Bit-oriented approach
Bit-Stuffing
This flag can create the same type of problem we saw in the byte-
oriented protocols. That is, if the flag pattern appears in the data, we
need to somehow inform the receiver that this is not the end of the
frame.
We do this by stuffing 1 single bit (instead of 1 byte) to prevent the
pattern from looking like a flag.
In bit stuffing, if a 0 and five consecutive 1 bits are encountered, an
extra 0 is added.
This extra stuffed bit is eventually removed from the data by the
receiver.
Note that the extra bit is added after one 0 followed by five 1s
regardless of the value of the next bit.
This guarantees that the flag field sequence does not inadvertently
appear in the frame.
Data Link Layer
Framing
Types of Framing Variable-Size Framing : Bit-oriented approach
Bit-Stuffing
Bit-Stuffing
Bit-Stuffing
Frame Format
The frame contains seven fields:
Preamble
SFD
DA
SA
Length of protocol data unit (PDU)
Upper-layer data
CRC.
Data Link Layer
MAC Sublayer: Framing MAC Frame Format
Preamble:
The first field of the frame contains 7 bytes (56 bits) of alternating
0s and 1s that alerts the receiving system to the coming frame.
The pattern provides only an alert.
The 56-bit pattern allows the stations to miss some bits at the
beginning of the frame.
The preamble is actually added at the physical layer and is not
(formally) part of the frame.
Data Link Layer
MAC Sublayer: Framing MAC Frame Format
Length:
This field is defined as a length field to define the number of bytes in
the data field.
Data:
This field carries data encapsulated from the upper-layer protocols.
It is a minimum of 46 and a maximum of 1500 bytes.
CRC:
This field contains error detection information, in this case a CRC-32.
Data Link Layer
MAC Sublayer: Framing MAC Frame Format
Frame Length
Standards has imposed restrictions on both the minimum and
maximum lengths of a frame.
Data Link Layer
MAC Sublayer: Framing MAC Frame Format
Addressing:
Each station on an Ethernet network (such as a PC, workstation, or
printer) has its own network interface card (NIC).
The NIC fits inside the station and provides the station with a 6-byte
physical address.
The Ethernet address is 6 bytes (48 bits), normally written in
hexadecimal notation, with a colon between the bytes.
Data Link Layer
MAC Sublayer: Framing MAC Frame Format
Example:
Define the type of the following destination addresses:
A. 4A : 30 : 10 : 21 : 10 : 1A
B. 47 : 20 : 1B : 2E : 08 : EE
C. FF : FF: FF: FF : FF : FF
Solution
To find the type of the address, look at the second hexadecimal digit
from the left. If it is even, the address is unicast. If it is odd, the
address is multicast. If all digits are F's, the address is broadcast.
The way the addresses are sent out on line is different from the way
they are written in hexadecimal notation.
This means that the bit that defines an address as unicast or multicast
arrives first at the receiver.
Data Link Layer
MAC Sublayer: Framing MAC Frame Format
Exercises:
What is the hexadecimal equivalent of the following Ethernet address?
01011010 00010001 01010101 00011000 10101010 00001111
How does the Ethernet address 1A:2B:3C:AD:5E:6F appear on the line
in binary?
If an Ethernet destination address is 07:01:02:03:04:05, what is the
type of the address (unicast, multicast, or broadcast)?
The address 43:7B:6C:DE:10:00 has been shown as the source
address in an Ethernet frame. The receiver has discarded the frame.
Why?
An Ethernet MAC sublayer receives 42 bytes of data from the upper
layer. How many bytes of padding must be added to the data?
An Ethernet MAC sublayer receives 1510 bytes of data from the upper
layer. Can the data be encapsulated in one frame? If not, how many
frames need to be sent? What is the size of the data in each frame?