New framing-protocols

63
Data Link Control 1. Framing 2. Flow and Error Control 3. Protocols 4. Noiseless Channels 5. Noisy Channels 6. HDLC 7. Point-to-Point Protocol

description

 

Transcript of New framing-protocols

Page 1: New framing-protocols

Data Link Control

1. Framing 2. Flow and Error Control3. Protocols4. Noiseless Channels5. Noisy Channels6. HDLC7. Point-to-Point Protocol

Page 2: New framing-protocols

Framing

• Data link layer needs to pack bits into frames, so that each frame is distinguishable from another

• Separate a message from one source to a destination, or from other messages to other destinations, by adding a sender address and a destination address

Page 3: New framing-protocols

Fixed-size framing: there is no need for defining the bound-aries of the frames.

Variable-size framingNeed a way to define the end of the frame and the begin-ning of the nextUsed in LANs

Two ApproachesCharacter-oriented approach and bit-oriented approach

Page 4: New framing-protocols

Character-Oriented Protocols

• Frame structure

Header carries the source and destination address and some control information.Trailer carries error detection and correction bitsTo separate one from the next, an 8 bit flag is added at the begin-ning and end of each frame

Page 5: New framing-protocols

• Any pattern used for flag can also be part of the information, in that case the receiver can detect end of frame in middle, think it has reached at the end. To fix this problem byte stuff-ing is used.

• In this a special byte called ESC (Escape character) is added before to the flag byte. Whenever the receiver encounters ESC byte, it is removed and the next byte is treated as data not as delimeter.

• Again problem if there is ESC in data, then one ESC before data ESC.

Page 6: New framing-protocols

• Byte stuffing: process of adding 1 extra byte whenever there is a flag or escape character in the text

Page 7: New framing-protocols

Bit-Oriented Protocols

• Frame structure

• Bit stuffing: process of adding one extra 0 whenever five consecutive 1s follow a 0 in the data

Page 8: New framing-protocols

Flow and Error Control• Data link control = flow control + error control• Flow control refers to a set of procedures used to restrict the amount of

data that the sender can send before waiting for acknowledgement• Error control in the data link layer is based on automatic repeat request

(ARQ), which is the retransmission of data• All the protocols are unidirectional i.e. the data frames travel from source

to destination node. Only ACK, NAK(Negative ACK) frames can flow in opposite direction.

Page 9: New framing-protocols

Noiseless Channels: Simplest Protocol• Simplest protocol with no flow or error control. The receiver immedi-

ately handle the frame.

Page 10: New framing-protocols

Simplest Protocol• Sender-site algorithm

• Receiver-site algorithm

Page 11: New framing-protocols

Stop-and-Wait Protocol

• Simple tokens of ACK and flow control added

Page 12: New framing-protocols

Stop-and-Wait Protocol• Sender-site algorithm

• Receiver-site algorithm

Page 13: New framing-protocols

Stop-and-Wait Protocol: Example

Page 14: New framing-protocols

Noisy Channels: Stop-and-Wait ARQ

• Stop-and-wait Automatic Repeat Request (ARQ)• Error correction in Stop-and-Wait ARQ is done by keeping

a copy of the sent frame and retransmitting of the frame when the timer expires

• In Stop-and-Wait ARQ, we use sequence numbers to num-ber the frames. The sequence numbers are based on mod-ulo-2 arithmetic

• Acknowledgment number always announces in modulo-2 arithmetic the sequence number of the next frame ex-pected.

Page 15: New framing-protocols

Stop-and-Wait ARQ

Page 16: New framing-protocols

Stop-and-Wait ARQ• Sender-site algorithm

Page 17: New framing-protocols

Stop-and-Wait ARQ• Receiver-site algorithm

Page 18: New framing-protocols

Stop-and-Wait ARQ: Example

Page 19: New framing-protocols

Go-Back-N ARQ• Pipelining : A task is often begun before the previous task

has ended. To improve the efficiency of transmission mul-tiple frames must be in trasition while waiting for ac-knowledgement

• In the Go-Back-N Protocol, the sequence numbers are in sequence using modulo 2m, where m is the size of the se-quence number field in bits. If m= 4, then sequence num-bers will be from 0 to 15. after that the sequence will be repeated.

• In this protocol the abstract concept of sliding window is used, that defines the range of sequence numbers that is the concern of sender and the receiver.

Page 20: New framing-protocols

The range which is the concern of the sender is called the send sliding window.

The range which is the concern of the sender is called the re-ceive sliding window

The send window is an abstract concept defining an imaginary box of size 2m − 1 with three variables: Sf, Sn, and Ssize

The send window can slide one or more slots when a valid ac-knowledgment arrives.

The send window divides the possible sequence numbers in four regions.

The send window can slide one or more slots when a valid ac-knowledgement arrives.

Page 21: New framing-protocols
Page 22: New framing-protocols

• The receive window is an abstract concept defining an imaginary box of size 1 with one single variable Rn. The window slides when a correct frame has arrived; sliding oc-curs one slot at a time.

Page 23: New framing-protocols

• Sliding windows, Timers, ACK, Resending a frame

Page 24: New framing-protocols

Go-Back-N ARQ: Send Window Size• In Go-Back-N ARQ, the size of the send window must be less than 2m;

the size of the receiver window is always 1• Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the

size of the send window is 1

Page 25: New framing-protocols

Go-Back-N ARQ: Sender Algorithm

Page 26: New framing-protocols
Page 27: New framing-protocols

Go-Back-N ARQ: Receiver Algorithm

Page 28: New framing-protocols

Go-Back-N ARQ: Example 1

Page 29: New framing-protocols

Go-Back-N ARQ: Example 2

Page 30: New framing-protocols

Selective Repeat ARQ

Go back N ARQ simplifies the process at the receiver site. The receiver keeps track of only one variable and there is no need to buffer out of order frames, they are simply discarded.

However this protocol is very inefficient for a noisy link, where a frame has higher probability of damage, which means resending of the multiple frames. This resending uses up the bandwidth and slows down the transmission.

For noisy links there is another mechanism that does not resend N frames when just one frame is damaged, only the damaged frame is resent. This mechanism is called Selective ARQ. It is more efficient for noisy links, but the processing at the receiver side is more complex.

Page 31: New framing-protocols

Selective Repeat ARQ• Sender window size

The size of the send window is much smaller i.e 2m-1

If m =4, the sequence numbers will be from 0 to 15, but the size of win-dow is just 8.

Page 32: New framing-protocols

• Receive window size

The size of the receive window is the same as the send window. The colored frames are the frames received out of order and are waiting for their neighbors.

Page 33: New framing-protocols

Selective Repeat ARQ

Page 34: New framing-protocols

Selective Repeat ARQ: Window Size• The size of the sender and receiver window must be at most one-half

of 2m

Page 35: New framing-protocols

Selective Repeat ARQ: Sender-Site Algorithm

Page 36: New framing-protocols
Page 37: New framing-protocols

Selective Repeat ARQ: Receiver-Site Algorithm

Page 38: New framing-protocols
Page 39: New framing-protocols

Selective Repeat ARQ: Example

Page 40: New framing-protocols

Piggybacking• To improve the efficiency of the bidirectional protocols• Piggybacking in Go-Back-N ARQ

Page 41: New framing-protocols

HDLC• High-level Data Link Control• Two common transfer mode: normal response mode (NRM) and asyn-

chronous balanced mode (ABM)

Page 42: New framing-protocols

HDLC: Frames• I(information)-frames, S(supervisory)-frames, U(unnumbered frame)-

frames• Flag field: 01111110 to identify both the beginning and the end of a

frame and serve as synchronization pattern for receiver• FCS field: 2- or 4-byte ITU-T CRC for error detection

Page 43: New framing-protocols

HDLC: Frames• Control Field: 1- or 2-byte segment of the frame used for flow and er-

ror control• Determine the type of frame and define its functionality• Control field for I-frame: P/F (poll/final bit for primary/secondary)

Page 44: New framing-protocols

HDLC: Frames• Control field for S-frame• Receive ready (RR), Receive not ready (RNR), Reject (REJ) Selective

reject (SREJ)

Page 45: New framing-protocols

HDLC: Frames• Control field for U-frame

Page 46: New framing-protocols

HDLC: Example 1• Connection and disconnection

Page 47: New framing-protocols

HDLC: Example 2• Piggybacking without error

Page 48: New framing-protocols

HDLC: Example 3• Piggybacking with error

Page 49: New framing-protocols

HDLC: Bit Stuffing and Unstuffing

Page 50: New framing-protocols

Point-to-Point Protocol: PPP• One of the most common protocols for point-to-point access• Many Internet users who need to connect their home computer to the

server of an Internet service provider use PPP• A point-to-point link protocol is required to control and manage the

transfer of data• PPP defines/provides

– the format of the frame to be exchanged between devices– how two devices negotiate the establishment of the link and the exchange of data– how network layer data are encapsulated in the data link frame– how two devices can authenticate each other– multiple network layer services– connection over multiple links– Network address configuration

• But, several services are missing for simplicity– no flow control, simple error control (detection and discard), no sophisticate address-

ing for multipoint configuration

Page 51: New framing-protocols

PPP Frame• Flag: 01111110 the same as HDLC, but it treated as a byte because of

PPP is a byte-oriented protocol• Address: 11111111 (broadcast address)• Control: No need because PPP has no flow control and limited error con-

trol• PPP is a byte-oriented protocol using byte stuffing with the escape byte

01111101

Page 52: New framing-protocols

PPP: Transition States

Page 53: New framing-protocols

PPP: Multiplexing• PPP uses another set of other protocols to establish the link, authenticate

the parties, and carry the network layer data• Three sets of protocols defined for powerful PPP: LCP, two APs, several

NCPs

Page 54: New framing-protocols

LCP: Encapsulated in a Frame

Page 55: New framing-protocols

LCP: Common Options

• Options are inserted in the information field of the config-uration packets

Page 56: New framing-protocols

Authentication

• Authentication means validating the identity of a user who needs to access

• PPP is designed for use over dial-up links

User authentication is necessary• PPP has two protocols for authentication

– Password Authentication Protocol (PAP)– Challenge Handshake Authentication Protocol

(CHAP)

Page 57: New framing-protocols

Password Authentication Protocol (PAP)

Page 58: New framing-protocols

Challenge Handshake Authentication Protocol (CHAP)

• Three-way hand-shaking authentication protocol with greater security than PAP

Page 59: New framing-protocols

Network Control Protocol: NCP

• PPP is a multiple-network layer protocol.• It can carry a network data packet from protocols defined by the Inter-

net, OSI, Xerox, DECnet, AppleTalk, Novel• IPCP (IP Control Protocol)

– Configures the link used to carry IP packets in the Internet

Page 60: New framing-protocols

IPCP Packet

IP Datagram in a PPP frame

Page 61: New framing-protocols

Multiple PPP

Page 62: New framing-protocols

Example (1)

Page 63: New framing-protocols

Example (2)