Lecture 10 (Data Link Layer) Outline
Data link layer protocols: z z z z
HDLC PPP Ethernet Wireless LAN
CSC4430 – Data Communication and Computer Networks
1
10.1. Data Link Layer Protocols
Data link layer protocols HDLC
PPP LANs
z
Ethernet WLAN
HDLC (High-level Data Link Control) Base protocol for most data link layer protocols
z
PPP (Point-to-Point Protocol) Most popular dial-up networking protocol
z
Ethernet Most popular LAN protocol
z
IEEE 802.11 WLAN Most popular wireless LAN protocol
CSC4430 – Data Communication and Computer Networks
2
10.1.1. High-level Data Link Control
High-level Data Link Control (HDLC): z
z z z
Is a base protocol for all other bit-oriented data link layer protocols. Supports both half-duplex and full-duplex mode. Supports both point-to-point and multipoint. Link layer services: Framing: uses bit-oriented framing. Flow control: uses sliding window. Error control: uses CRC with either go-back-n ARQ or selective-reject ARQ. Link access control: uses polling method. MAC is not defined for multipoint configuration.
CSC4430 – Data Communication and Computer Networks
3
10.1.1. High-level Data Link Control
HDLC frame:
z z
Flag: 01111110 (6 ones). Address: Address of the secondary station. 11111111 = broadcast address (to all stations).
z
Control: Differentiate 3 types of frames. Information, supervisory, and unnumbered frames.
z
FCS: Frame check sequence. Uses CRC for error-detection.
CSC4430 – Data Communication and Computer Networks
4
10.1.1. High-level Data Link Control
Bit stuffing: z
Is the process of adding one extra 0 whenever there are five consecutive 1s in the data so that the receiver does not mistake the data for a flag.
CSC4430 – Data Communication and Computer Networks
5
10.1.1. High-level Data Link Control
Three frame types: z z z
Information (I-frame): transports user data. Supervisory (S-frame): transports control information. Unnumbered (U-frame): reserved for system management.
CSC4430 – Data Communication and Computer Networks
6
10.1.1. High-level Data Link Control
Control field: z z
N(S) = N(R) = 3 bits – means window size = 8 Uses piggybacking – means combining data to be sent with acknowledgement of the frame received.
Poll/final field: z z
Has meaning only when it is set (= 1). Can mean poll or final depending the frame sender.
CSC4430 – Data Communication and Computer Networks
7
10.1.1. High-level Data Link Control
S-frame: z z
Used for link access control. Also used for ACK/NACK when the receiver does not have data (I-frame) to send.
CSC4430 – Data Communication and Computer Networks
8
10.1.1. High-level Data Link Control
Examples of S-frame usage in polling:
CSC4430 – Data Communication and Computer Networks
9
10.1.2. Point-to-Point Protocol
Point-to-Point Protocol (PPP): z
Is a protocol for configuring PPP connection and managing data transfer in a dial-up line. Telephone line provides the physical link. PPP provides the data link.
z z
Uses a variation of HDLC. Link layer services: Framing: uses bit-oriented framing. Flow control: none. Error control: uses CRC for error detection, no error correction. Link access control: detect connection liveness.
CSC4430 – Data Communication and Computer Networks
10
10.1.2. Point-to-Point Protocol
PPP frame:
z z
Most fields are similar to HDLC. Control: does nothing 11000000 show that the frame does not contain any sequence numbers and no flow and error control
z
Protocol: defines what is being carried in the data field. RFC 1700 gives a list of protocol numbers
CSC4430 – Data Communication and Computer Networks
11
10.1.2. Point-to-Point Protocol
Protocol field: z
Allow to carry data of any network layer protocol (not just IP) at the same time. LCP packets for link establishment. CHAP packets for user authentication. NCP, IPX, Appletalk packets – other network layer protocols.
z
This allows PPP to support: User authentication. Dynamic assignment of IP address.
CSC4430 – Data Communication and Computer Networks
12
10.1.2. Point-to-Point Protocol
Before exchanging network-layer data, data link peers must z
z
configure PPP link (max. frame length, user authentication) learn/configure network layer information e.g. for IP, it carries IP Control Protocol (IPCP) messages to learn/configure IP address
CSC4430 – Data Communication and Computer Networks
13
10.1.2. Point-to-Point Protocol
Typical PPP connection states:
CSC4430 – Data Communication and Computer Networks
14
10.1.2. Point-to-Point Protocol
Typical PPP connection process:
Uses LCP
Uses PAP
Uses LCP CSC4430 – Data Communication and Computer Networks
15
10.1.2. Point-to-Point Protocol
LCP: Link Control Protocol z z
z
For establishing and terminating links. For configuring links – negotiating options between the two points. All LCP packets are carried in the data field of PPP frames.
CSC4430 – Data Communication and Computer Networks
16
10.1.2. Point-to-Point Protocol
LCP packet: z
Fields: Code: defines the type of LCP packet.
ID: is used to match a request with a reply. Length: length of the whole LCP packet. Information: contains options that can be negotiated between the two end points. CSC4430 – Data Communication and Computer Networks
17
10.1.2. Point-to-Point Protocol
PAP: Password Authentication Protocol z
A simple protocol for authenticating users.
CSC4430 – Data Communication and Computer Networks
18
10.1.2. Point-to-Point Protocol
PAP packet: z z
There are three types of PAP packets. PAP packets are encapsulated in a PPP frame.
CSC4430 – Data Communication and Computer Networks
19
10.1.3. Local Area Networks
A local area network: z
z
Is a data communication system that allows a number of independent devices to communicate directly with each other in a limited geographic area. Some LAN architectures: Ethernet Token Bus Token Ring, FDDI Wireless LAN
z
The data link layer of the LAN protocols are all based on HDLC.
CSC4430 – Data Communication and Computer Networks
20
10.1.3. Local Area Networks
IEEE Project 802: z
z
Specifies functions of the physical layer and data link layer to interconnect various LAN protocols. Specifies the internetworking between the LAN protocols.
CSC4430 – Data Communication and Computer Networks
21
10.1.3. Local Area Networks
IEEE 802.2 logical link control (LLC). z z z
Common to all LAN protocols Contains the end-user portions of the HDLC frame. LLC protocol data unit (PDU): DSAP and SSAP: identify the protocol stacks on the receiving and sending machines Control: same as HDLC control field.
CSC4430 – Data Communication and Computer Networks
22
10.1.3. Local Area Networks
IEEE 802.3, 802.4, 802.5, 802.6, 802.11: z z
z
Contains the physical layer specifications. Contains the data link layer specifications, including the framing, flow, error control to use, and physical address format. Defines media access control to resolve the contention for the shared media. IEEE 802.3 (Ethernet) – CSMA/CD IEEE 802.4 (Token Bus) – Token passing IEEE 802.5 (Token Ring) – Token passing IEEE 802.6 (FDDI) – Token passing IEEE 802.11 (Wireless LAN) – CSMA/CA
CSC4430 – Data Communication and Computer Networks
23
10.1.3.1. Ethernet
Ethernet: z
“Dominant” LAN technology. Cheap HK$100 for 100 Mbps. Simpler, cheaper than token passing LANs. Kept up with speed race: 10, 100, 1000 Mbps
z
Link layer services: Framing: Bit-oriented framing. Flow control: no flow control. Error control: CRC for error detection, no error correction – provide unreliable services. Link access control: uses CSMA/CD for MAC protocol.
CSC4430 – Data Communication and Computer Networks
24
10.1.3.1. Ethernet
Ethernet frame:
z
Preamble: 7 bytes with pattern 10101010. used to synchronize receiver, sender clock rates
z
SFD: signals the beginning of the frame. Preamble+SFD = Flag in HDLC.
z
z
Destination/source address: contains the physical address of the frame destination/source Data: LLC PDU, 46-1500 bytes.
CSC4430 – Data Communication and Computer Networks
25
10.1.3.1. Ethernet
Physical or Ethernet address: z
z z
Is a unique address encoded on its network interface card (NIC). Its length is six bytes. Commonly written as six pairs of hexadecimal digits with dashes or colons. e.g. 00-B0-D0-3C-D4-A4.
z
On your PC, try to find out the Ethernet address using winipcfg or ipconfig -all command.
CSC4430 – Data Communication and Computer Networks
26
10.1.3.1. Ethernet
Access method: CSMA/CD A: sense channel, if idle
then { transmit and monitor the channel; If detect another transmission then { abort and send jam signal; update # collisions; delay as required by exponential backoff algorithm; goto A } else {done with the frame; set collisions to zero}
} else {wait until ongoing transmission is over and goto A} CSC4430 – Data Communication and Computer Networks
27
10.1.3.1. Ethernet
Access method: CSMA/CD z z
Jam signal: make sure all other transmitters are aware of collision = 48 bits. Exponential backoff: Goal: adapt retransmission attempts to estimated current load. heavy load: random wait will be longer. First collision: choose K from { 0,1 } wait K × 512 bit transmission times After second collision: choose K from { 0,1, 2, 3 } … After ten or more collisions, choose K from { 0,1, 2, 3, 4, …, 1023 }
CSC4430 – Data Communication and Computer Networks
28
10.1.3.1. Ethernet
Physical specifications: z
Two categories:
First number indicates the data rate in Mbps. Support data rates between 1 to 100 Mbps.
Last number indicates the maximum cable length or the type of cable. CSC4430 – Data Communication and Computer Networks
29
10.1.3.1. Ethernet
Example: 10Base5 (thick Ethernet or Thicknet) z
Bus topology using a thick coaxial cable.
CSC4430 – Data Communication and Computer Networks
30
10.1.3.1. Ethernet
Repeaters used to connect up to multiple segments. Repeater repeats bits it hears on one interface to its other interfaces: physical layer device only! To reduce collisions, total length of bus should not exceed 2500 meters (5 segments).
CSC4430 – Data Communication and Computer Networks
31
10.1.3.1. Ethernet
Example: 10Base-T (twisted-pair Ethernet). z z
Star topology using unshielded twisted pair (UTP). Most popular standard.
CSC4430 – Data Communication and Computer Networks
32
10.1.3.1. Ethernet
Newer Ethernet standards: z
Fast Ethernet Operates at 100 Mbps instead of 10 Mbps
z
Gigabit Ethernet Operates at 1 Gbps
CSC4430 – Data Communication and Computer Networks
33
10.1.3.2. Wireless LAN
IEEE 802.11: z z
Defines physical layer and MAC functionalities. Physical: Uses unlicensed RF frequency 2.4Ghz and infrared. Allows bit rate 1–2 Mbps.
z
Link layer services: Framing: Bit-oriented framing. Flow control: no flow control. Error control: CRC for error detection, no error correction – provide unreliable services. Link access control: uses CSMA/CA for MAC protocol.
CSC4430 – Data Communication and Computer Networks
34
10.1.3.2. Wireless LAN
IEEE 802.11 architecture: z
Basic Service Set (BSS) (a.k.a. “cell”) contains: wireless hosts access point (AP): base station
z
Multiple BSS’s form the distribution system (DS).
CSC4430 – Data Communication and Computer Networks
35
10.1.3.2. Wireless LAN IEEE 802.11 CSMA: Sender - if sense channel idle for longer than DIFS time unit then transmit entire frame (no collision detection) - if sense channel busy then binary backoff
Receiver: - if received OK then return ACK after SIFS
Others z
defer access for NAV time units
DIFS = Distribution Inter Frame Space SIFS = Short Inter Frame Space NAV = Network Allocation Vector
CSC4430 – Data Communication and Computer Networks
36
10.1.3.2. Wireless LAN
Hidden terminal effect: z
Due to decreasing signal strength (obstacles, signal attenuation), A and C cannot hear each other. If they transmit at the same time to B, collisions will occur at B.
z
Goal: to avoid collisions at B. Use CSMA/CA: CSMA with Collision Avoidance
CSC4430 – Data Communication and Computer Networks
37
10.1.3.2. Wireless LAN IEEE 802.11 CSMA/CA: Explicit channel reservation z z z
sender: send short RTS receiver: reply with short CTS CTS reserves channel for sender, notifying (possibly hidden) stations
Avoid hidden station collisions RTS and CTS short: z z
collisions less likely end result similar to collision detection
CSC4430 – Data Communication and Computer Networks
RTS = Request to Send CTS = Clear to Send
38
10.1.4. Summary
Four popular data link protocols: z z z z
z
HDLC, PPP, Ethernet, IEEE 802.10. All uses bit-oriented framing. HDLC provides reliable services. All others derive from HDLC but provide no flow control and unreliable services. Popular MAC method: CSMA. Carrier sensing allow high throughput even at high load.
CSC4430 – Data Communication and Computer Networks
39
10.1.5. Further Readings
Data link layer protocols: z z z z
HDLC : Section 10.4. PPP : Chapter 15. Ethernet : Section 12.1 – 12.3. Wireless LAN Ross Section 5.7 http://www.palowireless.com/i802_11/tutorials.asp
CSC4430 – Data Communication and Computer Networks
40
Next Lecture
Internetworking Devices (Forouzan Chapter 21)
41