Sie sind auf Seite 1von 2

fggfgjhgkgk

gghgjghjghj
gjggjhgg
khgjgjgh
hfjhfjhgkkhnProtocol for RDT using UDP Connection
For a given application we have to design a reliable data tranfer protocol. The
steps includes to implement are:
1.Declare the rdt packet header
2.Connection establishment and termination, sequence numbers, acknowledgements,
flow control, timestamp.
During designing, we need to take care of:
1.packet loss
2.duplicate packet detection
1) Kinds of messages used in this protocol:
There are two kinds of messages that will be used in this protocol:
i) Message used to establish a connection
ii) Message used to send data
2) Syntax of the Packets:
Syntax tells the rules of writing a message, that is, which message should b
e sent in which way.
i)General messages contain a header and a payload
ii)Special messages contain just a header
iii)A field in the header is seperated by '\n'(line feed)
iv)End of a packet is marked by '\n\n\n'
v)End of header is marked by '\n\n'
3) Semantics- Meaning of each field:
Protocol maintained for the header is:
conn_flags: They maintain the connection's status. There are 4 types of connecti
on flags- SYN, FIN, ACK and RST.
i)SYN Flag is set to 1 when a successful connection is established between the s
ender and the receiver. It is used to synchronize the handshaking mechanism.
ii)FIN Flag determines connection termination. It is set to 1 when a request is
made to close the connection.
iii)ACK Flag is used for acknowledgement. When the receiver receives a packet se
nt by the
sender, it sends back an acknowledgement. The receiver migh
t also send a negative
acknowledgement. This means that the receiver ha
s received the packets but with some errors.
iv)RST is set to 1 when a connection is reset. All the flags and variables are s
et to 0.
seq_nos.: All packets are denoted by a sequence number. seq_nos. maintains a ran
ge of valid sequence numbers.
ack_nos.: Sends a set of sequence nos. That the receiver would be expecting to r
eceive.

list_of_packets: Queue(set) of packets currently present in the connection.


4) Mechanism:
Retransmission:
In stop and wait protocol , for each packet, the receiver sends an acknowledgeme
nt. The sender expects an acknowledgement and hence waits for it. If the packet
gets lost on the way and the receiver does not receive it, the receiver won't se
nd an acknowledgement and the sender will keep waiting for it. It may also happe
n that the acknowledgement gets lost on the way. Here also the sender keeps wait
ing. Hence a timer is set as soon as a packet is sent. If the timer ends before
an acknowledgement is received, the sender retransmits the packet thinking that
it was lost.
Connection Setup:
For connection-oriented service provided by TCP, it is necessary to have a relia
ble data transfer (RDT) protocol to ensure delivery of all packets and to enable
the receiver to deliver the packets in order to its application layer.during tr
anferring of packets,it may get loss and to minimise this problem we use checksu
mming, sequence numbers, ACK packets, and retransmissions.
Termination:
The termination method can be used to terminate the thread used by the protocol
in response to a received close packet. To improve transmission rates, RDT proto
col use pipelining.This allows the sender to have a large number of packets in t
he pipeline.
Sequence Number:
We use to retranmmit whem packet get lost during tranmission,duplicate packets m
ay occur during re-tansmission, to resolve these problem we use sequence number,
it is to add a new field to the data packet and have the sender number its data
packets by putting a sequence number into this field. The receiver then need on
ly check this sequence number to determine whether or not the received packet is
a retransmission.

Das könnte Ihnen auch gefallen