1 of 20

1

Data Link Layer

Design Issues

krraju.in

2 of 20

  • Data link layer services
  • Data link Control
  • What is a frame?
  • Types of framing
  • Sublayers in Data Link layer

2

What you’ll learn

Data link layer: Design issues, Framing: fixed size framing, variable size framing, flow control, error control, error detection and correction codes, CRC, Checksum: idea, one’s complement internet checksum, services provided to Network Layer, Elementary Data Link Layer protocols: simplex protocol, Simplex stop and wait, Simplex protocol for Noisy Channel. Sliding window protocol: One bit, Go back N, Selective repeat-Stop and wait protocol, Data link layer in HDLC, Point to point protocol (PPP).

Unit-2

TCP

IP

IGMP

ICMP

Transport Layer

Network Layer

Link Layer

Media

UDP

ARP

Network Access

RARP

krraju.in

3 of 20

Nodes and Links

3

Nodes and Links

  • Hosts and routers are nodes (bridges and switches too)
  • Communication channels that connect adjacent nodes along communication path are links
    • wired links
    • wireless links
    • LANs
  • Data-link layer PDU is a frame, encapsulates datagram

Data-link Layer

Transfers datagram over a single link (from one node to adjacent node) in the path

krraju.in

4 of 20

Data Link Layer

4

Transfers data between nodes on a network segment and Provides a well defined service interface to the network layer.

  • Receives information in the form of packets from the network layer.
  • Divides packets into frames and sends those frames bit-by-bit to the underlying physical layer
  • Regulates the flow of data so that slow receivers are not swamped by fast senders.
  • Deals with transmission errors.

krraju.in

5 of 20

DLL Services

5

Design Issues

  • Services provided to the network layer
  • Addressing
  • Frame synchronization
  • Error and Flow control
  • Control and data on same link
  • Link management
    • Bringing lines up
    • Testing them
    • Negotiating options
    • Bringing lines down again gracefully

Services

  • Addressing
  • Framing
  • Error control
  • Flow control
  • Access Control

krraju.in

6 of 20

Enq/Ack (Enquiry and Acknowledgement)

6

  • i.e. when there is a dedicated link between two devices so that the only device capable of receiving data is the intended one.

Station

A

Station

B

  • Who should start?
  • How can one station be sure that the other is ready?

Used in systems where there is no question of the wrong receiver getting the transmission.

krraju.in

7 of 20

Multipoint Discipline

7

Multipoint Discipline

Who has the right to the channel?

  • Multipoint systems must coordinate several nodes.

Primary

Secondary

A

Secondary

B

Secondary

C

Poll/Select

All data communication must be made through the primary device.

  • Polling: To receive data, the primary asks the secondaries if they have anything to send.
  • Selecting: To send data, the primary tells the target secondary to get ready to receive.

One device is designated as a primary station and the other devices are secondary stations and all are using a single transmission line.

krraju.in

8 of 20

Link Control

8

Line Discipline

Who should send now?

  • Oversees the establishment of links and the right of a particular device to transmit at a given time.

Error Control

How can errors be corrected?

  • Based on automatic repeat request, which is the retransmission of data.

Flow Control

How much data may be sent?

  • Procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment.

krraju.in

9 of 20

Framing

9

The data link layer needs to pack bits into frames, so that each frame is distinguishable from another.

  • Postal system practices a type of framing.
    • Inserting a letter into an envelope separates one piece of information from another; the envelope serves as the delimiter.

Character-oriented protocol

Bit-oriented protocol

krraju.in

10 of 20

Framing Methods

10

Fixed size framing

  • Frame is of fixed size (Character count)
  • No worry about the ending of the frame.
  • Since frames are of fixed length, hence no flexibility is possible

Variable size framing

  • Need to define an end of the frame as well as beginning of the next frame
    • Character stuffing
    • Bir stuffing

Physical layer coding violations

krraju.in

11 of 20

Character Stuffing

11

Character stuffing: Data is changed by inserting additional characters to distinguish between data and control fields.

  • A flag is added at the beginning and at the ending of the frame.
  • Flag size is multiple of 8 bits
  • Used only when the character as a data was exchanged at the data link layer

When the data is having other than text, i.e. audio, video and images character stuffing is not used because there may be a chance when FLAG bytes get matched with the data inside the packet.

krraju.in

12 of 20

Byte Stuffing

12

  • Add one extra byte whenever there is a flag or ESCAPE character in the text.
  • Special byte is added to the data section of the frame when the same pattern as that of flag is present inside the frame.
  • Now frame has an extra byte called as ESCAPE(ESC)
  • When there is ESC pattern in an original frame add another escape byte.
  • Disadvantage: Have to use 1 byte always. So, there is always a limitation of using 8 bit.

krraju.in

13 of 20

Bit Stuffing

13

Bit stuffing (zero bit insertion). Each frame begins and ends with a flag pattern 01111110.

  • Whenever flag pattern appears in the data section of the frame, to prevent it from looking like a pattern of the flag we add an extra bit to break the pattern
    • Whenever the transmitter encounters five consecutive 1s in the data, it stuffs a 0 bit into the outgoing bit stream.

Real flag is not stuffed by the sender, hence no need of destuffing for real flag, at the end of the receiver.

krraju.in

14 of 20

Frame Synchronization

14

Synchronous frame format

  • Bit stream is combined into longer frames which may contain multiple bytes without start and stop bits

Asynchronous frame format

  • Data is transmitted one character at time.

Data is transmitted serially between the stations. The receiver may loose synchronization with the transmitter if the bit stream is long

krraju.in

15 of 20

Flow Control

15

Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgement.

  • Feedback based flow control
  • Rate based flow control (are never used in the data link layer)

Stop and wait: 

The sender sends one frame and waits for an acknowledgment before sending the next frame.

Sliding window: 

The sender can transmit several frames before needing an acknowledgment, i.e., several frames can be in transit at a time.

krraju.in

16 of 20

Connectionless vs Connection Oriented

16

Connectionless Protocol:

  • Frames are sent from one node to the next without any relationship between frames; each frame is independent.

Connection-oriented protocol:

  • A logical connection should first be established between the two nodes (setup phase).
  • After all frames that are somehow related to each other are transmitted (transfer phase).
  • The logical connection is terminated (teardown phase)

krraju.in

17 of 20

Links and Sublayers

Sublayers

Broadcast link

Point-to-point link

17

Links

  • Point-to-point (single wire, e.g. PPP, SLIP)
  • Broadcast (shared wire or wireless medium; e.g, Ethernet, Wavelan, etc.)

Sublayers

  • Data link control deals with all issues common to both point-to-point and broadcast links
  • MAC deals only with issues specific to broadcast links

Data Link Control

Media Access Control

Data Link Control

krraju.in

18 of 20

Types of Addresses

Unicast (One-to-one): Frame received by only one station.

Multicast (One-to-many): Frame received by a group of stations. However, the jurisdiction is local (inside the link)

  • Broadcasting (One-to-all): Frame is sent to all entities in the link. Special case of multicast; the group includes all stations.

18

krraju.in

19 of 20

Recap

19

Essential Network Protocol

ARP is a fundamental protocol that enables successful communication in IP-based networks.

Security Considerations

Understanding ARP security risks and implementing countermeasures is crucial for network protection.

Versatile and Practical

ARP finds applications in various network environments, promoting seamless connectivity.

Reverse Address Resolution Protocol (RARP) is dropped in IPv6 because it is seldom used.

krraju.in

20 of 20

Video Links

20

krraju.in