The data link layer provides service to the Network Layer above it:
Note: It is not always clear that we really want our data link layer protocol to provide this type of service. What if we run real-time applications across the link?
Nonetheless, the ISO reference model suggests that the data link layer provide such a service, and we now examine the protocols that provide such a service.
Look at successive data link protocols of increasing complexity to provide realiable, in order message delivery to the network layer.
Assume DLL executes as a process with routines to communicate with the Network Layer above and the Physical Layer below.
Deal with messages (packets)--bit strings
frames are the unit of transmission. Consists of data plus control bits (header information).
procedure wait (var event: EvType); {wait for an event; return event type in 'event'}
Look at data structures in Fig. 3-8
Assumptions:
Figure 3.9
Drop assumption that receiver can process incoming data infinitely fast
stop-and-wait--protocols where the sender sends one frame and then waits for acknowledgement.
In this protocol, the contents of the acknowledgement frame are unimportant.
Data transmission is one directional, but must have bidirectional line. Could have a half-duplex (one direction at a time) physical channel.
Figure 3.10
What if the channel is noisy and we can lose frames (checksum incorrect).
Simple approach, add a time out to the sender so it retransmits after a certain period and retransmit the frame.
Scenario of what could happen:
Use a sequence number. How many bits? 1-bit is sufficient because only concerned about two successive frames.
Positive Acknowledgement with Retransmission (PAR)--sender waits for positive acknowledgement before advancing to the next data item.
Figure 3-11.
How long should the timer be? What if too long? (inefficient)
What if too short? A problem because the ACK does not contain the sequence number of the frame which is being ACK'ed.
Scenario:
Two-way communication. One-way is not realistic.
Have two kinds of frames (kind field):
piggybacking--add acknowledgement to data frames going in reverse direction.
For better use of bandwidth. How long to wait for outgoing data frame before sending the ACK on its own.
Example of a sliding window protocol. Contains a sequence number whose maximum value MaxSeq is .
For stop-and-wait sliding window protocol n=1.
Problem with stop and wait protocols is that sender can only have one unACKed frame outstanding.
Example:
Frame takes 1ms to send. With propagation delay the ACK is not seen at the sender again until time 541ms. Very poor channel utilization. Solution:
Sender does not wait for each frame to be ACK'ed. Rather it sends many frames with the assumption that they will arrive. Must still get back ACKs for each frame.
Example 1: Use a 3-bit sequence number (0-7). Now we can transmit 7 frames (seq. nr. 0-6) before receiving an ACK.
Example 2: What if we allow the sender to send 8 (0-7) instead of 7 (0-6) frames?
Potential problem of window sizes (receiver window size of one):
MaxSeq is 7 (0 through 7) is valid. How big can sender window be?
Window Size Rule: The sender window size (number of buffers) plus the receiver window size (number of buffers) must be where n is the number of bits in the sequence number.
Example 3: Provides more efficient use of space and works well if we follow the window size rule and do not get errors. What if an error occurs?
What if 7 frames transmitted (seq nr 0-6), and sequence number 1 has an error. Frames 2-6 will be ignored at receiver side? Sender will have to retransmit.
Two strategies for Window size:
Tradeoff between bandwidth and data link layer buffer space.
In either case will need buffer space on the sender side. Cannot release until an ACK is received.
Use a timer for each unACK'ed frame that has been sent.
Can enable/disable network layer because no longer assume that network layer is ready (NetworkLayerReady event).
Summarize, not details
Example 4: Look at same example using protocol 6 with sender and receiver window size each equal to 4.
Now if 4 frames transmitted (seq nr 0-3), and sequence number 1 has an error. Frames 2-3 will not be ignored at receiver side, but they can be buffered.
What happens when Frame 1 times out and is retransmitted? Upon reception, the receiver can pass frames 1, 2 and 3 up to the network layer and update its receiver window.
Look at Sliding Window Protocols notes.
What is the channel efficiency of a stop-and-wait protocol?
Draw picture
time between frames: F/C + 2I + A/C
time spent sending data: D/C
efficiency:
Adopted as part of X.25.
Basically, Go Back N protocol.
Point-to-point lines
Two protocols used:
SLIP--Serial Line IP
Older protocol that just adds a framing byte at end of IP packet (with appropriate character stuffing). Some problems:
PPP--Point-to-Point Protocol
a Standard (RFCs 1661-1663)! Can be used for dial-up and leased router-router lines.
Provides:
See Fig. 3-28.
Similar to HDLC, but is character-oriented.
It does not provide reliable data transfer using sequence numbers and acknowledgements as the default. Reliable data transfer can be requested as an option (as part of LCP).
Transmission Convergence sublayer (refer back to ATM reference model).
Physical layer is T1, T3, SONET, FDDI.
This sublayer does header checksumming and cell reception.
Header Checksum
5-byte header consists of 4 bytes of virtual circuit and control stuff.
Checksum 4 bytes of header information and store in 5th byte. Use CRC checksum and add a constant 01010101 bit string.
Low probability of error (likelihood of fiber) so keep it cheap to checksum. Upper layers can do payload if they like.
8-bit checksum field is called Header Error Control (HEC).
Transmission
May have to output dummy cells in a synchronous medium (must send cells at periodic times). Use idle cells. Also have operation and maintenance (OAM) cells. Exchange control and other information.
Cell Reception
Drop idle cells, pass along OAM cells.
Need to generate framing information for underlying technology, but no framing bits! Use a probablistic approach of matching up valid headers and checksums in a 40-bit window.
See Fig. 3-30. Have a state-transition diagram where we are looking for consecutive valid headers.
If a bad cell received (flipped bit) do not immediately give up on synchronization.
Important: TC sublayer must know about header information above it. Violates layering principle to make things work.