[Back to Lecture Notes page]

Algorithms for Data Link Layer Protocols

In this subtopic, we look at various algorithms describing protocols at the DLL. Since they are algorithms for the protocols, they basically describe how to offer the services the data link layer needs to offer. They all have different approaches and make different assumptions, so which algorithm is actually appropriate depends on what situation it is going to be applied to.

Although I (and the textbook) use the word "protocol" in this sub-topic, what we are explaining are not real protocols like the ones we will encounter in the next sub-topic (eg. SLIP, PPP). They are more categories of protocols. It is for this reason I use the word "algorithm".

Sub-topic outline:

 

Some Terminology

 

Unrestricted Simplex Protocol

  1. Get a packet from the Network layer
  2. Put the packet into a frame
  3. Send the frame off
  1. Wait for frame
  2. When a frame arrives, take the packet out
  3. Give the packet to the Network layer

 

Simplex Stop-and-Wait Protocol

One possible solution is to have something similar to unrestricted simplex, but have the sending DLL slow down so much that in the worst case the receiver will still have enough time to process a frame at a time. Unfortunately doing this means that the transmission rate will be so slow that most of the time the channel is not used.

  1. Get a packet from the Network layer
  2. Put the packet into a frame
  3. Send the frame off
  4. Wait for acknowledgment from the receiver
  1. Wait for frame
  2. When a frame arrives, take the packet out
  3. Give the packet to the Network layer
  4. Send an empty acknowledgment frame to the sender

 

Simplex Protocol with Noisy Channel

  1. Get a packet from the Network layer
  2. Put the packet into a frame, put a sequence number in the frame
  3. Start timer and send the frame off
  4. Wait for acknowledgment from the receiver
  5. If time-out then, go back to 2 and send again
  6. If acknowledgment with the correct sequence number arrives, increment the current sequence number.
  1. Wait for frame
  2. When a frame arrives, check the sequence number is not one already received.
    If it is, send acknowledgment frame with the received sequence number (the sender obviously didn’t get the previous acknowledgment), and go back to 1.
    If not, go to 3.
  3. Take the packet out
  4. Give the packet to the Network layer
  5. Send an acknowledgment frame with the current sequence number to the sender. Increment the current sequence number.

 

Sliding Window Protocols

Again, let me remind you here that the data link layer is only concerned with communication between two adjacent machines. We don’t even think about multiple machines at this stage. That is the job of higher layers.

Eg. If the window is 2345, and we receive acknowledgment for 2, the new window is 3456.

    1. the sequence numbers sent but not acknowledged
    2. the sequence numbers remaining that can still be used to send new frames

 

One-Bit Sliding Window Protocol

Set sequence number for sending window (0 or 1) – call it next_frame_to_send
Set sequence number for receiving window (0 or 1) – call it frame_expected
Get a packet from network layer, and store in buffer
Put packet into frame with seq = next_frame_to_send
Start timer and send frame off
Repeatedly
{

If a new frame arrives
{
If the seq number is the same as frame_expected
then (this is a data frame from the other side)
{
Take out the packet and pass to network layer
Increment frame_expected
}

If the ack number is the same as next_frame_to_send
then (this is an acknowledgment for something we’ve sent)
{
Get another packet from the network layer and store in buffer
Increment next_frame_to_send
}

Put together a new frame using the packet in the buffer
For the new frame, let seq = next_frame_to_send, and ack = 1 - frame_expected
Start timer and send frame off
}

If time out
{
Put together a new frame using the packet in the buffer
For the new frame, let seq = next_frame_to_send, and ack = 1 - frame_expected
Start timer and send frame off

}
}

 

A Peculiar Situation with One-Bit Sliding Window Protocol

 

Pipelining

 

Sliding Window with Go Back n

Figure 3.15a

 

Sliding Window with Selective Repeat

[Back to Lecture Notes page]