0% found this document useful (0 votes)
151 views22 pages

CN Unit 2

This document discusses various topics related to data link layer design and protocols. 1. It describes framing methods like fixed size, variable size, and flow control and error detection codes like CRC and checksums. 2. It discusses elementary data link layer protocols for simplex and sliding window protocols. 3. The services provided by the data link layer to the network layer are described, including unacknowledged connectionless, acknowledged connectionless, and acknowledged connection-oriented services. Error handling strategies for each are also summarized.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
151 views22 pages

CN Unit 2

This document discusses various topics related to data link layer design and protocols. 1. It describes framing methods like fixed size, variable size, and flow control and error detection codes like CRC and checksums. 2. It discusses elementary data link layer protocols for simplex and sliding window protocols. 3. The services provided by the data link layer to the network layer are described, including unacknowledged connectionless, acknowledged connectionless, and acknowledged connection-oriented services. Error handling strategies for each are also summarized.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Computer Networks

UNIT-2
Data link layer: Design issues, Framing: fixed size framing, variable size framing, flow control, errorcontrol, error detection
and correction codes, CRC, Checksum: idea, one’s complement internetchecksum, services provided to Network Layer,
Elementary Data Link Layer protocols: simplexprotocol, Simplex stop and wait, Simplex protocol for Noisy Channel.
Sliding window protocol: One bit, Go back N, Selective repeat-Stop and wait protocol, Data link layer inHDLC:
configuration and transfer modes, frames, control field, point to point protocol (PPP): framingtransition phase,
multiplexing, multi link PPP.
 DATA LINK LAYER DESIGN ISSUES:
Functions of data link layer are
1. Providing well defined service interface to the network layer.
2. Dealing with transmission errors.
3. Regulating the flow of data.
To achieve these goals, the data link layer takes the packets it gets from the network layer and change as them into frames for
transmission.
Each frame contains a frame header, a payload field for holding the packet, and a frame trailer.

Services provided to the Network layer:


The function of the data link layer is to provide services to the network layer. The principal service is transferring
data from the network layer on the source machine to the network layer on the destination machine. On the source
machine is an entity, call it a process, in the network layer that hands some bits to the data link layer for transmission to
the destination. The job of the data link layer is to transmit the bits to the destination machine so they can be handed
over to the network layer there, as shown in Fig. 1(a). The actual transmission follows the path of Fig. 1(b), but it is
easier to think in terms of two data link layer processes communicating using a data link protocol.

The principal service of data link layer is transferring data from the network layer on the source machine to the
network layer on the destination machine.
Three commonly provided services are:
1. Unacknowledged connection less service.

Ch.santhi Asst.prof., CSE dept Page 1


Computer Networks

2. Acknowledged connection less service.


3. Acknowledged connection-oriented service.

1. Unacknowledged connection less service:

 Unacknowledged connectionless service consists of having the source machine send independent frames to the
destination machine without having the destination machine acknowledge them..
 No logical connection is established between source & destination.
 If a frame is lost, no attempt is made to detect the loss of the frame.
 This service is appropriate when the error rate is low.
 In this the destination m/c does not send any acknowledgement back to the sender.
 It is useful when an error rate is very low.
 Most LAN’s are used unacknowledged connectionless services.

2. Acknowledged connectionless service:


 No logical connection is established between source &destination machine.
 But the receiver sends an acknowledgement back to the sender.
 By receiving the acknowledgement the sender knows that the frame has arrived correctly.
 If the acknowledgement is not received with in a specified time interval, it can be sent again.
 The network layer can always send a packet and wait for it to be acknowledged.
 If the acknowledgement is not forthcoming before the timer expires, the sender can just send the entire message again.
 The trouble of this strategy is that frames usually have a strict maximum length imposed by the hardware and network
layer packets do.
3.Acknowledgement connection –oriented service:
 Before any data is transferred a connection is established between source & destination machines.
 It guarantees that each frame is received exactly once and that all frames are received in the right order.
 In this service the data transfer goes through three distinct phases.
 In the first phase, the connection is established variables are initiated & counters keep track of which frames have been
arrived &which once have not.
 In the second phase, one or more frames are actually transmitted.
 In the third phase, the connection is released freeing up the variables, buffer &other resources.
 Ex: In a WAN subnet consisting of routers connected by point-to-point leased telephone lines.
 When a frame arrives at a router, the hardware checks it for errors then passes the frame to the data link layer software .
 The data link layer software checks to see if this is the frame expected, and if so, gives the packet contained in the
payload field to the routing software.
 The routing software then chooses the appropriate outgoing line and passes the packet back down to the data link layer
software.
 FRAMING:
 In order to provide services to the network layer, the data link layer must use the services from the physical layer.
 The physical layer sends the bit stream to the data link layer.
 The no. of bits received may be different from the no. of bits transmitted.
 The data link layer convert the bit stream into data frames and compute the checksum for each frame.
 At the destination, the check sum is recomputed.

Ch.santhi Asst.prof., CSE dept Page 2


Computer Networks

 If the recomputed check sum is different from the one contained in the frame.
 An error has occurred and the data link layer deals with the errors.
 To mark the start and end of each frame, we use four methods. They are
1. Character count.
2. Flag bytes with byte stuffing.
3. Starting and ending flags with bit stuffing.
4. Physical layer coding violations.
1. Character count:
This method uses a field in the header to specify the number of characters in the frame.
 The first framing method uses a field in the header to specify the number of characters in the frame. When the
data link layer at the destination sees the character count, it knows how many characters follow and hence
where the end of the frame is. This technique is shown in Fig.1(a) for four frames of sizes 5, 5, 8, and 8
characters, respectively.

1.(a) With out error 1.(b) with error

 For example, if the characters count of 5 in the second frame becomes a 7.


 The destination will go out of synchronize and will be unable to locate the start of the next frame.
 The destination does not know how many characters to skip over to get to the start of the re- transmission. For this
reason, the character count is rarely used.

2. Flag bytes with byte stuffing/character stuffing:


 In this method, each frame start and end with special bytes. Most protocols have used the same byte called a flag
byte as FLAG at both starting &ending of the frame.
 The second framing method gets around the problem of resynchronization after an error by having each
frame start and end with special bytes. In the past, the starting and ending bytes were different, but in recent
years most protocols have used the same byte, called a flag byte, as both the starting and ending delimiter,
as shown in 3.2(a) as FLAG.
 In this way, if the receiver ever loses synchronization, it can just search for the flag byte to find the end of
the current frame. Two consecutive flag bytes indicate the end of one frame and start of the next one.
 Even if the receiver ever loses synchronization, it can just search for the flag byte to find the end of the current
frame.

Ch.santhi Asst.prof., CSE dept Page 3


Computer Networks

Fig . (a) A frame delimited by flag bytes. (b) Four examples ofbyte sequences before and after byte stuffing.
 The sender’s data link layer inserts a special escape byte “ESC“just before each flag byte the data. At the
receiving end, the data link layer removes the escape byte before the data are given to the network layer. This
technique is called” byte stuffing” or “character stuffing”.
 A framing flag byte can be identified by the absence or presence of an escape byte in the data. If an escape byte
occurs in the middle of data that, too, is stuffed with an escape byte.
 Any single escape byte is part of an escape sequence, where as a doubled one indicates that a single escape
occurred naturally in the data. Examples of the byte sequences before & after byte stuffing.
 A major disadvantage of this framing method is What happens if an escape byte occurs in the middle of the
original data already. The transmission takes place by stuffed with an escape byte. Thus, any single escape
byte is part of an escape sequence, whereas a doubled one indicates that a single escape occurred naturally
in the data.
 It is used for 8-bit character only. Not all character codes use 8-bit characters, some use 16-bit characters, so a
new technique had to developed to allow sized characters.
3. Starting and ending flags, with bit stuffing:
 In this method, each frame begins and ends with a special bit pattern, 01111110 a flag byte.
 When the sender’s data link layer encounters five consecutive 1’s in the data, it automatically stuffs a 0 bit into
outgoing bit stream.
 This bit stuffing is similar to byte stuffing.
 When the receiver sees five consecutive incoming 1 bits, followed by a 0 bit, it automatically destuffs (i.e.,
deletes) the 0 bit. Just as byte stuffing is completely transparent to the network layer in both computers, so
is bit stuffing. If the user data contain the flag pattern, 01111110, this flag is transmitted as 011111010 but
stored in the receiver's memory as 01111110.
 The boundary between two frames can be recognized by the flag pattern.
 If the receiver losses its track the receives has to scan the input for flag sequences.
 The flag sequences occur only at frame boundaries and never with in the data.

Ch.santhi Asst.prof., CSE dept Page 4


Computer Networks

4. Physical layer coding violations:


 This framing method is used in the networks in which physical medium contains some redundancy. A 1 bit is a high
–low pair & a 0 bit is a low-high pair. It means that every data bit has a transmission in the middle. It makes easy for
the receiver to locate the bit boundaries.

 Error control:
 To make sure that all frames are eventually delivered to the network layer at the destination & in the proper order.
 The protocol calls for the receiver to send back special control frames bearing positive or negative acknowledgements
about the incoming frames.
 If a +ve acknowledgement is received the frame has arrived safely. If a – ve acknowledgement is received the frame has
gone wrong & the frame must be transmitted again.
 If a frame is lost due to hardware failure the receiver will not react & does not send any acknowledgement.
 Timers are introduced into the data link layer. When a frame is exacted the timer also starts, the frame will be correctly
received & the acknowledgement will get back before the timer runs out.
 If the frame or acknowledgement is lost the timer will go off, here the frame is transmitted again. If a frame is
transmitted multiple times the receiver may accept the same and pass it to the network layer more than once.
 To prevent this, sequence numbers are assigned to outgoing frames, so that the receiver can distinguish retransmission
from originals.
 Flow control:
 Flow control occurs when the sender wants to transmit frames faster than the receiver can accept them. Even if the
transmission is error free, the receiver will simply be unable to handle the frames as they arrive & will start to lose
them.
 Feed back based flow control & rate based flow control are the two approaches that are commonly used. In feedback –
based flow control, the receiver sends back information to the sender giving it permission to send more data.
 In rate based flow control, the protocol has a built – in –mechanism that limits the rate at which senders may transmit
data, with out using feedback from the receiver.

 Error detection and correction:


Data can be corrupted during transmission .for reliable communication; error must be detected &corrected.
Error correction: error correction can be done in two ways. When an error is discovered, the receiver can ask the sender to
re –transmit the entire data unit.
- Or the receiver can be use an error- correcting code, which automatically corrects errors.
Single bit error occurs when the receiver reads a 1 bit as a 0 or a 0 bit as a 1.to correct the error, the receiver simply reverse
the value of the altered bit.
 Error detection and correction:

Error detection and correction has great practical importance in maintaining data (information) integrity across noisy
Communication Networks channels and lessthan- reliable storage media.

Error Correction : Send additional information so incorrect data can be corrected and accepted. Error correction is the
additional ability to reconstruct the original, error-free data. Error Detection Schemes : In telecommunication, a redundancy
check is extra data added to a message for the purposes of error detection. Several schemes exist to achieve error detection,
and are generally quite simple. All error detection codes transmit more bits than were in the original data. Most codes are
"systematic": the transmitter sends a fixed number of original data bits, followed by fixed number of check bits usually
referred to as redundancy which are derived from the data bits by some deterministic algorithm.

Ch.santhi Asst.prof., CSE dept Page 5


Computer Networks

The receiver applies the same algorithm to the received data bits and compares its output to the received check bits; if the
values do not match, an error has occurred at some point during the transmission. In a system that uses a "non-systematic"
code, such as some raptor codes, data bits are transformed into at least as many code bits, and the transmitter sends only the
code bits.

 Parity check : A parity bit is an error detection mechanism . A parity bit is an extra bit transmitted with a data item,
chose to give the resulting bitseven or odd parity. Parity refers to the number of bits set to 1 in the data item. There
are 2 types of parity
 Even parity - an even number of bits are 1 Even parity - data: 10010001, parity bit 1
 Odd parity - an odd number of bits are 1 Odd parity - data: 10010111, parity bit 0

The stream of data is broken up into blocks of bits, and the number of 1 bits is counted. Then, a "parity bit" is set (or cleared)
if the number of one bits is odd (or even).This scheme is called even parity; odd parity can also be used. There is a limitation
to parity schemes. A parity bit is only guaranteed to detect an odd number of bit errors (one, three, five, and so on). If an
even number of bits (two, four, six and so on) is flipped, the parity bit appears to be correct, even though the data is corrupt.
For example

 Original data and parity: 10010001+1 (even parity)


 Incorrect data: 10110011+1 (even parity!)

Parity usually used to catch one-bit errors

 Hamming code:
 Hamming code can be applied to data units of any length & uses the relationship between data & redundancy
bits or check bits.

Ch.santhi Asst.prof., CSE dept Page 6


Computer Networks

 Here, m is the no. of redundancy bits & r is the no. of redundancy bits added to the bits.
Consider, m=7 &r=4
Here redundancy bits are occupy the positions . Each redundancy bit is the parity bit which depends on the
combination of data bits at different positions.
 Redundancy bit : The bit positions from which the bit value are task for calculating the redundancy by
value .

1 1,3,5,7,9,11
2 2,3,6,7,10,11
4 4,5,6,7
8 8, 9, 10, 11

Calculating the redundant bit values.


In the calculation of redundancy bits, even parity is considered in the total number of 1’s is even.

Redundancy Positions used for redundancy Bit values in the positions Bit required for creating even
bit Bit calculation mentioned in column 2 parity(redundancy bit values)
R1 1,3,5,7,9,11 Nill,1,0,1,0,1 1
R2 2,3,6,7,10,11 Nil,1,1,1,0,1 0
R4 4,5,6,7 Nil,0,1,1 0
R8 8,9,10,11 Nil,0,0,1 1

After adding the redundancy bits in the proper positions along with the data unit we will be getting hamming code.The
hamming code or code word is 10011100101 This code will be transmitted.
Error Correction
If any data bit changes then it can be corrected as follows
Original code word is 10011100101 changed code word is 11011100101
Redundancy Positions used for redundancy Bit values in the positions Bit required for creating even
bit Bit calculation mentioned in column 2 parity(redundancy bit values)
R1 1,3,5,7,9,11 1,1,0,1,0,1 0
R2 2,3,6,7,10,11 0,1,1,1,1,1 1
R4 4,5,6,7 0,0,1,1 0
R8 8,9,10,11 1,0,1,1 1
If we represent the redundancy bits in the binary representation 1010 it shows the location of the error bit. Hamming is
the single bit Error correction method

Ch.santhi Asst.prof., CSE dept Page 7


Computer Networks

Crc generator and checker:

Binary division in Crc generator:

Ch.santhi Asst.prof., CSE dept Page 8


Computer Networks

Ch.santhi Asst.prof., CSE dept Page 9


Computer Networks

 ELEMANTARY DATA LINK LAYER PROTOCOLS:


There are 3 protocols below
 An Unrestricted Simplex Protocol(utopian simplex protocol)
 A Simplex Stop-and-Wait Protocol
 A Simplex Protocol for a Noisy Channel

For noiseless channels:


Unrestricted Simplex protocol: it is a unidirectional protocol in which data frames are traveling in only one
direction-from thesender to receiver. There is no need for flow control in this scheme. The data link layer at the
sender site gets data from its network layer, makes a frame out of the data, and sends it. The data link layer at the
receiver site receives a frame from its physical layer, extracts data from the frame, and delivers the data to its
network layer. The data link layers of the sender and receiver provide transmission services for their network
layers. The data link layers use the services provided by their physical layers
 Both the transmitting and receiving network layers are always ready
 Infinite buffer space is available
 The communication channel between the data link layers never damages or loses frames
 Data are transmitted in one direction only Processing time can be ignored

Ch.santhi Asst.prof., CSE dept Page 10


Computer Networks

Algorithms for sender and receiver:

Simplex stop and wait protocol:

Protocols in which the sender sends one frame and then waits for an acknowledgement before proceeding are called stop-
and-wait. The protocol we discuss now is called the Stop-and-Wait Protocol because the
sender sends one frame, stops until it receives confirmation from the receiver (okay to go ahead), and then sends
the next frame. We still have unidirectional communication for data frames, but auxiliary ACK frames (simple
tokens of acknowledgment) travel from the other direction. We add flow control to our previous protocol.

Ch.santhi Asst.prof., CSE dept Page 11


Computer Networks

Algorithms for sender and receiver:

A Simplex Protocol for a Noisy Channel:

Stop and wait ARQ:


Protocols in which the sender waits for a positive acknowledgement before advancing to the next
data item are often called ARQ (Automatic Repeat reQuest) or PAR (Positive Acknowledgement with
Retransmission).
Our first protocol, called the Stop-and-Wait Automatic Repeat Request (Stop-andWait ARQ), adds a simple error
control mechanism to the Stop-and-Wait Protocol. Let us see how this protocol detects and corrects errors. To
detect and correct corrupted frames, we need to add redundancy bits to our data Frame. When the frame arrives at
the receiver site, it is checked and if it is corrupted, it is silently discarded. The detection of errors in this protocol
is manifested by the silence of the receiver. 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.

Ch.santhi Asst.prof., CSE dept Page 12


Computer Networks

Ch.santhi Asst.prof., CSE dept Page 13


Computer Networks

Ch.santhi Asst.prof., CSE dept Page 14


Computer Networks

When a data frame arrives, instead of immediately sending a separate control frame, the receiver restrains itself and waits
until the network layer passes it the next packet. The acknowledgement is attached to the outgoing data frame (using the ack
field in the frame header). In effect, the acknowledgement gets a
free ride on the next outgoing data frame.

 The technique of temporarily delaying outgoing acknowledgements so that they can be hooked onto the next
outgoing data frame is known as piggybacking.
The principal advantage of using piggybacking over having distinct acknowledgement frames is a better use of the available
channel bandwidth.

SLIDING WINDOW PROTOCOLS:3 protocols


 1 bit sliding window protocol
 Goback N ARQ
 Selective repeat ARQ
The essence of all sliding window protocols is that at any instant of time, the sender maintains a set of sequence numbers
corresponding to frames it is permitted to send. These frames are said to fall within the sending window. Similarly, the
receiver also maintains a receiving window corresponding to the set of frames
it is permitted to accept. The sender’s window and the receiver’s window need not have the same lower and upper limits or
even have the same size. In some protocols they are fixed in size, but in others they can grow or shrink over the course of
time as frames are sent and received. The send window is an imaginary box covering the sequence numbers of the data
frames which can be in transit. In each window position, some of these sequence numbers define the frames that have
been sent; others define those that can be sent. The maximum size of the window is 2m - 1 for reasons that we discuss
later. In this chapter, we let the size be fixed and set to the maximum value, but we will see in future chapters that some
protocols may have a variable window size.

Ch.santhi Asst.prof., CSE dept Page 15


Computer Networks

A One-Bit Sliding Window Protocol


Before tackling the general case, let us examine a sliding window protocol with a window size of 1. Such a protocol uses
stop-and-wait since the sender transmits a frame and waits for it acknowledgement before sending the next one.

Timers
Although there can be a timer for each frame that is sent, in our protocol we use only one. The reason is that the
timer for the first outstanding frame always expires first; we send all outstanding frames when this timer expires.
Acknowledgment
The receiver sends a positive acknowledgment if a frame has arrived safe and sound and in order. If a frame is
damaged or is received out of order, the receiver is silent and will discard all subsequent frames until it receives
the one it is expecting. The silence of the receiver causes the timer of the unacknowledged frame at the sender site
to expire. This, in turn, causes the sender to go back and resend all frames, beginning with the one with the expired
timer. The receiver does not have to acknowledge each frame received. It can send one cumulative
acknowledgment for several frames.
Resending a Frame
When the timer expires, the sender resends all outstanding frames. For example, suppose the sender has already
sent frame 6, but the timer for frame 3 expires. This means that frame 3 has not been acknowledged; the sender
goes back and sends frames 3, 4,5, and 6 again. That is why the protocol is called Go-Back-N ARQ.
GOBACK-N ARQ:
To improve the efficiency of transmission (filling the pipe), multiple frames must be in transition while waiting for
acknowledgment. In other words, we need to let more than one frame be outstanding to keep the channel busy while the
sender is waiting for acknowledgment. The first is called Go-Back-N Automatic Repeat Request (the rationale for the
name will become clear later). In this protocol we can send several frames before receiving acknowledgments; we keep
a copy of these frames until the acknowledgments arrive.

Sequence Numbers

Ch.santhi Asst.prof., CSE dept Page 16


Computer Networks

Frames from a sending station are numbered sequentially. However, because we need to include the sequence number
of each frame in the header, we need to set a limit. If the header of the frame allows m bits for the sequence number, the
sequence numbers range from 0 to 2m - 1. For example, if m is 4, the only sequence numbers are 0 through 15 inclusive.
However, we can repeat the sequence. So the sequence numbers are
0, 1,2,3,4,5,6, 7,8,9, 10, 11, 12, 13, 14, 15,0, 1,2,3,4,5,6,7,8,9,10, 11, ...
In other words, the sequence numbers are modulo-2m

.
In the Go-Back-N Protocol, the sequence numbers are modulo 1!", where m is the size of the sequence number field in bits.

Ch.santhi Asst.prof., CSE dept Page 17


Computer Networks

Selective Repeat Automatic Repeat Request:


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. In a noisy link a frame has a higher probability of damage, which means the resending of 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 RepeatARQ.
It is more efficient for noisy links, but the processing at the receiver is more complex.
-

Error detecting codes:


For error detecting we use polynomial code also known as CRC is used. Polynomial codes are based upon treating bit
strings as representations of polynomials with coefficients of 0 and 1 only.
CRC cyclic redundancy check
1. Let us consider a data unit of ‘m’ bits.
2. A string of (n-1) 0’s is append to the data unit where ‘n’ is number of bits of the divisor.
3. The new data unit with m+ (n-1) bits is divided by divisor using modulo -2 division method.
The resulting remainder is having (n-1) bits .this remainder is called CRC remainder.
4. The CRC remainder of (n-1) bits obtained from step 3 replaces the already append 0’s in step 2.
5. The data unit followed by CRC reaches the receiver.
6. The receiver divides the CRC appended data unit using the same divisor by the module -2 division method.
If the data unit, received by the receiver is without any error then the remainder obtained from step 6 will be zero.
Other wise the remainder will be non zero.
Ex: using error detecting code find the transmitted frame for a given frame of 1101011011 using the generator.
Frame: 1101011011
Generator it becomes 10011
In the given generator the highest power is 4, so we have to add 4 zero’s to the frame.

Ch.santhi Asst.prof., CSE dept Page 18


Computer Networks

Now, the transmitted frame is:


11010110111110
The frame is transmitted to the destination.
At the destination it again performs the same operation.
If the remainder is 0 the data is without errors & is accepted. Otherwise, the data is discarded.

 DATA link protocols


 HDLC:,High-level Data Link Control (HDLC) is a bit-oriented protocol for communication over point-
to-point and multipoint links. It implements the ARQ mechanisms
 Configurations and Transfer Modes:HDLC provides two common transfer modes that can be
used in different configurations: normal response mode (NRM) and asynchronous balanced mode
(ABM).
 Normal Response Mode: In normal response mode (NRM), the station configuration is unbalanced. We
have one primary station and multiple secondary stations. A primary station can send commands; a
secondary station can only respond. The NRM is used for both point-to-point and multiple-point links,
 Asynchronous Balanced Mode:In asynchronous balanced mode (ABM), the configuration is balanced. The link
is point-to-point, and each station can function as a primary and a secondary (acting as peers)

Ch.santhi Asst.prof., CSE dept Page 19


Computer Networks

 Frame Format: Each frame in HDLC may contain up to six fields, as shown in Fig: a beginning flag field, an
address field, a control field, an information field, a frame check sequence (FCS) field, and an ending flag field.
In multiple-frame transmissions, ending flag of one frame can serve as the beginning flag of the next frame.

 Fields:Let us now discuss the fields and their use in different frame types.
 Flag field. The flag field of an HDLC frame is an 8-bit sequence with the bit pattern 01111110 that identifies both
the beginning and the end of a frame and serves as a synchronization pattern for the receiver.
 Address field. The second field of an HDLC frame contains the address of the secondary station. If a primary
station created the frame, it contains a to address. If a secondary creates the frame, it contains afrom address. An
address field can be 1 byte or several bytes long, depending on the needs of the network. One byte can identify
up to 128 stations (l bit is used for another purpose). Larger networks require multiple-byte address fields. If the
address field is only 1 byte, the last bit is always a 1. If the address is more than 1 byte, all bytes but the last one
will end with 0; only the last will end with 1. Ending each intermediate byte with 0 indicates to the receiver that
there are more address bytes to come.
 Control field. The control field is a 1- or 2-byte segment of the frame used for flow and error control. The
interpretation of bits in this field depends on the frame type.
 Information field. The information field contains the user's data from the network layer or management
information. Its length can vary from one network to another.
 FCS field. The frame check sequence (FCS) is the HDLC error detection field. It can contain either a 2- or 4-byte
ITU-T CRC.

 Control Field: The control field determines the type of frame and defines its functionality. So let us discuss the
format of this field in greater detail. The format is specific for the type of frame

 Control Field for I-Frames: I-frames are designed to carry user data from the network layer. In addition, they
can include flow and error control information (piggybacking). The subfields in the control field are used to
define these functions. If the first bit of the control field is 0, this means the frame is an I-frame.

Ch.santhi Asst.prof., CSE dept Page 20


Computer Networks

 The next 3 bits, called N(S), define the sequence number of the frame. Note that with 3 bits, we can define a
sequence number between and 7; but in the extension format, in which the control field is 2 bytes, this field is
larger. The last 3 bits, called N(R), correspond to the acknowledgment number when piggybacking is used.
 The single bit between N(S) and N(R) is called the PIF bit. The PIP field is a single bit with a dual purpose. It has
meaning only when it is set (bit = 1) and can mean poll or final. It means poll when the frame is sent by a primary
station to a secondary (when the address field contains the address of the receiver). It means final when the frame
is sent by a secondary to a primary

 Control Fieldfor S-Frames:Supervisory frames are used for flow and error control whenever piggybacking is
either impossible or inappropriate. S-frames do not have information fields. If the first 2 bits of the control field
is 10, this means the frame is an S-frame. The last 3 bits, called N(R), corresponds to the acknowledgment
number (ACK) or negative acknowledgment number (NAK) depending on the type of S-frame.The 2 bits called
code is used to define the type of S-frame itself. four types of S-frames, as described below:
 Receive ready (RR). If the value of the code subfield is 00, it is an RR S-frame. This kind of frame acknowledges
the receipt of a safe and sound frame or group of frames. In this case, the value N(R) field defines the
acknowledgment number.
 Receive not ready (RNR). If the value of the code subfield is 10, it is an RNR S-frame. This kind of frame is an
RR frame with additional functions. It acknowledges the receipt of a frame or group of frames, and it announces
that the receiver is busy and cannot receive more frames.
 Reject (REJ). If the value of the code subfield is 01, it is a REJ S-frame. This is a NAK frame, but not like the one
used for Selective Repeat ARQ. It is a NAK that can be used in Go-Back-N ARQ to improve the efficiency of
the process by informing the sender, before the sender time expires, that the last frame is lost or damaged..
 Selective reject (SREJ). If the value of the code subfield is 11, it is an SREJ S-frame. This is a NAK frame used
in Selective Repeat ARQ. Note that the HDLC Protocol uses the term selective reject instead of selective repeat.
The value of N(R) is the negative acknowledgment number.
 Control Fieldfor U-Frames: Unnumbered frames are used to exchange session management and control
information between connected devices.
 Unlike S-frames, U-frames contain an information field, but one used for system management information, not
user data.
 As with S-frames, however, much of the infonnation carried by U-frames is contained in codes included in the
control field

PPP: ( Point- to -point protocol)


 PPP is an official internet standard. PPP handles error detection, supports multiple protocols, allows IP addresses,
permits authentication
pp provides three things:

1. PPP provides framing method that describes the end of one frame & the start of the next one frame format also
handles error detection.
2. Link control protocol(LCP) for bringing lines up, testing them & bringing them down again when they are no
longer needed.

Ch.santhi Asst.prof., CSE dept Page 21


Computer Networks

3. Network control protocol method chooser to have a different NCP for each network layer supported.

PPP frame format:

 All PPP frames begin with the std HDLC flag byte 01111110.
 Address field indicate that all stations accept the frame. It always sets to binary value 111111111.
 Control field indicates an unnumbered frame. Its default value is 00000011.
 Protocol field indicates the type of packet in payload field.
 Protocol starting with 0 bit is network layer.
 Protocol starting with 1 are other protocols
 Payload field is variable length, if the length is not defined using LCP, a default length of 1500 bytes is used.
 Checksum field is used for error detection.
 The simplified phase diagram shows the phases that a line goes through when it is brought up, used & taken
down again.

Fig. A simplified phase diagram for bringing a line up and down.

 The protocol starts with the line in the DEAD state, which means that no physical layer carrier is present and no
physical layer connection exists.
 After physical connection is established, the line moves to ESTABLISH.
 At that point LCP option negotiation begins, which, if successful, leads to AUTHENTICATE.
 Now the two parties can check on each other's identities if desired.
 When the NETWORK phase is entered, the appropriate NCP protocol is invoked to configure the network layer. If
the configuration is successful, OPEN is reached and data transport can take place.
 When data transport is finished, the line moves into the TERMINATE phase, and from there, back to DEAD when
the carrier is dropped.

Ch.santhi Asst.prof., CSE dept Page 22

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy