01 Framing-1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Data Link Layer

Unit 2

04/01/2024
Purpose of the Data Link Layer​

The Data Link Layer​


• The Data Link layer is responsible for communications between end-
device network interface cards.​
• It allows upper layer protocols to access the physical layer media
and encapsulates Layer 3 packets (IPv4 and IPv6) into Layer 2 Frames.​
• It also performs error detection and rejects corrupts frames.​

04/01/2024
Purpose of the Data Link Layer​

The Data Link Layer​Duties

04/01/2024
Purpose of the Data Link Layer

Position of Data Link Layer

04/01/2024
​ Data Link Sublayers
Ethernet Frames

The 802 LAN/MAN standards,


including Ethernet, use two separate
sublayers of the data link layer to
operate:

• LLC Sublayer: (IEEE 802.2) Places


information in the frame to
identify which network layer
protocol is used for the frame.

• MAC Sublayer: (IEEE 802.3,


802.11, or 802.15) Responsible for
data encapsulation and media
access control, and provides data
link layer addressing.

Computer Networks 04/01/2024


​Data Link Frame
The Frame​

Data is encapsulated by the data link layer with a header and a trailer to
form a frame.

A data link frame has three parts:​
•Header​
•Data​
•Trailer​

The fields of the header and trailer vary according to data link layer
protocol.​

​ he amount of control information carried with in the frame varies


T
accordingComputer
to access
Networks
control information and logical topology.​ 04/01/2024
Data Link Frame ​
​Frame Fields

Field​ Description​
Frame Start and Stop​ Identifies beginning and end of frame​
Addressing​ Indicates source and destination nodes​
Type​ Identifies encapsulated Layer 3 protocol​
Control​ Identifies flow control services ​
Data​ Contains the frame payload​
Error Detection​ Used for determine transmission errors​

04/01/2024
Data Link Frame
​Layer 2 Addresses​
•Also referred to as a physical address.​
•Contained in the frame header.​
•Used only for local delivery of a frame on the link.​
•Updated by each device that forwards the frame.

Computer Networks
04/01/2024
Data Link Layer
​FRAMING

The data link layer needs to pack bits into frames, so that each
frame is distinguishable from another. Our postal system practices
a type of framing.

The simple act of inserting a letter into an envelope separates one


piece of information from another; the envelope serves as the
delimiter. ​

Fixed-Size Framing:– no boundaries for frames, size used as the


delimeter

Variable-Size Framing:– define begining and end of frame,


character oriented or bit oriented approach
Computer Networks 04/01/2024
Data Link Layer
​ FRAMING

Character-oriented
protocol: In a character-
oriented protocol, data to
be carried are 8- bit
characters from a coding
system such as ASCII . The
header, which normally
carries the source and A frame in a character-oriented protocol
destination addresses and
other control information, To separate one frame from the next, an 8-bit (1-
and the trailer, which byte) flag is added at the beginning and the end of
carries error detection or a frame.
error correction redundant The flag, composed of protocol-dependent special
bits, are also multiples of 8 characters, signals the start or end of a frame.
bits. Figure shows the format of a frame in a character-
oriented protocol 04/01/2024
Computer Networks
Data Link Layer
​ FRAMING

Bit-oriented protocol: In a bit-oriented protocol, the data section of a frame is a sequence


of bits to be interpreted by the upper layer as text, graphic, audio, video, and so on.
However, in addition to headers (and possible trailers), we still need a delimiter to separate
one frame from the other.

Most protocols use a special 8-bit pattern flag 01111110 as the delimiter to define the
beginning and the end of the frame, as shown in Figure.

A frame in a bit-oriented protocol


Computer Networks 04/01/2024
Data Link Layer
​FRAMING

Byte stuffing and unstuffing


(Used in Character-oriented protocols)

Byte stuffing is the process of adding 1 extra byte whenever there is a


flag or escape character in the text.

Computer Networks 04/01/2024


Data Link Layer
​FRAMING
Framing : Byte Stuffing

(a) A frame delimited by flag bytes.


(b) Four examples of byte sequences before and after stuffing.

Computer Networks 04/01/2024


Data Link Layer
​FRAMING

Bit stuffing and unstuffing


(Used in Bit-Oriented Protocols)

Bit stuffing is the process of adding one extra 0 whenever five


consecutive 1s follow a 0 in the data, so that the receiver does not
mistake the pattern 0111110 for a flag.

A frame in a bit-oriented protocol


Computer Networks 04/01/2024
Data Link Layer
​FRAMING: Bit stuffing and unstuffing

Computer Networks 04/01/2024


​ Ethernet Frame Fields
Ethernet Frames

• The minimum Ethernet frame size is 64 bytes and the maximum is 1518 bytes.
The preamble field is not included when describing the size of the frame.
• Any frame less than 64 bytes in length is considered a “collision fragment” or
“runt frame” and is automatically discarded. Frames with more than 1500 bytes of
data are considered “jumbo” or “baby giant frames”.
• If the size of a transmitted frame is less than the minimum, or greater than the
maximum, the receiving device drops the frame. Dropped frames are likely to be
the result of collisions or other unwanted signals. They are considered invalid.
Jumbo frames are usually supported by most Fast Ethernet and Gigabit Ethernet
switches and NICs.

Computer Networks 04/01/2024


​ Ethernet Frame Fields
Ethernet Frames

The MAC sublayer is responsible for data encapsulation and


accessing the media.

Data Encapsulation
IEEE 802.3 data encapsulation includes the following:
1. Ethernet frame - This is the internal structure of the Ethernet frame.
2. Ethernet Addressing - The Ethernet frame includes both a source and
destination MAC address to deliver the Ethernet frame from Ethernet
NIC to Ethernet NIC on the same LAN.
3. Ethernet Error detection - The Ethernet frame includes a frame check
sequence (FCS) trailer used for error detection.

Computer Networks 04/01/2024


​ MAC Sublayer
Ethernet Frames

Media Access
• The IEEE 802.3 MAC sublayer includes the specifications for different
Ethernet communications standards over various types of media
including copper and fiber.
• Legacy Ethernet using a bus topology or hubs, is a shared, half-duplex
medium. Ethernet over a half-duplex medium uses a contention-based
access method, carrier sense multiple access/collision detection
(CSMA/CD).
• Ethernet LANs of today use switches that operate in full-duplex. Full-
duplex communications with Ethernet switches do not require access
control through CSMA/CD

Computer Networks 04/01/2024

You might also like