04 Data Link Layer
04 Data Link Layer
Server with video clips Application Layer Presentation Layer Session Layer Transport Layer Network Layer Network Layer
Contents Design Issues Error Detection and Correction Elementary Data Link Protocols Sliding Window Protocols High Level Data Link Control (HDLC) Point-to-Point Protocol (PPP) Protocol Verification
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.2
Design Issues
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.3
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.4
LLC
IEEE 802.2 Logical Link Control ANSI X3T9.5 FDDI ATM Forum ATM LAN Emulation
...
802.6 DQDB
...
ISO/OSI
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.5
Services Provided to the Network Layer The data link layer provides services to the network layer
Principal service is transferring data from the network layer of the source to the network layer of the destination machine
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.6
Services Provided to the Network Layer Communication of two processes on the network layer
Virtual data path Actual data path
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.7
Services Provided to the Network Layer Service provided by the data link layer
Unacknowledged connectionless service
No logical connection beforehand Source sends independent frames Destination does not acknowledge frames
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.8
Packets here
Routing process
DLL Process
DLL Process
DLL Process
DLL Process
DLL Process
DLL Process
Frames here
DLL Protocol
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.10
Error check
Header
Data
Trailer
Mark the frame by: Start and end flags Start flag and length Code injuries
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.11
Byte/bit-stream Frames
Frame 1
Frame 2
Frame 3
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.12
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.13
Framing: Flag Bytes with Character Stuffing The start and end of a frame is represented by a special flag byte. Problem: What happens if the flag byte occurs in the data? Byte stuffing/character stuffing
A special escape byte (ESC) is inserted (stuffed) by the sender and removed by the receiver If the escape byte occurs in the data, then it is also stuffed
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.14
Framing: Flag Bytes with Bit Stuffing Character stuffing is bound to the character set (disadvantage)! General form: Bit stuffing
Frames begin and end with a special pattern: 01111110 Sender inserts after five 1s a 0-bit, i.e., 011111x... 0111110x... and the receiver removes it
After destuffing:
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.15
Framing: Physical Layer Coding Violations Only applicable if physical layer coding has some redundancy
1 bit data is encoded in 2 physical bits 1-bit coded as high-low, 0-bit coded as low-high, high-high and low-low are not used
1-bit
0-bit
not used
not used
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.16
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.17
Error Detection and Correction Next task of the LLC layer: protected transmission of the frames to the
communication partner
The transmission over layer 1 is not necessarily free of errors! Errors tend to come in bursts rather than single
Scenario
A frame consisting of m data bits and r redundant (check) bits Total length: n = m + r The n-bit unit with data and check bits is called codeword
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.18
Check the terms even and odd parity! Parity bits often used in RAM (not networking)
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.19
Error Detection
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.20
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.21
Error Detection with Cyclic Codes For computations, polynomial arithmetic modulo 2 is used, i.e., addition
and subtraction without carriage. Both operations become Exclusive-OR (XOR) operations.
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.22
The receiver divides the received extended M(x) by G(x). If the remainder is 0, there was no error, otherwise some error occurred Cyclic Redundancy Checksum (CRC)
Note: also the parity bit can be seen as CRC, with generator polynomial x + 1!
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.23
Error Detection with Cyclic Codes Algorithm for computing the checksum
Let r be the degree of G(x).
Append r zero bits to the low-order end, so it now contains m+r bits. The corresponding polynomial is xrM(x).
Divide the bit string corresponding to G(x) into the bit string corresponding to xrM(x). Subtract the remainder from the bit string corresponding to xrM(x). The result is the checksummed frame to be transmitted, denoted as T(x).
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.24
CRC: Example
Data to be transmitted: Generator polynomial: 10111001 x4 + x +1 10011
Note: here, the extra positions are preset with zeros but many systems like, e.g., Ethernet use the inverted bits as presets (what happens if only 0s to be transmitted?).
Sender:
101110010000 : 10011 = 10100111 10011 10000 10011 11100 10011 11110 10011 11010 10011 1001 = x3 + 1 = R(x)
Receiver:
101110011001 : 10011 = 10100111 10011 10000 10011 11110 10011 11010 10011 10011 10011 0
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.25
Receiver:
001010010001 : 10011 = 00101110 10011 11110 10011 11010 10011 10010 10011 11
Receiver:
001110110001 : 10011 = 00111111 10011 11101 10011 11100 10011 11110 10011 11010 10011 10011 10011 0
Error detected
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.26
Most important
A polynomial code with r check bits will detect all burst errors of length r
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.27
CRC: Characteristics
Common 16-bit generator polynomials: CRC-16: G(x) = x16 + x15 + x2 +1 CRC CCITT: G(x) = x16 + x12 + x5 +1 Ethernet: G(x) = x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 Error detection (for 16-bit generator polynomials): all single bit errors all double bit errors all three-bit errors all error samples with odd number of bit errors all error bursts with 16 or fewer bits 99.997% of all 17-bit error bursts 99.998% of all error bursts with length 18 bits Remaining error rate < 0.510-5 block error rate (original)
Not all errors are detected, an error could consist of adding a multiple of G(x) to M(x)
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.28
Implementation of CRC
Hardware
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.29
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.30
Simplified realization:
When no more input is given in the leftmost register, the other registers contain the CRC result.
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.31
101110010000
Sent data
01110010000
Sent data
10
1110010000
Sent data
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.32
110010000
Sent data
1011
10010000
Sent data
10111
0010000
Sent data
101110
010000
Sent data
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.33
1011100
10000
Sent data
10111001
0000
Sent data
10111001
000
Sent data
10111001
00
Sent data
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.34
10111001
Sent data
10111001
Sent data
101110011
Sent data
1011100110
Sent data
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.35
10111001100
Sent data
101110011001
Sent data
101110011001
Sent data
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.36
CRC Implementation
Software
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.37
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.38
CRC Implementation
#include <stdio.h> static unsigned int R; // Content of r-bit shift register static unsigned int Gr1 = 0x0810; // G = least-significant coeff. of generator polynomial // Gr1 = G right-shifted one bit position void ResetCRC() { R = 0; } void UpdateCRC(char x) { int i; // Input bit for cycle i int k; // Counter printf("\nUpdateCRC(%02x)\n", x); for (k=0; k<8; k++) { i = (x >> 7) & 1; // msb printf(" %04x < %1x -> ", R, i); if (R & 0x8000) // is msb of R == 1? R = ((R ^ Gr1) << 1) + (i ^ 1); // ^ is xor else R = (R << 1) + i; R &= 0x0ffff; printf("%04x\n", R); x <<= 1; } }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.39
CRC Implementation
long CheckCRC(FILE *fp, int length) { int i; ResetCRC(); for (i = 0; i < length; i++) { UpdateCRC(getc(fp)); } return R; }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.40
CRC Implementation
main() { FILE *fp; int c, length = 0; long crcSent; if ((fp = fopen("tmp", "w")) == NULL) { printf("Can't open tmp file. Exiting\n"); exit(-1); } ResetCRC(); while ((c = getchar()) != EOF) { UpdateCRC(c); putc(c, fp); length++; } printf("CRC is %04x\n", R); crcSent = R; putc(((R >> 8) & 0xff), fp); putc((R & 0xff), fp); fclose(fp); if ((fp = fopen("tmp", "r")) == NULL) { printf("Can't read tmp file. Exiting\n"); exit(-2); } if (CheckCRC(fp, length) == 0) printf("CRC checks.\n"); else printf("Computed CRC doesn't match\n"); }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.41
CRC: Error Correction In exceptional cases even errors can be corrected by CRCs. Example: ATM (Asynchronous Transfer Mode)
Data units have fixed length: 5 byte header + 48 byte data The last header byte is a checksum for the header Generator polynomial G(x) = x8 + x2 + x +1
It is even possible to correct a 1-bit error, because there are 40 possible 1-bit errors and those lead to 40 different non-zero remainders
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.42
Error Correction
Hamming Code
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.43
If two codewords have Hamming distance d, d single bit errors are required to convert one codeword into the other
find the two codewords with minimum Hamming distance this distance is the Hamming Distance of the whole code
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.44
Error-detecting and -correcting Codes Error-detecting and error-correcting properties of a code depends on its
Hamming distance
To detect d errors, a distance of d+1 is required To correct d errors, a distance of 2d+1 is required
Example:
Code with only four valid codewords w1=0000000000 w2=0000011111 w3=1111100000 w4=1111111111 Distance 5
it can detect 4 bit errors it can correct 2 bit error
If 0000000111 is received, the original must be 0000011111 (correct) If 0000000000 is changed to 0000000111, the error is not corrected properly
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.45
Error-detecting and -correcting Codes Goal: A code with m data bits and r check bits, which can correct all single
bit errors
Each of the 2m data bits has n illegal codewords with distance 1
Systematically invert each of the
n bits
Total number of bit sequences 2n Requirement: (n+1)2m 2n With: n = m+r (m + r + 1) 2r Given m, the lower limit on the number of check bits needed to correct single errors The Hamming Code fulfills this lower limit
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.46
Hamming Code Goal: Use of several parity bits, each of them considering several bits
The Hamming code is the minimal code of this category.
(overlapping). Errors can be identified and corrected by combining the parity bits.
Idea: Representation of each natural number by sum of powers of two. In a codeword with n bits: w = z1,, zn
the parity bits are placed exactly at the r positions, which are a power of two. At the remaining m = n - r positions the data bits are placed. each of the r additional bits is a parity bit for all places, for which the representation in powers of two contains the position of the additional bit.
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.47
2
X X X X X X X X X X X X X X
16
X
X X X X X X X X X
X X X X
X X X X
X X X X X X X X
X X X X
X X X X X
X X X X X X X X X X X X X
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.48
1 2 3 4 5 6 7 8 9 10 11 1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
1 2 3 4 5 6 7 8 9 10 11
Example
m=7, r=4
4.49
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
Hamming Code
Check bits ASCII-Code
H A M M I N G 1001000 1100001 1101101 1101101 1101001 1101110 1100111 1 2 3 4 5 6 7 8 9 10 11
0 1 1 1
0 0 1 1
1 1 0 0 1 0 0 0
1 1 1 0 0 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0
1 1 1
Codeword
Receiver:
3=1+2
5=1+4 6=2+4 7=1+2+4 9=1+8 10 = 2 + 8 11 = 1 + 2 + 8
examine parity bits if necessary, sum up indices of the incorrect parity bits index of the incorrect bit 1-bit errors can definitely be identified and corrected
4.50
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
Hamming Code
00110010000
Transmission error
00110000000
Summing up the indices 1, 2 and 4 bit 7 is detected as false Weaknesses: 2-bit errors are not corrected (or wrongly corrected!) 3-bit errors are not recognized Hamming Code is expensive in terms of required bits!
a) Bit 4 and bit 11 inverted: parity bits 1, 2, 4, 8 are wrong bit 15 is to be corrected, but does not exist
b) Bit 2 and bit 4 inverted parity bits 2, 4 wrong bit 6 is falsely recognized as incorrect c) Bits 1, 8, 9 inverted all parity bits are correct no error is recognized
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.51
Suitable for transmissions tolerating no transmission delays (video, audio) as well as for coding resp. protecting data on CDs or DVDs
4.52
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.53
Reliable, connection-oriented service Infinite supply of data Wire-like delivery of packets, i.e., in the sent order
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.54
Implementation of Protocols Example: Implementation of a protocol for layer 2 First: Definition of some data types (protocol.h):
#define MAX_PKT 1024 typedef enum {false, true} boolean; typedef unsigned int seq_nr;
/* determines packet size in bytes /* boolean type /* sequence or ack numbers */ */ */
/* packet definition
*/
typedef enum {data, ack, nak} frame_kind; typedef struct { frame_kind kind; seq_nr seq; seq_nr ack; packet info; } frame;
/* kinds of frames /* /* /* /* /*
*/
frames are transported in this layer */ what kind of a frame is it? */ sequence number */ acknowledgement number */ the network layer packet */
kind
seq
ack
info
4.55
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
Implementation of Protocols
void wait_for_event(event_type *event); // Wait for an event; return its type in event
// Fetch a packet from the network layer // Deliver packet to the network layer
// Get frame from the physical layer // Pass the frame to the physical layer
// Start the clock running; enable timeout event // Stop the clock; disable the timeout event
// Start an auxiliary timer; enable ack_timeout // Stop auxiliary timer; disable ack_timeout
// // // //
Allow the network layer to cause a network_layer_ready event. Forbid the network layer from causing a network_layer_ready event.
// Macro inc is expanded in-line: Increment k circularly. #define inc(k) if (k < MAX_SEQ) k = k + 1; else k = 0
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.56
Implementation of Protocols
Network Layer
to_network_layer(packet *p)
to_physical_layer(frame *s)
from_physical_layer(frame *r)
Physical Layer
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.57
Implementation
Two procedures
sender1()
and
receiver1()
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.58
typedef enum {frame_arrival} event_type; #include "protocol.h void sender1(void) { frame s; packet buffer; while (true) { from_network_layer(&buffer); s.info = buffer; to_physical_layer(&s); } } void receiver1(void) { frame r; event_type event; while (true) { wait_for_event(&event); from_physical_layer(&r); to_network_layer(&r.info); } }
/* buffer for an outbound frame /* buffer for an outbound packet /* go get something to send /* copy it into s for transmission /* send it on its way
/* filled in by wait, but not used here */ /* only possibility is frame_arrival /* go get the inbound frame /* pass the data to the network layer */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.59
B
wait_for_event()
to_network_layer() ___
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.60
Two approaches
Feedback-based flow control
Receiver sends information back to the sender giving permission to send more data
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.61
Frame 1
Ack
Frame 2
Ack
Disadvantage: large waiting periods between the transmission of single blocks. Thus much transmission capacity is wasted.
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.62
typedef enum {frame_arrival} event_type; #include "protocol.h" void sender2(void) { frame s; packet buffer; event_type event; while (true) { from_network_layer(&buffer); s.info = buffer; to_physical_layer(&s); wait_for_event(&event); } } void receiver2(void) { frame r, s; event_type event; while (true) { wait_for_event(&event); from_physical_layer(&r); to_network_layer(&r.info); to_physical_layer(&s); } }
/* buffer for an outbound frame /* buffer for an outbound packet /* frame_arrival is the only possibility /* /* /* /* go get something to send copy it into s for transmission bye-bye little frame do not proceed until given the go ahead
/* buffers for frames /* frame_arrival is the only possibility /* /* /* /* only possibility is frame_arrival go get the inbound frame pass the data to the network layer send a dummy frame to awaken sender
*/ */ */ */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.63
void sender2(void) { frame s; packet buffer; event_type event; while (true) { from_network_layer(&buffer); s.info = buffer; to_physical_layer(&s); wait_for_event(&event); } }
void receiver2(void) { frame r, s; event_type event; while (true) { wait_for_event(&event); from_physical_layer(&r); to_network_layer(&r.info); to_physical_layer(&s); } }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.64
B
wait_for_event() ___ ___ from_physical_layer() _ to_network_layer()___ to_physical_layer() ___
wait_for_event()_
___
from_physical_layer() _ to_network_layer()___
to_physical_layer() ___
from_network_layer()_
wait_for_event()_
___
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.65
Simplex Protocol for a Noisy Channel Protocol 3: Simplex Protocol for a Noisy
Channel
Communication channel makes errors
Frames may be damaged or lost completely If frame is damaged, receiver detects errors Normal case
Err
Ack loss
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.66
n
Err n n n
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.67
Simplex Protocol for a Noisy Channel: Implementation Step 3: Error handling and flow control sender
/* Protocol 3 (par) allows unidirectional data flow over an unreliable channel. #define MAX_SEQ 1 /* must be 1 for protocol 3 typedef enum {frame_arrival, cksum_err, timeout} event_type; #include "protocol.h" void sender3(void) { seq_nr next_frame_to_send; /* seq number of next outgoing frame frame s; /* scratch variable packet buffer; /* buffer for an outbound packet event_type event; next_frame_to_send = 0; /* initialize outbound sequence numbers from_network_layer(&buffer); /* fetch first packet while (true) { s.info = buffer; /* construct a frame for transmission s.seq = next_frame_to_send; /* insert sequence number in frame to_physical_layer(&s); /* send it on its way start_timer(s.seq); /* if answer takes too long, time out wait_for_event(&event); /* frame_arrival, cksum_err, timeout if (event == frame_arrival) { from_physical_layer(&s); /* get the acknowledgement if (s.ack == next_frame_to_send) { stop_timer(s.ack); /* turn the timer off from_network_layer(&buffer); /* get the next one to send inc(next_frame_to_send); /* invert next_frame_to_send } } } } */ */
*/ */ */
*/ */ */ */ */ */ */ */
*/ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.68
void receiver3(void) { seq_nr frame_expected; frame r, s; event_type event; frame_expected = 0; while (true) { wait_for_event(&event); if (event == frame_arrival) { from_physical_layer(&r); if (r.seq == frame_expected) { to_network_layer(&r.info); inc(frame_expected); } s.ack = 1 - frame_expected; to_physical_layer(&s); } }
/* /* /* /* /* /*
possibilities: frame_arrival, cksum_err a valid frame has arrived. go get the newly arrived frame this is what we have been waiting for. pass the data to the network layer next time expect the other sequence nr
*/ */ */ */ */ */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.69
while (true) { wait_for_event(&event); if (event == frame_arrival) { from_physical_layer(&r); if (r.seq == frame_expected) { to_network_layer(&r.info); inc(frame_expected); } s.ack = 1 - frame_expected; to_physical_layer(&s); } } }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.70
Sliding Window Previous protocols work only in one direction (simplex) What to do if full-duplex communication is required?
Use two different simplex communication channels
Wasting of resources, because the acknowledgements are rare and small
Piggybacking
Instead of using special ack-packets, use a field in the header of a data frame to inform the receiver
When a data packet arrives, the receiver does not send immediately an ack, instead waits a particular time interval for a data packet to the other direction
4.71
Ack-frames piggybacked
A
data A
B
data wait
data B, ack A
data A, ack B
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.72
The receiver confirms the reception of a frame by an acknowledgement (ACK) The sender moves the window as soon as an ACK arrives All frames in the window must be buffered for retransmission
Window size n Buffer for n frames required
4.73
Sliding Window
Example: (for 3-bit sequence/acknowledgement number) with 3 bits for sequence/acknowledgement number, m = 23 = 8 Stations agree upon a window size W with 1 W < m, e.g., W = 7 The window limits the number of unacknowledged frames allowed at one time In this example max. 7, because of W = 7 With receipt of an acknowledgement, the window is shifted accordingly Frames are numbered sequentially modulo m (for m=8, numbers from 0 to 7)
7 0 ACK 6 0 ACK 12
7 6 5
0 ACK 16 2
7 6 5
0 1 2 6 5
0 1 2 6 5
0 1 2
0 41 3 2
4 453 6
Station erhlt Station receives Quittung ack 0 0
0 4 13 2
4 4 53 6
3 04 1
Station verschiebt Station slides Fenster um 1, window by 1 and sendet Frame sends frame 77
Station verschiebt Station slides Fenster um 2, window by 2 and sendet Frame 0, 1 Time sends frames 0,1
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.74
Maximum Window Size with Sliding Window There is a reason why window size W has to be smaller than MODULUS 2n
In the example, sequence numbers have 3 bits sequence numbers {0, , 7} MODULUS m = 8
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.76
#define MAX_SEQ 1
*/
typedef enum {frame_arrival, cksum_err, timeout} event_type; #include "protocol.h" void protocol4 (void) { seq_nr next_frame_to_send; seq_nr frame_expected; frame r, s; packet buffer; event_type event; next_frame_to_send = 0; frame_expected = 0; from_network_layer(&buffer); s.info = buffer; s.seq = next_frame_to_send; s.ack = 1 - frame_expected; to_physical_layer(&s); start_timer(s.seq);
// while() part see next slide
/* /* /* /*
*/ */ */ */
/* /* /* /* /* /* /* /*
next frame on the outbound stream frame expected next fetch a packet from the network layer prepare to send the initial frame insert sequence number into frame piggybacked ack transmit the frame start the timer running
*/ */ */ */ */ */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
/* frame_arrival, cksum_err, or timeout */ /* a frame has arrived undamaged. */ /* go get it */ /* handle inbound frame stream. /* pass packet to network layer /* invert seq number expected next */ */ */
/* /* /* /*
handle outbound frame stream. turn the timer off fetch new pkt from network layer invert sender's sequence number
*/ */ */ */
/* /* /* /* /*
construct outbound frame insert sequence number into it seq number of last received frame transmit a frame start the timer running
*/ */ */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.78
Receiver
while (true) { wait_for_event(&event); if (event == frame_arrival) { from_physical_layer(&r); if (r.seq == frame_expected) { to_network_layer(&r.info); inc(frame_expected); } if (r.ack == next_frame_to_send) { stop_timer(r.ack); from_network_layer(&buffer); inc(next_frame_to_send); } } s.info = buffer; s.seq = next_frame_to_send; s.ack = 1 - frame_expected; to_physical_layer(&s); start_timer(s.seq);
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.79
B
0,1,A0
nf=0 ex=0 ex=1 0,0,B0
ex=1 nf=1
1,0,A1
ex=2=0 nf=1
1,1,B1
nf = next frame ex = expected frame Packet format is (seq, ack, packet number) Half of the frames contain duplicates, even without transmission errors!
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.80
Example scenario
Long round-trip time
20 ms
frame
50 kbps satellite channel with 500 msec round-trip propagation time Transmission of 1000-bit frame Sender is blocked 500/520=96% of the time Utilization only 4%
520 ms time
270 ms
ack
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.81
Pipelining
Assumptions
Channel capacity is b bits/sec Frame size l bits Round-trip-time R sec
Solution
Allow sender to transmit up to W frames before blocking In the example W=520/20=26 Maximum window size = 26 If bandwidth round-trip-delay large, large window is required Capacity of the pipe Sender has to fill the pipe Pipelining
Time to transmit a frame: l/b sec After sending last bit, delay of R/2 sec Another R/2 sec delay for ack
Example: Stop-and-wait
Busy for l/b sec Idle for R sec Utilization l/(l+bR) If l<bR Utilization <
If l=bR Utilization =
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.82
Receiver:
Correct frames are acked Incorrect frames are discarded and no ack is send Timeout for 2
Source
2 3
5 2
4 5
Destination
ACK0 ACK1 Discard
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
ACK2 ACK3
4.83
*/ */ */ */ */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.84
/* /* /* /* /*
allow network_layer_ready events next ack expected inbound next frame going out number of frame expected inbound initially no packets are buffered
*/ */ */ */ */
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.85
/* the network layer has a packet to send /* Accept, save, and transmit a new frame. from_network_layer(&buffer[next_frame_to_send]); /* fetch new packet nbuffered = nbuffered + 1; /* expand the sender's window send_data(next_frame_to_send,frame_expected, buffer); /* transmit the frame inc(next_frame_to_send); /* advance sender's upper window edge break;
/* a data or control frame has arrived */ /* get incoming frame from physical layer */ /* Frames are accepted only in order. /* pass packet to network layer /* advance lower edge of recv's window */ */ */ */ */ */ */ */ */
/* Ack n implies n-1, n-2, etc. /* Check for this. while (between(ack_expected, r.ack, next_frame_to_send)) { /* Handle piggybacked ack. nbuffered = nbuffered - 1; /* one frame fewer buffered stop_timer(ack_expected); /* frame arrived intact; stop timer inc(ack_expected); /* contract sender's window } break;
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.86
*/ */ */ */ */
case timeout: /* trouble; retransmit all outstanding frames next_frame_to_send = ack_expected; /* start retransmitting here for (i = 1; i <= nbuffered; i++) { send_data(next_frame_to_send, frame_expected, buffer); /* resend 1 frame inc(next_frame_to_send); /* prepare to send the next one } }// of switch if (nbuffered < MAX_SEQ) enable_network_layer(); else disable_network_layer(); }// of while }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.87
Sender
Send frames according sliding window If an ack does not arrive before timeout, repeat all frames (like in Go-back-N) When the sender receives the ack, it stops repeating old frames and goes on with new frames
Thus, the capacity is used more efficiently, but the receiver needs more
buffer
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.88
/* no nak has been sent yet */ /* initial value is only for the simulator */
static boolean between (seq_nr a, seq_nr b, seq_nr c) {/* Same as between in protocol5, but shorter and more obscure. */ return ((a <= b) && (b < c)) || ((c < a) && (a <= b)) || ((b < c) && (c < a)); } static void send_frame (frame_kind fk, seq_nr frame_nr, seq_nr frame_expected, packet buffer[]) { /* Constr. and send a data, ack, nak frame.*/ frame s; /* scratch variable */ s.kind = fk; /* kind == data, ack, or nak */ if (fk == data) s.info = buffer[frame_nr % NR_BUFS]; s.seq = frame_nr; /* only meaningful for data frames */ s.ack = (frame_expected + MAX_SEQ) % (MAX_SEQ + 1); if (fk == nak) no_nak = false; /* one nak per frame, please */ to_physical_layer (&s); /* transmit the frame */ if (fk == data) start_timer (frame_nr % NR_BUFS); stop_ack_timer (); /* no need for separate ack frame */ }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.89
/* initialize */ /* next ack expected on the inbound stream */ /* number of next outgoing frame */
*/
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.90
*/ */ */ */ */ */ */ */ */
*/ */ */ */
*/ */ */
4.91
/* damaged frame
*/
case timeout: send_frame (data, oldest_frame, frame_expected, out_buf); /* we timed out break;
case ack_timeout: send_frame (ack, 0, frame_expected, out_buf); } if (nbuffered < NR_BUFS) enable_network_layer (); else disable_network_layer (); } }
*/
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.92
Variant
The receiver can send a list of missing frames to the sender, not only single negative acknowledgements
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.93
Timeout for 2
2 3 4 5 6 7 8
3 4 5 6 7 8 9 2
Timeout for 2
Timeout for 2
1 3 4 5 6 7 8 2
Buffer frames
10 11
10 11 12 13 14 15 16 17
BE WARNED - two concepts mixed: error correction via ARQ and flow control!
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.94
Implementation of Timer Some protocols require many timers, but few hardware timers exist
Implement timers in software by using one hardware timer Store expiration times in a linked list and update it during protocol runtime
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.95
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.96
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.97
Link configurations
Unbalanced configuration
One primary and one or more secondary stations
Full-duplex and half-duplex transmissions
Balanced configuration
Two combined stations
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.98
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.99
High Level Data Link Control (HDLC) Bit oriented protocol Frame identification
Mark the beginning and the end of a frame with a flag: 01111110 Flag may never occur within a frame: bit stuffing
Sender inserts a 0 after each sequence of five 1 The receiver removes this zero
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.100
8
Address
8
Control
0
Data
16
Checksum
8
01111110
Address
contains the address of the receiver, only important when multiple terminal on line on point-to-point lines used to distinguish commands from responses sequence numbers, acknowledgements, and some other purposes arbitrary long, however efficiency of the checksum falls of with increasing frame length is computed by using a CRC
Control Data
Checksum
4.101
Supervisory (S-Frame)
Supervisory frames are used for flow and error control when piggybacking is not possible
Unnumbered (U-Frame)
Unnumbered frames are used for link management
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.102
High Level Data Link Control (HDLC) Control field of the header
Seq: sequence number
HDLC uses sliding window with a 3-bit sequence number
8 8 8 Control 0 Data 16 8
01111110 Address
Checksum 01111110
Bits
I-Frame
1
0
3
Seq
1
P/F
3
Next
P/F: Poll/Final
Used when a master polls a group of terminals If P: Terminal is invited to send data. All frames of the terminal have the P/F bit set to P, only the last frame is set to F
S-Frame
Type
P/F
Next
U-Frame
Type
P/F
Modifier
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.103
1
0 1 1 1 1 1
Fields 3 4 5
Seq. P
P/ F P/ F P/ F P/ F
6 7
Send frame Seq., ACK up to Next-1 in the other direction Ready to receive, ACK up to Next-1 in the other direction Temporarily not ready to receive, acknowledge up to Next-1 in the other direction NACK for Next, ACK up to Next-1. The sender should repeat everything beginning with Next
0 0 0 0 1
0 1 0 1 1
0 0 1 1 1
Connection Establishment
Announcement of connection termination General ACK (e.g. for connection establishment)
1 1
1 1 1
1 1
1 1 1
0 0
1 1 1
0 0
0 0 1
P F
F F F
0 1
0 0 0
1 1
0 0 0
0 0
1 1 0
Connection Termination
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.104
High Level Data Link Control (HDLC) There are some special commands provided
DISC (Disconnect): machine announces that it is going down SNRM (Set Normal Response Time): machine announces that it is back
Sequence numbers are set to zero
Enhancements
7-bit sequence numbers, instead of 3-bit sequence numbers
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.105
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.106
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.107
Features of PPP
PPP is defined in RFC 1661, RFC 1662, RFC 1663 Handles error detection, support multiple protocols Supports synchronous and asynchronous connections Framing method with error detection Link Control Protocol (LCP)
Initiation of connections Testing of connections Negotiation of options Terminating of connections
4.108
Point-to-Point Protocol (PPP) PPP frame format was chosen closely to resemble the HDLC frame format
Major difference is that PPP is character oriented and uses byte-stuffing
Control: unnumbered mode (marked by 00000011) without sequence numbers and acknowledgments as default procedure
Protocol: specifies contents of the data part (Payload), i.e., contains an identifier to inform the receiver about what to do.
00000110 means IP protocol used for processing the data.
4.109
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.110
Point-to-Point Protocol (PPP) The Link Control Protocol (LCP) frame types defined in RFC 1661
I = Initiator proposes option values R = Responder accepts or rejects proposed options
Name Configure-request Configure-ack Configure-nak Direction IR IR IR Description List of proposed options and values All options are accepted Some options are not accepted
Configure-reject
Terminate-request Terminate-ack Code-reject
IR
IR IR IR
Protocol-reject
Echo-request Echo-reply Discard-request
IR
IR IR IR
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.111
Some more PPP flavors PPPoE (PPP over Ethernet, RFC 2516)
Encapsulation of PPP frames inside Ethernet frames Often used in the context of DSL fits into telco architectures (virtually a connection over a Ethernet Relatively high overhead with small packets Can be replaced by DHCP
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.112
Protocol Verification
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.113
Protocol Verification Realistic protocols and their implementations are very complicated
How to verify that an implementation of a protocol is correct?
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.114
Protocol Verification
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.115
Finite State Machine Models Construct a finite state machine for a protocol Protocol machine
The machine is always in a specific state The states consist of all the values of its variables Often, a large number of states can be grouped Number of state is 2n, where n is the number of bits needed to represent all variables Well-known techniques from graph theory allow the determination of which states are reachable and which are not Reachability analysis
Incompleteness: protocol machine is in a state and the protocol does not specify what to do Deadlock: no exit or progress from a state Extraneous transition: event occurs in a state in which it should not occur
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.116
Finite State Machine Models Formal definition of a protocol machine as a quadruple (S, M, I, T)
S set of states the processes and channel can be in M set of frames that can be exchanged over the channel I set of initial states of the processes T set of transitions between states
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.117
Sender and receiver have 2 possible states 2 bits The whole system has 16 possible states 4 bits Each state is labeled by three characters: (SRC)
S {0 = sender transmits a 0-frame, 1 = sender transmits a 1-frame} R {0 = receiver expects 0-frame, 1 = receiver expects 1-frame} C {0 = 0-frame, 1 = 1-frame, A = ack-frame, - = empty}
Examples
(000) Sender sends 0-frame, receiver expects 0-frame, 0-frame on channel (01-) Sender sends 0-frame, receiver expects 1-frame, channel is empty
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.118
B
ex=0
B
ex=0
ack=0
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.119
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.120
B
ex=0
000
01A
10A
111
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.121
ack-frame lost
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
1-frame lost
4.122
Protocol Verification
Petri Net Models
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.123
Transitions
- drawn as horizontal or vertical bar
- have 0 or more inputs arcs - have 0 or more output arcs
Arcs
- connect places and transitions
Tokens
- drawn as filled circles - number of resources in state
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.124
PN = (P, T, F, W, M0)
P = {P1, P2, , Pm} T = {T1, T2, , Tn}
F(PxT)(TxP) W: F {1, 2, 3, }
M0: P {0, 1, 2, }
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.125
2 3 1
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.126
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.127
4.128
Transition 10
Transition 11
4.129
Transition 5
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.130
Summary The data link layer deals with networking of adjacent nodes The data link layer consists of two sublayers
Logical Link Control (LLC) Media Access Control (MAC)
Its main task is to provide services to the network layer This includes the delivery of error free frames, which contain payload from
the network layer
Transmission error Flow control
Implementation of protocols is very complicated and weird Formal methods for their verification are needed
Finite state machines
Petri nets
Univ.-Prof. Dr.-Ing. Jochen H. Schiller cst.mi.fu-berlin.de Telematics Chapter 4: Data Link Layer
4.131