RCDA - Reliable Data Transfer

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

RCDA – Reliable Data Transfer

ing. Marco Andrés Ortiz N. – February 2018


Connectionless and
Connection-Oriented

A protocol can be either


• Connectionless
• connection-oriented.

Connectionless Protocol
• Packets are sent from one node to the next without any relationship
between the packets (each packet is independent).
• Physical connection (transmission medium) between the nodes, but
No connection between packets.
• The packets are not numbered and there is no sense of ordering.
• Most of the data-link protocols for LANs are connectionless protocols,
as well as the UDP transport protocol.

2
Connectionless and
Connection-Oriented
• Connectionless

Connectionless Protocol

3
Connectionless and
Connection-Oriented
A protocol can be either
• Connectionless
• connection-oriented.

Connection-Oriented Protocol
• A logical connection should first be established between the two
nodes.
• Packets are somehow related to each other
• Packets are numbered and sent in order
• If they are not received in order, the receiver waits until all
packets belonging to the same set are received and then deliver
them in order to the upper layer.
• Used in some point-to-point protocols, wireless LANs, and
WANs and TCP transport protocol.
4
Principles of Reliable Data
Transfer
Reliable Service
• Error detection
• Receiver feedback
• The positive (ACK) and negative (NAK) acknowledgment replies
• Retransmission.

Reliable data transfer protocols


• Stop and Wait
• Pipelined
• Go-Back-N
• Selective repeat

5
Stop and Wait protocols
rdt2.0 error detection, positive acknowledgments and
negative acknowledgments

Rdt2.1 error detection, positive acknowledgments, negative


acknowledgments and sequence number

Rdt2.2 error detection, positive acknowledgments sequence


number and acknowledgment number

Rdt3.0: error detection, positive acknowledgments,


sequence number, acknowledgment number and
countdown timer

6
Stop and wait algorithm 1 (rdt2.0)

Sender side

if an ACK or NAK is corrupted, the sender has no way of knowing whether


or not the receiver has correctly received the last piece of transmitted data.
7
Stop and wait algorithm 1 (rdt2.0)

Receiver side

8
Stop and wait algorithm 2 (rdt2.1)

Sender

9
Stop and wait algorithm 2 (rdt2.1)

Receiver

10
Stop and wait algorithm 3 (rdt2.2)

Sender

11
Stop and wait algorithm 3 (rdt2.2)

• Receiver

12
Stop and wait algorithm 4 (rdt3.0)

Sender

13
Stop and wait operation

14
Stop and wait operation

15
Stop and wait performance

Example:
RTT: 30 milliseconds.
Channel transmission rate: R = 1 Gbps
Packet size: L=1,000 Bytes per packet including both
header fields and data.

16
Pipelined protocol

the sender is allowed to send multiple packets without


waiting for acknowledgments.

17
Pipelined protocol

The range of sequence numbers is increased.

The sender and receiver sides of the protocol may have


to buffer more than one packet. Minimally, the sender
will have to buffer packets that have been transmitted
but not yet acknowledged.

Two basic approaches can be identified:

• Go-Back-N
• Selective repeat.
18
Go-Back-N

Base: The sequence number of the oldest


unacknowledged packet.
Nextseqnum: The sequence number of the next packet
to be sent.
N: Maximum allowable number, N, of
unacknowledged packets in the pipeline.
Flow control is one reason to impose a limit on the
senders N.
receiver will acknowledge a correctly
received packet when is in order.

19
Go-Back-N

[0,base-1]: Packets that have already been transmitted


and acknowledged.
[base,nextseqnum-1]: Packets that have been sent but
not yet acknowledged.
[nextseqnum,base+N-1]: Packets that can be sent
immediately.
Sequence numbers greater than or equal to base+N
cannot be used until the packet with sequence number
base has been acknowledged.

20
GBN sender

21
GBN Receiver

22
GBN Operation

23
Selective-Repeat protocol

sender retransmit only those packets that it suspects


were received in error (that is, were lost or corrupted)
at the receiver

individually acknowledge correctly received packets.

receiver will acknowledge a correctly


received packet whether or not it
is in order.

24
Selective-Repeat protocol

25
Marco A Ortiz N
13/02/2018

selective-repeat protocols

26
Selective-Repeat
sender events and actions

When data is received from above, the SR sender


checks the next available sequence number for the
packet. If the sequence number is within the sender’s
window, the data is packetized and sent; otherwise it is
either buffered or returned to the upper layer for later
transmission.

Timers are again used to protect against lost packets.


However, each packet must now have its own logical
timer, since only a single packet will be transmitted on
timeout.
27
Selective-Repeat
sender events and actions

If an ACK is received, the SR sender marks that packet


as having been received. If the packet’s sequence
number is equal to send_base, the window base is
moved forward to the unacknowledged packet with
the smallest sequence number. If the window moves
and there are untransmitted packets with sequence
numbers that now fall within the window, these
packets are transmitted.

28
Selective-Repeat
Receiver events and actions

When a Packet with sequence number in [rcv_base,


rcv_base+N-1] is correctly received, the received packet
falls within the receiver’s window and a selective ACK
packet is returned to the sender. If the packet was not
previously received, it is buffered. If this packet has a
sequence number equal to the base of the receive
window (rcv_base), then this packet, and any
previously buffered and consecutively numbered
(beginning with rcv_base) packets are delivered to the
upper layer. The receive window is then moved
forward by the number of packets delivered to the
upper layer.
29
Selective-Repeat
Receiver events and actions

Packet with sequence number in [rcv_base-N,


rcv_base-1] is correctly received. In this case, an ACK
must be generated, even though this is a packet that
the receiver has previously acknowledged.

30
References

[1] J. Kurose, and K. Ross, Computer Network: A Top-


Down Approach, 6ed. USA: Pearson, 2013, pp. 862
Section 3.4

[2] L. Peterson, and B. Davie, Computer Network: a


systems approach, 5ed. Burlington, USA: Elsevier, 2012,
pp. 884. Section 2.5

[4] Forouzan, Data Communications and Networking,


5ed. NY, USA: McGraw-Hill, 2013, pp. 1226. Sec. 11.2, 23.2
31

You might also like