0

While reading one of the assignment questions in "Data Communication and Networking" by Behrouz Forouzan, one of the questions asked were using UDP for file-transfer have any adverse effects keeping process crash phenomenon in mind.

The solution to this said that if a process A asked for the file-contents from a server X and soon after the request, A crashed and another process B came up on the same port on the same machine(giving it the same socket address) and sends a request to the same server for another file but the request is lost which makes the server unknown of both the process A crashing and the request being lost and hence, it sends the contents of the file asked by A to B.

Why doesn't this problem occur, in a video-on-demand channel like you-tube or likes?

One of the closest answers I got is this, but it doesn't seem to address my problem:

UPDATE: For people who would like to have a read of the question given in the book, I found an online version of the required part, please have a look at the 8th question of the PDF:

Community
  • 1
  • 1
jobin
  • 2,600
  • 7
  • 32
  • 59

1 Answers1

0

In theory the problem could happen but in real life? Not a chance.

Let's say a user wants to stream a video from Youtube with a browser.

  1. Browser must crash - realistically does not happen too often.
  2. New browser instance takes the exact same source UDP port - virtually never happens.
  3. The user decides to look at a different video - makes no sense.
  4. While all this happens, server side does not time out - I don't think so.

This is like arguing that TCP should be used because a packet might get dropped on the wire when two computers are connected back to back with one meter Ethernet cable.

wookie919
  • 3,054
  • 24
  • 32
  • I agree that the situation may not happen often, but even if it would have happened once in while, would it really have the effect given in the question? By the way, why won't a new browser (or a tab) take the same UDP port? Is it blocked or something for a while? PS: Every tab has a different port so even a tab crashing is enough to trigger the effect(though that does not usually happen) – jobin Apr 22 '13 at 17:33
  • Basically, I don't think the situation will ever happen in real life. I think the source UDP ports are picked randomly from the available ports, so it is unlikely that the exact same source port will be chosen back to back. In my opinion the only way for this to occur is to force it occur by implementing the server/client in such a way. And the purpose of this might simply be to claim that "In this hypothetical environment, TCP would behave differently." – wookie919 Apr 23 '13 at 02:30