Download presentation
Presentation is loading. Please wait.
1
Chapter 5 Data Link Layer
2
OBJECTIVES After reading this chapter, the reader should be able to:
Understand the functions of the data link layer. Understand the concept of the hop-to-hop delivery compared to host-to-host delivery and application-to-application delivery. Understand the concept of access method and define different access methods used in LANs and WANs . Understand how error control is handled at the data link layer. Understand the addressing mechanism used in the data link layer and how network layer addresses are mapped to data layer addresses.
3
5.1 DUTIES OF THE DATA LINK LAYER
4
Data link layer in the Internet model
Figure 5-1 Data link layer in the Internet model
5
Data-link layer duties
Figure 5-2 Data-link layer duties
6
5.2 HOP-TO-HOP DELIVERY
7
Figure 5-3 Hop-to-hop delivery Transport layer :application program to application program Network layer : host to host delivery (source to destination) Datalink layer : hop to hop
8
5.3 PACKETIZING
9
packetizing Different protocols have different names for the packet at the data link layer Most LANs (ethernet) refer to the packet as frames. ATM WAN refers to a packet as a cell A header and trailer are usually added to a packet received from the network layer Header : length of the data, addressing information… Trailer : error detection
10
5.4 ADDRESSING
11
Technical Focus: Addresses in Local Area Networks
The physical address for most computers on local area networks is imprinted on the network card that is installed in the computer. If the user or network manager changes the network card (because of a failure, for example), the physical address of the computer is changed. In most cases, changing the network card requires reconfiguration of the computer.
12
Addressing The data link layer addresses are called physical addresses or MAC addresses and are used to find the address of the next hop in the hop to hop delivery The physical address used by a LAN is totally different from that used by a WAN A LAN address is 6 bytes (48 bits) long A WAN address is usually longer
13
ARP (address resolution protocol)
Mapping the logical address (IP address) to the physical address (MAC address) dynamically. Anytime a host or a router needs to find the physical address of another host or router on its network, it sends an ARP query packet. The packet includes the physical and IP addresses of the sender and the IP address of the receiver. Because the sender does not know the physical address of the receiver, this query is broadcast over the network.
14
Figure 5-4 ARP operation
15
5.5 ERROR CONTROL
16
Error control In data communication, errors are inevitable
Using better equipment and more reliable transmission media may reduce the frequency of occurrence. But it can never eliminate errors. Detect and correct errors
17
Note: Data can be corrupted during transmission. For reliable communication, errors must be prevented, or detected and corrected.
18
Source of errors White noise : Impulse noise Crosstalk
due to the heat; is constant by nature Impulse noise It is a surprise signal that suddenly affects the medium Can not be predicted Effect of impulse noise depends on the speed of data transmission Crosstalk It is the effect of one medium on another
19
Source of errors Echo Jitter Attenuation Distortion
We have echo when a sending device receives some of the energy it has sent Jitter It is the result of a change in the signal when it passes through an electronic device Attenuation A signal may become too weak if it travels a lon distance Distortion Harmonics are combined at the receiver, the signal is not exactly the one sent by sender
20
In a single-bit error, only 1 bit in the data unit has changed.
Note: In a single-bit error, only 1 bit in the data unit has changed.
21
Single-bit error ASCII LF : line feed ASCII STX : start of text
Figure 5-5 Single-bit error ASCII LF : line feed ASCII STX : start of text
22
Note: A burst error means that two or more bits in the data unit have changed.
23
Burst error of length five
Figure 5-6 Burst error of length five The errors not necessarily occur in consecutive bits. The length of the burst is measured from the first corrupted bit to the last corrupted bit Some bits in between may not have been corrupted
24
Error prevention White noise : reduce the ambient temperture
Crosstalk : twist or shield the cable Attenuation : repeaters Errors are inevitable, for accuracy we need to detect and correct errors
25
Note: Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destination.
26
Figure 5-7 Redundancy
27
Detection methods cyclic redundancy check Vertical redundancy check
Figure 5-8 Detection methods cyclic redundancy check Vertical redundancy check Longitudinal redundancy check
28
Note: In vertical redundancy check (VRC), a parity bit is added to every data unit so that the total number of 1s becomes even. Most common and last expensive mechanism for error detection. Often called parity check. A redundant bit (parity bit) is added to make the number of 1s even.
29
Even parity VRC concept
Figure 5-9 Even parity VRC concept
30
Longitudinal redundancy check
Figure 5-10 LRC Longitudinal redundancy check New column Calculate the parity bit for each column and create a new column
31
Note: In longitudinal redundancy check (LRC), a block of bits is divided into rows and a redundant row of bits is added to the whole block.
32
Cyclic redundancy check
Figure 5-11 CRC Cyclic redundancy check Most powerful redundancy check. Based on binary division rather than binary addition. CRC remainder is appended to the end of the data.
33
Error correction Once the data are detected, the receiver has 3 choice : Simply discard the data Discard the data but request a retransmission Correct the data Data correction is select when the data packet is very small and we need the accurcy but can not wait for retransmission Very difficult to achieve if there are more than a few bits in error.
34
Error correction using retransmission
If the sender has not received positive news in due time, the frame is retransmitted. The frame is damage : The receiver send a negative acknowledgement The receiver does not send an acknowledgement The acknowledgement is lost There are two protocols for retransmission : Stop and wait automatic repeat request Sliding window automatic repeat request
35
Stop and wait ARQ Only the fate of one frame at any moment is unknown
Figure 5-12 Stop and wait ARQ Only the fate of one frame at any moment is unknown After sending a frame the sender stops and waits before the next frame is sent
36
Technical Focus: Procedure for Stop-And-Wait ARQ
The sending device keeps a copy of the last frame transmitted until it receives an acknowledgment for that frame Both data frames and ACK frames are numbered 0 and 1 alternately. A data 0 frame is acknowledged by an ACK 1 frame. If an error is discovered in a data frame, a negative acknowledgment (NAK) frame is returned. If an expected acknowledgment is not received within an allotted time period, the sender assumes that the last data frame was lost in transit and sends it again.
37
Figure 5-13 Sliding-window ARQ
38
Technical Focus: Procedure for Sliding-Window ARQ
The sending device keeps copies of all transmitted frames until they have been acknowledged. In addition to ACK frames, a receiver can return a NAK frame if the data have been received damaged. The NAK frame tells the sender to retransmit a damaged frame. Like stop-and-wait ARQ, the sending device in sliding-window ARQ is equipped with a timer to enable it to handle lost acknowledgments.
39
5.6 FLOW CONTROL
40
Note: Flow control refers to a set of procedures used to restrict the amount of data the sender can send before waiting for acknowledgment. Buffer : the rate of transmission is faster than check and process , for this reason, each receiving device has a block of memory called buffer, reserved for storing incoming data until they are processed. If the buffer begins to fill up, the receiver must tell the sender to halt transmission until it is once again able to receive.
41
5.1 MEDIUM ACCESS CONTROL
42
Figure 5-14 Medium access methods
43
Select The select procedure is used whenever the primary has
Figure 5-15 Select Know if the secondary is ready to accept the data The select procedure is used whenever the primary has something to sent. The select procedure has priority over the poll procedure
44
Figure 5-16 Poll
45
Note: The poll/select method is mostly used in time-sharing systems when a central computer is used to control other computers.
46
Token passing In the token passing method, the permit is passed from one computer to another. Stations are arranged around a physical or logical ring Permit is a small frame called token. If a station needs to send data, it waits for the token and captures it. After capturing the token, the station send one or more frames.
47
Figure 5-17 Token passing network
48
Random access The station checks to make sure the medium is idle.(carrier sense) If the medium is idle, the station can send data. There is still a potential for collision.to detect collision and send the data again, the station needs to continue monitoring the medium.
49
CSMA/CD Carrier sense multiple access with collision detection.
Check the level of energy in the medium to tell the idleness of the medium. Frame from a distant station might be undetectable If the stations discovered a collision(a very high level of energy), they know that their frames have been destroyed To minimize the risk of collision, two stations each wait a random amount of time
50
CSMA/CA Collision is avoided by sending a special frame to tell other stations how long it is usuing the medium before sending data. If it receives no objection from any other station, it means that it can send data
51
Note: Token passing is used mostly by local area networks (LANs). We discuss LANs in Chapter 9.
52
CSMA/CD is used in the Ethernet LAN discussed in Chapter 9.
Note: CSMA/CD is used in the Ethernet LAN discussed in Chapter 9.
53
CSMA/CA is used in the wireless LANs discussed in Chapter 10.
Note: CSMA/CA is used in the wireless LANs discussed in Chapter 10.
54
5.8 DATA LINK PROTOCOLS
55
Note: A data link protocol is a set of specifications used to implement the data link layer.
56
Note: In a character-oriented protocol, the frame is interpreted as a series of characters. In a bit-oriented protocol, the frame or packet is interpreted as a series of bits.
57
Note: All bit-oriented protocols are related to high-level data link control (HDLC), a bit-oriented protocol.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.