# Data Link Layer in OSI Model

Below are some common GATE CS topics of data link layer.

Carrier Sense Multiple Access (CSMA)

Carrier Sense Multiple Access or CSMA method was developed to minimize the probability of collision and thus, to increase the performance. The probability of collision can be minimized if a station senses or reads the medium before trying to use it for sending data. CSMA is based on the principle of sensing before transmitting.

CSMA/CD (Carrier sense multiple access with collision detection)
The CSMA method does not tells us what to do in case there is a collision. Carrier sense multiple access with collision detection (CSMA/CD) adds on to the CSMA algorithm to deal with collision. For CSMA/CD to work, we need a particular frame size. Before sending the last bit of the frame, the sending station must detect a collision, if any, and abort the transmission because the station, once the entire frame is sent, does not keep a copy of the frame and does not monitor the channel for collision detection.

In CSMA/CD, the size of a frame must be large enough so that collision can be detected by sender while sending the frame. So, the frame transmission delay must be at least two times the maximum propagation delay.

```

Tt >= 2*Tp```

Here Tt is transmission delay and Tp is propagation delay.

```
Tt = S/B```

Here S is size of frame and B is bandwidth or transmission speed.

```
Tp = L/P```

Here L is distance between the farthest nodes and P is propagation speed, putting above values we get

```
S/B >= 2*(L/P)

Frame size 'S' should be
S >= 2BL/P

Or cable length 'L' should be
L <= SP/2B```

Example: A network using CSMA/CD has a bandwidth of 10 Mbps. If the maximum propagation time including the device delays is 25.6 µs, what is the minimum size of the frame?
Solution: Frame Transmission Time, Tt = 2 * Tp = 2 * 25.6 = 51.2 µs
Minimum frame size, S = 10 Mbps * 51.2 µs = 512 bits = 64 bytes

Below questions have been asked in previous GATE exam on above topic.

GATE | GATE CS 2003 | Question 90

GATE | GATE CS 2015 Set 3 | Question 65

CRC (Cyclic Redundancy Check)
Please refer this for examples and detailed explanation.