14-Datalink File
Download
Report
Transcript 14-Datalink File
The Data Link Layer
•
•
•
•
Data Link Types
Data Link Protocols
Access Methods
Data Link Sub-layers
30/11/10
14-Datalink
1
Data Link Types
•
•
•
•
Point-to-Point
Point-to-Multipoint
Links through Switched Networks
Broadcast
30/11/10
14-Datalink
2
Binary Synchronous Communication (BSC)
•
•
•
•
•
•
•
•
•
•
•
Developed by IBM, standardised by ISO (Basic Mode)
Connection-oriented
Half Duplex
Point-to-Multipoint or Point-to-Point
Asymmetric (Master-Slave polling)
Synchronous
Character-oriented
Byte Stuffed
VRC/LRC Error Checking (CRC for transparent mode)
Idle RQ (Stop and Wait)
Explicit Negative Acknowledgements (NAKs)
30/11/10
14-Datalink
3
High-level Data Link Control (HDLC)
• Developed by ISO (based on IBM’s proprietary SDLC
protocol)
• Connection-oriented
• Full Duplex
• Synchronous
• Bit-oriented
• Bit Stuffed
• CRC Error Checking
• Two classes (Six modes)
– Unbalanced. E.g. Normal Response Mode
– Balanced. E.g. Asynchronous Balanced Mode
30/11/10
14-Datalink
4
HDLC Normal Response Mode
•
•
•
•
•
Point-to-Multipoint (or Point-to-Point)
Asymmetric (Master-Slave polling)
Continuous RQ (Sliding Window) with Go Back N
No Explicit Negative Acknowledgements
Used for Mainframe-Terminal networks with Pointto-Multipoint or Point-to-Point Private Circuits
30/11/10
14-Datalink
5
HDLC Asynchronous Balanced Mode
•
•
•
•
•
Point-to-Point
Symmetric (Equal status for both ends)
Continuous RQ (Go Back N or Selective Reject)
Positive Acknowledgements - Receiver Ready (RR)
Explicit Negative Acknowledgements
– Reject (REJ) for Go Back N
– Selective Reject (SREJ)
– Flow Control - Receiver Not Ready (RNR)
• Often used as Layer 2 protocol for IP over Point-toPoint Private Circuits
30/11/10
14-Datalink
6
Link Access Protocol Balanced (LAPB)
• Subset of HDLC Asynchronous Balanced Mode
• Only supports Go Back N ARQ
• Also supports Asynchronous Balance Mode
Extended which provides 7 bit sequence numbers
(allowing window sizes of 128) for high speed or
long delay circuits (E.g. satellite)
• Used as the layer 2 protocol by X.25 packet
switched networks
30/11/10
14-Datalink
7
HDLC Frame Formats
• Unnumbered Frames
– Used for Connection Control with no sequence
numbers at all
• Information Frames
– Used to carry data with sequence numbers, but also
contains field for sequence number of acknowledged
frames (piggybacking)
• Supervisory Frames
– Used for Flow and Error Control with no data field but
do have sequence numbers of acknowledged frames
30/11/10
14-Datalink
8
Point-to-Point Protocol (PPP)
•
•
•
•
•
•
•
•
•
•
Based on HDLC
Connection-oriented
Full Duplex
Point-to-Point
Symmetric
Synchronous
Character-oriented
Byte Stuffed
CRC-16 or CRC-32 Error Checking
No flow control or error recovery. Relies on higher layers
30/11/10
14-Datalink
9
PPP Header
© Tanenbaum, Prentice Hall International
30/11/10
14-Datalink
10
Point-to-Point Protocol
• PPP is used for Internet access over a switched
network (E.g. Public Switched Telephone
Network)
• As well as supporting a frame protocol similar to
HDLC, it supports other sub-layer protocols
– Link Control Protocol
– Network Control Protocol
– Two alternative authentication protocols (PAP and
CHAP)
30/11/10
14-Datalink
11
Link Control Protocol (LCP)
• Encapsulated in a PPP frame
• Establishes, maintains, configures, tests and
terminates links
• Determines quality of link, closing if
necessary
• Negotiates options
– Maximum Receive Unit
– Authentication Protocol
– Compression
30/11/10
14-Datalink
12
Link Control Protocol Phases
© Tanenbaum, Prentice Hall International
30/11/10
14-Datalink
13
Network Control Protocol (NCP)
• Encapsulated in an PPP frame
• The NCP is used to configure the Network Layer
protocol
• A specific Network Control Protocol is used
dependent on which Network Layer is supported
• For IP, the IP Control Protocol (IPCP) is used. For
IPX, it is IPXCP
• IPCP will also configure an IP address, if
necessary
30/11/10
14-Datalink
14
Password Authentication Protocol (PAP)
• PAP is encapsulated in a PPP frame
• 2 way handshake performed once at link
establishment
• Sends username password repeatedly in
plaintext and hence is not secure
• The ISP must close the link, if it is incorrect
30/11/10
14-Datalink
15
Challenge Handshake Authentication Protocol (CHAP)
• 3 way handshake (challenge, response and
accept/reject)
• Password is not transmitted across the network
and is hence secure
• Challenge packet contains a challenge value
(usually a few bytes)
• Response applies a pre-defined function to the
challenge value and the user’s password
• Challenger performs the same calculation and
checks the response
• Challenge can also be repeated at any time
30/11/10
14-Datalink
16
Switched Links
• Data Link Protocols, such as HDLC and
PPP are often used to carry data over links
through switched networks such as:
– Public Switched Telephone Network (PSTN)
– Integrated Services Digital Network (ISDN)
– ADSL Broadband Access Network
30/11/10
14-Datalink
17
Broadcast Links
• Data Link Protocols are often used over broadcast
links, but the Point-to-Point and Point-toMultipoint protocols will not support broadcast
links where there are multiple transmitters
• The major problem to overcome with broadcast
links such as radio and Ethernet LANs is
contention (resulting in collisions) accessing the
link. Only one device can be permitted to access a
broadcast link at any one time
• The means of overcoming contention is called the
Access Method
30/11/10
14-Datalink
18
Access Methods
• There are several strategies for handling
contention:
–
–
–
–
–
–
30/11/10
Frequency Division Multiple Access (FDMA)
Time Division Multiple Access (TDMA)
Code Division Multiple Access (CDMA)
Carrier Sense Multiple Access (CSMA)
Token Passing
Spread Spectrum
14-Datalink
19
Frequency Division Multiple Access (FDMA)
• FDMA solves the contention problem by
dynamically allocating a different frequency to
each station that wants to transmit
• Allocations are requested via a common control
channel which has its own access method
• FDMA was used on 1st Generation (analogue)
mobile phone networks
• A similar method, called Wavelength Division
Multiple Access is used on all optical LANs
30/11/10
14-Datalink
20
Time Division Multiple Access (TDMA)
• TDMA solves the contention problem by
dynamically allocating different timeslots to
each station that wants to transmit
• Allocations are requested via a common
control channel which has its own access
method
• TDMA is used on 2nd Generation (GSM)
mobile phone networks
30/11/10
14-Datalink
21
Code Division Multiple Access (CDMA)
• CDMA is a technique that allows all transmissions to
share the same channel by marking each
communication with a unique ID (the code)
• The receiver is able pick out the one communication it
wants to receive by detecting the code
• A good analogy is a conversation between two people
in a noisy party where lots of other conversations are
going on around them, but a listener can focus in on just
one speaker
• CDMA is used by 3rd Generation mobile phone
networks
30/11/10
14-Datalink
22
Carrier Sense Multiple Access
• Carrier Sense means listen to make sure that nobody else is
transmitting before you start
• CSMA/CD (with Collision Detection) - used by Ethernet
– Also keep listening after starting to transmit to make sure that nobody else
has transmitted while you were
– Back off for a random period of time, and retransmit
• CSMA/CA (with Collision Avoidance) - used on Wireless LANs
– Send a short “request to send” frame and wait for “clear to send” frame
before transmitting data
– All other stations will see this and will hold off
– Any collision of CTS/RTS frames will be dealt with by backing off for a
random period
30/11/10
14-Datalink
23
Token Passing
• A single token is circulated around the network
• No station can transmit unless it has the token
• Once the station verifies that its transmission has been
received it releases the token for another station to use
• The network needs to be continually monitored to ensure that
the token doesn’t get lost and must be recreated when
necessary
• Token passing networks unlike CSMA networks can
guarantee fair access with a fixed maximum delay
• The IBM Token Ring LAN is an example of a network that
uses a token passing access method
30/11/10
14-Datalink
24
Spread Spectrum
• Spread spectrum techniques, which share a wide frequency band
(much wider than the original signal), are used to support
multiple access in Wireless LANs. There are many different
techniques
– Code Division Multiple Access (CDMA)
• frequency of transmitted signal is made to vary according to a defined pattern
(code)
– Frequency Hopping Spread Spectrum (FHSS)
• Hops between frequencies according to pseudo-random sequence
– Direct Sequence Spread Spectrum (DSSS)
• codes one bit as n bits
– Orthogonal Frequency Division Multiplexing (OFDM)
• used in IEEE 802.11a – splits signal across many frequencies which do not
interfere with each other
– High Rate Direct Sequence Spread Spectrum (HR-DSSS)
• used in IEEE 802.11b – higher speed version of DSSS
30/11/10
14-Datalink
25
Data Link Sub-layers
• The IEEE who have standardised LAN
protocols have divided the Data Link Layer
into two sub-layers
– Logical Link Control (LLC)
• Common to all LANs
• Independent of physical media, topology and access
method
– Media Access Control (MAC)
• Specific to particular media, topology and access
methods
30/11/10
14-Datalink
26
Logical Link Control
• Functions
– Identifies and encapsulates Network Layer
Protocols
– Flow Control
– Error Control
30/11/10
14-Datalink
27
Media Access Control (MAC)
• Functions
–
–
–
–
30/11/10
Access to the physical media
Physical (MAC) Addressing
Ordered Delivery
Managing network topology (including
bridging)
14-Datalink
28
MAC Addresses
• MAC (or Physical) addresses are burned into Network
Interface Cards
• They uniquely identify the card
• They are 48 bits (6 bytes) long
• They are split into two 24 bit parts
– Organisationally Unique Identifier (OUI) which identifies the
manufacturer of the card and is assigned by the IEEE
– A manufacturer assigned serial number
• MAC addresses are usually shown as 12 hexadecimal
digits, grouped in pairs to represent each byte and
separated by colons or hyphens. E.g. 00:06:f5:00:1f:2c
30/11/10
14-Datalink
29