24
www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia and Indra Widjaja , Data communication by Behrouz Ferouzen) In the earlier discussions you have seen how communication can be sent across a network, concepts of protocols and their functions in each layer has been explained. Every layer will provide service to the above layer by running peer-to-peer protocols. Now we shall see in detail how peer-to-peer protocols function to provide service to the layer above it. For this to be understood we shall initially learn 1) Peer-to-peer protocols 2) Data-link layer protocol standards Peer-to-Peer protocols These protocols can occur 1) Across a single loop in a network 2) From end-to-end across multiple hops in a network We will learn both the cases. Let us see first the service models for the protocols. A peer-to-peer protocol functions through protocol data units (PDUs) within the layer as well as it provides services to the n+1 layer through SDUs (service data units). Services can be 1) Connection-oriented transfer service 2) Connectionless transfer service In the first case, a connection setup is first to be established. Later the information transfer takes place. The first step will initialize the state information in the layer-n peer processes. Then the data transfer takes place via the connection setup. Finally, once the data transfer is over it involves connection release. This procedure will remove the state information and release the resources allocated for the connection. The figure below shows the service model for connection-oriented services. The data will be delivered in- order in this case. Definite connection setup Fig 1 Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja In connectionless services, the information blocks will be transmitted independently without a connection setup. The service data units (SDUs) will be delivered but may not be in-order. The figure2 below shows the service model for connectionless service. N+1 peer process SEND N+1 peer process RECEIVE

| VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

  • Upload
    others

  • View
    14

  • Download
    1

Embed Size (px)

Citation preview

Page 1: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia and Indra Widjaja , Data communication by Behrouz Ferouzen) In the earlier discussions you have seen how communication can be sent across a network, concepts of protocols and their functions in each layer has been explained. Every layer will provide service to the above layer by running peer-to-peer protocols. Now we shall see in detail how peer-to-peer protocols function to provide service to the layer above it. For this to be understood we shall initially learn 1) Peer-to-peer protocols 2) Data-link layer protocol standards Peer-to-Peer protocols These protocols can occur 1) Across a single loop in a network 2) From end-to-end across multiple hops in a network We will learn both the cases. Let us see first the service models for the protocols. A peer-to-peer protocol functions through protocol data units (PDUs) within the layer as well as it provides services to the n+1 layer through SDUs (service data units). Services can be 1) Connection-oriented transfer service 2) Connectionless transfer service In the first case, a connection setup is first to be established. Later the information transfer takes place. The first step will initialize the state information in the layer-n peer processes. Then the data transfer takes place via the connection setup. Finally, once the data transfer is over it involves connection release. This procedure will remove the state information and release the resources allocated for the connection. The figure below shows the service model for connection-oriented services. The data will be delivered in-order in this case.

Definite connection setup

Fig 1 Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja In connectionless services, the information blocks will be transmitted independently without a connection setup. The service data units (SDUs) will be delivered but may not be in-order. The figure2 below shows the service model for connectionless service.

N+1 peer process SEND

N+1 peer process RECEIVE

Page 2: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

No definite path

Fig 2 The service model in a given layer will specify how information is to be transmitted and also it can specify Quality of service (QoS) parameters such as probability of errors, probability of loss, guarantee of delivery, transfer delay, etc. All communication networks transfer messages. These messages can be different services. In 1) E-mail - messages are discrete, well-defined entities 2) Data files- the files will be very large and hence they will be broken into smaller units and sent as data blocks, which will be reassembled at the receiving end. 3) In telephony- a single message containing an entire speech sample or stream of digital speech sample. (Connection-oriented transfer will transfer stream of information). 4) In case of audio, video, the information is a stream, but each stream will have a temporary relationship with the other information elements. Sequence numbering and time stamps will enable the reconstruction of the information stream. Now coming to the two cases for peer-to-peer protocols to function: Across the network hop-by-hop Look the fig 3 below: Data data data ACK/NAK ACK/NAK ACK/NAK Fig 3 Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja

The peer protocols should provide procedures for reliable data transfer on a hop-by-hop basis. Error control, flow control should be implemented at each node by sending acknowledgements (ACK and NAK) messages until a block of information is fully received. The processing at each node is complex. HDLC (High level Data Link Control) is an example for this case of communication in networks. For every data transfer between two nodes the acknowledgements (ACK) or non-acknowledgements (NAK) will be set. Until a node receives the correct data, it will not send it to the next node. This happens throughout the network.

N+1 peer process SEND

N+1 peer process RECEIVE

1 2 3 4

Page 3: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

End to end across multiple hops The peer-to-peer protocols in a set-up such as end-to-end will be implemented even at layers higher than the transport layer. The protocols will be implemented in a manner such that the error control and flow control will not be taken care of at every node; instead blocks of information are forwarded across the path, and only the end system will look into the error recovery. The ACK/NAK will be sent end-to-end and not at every node. ACK/NAK Data data data Fig 4 Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja

ARQ Protocols Automatic repeat request protocols are explained in the following sections. These protocols will be implemented for transmission of data wherein the channels will be prone to errors. As the machines or hosts will be distance apart, these protocols will be implemented over networks to provide reliable service. These protocols will deal with errors and requests for retransmission so that accurate data will be delivered. These protocols are classified as: 1) Stop-and-Wait ARQ 2) Go-Back-N ARQ 3) Selective Repeat ARQ To discuss the different ARQ protocols we need to know the different terminologies and the mechanisms during data transmission. Information blocks at layer n+1 will be generated called as SDUs for transmission to layer n+1 peer processes. Now a layer n protocol will be developed to transmit packets referred to as PDUs in layer n+1, and frames at layer n. for transmitting, the protocol to be developed should include procedures to ensure reliable transmission. Since basic elements (terminologies) such as information frames (I-frames) which will encapsulate a packet to which header information and CRC check-bit will be added will have to be sent from process A (transmitter) to process B (receiver). Next control frames, which have header and checkbits, may be ACKs (acknowledgements) or NAKs (non-acknowledgements). The mechanism in general will be working such that frames will be exchanged between sender and receiver. The basic operation of the ARQ protocols will have inter-layer functions such that the layer n+1 process will span n+1 PDU to layer n. the layer n will

1 2 3 4

Page 4: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

take the (n+1 PDU) called n SDU, prepares an n PDU according to the n protocol and sends it to the layer n-1. Then at destination layer n-1 notifies the layer n process when a (layer n-1) SDU arrives. Stop-and-Wait ARQ This protocol is named so because when a frame is transmitted, it waits until it receives the acknowledgment and only then, it transmits the next frame to the receiver. To understand the way this protocol operates let us consider 'A' as transmitter and 'B' as receiver. Every I-frame will have a sequence number. Usually sequence number will not be large instead only a fixed no. Of bits will be designated for sequence number of a frame. For this example, let us designate one-bit sequence number. So only zero or one can be the sequence number of the I-frame. Two variables Slast and Rnext will be needed for explanation of the protocol. Transmitter functions as follows: The transmitter will initially be in the ready state, the Slast number will be 0 and the Rnext number will be 0. The transmitter will receive a packet from its above layer and it encapsulates the packet into an I-frame with header information Slast and CRC. A timer is started and the I-frame is transmitted using the services offered by its lower layer. It then goes to the wait state. In this state the transmitter will wait for the ACK frame with sequence Rnext = (Slast +1) mod 2. If it does not receive the ACK frame then it retransmits the same I-frame. If it receives the correct ACK frame, it sends the next I-frame. The fig 5 below shows the transmission procedure as per the Stop-and-Wait protocol. Receiver functions as follows: The receiver 'B' will be in the ready state waiting to receive an I-frame. It sends an ACK packet if it receives a correct I-frame with sequence number (Rnext+1) mod 2. If it receives an I-frame with wrong sequence number then it discards the frame fig 5 below shows the reception of I-frames and transmission of I-frames.

Time interval A I-frame 0 I-frame 1 I-frame 1 ACK frame 1 ACK frame 0 lost B Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja

Fig 5

Page 5: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Performance of Stop-and-Wait ARQ protocol The transmission efficiency of stop-and-wait ARQ is derived as follows. The foll fig 6 defines the different delay components: to A tproc B

tprop frame tf tproc tack tprop fig 6 tprop propagation time for a bit from process A to process B or B to A tproc processing time by process A or process B to carry out the CRC checking tf time taken for the entire frame to reach process B tack time taken for the ack to reach process A Now the basic time to send a frame and receive an ACK without any error is then to = 2tprop + 2tproc + tf + tack = 2(tprop + tproc) + nf + na R R Where nf and na are the no. Of bits in the I-frame and ack frame respectively; and R is the bit-rate of the transmission channel. The effective information transmission rate of the protocol no. Of information bits delivered to data Ro

eff = total time required to deliver the information bits nf - no = (no is the no. Of overhead bits in a frame)

to Hence, transmission efficiency of Stop- and - wait protocol is ratio of Ro

eff to R

Page 6: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

nf - no to ηο = R 1 - no nf = 1 + na + 2(tprop + tproc) R nf nf 2(tprop + tproc) R is the delay-bandwidth product no/nf represents loss in transmission efficiency due to headers and CRC bits na/nf is the loss in efficiency due to the time required for the acknowledgement Now let us see the performance with effect of transmission errors during transmission. Each transmission or retransmission will take to secs. If Pf is the probability that a frame transmission has errors and if 1 in 10 frames go through without errors. 1-Pf = 0.1. On an average, a frame will have to be transmitted 10 times to get through. Then 1/ 1-Pf frame transmissions are required. Then Stop-and-Wait ARQ on average requires tsw = to/1-Pf seconds to get a frame sent Then efficiency is nf-no ηsw = tsw

R 1 - no nf = (1 – Pf) 1 + no + 2(tprop + tproc)R nf nf Go-Back-N ARQ protocol functions as follows In this protocol the delay-bandwidth of the channel is overcome which was the problem of stop-and-wait protocol. In this, the channel is kept busy by allowing the transmitter to send frames continuously without waiting for the ack frames. A window size (ws) is defined which is chosen larger than the delay-bandwidth product to see that the channel is kept full. The transmitter functions as follows:

Page 7: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

When requests occur from higher layers the transmitter accepts the packets and encapsulates it into a frame with header, CR, sequence number, Srecent that is set to the lowest number. A timer is started and the frames are sent. If Srecent = Slast +ws -1, the send window is empty and the transmitter is in the waiting state, else it will be in the ready state. On receipt of the Rnext behind Slast and Srecent, the window slides forward and sets Slast=Rnext and. send window number to Slast + ws-1. If the value is outside the range, then the frame is discarded. On exhaustion of the timer, the transmitter retransmits Slast and all subsequent frames. As the transmitter retransmits all the frames from the non-receipt of ACK frame, it is called Go-Back-N. Fig 8 shows the transmission from process A to process B. Fr 0 fr 1 fr 2 fr 3 fr 4 fr 5 fr 6 fr 3 fr 4 fr 5 fr 6 A B Ack 0 ack 1 ack 2 ack 3 ack 4 ack 5 ack 6 Fig 8 The receiver functions as follows: When the frames start arriving the receiver checks for errors. If error-free, the frame has arrived. It sends Rnext and Rnext is incremented by 1. If the received I-frame is erroneous, then the I-frame is discarded and it sends the Rnext sequence numbered frame. Hence, the complexity of receiver is same as in Stop-and-Wait protocol. If maximum number of bits is m then 2m possible sequence numbers are allowed. Here sequence numbers must be created using modulo 2m. hence if m=3, then 0,1,2,3,4,5,6,7,0,1,2,... will be the sequence numbers of the I-frame. Performance issues for Go-Back-N ARQ protocol As compared to Stop-and-Wait ARQ protocol, this protocol has an improvement in efficiency. tGBN is the time taken to get a frame where 1 in 10 frames get through without error, i.e., 1-Pf = 0.1. Then the first transmission will take tf = nf/R secs. With Pf (0.9) the first frame is in error and all frames from 1 should be retransmitted. Every time it has to transmit ws frames with each duration tf and average, no. Of retransmission is (1-Pf). Therefore total average time required to transmit a frame in go-back-n is

Page 8: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

tf + Pf (ws tf) tGBN = 1-Pf If tGBN = tf + 9ws tf then Nf – no ηGBN =

TGBN R 1 – no nf = (1-Pf) 1 + (Ws –1) Pf Here if channel is error free, that is Pf=0, then go-back-n gets the best efficiency 1-no/nf Selective Repeat ARQ Selective repeat ARQ protocol is an extension of the Go-Back-N with two new features. They are:

• The receive window is made larger than one frame-capacity • Retransmission mechanism is modified such that only the individual frames that

are required are retransmitted. Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja

The protocol is explained as follows:

ACK1

f0 f1 f2

ACK2

f3 f4 f2 f6

NAK2 ACK2

f5

ACK2 ACK6

f7 f8

ACK7 ACK8 ACK9

Page 9: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Function of the transmitter: When the send window is empty, the transmitter is in the ready state, waiting for a request from a process in a higher layer. When the transmitter receives a request for transmission, it accepts a packet from the upper layer and prepares a frame for transmission; the sequence number (Srecent) is set to the lowest number available in the send window. Suitable error detection codes are also added. The frame is transmitted and a timer is started. If Srecent = WS – 1 then the send window is empty, and the transmitter goes back into the blocking state. Else the transmitter stays in the ready state. If an ACK frame is received with value of Rnext between Slast and Srecent, then the send window slides forward by setting Slast = Rnext and limit of send window number to Slast + WS – 1. If a NAK frame is received with value of Rnext between Slast and Srecent then, the frame with sequence number Rnext is retransmitted. The send window slides forward by setting Slast = Rnext and limit of send window number to Slast + WS – 1; else the frame is discarded. The transmitter is in the blocking state when the send window is empty. Function of the receiver: The receiver process is always in the ready state waiting for the arrival of a frame from the transmitter. On reception of the incoming frame, the frame is checked for errors. If there are no errors and if the sequence number of the frame is within the range of the send window, then the frame is accepted, buffered, and an acknowledgement is sent. If an arriving packet has no errors, but the sequence number is outside the range of the sending window, then the frame is discarded and a NAK frame is transmitted to the transmitter Maximum window size The maximum size of the send window is half the sequence number space, i.e., Ws = Wr = 2m-1 Efficiency of Selective Repeat ARQ It is said to be the most efficient of all the ARQ protocols that have been discussed. The probability of a frame being received in good order is 1-Pf. Thus the average number of times a frame has to be sent is the reciprocal of the probability, i.e.,

Page 10: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

tf tSR =

1-Pf

nf –no

tSR

Thus, the efficiency of Selective Repeat ARQ is given as ηSR = R

no = 1 - (1-Pf) nf OTHER PEER-TO-PEER PROTOCOLS Sliding Window Protocol In practice, we often come across situations in which the transmitter is much more powerful than the receiver. Here, the transmitter transmits frames at a faster rate than the receiver can handle. In such situations, frames are lost because they overrun the buffers on the receiver side. To avoid loss of frames in this way, we institute procedures to control the rate of transmission. This is called flow control. One of the techniques for flow control is the sliding window protocol. One of the simple ways to do this is to make sure that, at any time, the transmitter is sending only as much data as can be stored in the buffers of the receiver. Only when the acknowledgements from the receiver are received, does the transmitter advance the sliding send window. Thus the sliding window protocol provides for flow control at the sender side. The characteristics of sliding windows used at the sender and receiver usually involve

• Error correction (by retransmission), • Flow control and • Message ordering by sender (FIFO).

The latter property can easily be incorporated in a sliding window protocol, but sometimes, it is preferred to be implemented as a separate protocol for easier maintenance / replaceability Timing Recovery for Synchronous Services Many audio and video applications today are transmitted over networks. The various delays induced by the many network elements cause the blocks of data earlier or later

Page 11: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

relative to one another. This results in the breakup of periodicity in the sequence. This effect is referred to as timing jitter. To smoothen out the jitter and to restore the periodicity, we need to adopt some protocols known as timing recovery protocols. We consider to approaches to rectifying this problem. • Time-stamp based timing recovery In this method we make use of time-stamping information. After all the data that has to transmitted over the network has been organized into blocks, they are time-stamped. The time-stamp contains information about the time of file-creation, time-of transmission, etc. the blocks are all time-stamped in relative order. Thus there will be slight variations in the time of transmission, as the blocks are all not transmitted at the same instant of time. The blocks may be received at the receiver in unordered sequence. But the receiver checks the time-stamps on data reception. An older time-stamp means that that particular block is ahead of all other blocks that bear a newer time-stamp. Thus the receiver arranges the blocks of data in order of their increasing time-stamps, and this restores the original sequence and periodicity between the blocks of data. The difference between the time-stamps of adjacent blocks of data is then analyzed to recover the clock frequency, and the data playback is done according to this clock. • Network-based timing recovery Here, we are assuming that all the elements involved in data transmission, including the sender and receiver, belong to the same homogeneous network. The whole network is made to synchronize itself to a local clock. All the network elements derive their timing from this clock. Thus, the sender transmits all the data blocks in respect to the local network synchronization clock. The receiver waits till all the data blocks have been received. The playback is easy here because the receiver too, derives its timing from the same clock as the sender. Thus, the jitter is smoothened out. This is network-based timing recovery.

Page 12: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

TCP Reliable Stream Service and Flow Control TCP provides a connection oriented, reliable, byte stream service. The term connection-oriented means the two applications using TCP must establish a TCP connection with each other before they can exchange data. It is a full duplex protocol, meaning that each TCP connection supports a pair of byte streams, one flowing in each direction. TCP includes a flow-control mechanism for each of these byte streams that allows the receiver to limit how much data the sender can transmit. TCP also implements a congestion-control mechanism. TCP deals with the problem of old and outdated packets by using 32-bit sequence numbers and selecting initial sequence numbers randomly. TCP uses sliding window protocol for flow control. It encompasses features of Selective Repeat ARQ and a timer mechanism. Now we consider the retransmission policy adopted by TCP. The transmitter sets a timer each time a transmission takes place. If the timer sounds before an acknowledgement is received, that particular segment is retransmitted. Since network speeds and congestion may delay packets, TCP uses the concept of round-trip time (RTT). tRTT is estimated for each and every packet that is transmitted. τn is the delay incurred between transmission of a packet and the reception of it’s acknowledgement by the following equation: tRTT (new) = αtRTT (old) + (1-α) τn. typically the value of α is 7/8. the time-out value of the timer is computed as: tout = tRTT + kσRTT. The standard deviation of time-out values is computed and used as: dRTT (new) = βdRTT (old) + (1-β) |τn – tRTT| with the typical value of β being 3/4. the most suitable time-out value is then found to be tout = tRTT + 4dRTT. DATA LINK CONTROLS The prime objective of the data link layer is to enable the transfer of information frames by using the services provided by the physical layer. The functions of the data link layer are:

• Inserting framing information to define frames • Ensuring reliable information transfer by providing error control • Implementing flow control mechanism so as not to overwhelm the receiver • Inserting addressing and protocol information

FRAMING

Page 13: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Framing is basically concerned with defining the boundaries of an information block within a stream of bytes. There are two levels of accuracy that we look to in the framing procedure:

• Asynchronous data transfer In this mode, transmissions occur at different intervals of time. The resynchronization occurs on the receiver end at the start of each eight-bit character by use of suitable delimiters.

• Synchronous data transfer In this mode, the data transfer occurs at regular intervals of time. Receiver is equipped with digital circuits that recover and track the frequency and bit transitions of the transferred data. Framing is different for both frames of fixed length and those of variable length. Each of them has different requirements of delineation. Fixed-Length Frames The essence of the framing technique involved in the case of fixed-length frames is that of character-counting. Counting is done with the help of framing-bits or character, which are used for synchronization and confirmation. Variable-Length Frames Framing in the case of variable-length require more information than just a framing-bit. There are several methods available to delineate. They are listed and explained as below: Using Characters to denote beginning and end of frames : In this method, we use different framing-bits to denote the beginning and end of frames. To define a frame of character, one may use special 8-bit codes such that they are not printable, and they are designated as control characters. This method is limited only to cases where the frames contain only printable characters. To overcome this limitation, we use the byte-stuffing technique. A special data link escape (DLE) control with HEX value of 10 is introduced. The combination of STX (start of text) and DLE denotes the starting of the frame and the combination of ETX (end of text) and DLE denotes the end of the frame. Whenever a DLE character occurs in the actual data, two DLE characters replace it. This helps the receiver to identify the DLEs used at the beginning and end of frames. Data to be sent

A DLE B ETX DLE STX E

Page 14: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

After stuffing and framing Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja USING FLAGS BIT STUFFING AND BYTE STUFFING Flag-based synchronization method was introduced for the very purpose of transferring variable-size frames. Here we explain the method with the help of a HDLC frame. The beginning and end of the HDLC frame are denoted by the presence of 8-bit flags. The byte 01111110 is designated as the flag byte in HDLC. Bit stuffing is done to ensure that flag byte does not occur anywhere inside the frame, within the data part. The transmitter, before transmitting the data, checks it for consecutive 1s. if more than five 1s occur consecutively, then a 0 is inserted after five 1s. if a 01 follows five consecutive 1s, the receiver knows that 0 is the stuffed bit and removes it. If 10 follows five consecutive 1s, that indicates a flag. Five consecutive 1s followed by 11 indicate an error. Data to be sent 0110111111111100 After stuffing and framing 0111111001101111101111100001111110 Data received 0111111001101111101111100001111110 After destuffing and deframing *000111011111-11111-110*

* - shows where flags have been removed - - shows where stuffed bit has been removed

similarly byte stuffing is used in PPP frames. CRC based framing The Generic Framing Procedure was introduce the shortcomings of the byte-stuffing method. This is because the byte-stuffing method increases the original length of the data frame. Also, inserting flag sequences repeatedly within a frame can cause intentional consumption of bandwidth. GFP uses Header Error Control(HEC) to overcome this

DLE DLE DLE STX STX A B ETX ETX DLE DLE DLE E

Page 15: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

problem. If we know the length of the information segment I the frame, and we are given the starting bit inside the frame, then we can easily find the end of the frame. the frame structure of the GFP is as shown below:

Payload Core Payload Type GFP GFP length header type header extension payload indicator error error headers checking checking Courtesy:Communication networks by Alberto Leon-garcia and Indra Widjaja the first two fields, PLI and cHEC are used to delineate a frame. PLI gives the size of the GFP payload area in bytes. Indicating the beginning of the next GFP frame. The cHEC field contains CRC-16 redundancy check bits for PLI and cHEC fields. Initially the receiver is in the hunt state, and in this state, it examines four bytes at a time to see whether CRC computed over the first two bytes matches that of the next two bytes. If there is no match, the receiver moves forward by one byte. If there is a match, the receiver goes to the pre-sync state. the receiver uses the PLI field to determine the location of the next frame boundary. After N successful frame detection, the receiver moves to the sync state. Here it checks each PLI, validates it using the cHEC, extracts payload information, and then moves forward to the next frame. POINT-TO-POINT PROTOCOL Point-to-Point protocol is mainly intended to encapsulate IP packets over any variant to f full-duplex point-to-point communication link. PPP protocol uses an HDLC-like frame format. It always begins and ends with the standard HDLC flag. since PPP frames consist of integer number of bytes, bit-stuffing technique, as used in HDLC, is not used. Instead, the byte insertion method is used. the second field carries the all 1s field, meaning that all receivers are to accept the frame. the control field mentions whether the PPP is operating in connection-oriented or connectionless mode. the protocol field specifies which protocol is currently being run. PPP was originally designed to operate without network differentiation, i.e., it should be able to handle packets produced by any network. the CRC field contains the checksum polynomial, and it may use either the CCITT 16 or CCITT 32 system. PPP provides a number of services through a link control protocol and an accompanying family of network control protocols. Link control protocol (LCP) is used to setup, configure and maintain and terminate a link connection. It involves communication between peer processes to negotiate the setting up of a connection. After the authentication phase is over, a network control protocol (NCP) is used to configure each network layer protocol that operates over the link. One distinct advantage of the PPP is that it includes several authentication protocols like Password Authentication Protocol (PAP) and Challenge-Handshake Authentication Protocol(CHAP).

PLI cHEC Type GEH tHEC GFP Payload

Page 16: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

In PAP the client is expected to send a username and a password. The server then responds with an appropriate message saying whether the authentication has succeeded or not. In CHAP, we assume that the peer processes have somehow agreed on a secret key, and when the server questions the client with a pre-negotiated question, the client must respond with the pre-agreed answer. Only if the negotiated and given answers match, does the server provide access to the client. HDLC DATA LINK CONTROL High-level data link control gives the set of standards for operating a data link over bit synchronous physical layers. It is derived from SDLC (Synchronous Data Link Control). Data link services The data link control is a set of functions, which provide a communication service to the network layer. the data link layer transmits frames and makes use of the bit transfer service provided by the physical layer. the packets that are given to the data link layer from it’s upper layer, are augmented with a header and CRC check bits to form a PDU, which is then given to the physical layer for actual transmission. Data link layers can be configured to provide connection-oriented or connectionless services to it’s upper layers. HDLC configurations and transfer modes. The different HDLC configurations are explained as below:

• Balanced mode

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN

In the balanced mode, the primary station sends a command/response to the secondary station and the secondary responds to the primary station. In this case, interaction between the primary and each secondary station are unique.

Page 17: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

• Unbalanced mode

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN

In this configuration of HDLC, the command/responses are broadcasted by the primary station to all the secondary station on the same line. Similarly, the responses/requests are transmitted on the same line to the primary station. • Symmetrical mode

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN

In the symmetrical mode, the command from the primary station is sent to a specific secondary station. Only the specific secondary station for which the message is intended receives the command. The secondary station then analyses the command, performs the associated processing, and then sends a response to the primary station.

There are two types of transfer modes defined by HDLC and they are explained as below: • Normal Response Mode (NRM)

Page 18: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

This uses a command-response interaction, where primary stations query secondary stations with commands, and the secondary stations respond with response frames.

• Asynchronous Balanced Mode This mode has been designed for full-duplex transmission of frames. HDLC Frame format Two 8-bit flags delineate each frame. The frame has only one address field. The frame also has a field for either 8-bit or 16-bit control code. A 16-bit or 32-bit CRC is calculated and inserted. There are three types of control fields.

• Information frame A 0 in the first bit of the control field indicates an information frame(I-frame).

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN a 10 in the first two bits of the control frame indicates a supervisory frame.

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN A 11 in the first two bits of the control field indicates an unnumbered frame

Flag Address Information Control FCS Flag

Page 19: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN The flag is nothing but a fixed pattern of bits. This pattern does not change, ever. The pattern of bits in the flag is kept fixed atleast for the duration of a particular communication session.

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN Addressing is another major issue in HDLC. Addressing can be done in the following ways:

• Using single-byte addresses • Using multi-byte addresses

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN

Page 20: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Each control field has a poll/final bit(P/F). this always a poll when sent from primary to secondary and a final bit when it is sent from a secondary to a primary. The N(S) field in the I-frame provides the send sequence number of the I-frame. N(R) is the acknowledgements of all received frames and also indicates the sequence number of the next expected frame. There are four kinds of supervisory frames. A value of SS=00 denotes a receive ready(RR) frame. SS=01 denotes a reject(REJ) frame. SS=10 denotes a receive not ready(RNR) frame. SS=11 denotes a selective reject frame(SREJ). A combination of I-frames and supervisory frames allow the implementation of Stop-and-Wait, Go-Back-N and Selective Repeat ARQs. Unnumbered frames are used to implement a variety of control functions. during call setup or release, unnumbered frames are use to denote and set the data transfer mode. It can be used to acknowledge frames. It can also be used to reject frames and also terminate a connection between two processes.

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN The primary station queries the secondary station with a poll bit(polling). As and when the secondary station is free to process the command/request of the primary station, it sends across the final bit to the primary station. This is the use of the poll/final bits. The use of the Information field is described as below:

Page 21: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN From the diagram shown above, the significance of the information field is clear. The points to be noted here are that: The information field carries the user data in an I-Frame. The information field is absent in an S-Frame. The information field carries the management information in an U-Frame. The use of the Frame- Check Sequence (FCS) is described below: The frame check sequence (FCS) is either a two-byte of four-byte CRC code.

Courtesy: Introduction to Data Communications and Networking By BEHROUZ FEROUZAN

Page 22: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

PROBLEMS: 1) In a stop and wait ARQ system, the bandwidth of the

channel is 1Mbps and 1 bit takes 20ms to make a round trip, What is the bandwidth delay product? a). If the data frames are 1000 bits in length, what is the utilization percentage of the links. Given: RTT = 20 ms Bandwidth delay product = 1 x 106 x 20 x 103 = 20000 bits = 1000 / 20000 = 5% 2. Suppose your design is STOP & WAIT protocol for a 1Mbps point – to – point link to a stationary satellite revolving around the earth and 3X104km altitude. Assume that each frame carries 1kB of data and speed of light is 3X108 metre/sec. What is the minimum number of bits you need for a sequence number of receive window size = 1 L=1kB Channel utilization for s.w protocol (100%) 3. Compute the fraction of the bandwidth that is wasted on overhead for selective repeat on a heavily loaded 50kbps channel. With data frames consisting 40bit header and 3960 data bytes , NACK frames are 40 bits. The error rate for data frames is 1% and the error rate for NACK frames is negligible. 100 frame 1 frame is in error 1 frame 40 bit header 100 frame 4000 bits for header due to header, bandwidth wasted is

mstf

msstp

192.810

81024

1001.0103103

6

8

7

=

==×

×=

26192.8

192.8200

121

=

+=

+

=

w

w

tftpw

( )( ) ( )

01989.0

4010040401003960401004040

=

+++×++

Page 23: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

≈ 2% of the bandwidth is wasted because of header and NACK 4. Frames of 1000 bits are sent over a 1Mbps satellite Channel ,acknowledgements are always piggybacked on to data frames. The headers are very short 3bit sequence no. are used. What is the maximum achievable channel utilization for selective repeat. Given propagation delay = 240 ms .Processing time is neglected. Channel utilization = Windows size = 2m-1 = 23-1 = 22 = 4 Therefore, Channel utilization =

5. T1carrier has a channel capacity of 1.544X106

bits / sec. If 3000 km long T1 trunk is used to transmit 64 byte frames using Go – back – N protocol. How many bits the sequence number should be if the propagation speed is 6ųs/km.

The propagation delay for 3000 km is: Two way delay = 18X2 = 36 ms

Time taken for the frame to be transmitted Total time taken = 0.33 + 18 + 18 = 36.33 ms (two way delay for frame + ack) 36.33 ms is required to transmit a frame.

( )

240

1010240

110101

1000

211

3

3

36

=

×=

==×

=

++

f

p

f

p

f

proctt

tttt

mst

tf

p

( )( )

%8.0103.8

4814

240*212

3

2

=×=

=

+

ms18101863000 3 =×=× −µ

ms33.010544.1864

6 =××

=

Page 24: | VTU NOTES | QUESTION PAPERS | NEWS ... · | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS PEER-to-PEER PROTOCOLS (BOOKS REFERED: Communication networks by Alberto Leon-garcia

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

www.bookspar.com | VTU NOTES | QUESTION PAPERS | NEWS | RESULTS | FORUMS

Since it is GO BACK-n ARQ number of frames that can be transmitted Therefore, the number of bits required for sequence number = 7 6. Frames of 1000 bits are sent over a 1 Mbps transmission channel. The headers are very short and 3 bit sequence number are used. The acks are always piggybacked on to data frames. What is the maximum channel utilization for Go – back – N given tp 120ms. The time taken to process the frame is negligible. Channel utilization = ___________________________________________________________________

11109.11033.033.36

≅==

)1282( 7 =

120101

10120

1101

1000

3

3

6

×=

=

f

p

f

tt

mst

%9.2029.02417

)120*2(17

71212

21

3

===

+=

=−=−=

++

m

procf

p

w

tttw