Hi,
I have implemented client server communication, I have used UDP as transport layer protocol. I am sending a file from client to server. Each time am sending 1024bytes. At receiver side am receiving those bytes and writing to a file. But as we know that UDP is unreliable, packets may arrive out of order. So how can I make all packets in order at receiver side? Is there any way to implement it? My target is to make sending file and receiving file to be identical. Please show me the way how can i implement?
Thanks,
Manjunath
7 10224
Hi,
I have implemented client server communication, I have used UDP as transport layer protocol. I am sending a file from client to server. Each time am sending 1024bytes. At receiver side am receiving those bytes and writing to a file. But as we know that UDP is unreliable, packets may arrive out of order. So how can I make all packets in order at receiver side? Is there any way to implement it? My target is to make sending file and receiving file to be identical. Please show me the way how can i implement?
Thanks,
Manjunath
What you can do is with every chunk of data you send add a chunk count to it and in the receiving end you can read the data and store it in memory for some time till u get the all the chunks.
Then you can order the chunks based on the count and flush it to the file
Raghuram
My big question is why are you trying to do this? If you want a reliable protocol, use TCP. UDP is for streaming data, TCP is where you want to make sure you have everything being sent.
Easy fix: use TCP.
My big question is why are you trying to do this? If you want a reliable protocol, use TCP. UDP is for streaming data, TCP is where you want to make sure you have everything being sent.
Easy fix: use TCP.
Ok thanks, But am intrusted to implemented using UDP, Its just for my curiosity to know how can we make UDP as reliable.
Thanks,
Manju
Ok thanks, But am intrusted to implemented using UDP, Its just for my curiosity to know how can we make UDP as reliable.
Thanks,
Manju
Make it like UDP? I don't understand the question. Why would you want to turn it into something that's already out there? Why not just use what's already out there?
Ok thanks, But am intrusted to implemented using UDP, Its just for my curiosity to know how can we make UDP as reliable.
Thanks,
Manju
UDP is designed for unreliable, connection less purpose, it is not like you can not make it as reliable, when you make it completely, then it becomes TCP. And also your are violating RFC. if you are violating RFC you many live in networking world.
TCP is one the more powerfull protocol in transport, so learn it , work on it, then i think you will become more curiosity on TCP.
If you have any design/technical problem by using TCP, please tell to me, we could innovate something else....
-Regards
Arul
Hi,
I have implemented client server communication, I have used UDP as transport layer protocol. I am sending a file from client to server. Each time am sending 1024bytes. At receiver side am receiving those bytes and writing to a file. But as we know that UDP is unreliable, packets may arrive out of order. So how can I make all packets in order at receiver side? Is there any way to implement it? My target is to make sending file and receiving file to be identical. Please show me the way how can i implement?
Thanks,
Manjunath
Why not add a header for every chunk of data? Normally, network protocols that can be implemented over UDP uses sequence numbers to keep track of its order.
There's not much point in making UDP as reliable as TCP (just use TCP). However, it is frequently desireable to use UDP and assume some lost packets but still require that packets be processed in order.
An easy way to ensure packets are receive in order is to add a sequence number to your message. If the receiver has received and processed sequence # n and gets a packet with secquence # n-1, it drops it. If the receiver receives n+1, it processes it (sends it to the application).
f it receives n+2, it sticks it in a queue and then starts an interval timer. If the timer expires without getting any other messages, it assumes n+1 never made it and processes the queued packet. If n+1 arrives, it processes it and then pulls n+2 out of the queue and processes it.
The implementation details are a little more complicated, but you get the gist.
TCP has all sorts of stuff in the protocol, including ACKs, retries, flow control, etc, that would be very difficult to (re)implement with UDP. However, you could probably devise a light-weight retry mechanism (without the rest of TCP) on UDP with not much effort if your application can't handle dropped packets. You can do this by manuall sending ACKs for each packet, but then you will need to deal with duplicate packets, more timers, etc.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Peter Diedrich |
last post by:
The site design is pretty simple:
============================================
| Head |
============================================
| | ...
|
by: relisoft |
last post by:
Seattle, WA -- Seattle-based Reliable Software® announces the release
their Windows Library into the public domain. Reliable Software Windows
Library, RSWL, is the foundation for their compact,...
|
by: melledge |
last post by:
The Reliable Source for Everything XML - XML 2005 Update
XML 2005 - November 14-18 - Atlanta Hilton Hotel - Atlanta, GA
www.xmlconference.org
Register today and participate in IDEAlliance's...
|
by: Buddy Ackerman |
last post by:
I seem to have a lot of complaints from users about file upload problems to my site (developed in ASP.NET). The issue
is not related to setting the maxRequestLength or any security issues. Most of...
|
by: splodge |
last post by:
This may seem like a stupid question but I want to check before I go
ahead and build this...
I am working on a portal, part of which allows users to upload files.
Part of the array within...
|
by: OlafMeding |
last post by:
Because of multithreading semantics, this is not reliable. This
sentence is found in the Python documentation for "7.8.1 Queue
Objects".
This scares me! Why would Queue.qsize(), Queue.empty(...
|
by: John Grant |
last post by:
If I build a web services today with VS 2005 does it support reliable
messaging?
If I use WSE 3.0 will it support reliable messaging?
If I don’t have reliable messaging can I make a web method...
|
by: relisoft |
last post by:
SEATTLE, Washington. - July 12, 2006: Reliable Software® announces
the upcoming release of Code Co-op® version 5.0. Code Co-op is an
affordable peer-to-peer version control system for distributed...
|
by: bshumsky06 |
last post by:
Hi,
I am trying to create stored procedures in MySQL. Does anyone have a
suggestion on a good IDE to use. I have been working with the MySQL
Query Browser but it generates errors very often and...
|
by: =?Utf-8?B?S2F1c2hhbCBNZWh0YQ==?= |
last post by:
Hi,
I am facing the ServerTooBusyException when using reliable session and
net.tcp binding.
I have single server and single client application. The client registers for
the event at the...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |