0% found this document useful (0 votes)
10 views

L2 - The Data Link Layer

The document discusses the datalink layer of the TCP/IP model, including its functions, sublayers, protocols, devices, frames, and error control. It describes how the LLC and MAC sublayers operate, as well as common data link protocols like Ethernet, PPP, and HDLC.

Uploaded by

Rod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

L2 - The Data Link Layer

The document discusses the datalink layer of the TCP/IP model, including its functions, sublayers, protocols, devices, frames, and error control. It describes how the LLC and MAC sublayers operate, as well as common data link protocols like Ethernet, PPP, and HDLC.

Uploaded by

Rod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 31

TCP/IP MODEL:

Lecture 2: The datalink layer


Objective

• Explain the functions, devices and protocols of


the datalink layer of the TCP/IP networking
model.

• Explain the structure of an Ethernet frame


Introduction
• The data link layer is the first logical layer of TCP/IP model.

• The main responsibility of the datalink layer is to transfer datagrams


from one node to physically adjacent nodes over a link

• Generally, the functions of the datalink layer can be summed up as:


1. Framing – Defines how the bits are grouped into frames,
encapsulation, etc.
2. Error control – Deals with transmission errors
3. Flow control – Regulates the flow of frames
4. Link access management – if it’s a multiple access link
Sublayers of the Data Link Layer

• LLC Sub-layer: Logic Link Control Sub-layer


• MAC Sub-layer : Media Access Control Sub-Layer

Application layer
Transport layer
Network layer
LLC sub-layer
Data link layer
MAC sub-layer
Physical layer
Functions of the LLC sublayer

• LLC lies between the network layer and the MAC sub-layer.
• This sub-layer is responsible for identifying protocols and
encapsulating data for transmission.
• The LLC sub-layer performs most functions of the data link
layer and some functions of the network layer such as
sending and receiving frames.
Functions of the LLC sublayer

• When sending a frame, it adds the MAC address and the cyclic
redundancy checksum (CRC) to the original data; it encapsulates the
data into a header and trailer.

• When receiving a frame, it takes apart the frame and performs address
identification and CRC (Decapsulation)

• It also provides flow control, frame sequence check, and error recovery.

• Besides these, it can perform some of the network functions such as


Functions of the MAC sublayer

• The MAC sub-layer defines how data is transmitted


through physical links (link access management).

• It communicates with the physical layer, specifies physical


addresses, network topologies, and line standards and
performs error notification, sequence transmission and
traffic control etc.
Error control
• Error control is a two fold function.
1. Error detection
Parity check for single bit errors
Checksum for multiple bit / busty errors
Cyclic redundancy checks (CRC) – Widely used on
Ethernet, Wi-Fi networks
2. Error control
Forward error control (FEC) – (No retransmission)
Backward error control (BEC) – (Retransmission)
Flow control
• Flow control restricts the number of frames the sender can send before it
receives an acknowledgement from the receiver.
• Thus, it allows two communicating parties working at different speeds to
communicate without dropping frames.
• At the data link layer, devices use the following flow control methods.
1. Stop and wait:
Sender sends frame and waits for an acknowledgment (ACK) from receiver.
Receiver receives frame and sends An ACK frame
On receiving the ACK, receiver transmits the next frame in queue.
If an ACK is not received within a particular period, sender retransmits the frame.
Flow control

2. Sliding window method


Both sender and receiver have finite sized buffers called sending
windows.

Sender sends multiple frames in sequence based on the buffer


size without waiting for an ACK.

On receiving an ACK, sender sends the next frame in sequence.


Link access management
• In case of single multiple access links, the data link layer
performs link access management to prevent collisions on
the link.

• There are three broad categories of link access.

1. Channel partitioning – TDMA, FDMA, CDMA


2. Random access – CSMA, CSMA/CA, CSMA/CD
3. Taking turns – as in the use of tokens
Channel partitioning protocols
• Time division multiple access (TDMA)
Each station gets fixed length slot (Single time slot =
Transmission time)
Unused time slots go idle (i.e wasteful of channel)

• Frequency division multiple access (FDMA)


Channel spectrum divided into frequency bands
Each station is assigned a frequency band
Unused frequency bands will lie idle for the duration of the
communication.
Random access protocols
• Random access protocols specify how to detect collisions and how
to recover from such collisions.
• CSMA (Carrier sense multiple access)
Devices listen to the state of the channel before transmitting
If channel is idle, then device will transmit.
If channel is busy, the device will wait for a random period of
time before trying to retransmit.
But CSMA may not completely eradicate collisions on the link
as propagation delays may cause two devices not to hear each
other’s transmissions.
Random access protocols

• CSMA/CD (CSMA with collision detection)


• With CSMA /CD, the NIC of the device listens to the
state of the channel even as it is transmitting.
• If a collision is detected, transmission is aborted
immediately to avoid channel wastage.
• Then a 48 bit jam is sent to alert all stations that there
is a collision.
Data link layer devices

• Link layer functions are mostly implemented by:

1. Network Adaptors (Network interface cards)


Ethernet cards – PCMCI card, 802.11 card

2. Layer 2 switch - A network device used to


interconnect hosts on the same network segment
Network interface card (NIC)

• A network card acts as the interface between a computer and the rest of
the devices that form a network.

• The purpose of the network card is to prepare, send, and control data
on the network.

• The green LED shows that the card is energized.

• The orange (10 Mb/s) or red (100 Mb/s) LED indicates network activity
Network interface card (NIC)

• To prepare data to be sent, the network card uses


a transceiver, which transforms parallel data into
serial data.

• Each network card has a unique address, called


a MAC address, assigned by the card’s manufacturer,
which lets it be uniquely identified among all the
network cards in the world.
Network interface card (NIC)

• To ensure that the computer and network are compatible, the card
must be suitable for the computer’s data bus architecture, and
have the appropriate type of socket for the cable.

• Each card is designed to work with a certain kind of cable.

• Some cards include multiple interface connectors (which can be


configured using jumpers, DIP switches, or software).
Media access control (MAC) address

• Network Interface Card (NIC) has a fixed MAC address.


• Most NIC producers burn the MAC address of their products into the ROM.
• When a NIC is initialized, the MAC address in the ROM is read into the
RAM.
• When you insert a new NIC into a computer, the physical address of the
computer is replaced by the physical address of the NIC.
• However if you insert two NICs into your computer, then your computer may
have two MAC addresses, so a network device may have multiple MAC
addresses.
Ethernet (MAC) Address
• MAC address is composed of 48 bits. The vendor ID
of Huawei products is 00e0fc

24 bits 24 bits

Serial
Vender Code Number

00e0.fc01.2345 00e0.fc01.2345

Rom
Ethernet Frame format
Ethernet IP TCP User data/padding Ethernet
header header header trailer
14B 20-60B 20B-60B 4B

DMAC SMAC L/T

6B 6B 2B

Length/Type value meaning

Ethernet_II Length/T > 1500 Represents Type

Represents Length
802.3 Length/T <= 1500
Ethernet frame fields

1. Ethernet header - is made up of three fields:


a) DMAC: indicates the MAC address of the destination.
b) SMAC: indicates the MAC address of the source.
c) LENGTH/TYPE: its meanings may vary with its
values.
Ethernet frame fields

1. DATA/PAD: the original data.


Ethernet standards specify that the minimum data
length should be 46 bytes.

If the data is less than 46 bytes, add the Pad field to fill
it.
2. FCS: the frame check sum used for correction of
errors in the frame
Data link layer protocols

• Data link layer protocols specify the frame encapsulation at


the data link layer and control link access.
• LAN protocol
IEEE 802.2LLC
• WAN Protocols
Point-to-Point Protocol (PPP)
High-level Data Link Control (HDLC)
Frame Relay (FR)
Point to point protocol (ppp)
• PPP is commonly used as a data link layer protocol for
connection over synchronous and asynchronous circuits
(Serial links).

• Example: Dial up internet, leased lines between routers, etc.

• PPP is supported by two other protocols:


1. Link Control Protocol (LCP)
2. Network Control Protocol (NCP)
How PPP works

• Link Control Protocol (LCP)


1. Establishing links between communication parties
2. Testing links between communicating parties
3. Negotiate Parameters between communication parties; e.g. file
size, authentication type etc.
4. Tearing down connections
• Network Control Protocol (NCP)
1. Negotiates parameters such as dynamic IP address assignment
How PPP works (Scenario: Dial-up internet)
1. PC calls router of provider via modem

2. Router’s modem answers phone  physical connection

3. Series of LCP packets exchanged to negotiate PPP parameters

4. Series of NCP packets to e.g. get IP address from service


provider.

5. PC accesses the internet


High-level Data Link Control (HDLC)

• HDLC is a bit-oriented synchronous data link layer


protocol developed by the ISO.

• HDLC specifies data encapsulation for synchronous


serial links with frame characters and CRC.
Frame relay (FR)

• FR is a protocol conforming with the industrial


standards and it is an example of packet-switched
technology.

• Used on leased lines


Summary questions

1. Name any two devices that are used at the datalink layer
2. Explain the mechanisms used by the data link layer for flow control
3. Explain the mechanisms used by the datalink layer to detect and correct
errors.
4. Explain any two link access management techniques used by the data link
layer.
5. With the aid of the diagram, describe the contents of the Ethernet frame.
6. What are the two parts of a MAC address and what do they represent?

You might also like