×

Discussion Board

Results 1 to 11 of 11

Hybrid View

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    8

    Unhappy Loss packets when receiving multi-packets data

    Hi:
    A frame picture(320X240) is split to multi packets( about 6~7)
    on Server(PC), These packets will be requested to send to client(Symbian) by UDP command,After Client gets first frame from server, continue to ask next frame, One by one.... Now The problem is that:
    Only severals frames at begin are able to be received all packets completely, and left frames will not be get whole packets, for example, Only get packet1~5,and packet 7 is lost.
    SO the picture is not completed. I make an engine use CActive to
    do this udp session.
    BTW: If i change pictue size to small size, for exampe (160x120)
    ,Only 1~2 packets for one frame. SO picture can recv completely.
    everyone, This problem take me a long long time........,,, Can you help me, sincerely.......

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: Loss packets when receiving multi-packets data

    Doh! UDP is stateless. Its not called the "Unreliable Datagram Protocol" for nothing.

    If you need guaranteed and ordered unique packet delivery use TCPIP, rather than UDP, otherwise you will need to write your own signalling to get the server to resend the packets and you will need to validate and assemble them in the correct order on the client.

    See http://en.wikipedia.org/wiki/User_Datagram_Protocol for more info
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    8

    Re: Loss packets when receiving multi-packets data

    Quote Originally Posted by Paul.Todd View Post
    Doh! UDP is stateless. Its not called the "Unreliable Datagram Protocol" for nothing.

    If you need guaranteed and ordered unique packet delivery use TCPIP, rather than UDP, otherwise you will need to write your own signalling to get the server to resend the packets and you will need to validate and assemble them in the correct order on the client.

    See http://en.wikipedia.org/wiki/User_Datagram_Protocol for more info
    Thank for your reply. en, but Now, I am not to permitted to do anything to Server. Server has no any mechanisms to guarantee correct order& complete data to client. But If I rewrite client like as symbian on PC. I will get quite right picture. right order,whole data. But on emulator, it is a problem.......

  4. #4
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: Loss packets when receiving multi-packets data

    Try it on a real handset. It uses a different IP stack. It will probably work, but still one off sending UDP packets is a duff protocol. (unless it is some sort of streaming where the errors are hidden)

  5. #5
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Loss packets when receiving multi-packets data

    You can often make UDP more reliable by sending slower (or less bursty anyway). This is because most packet loss occurs when some node in the network drops packets because it can't handle the rate they are ariving at (usually due to a lack of buffer space).

    However, you can never guarantee the delivery of UDP packets over a network. So, witchsnk, to say you can't change the server means you can't really fix the problem. It should be a trivial change (just change the type of socket) and if the server intends people to recieve the whole picture then it is very clearly wrong to use UDP.

    Sorcery

  6. #6
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: Loss packets when receiving multi-packets data

    I agree with everything Paul says (its safer that way).
    The trouble is that on a LAN almost all UDP packets do get there so people forget the unreliable bit.
    A UDP packet going to a phone has to "fly round the world first", getting attenuated at each stage. So it is not surprising that some go missing.

    However, the point of my post, are there any known issues for the Symbian IP stack with respect to this?

    I have seen several posts around the web saying that if you send several packets at once the last ones will go missing. Is this a limitation of the hardware or a bug in the software?

    Witchsnk, what happens if you put a short time gap in between packets?
    (if this keeps the packets, you are still better off with TCP)

  7. #7
    Registered User
    Join Date
    May 2006
    Posts
    30

    Re: Loss packets when receiving multi-packets data

    Witchsnk,

    You've mentioned that you can't change the server side code... hence you are stuck with UDP.

    There's plenty of reasons why the packets maybe dropped. One factor often missed is the rate at which the application can process the packets, because it just happen that the TCP/IP stack in the Symbian device is sending the packets faster than your application can handle, hence its discarding the packets before it reaches your application.

    You've mentioned that you are using active objects... why don't you write a AO with higher priority than standard that only encapsulates read requests?

    Other things to consider would be to pass large enough buffers in your Recv/RecvFrom calls so you get as much data possible during each call.

    Besides this, consider application side buffering techniques, maybe you are spending too much time reading and processing the data? Why not offload the processing to another AO?

  8. #8
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: Loss packets when receiving multi-packets data

    And in your RunL, call the next recv before you do any other processing.

  9. #9
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: Loss packets when receiving multi-packets data

    What is this protocol called does it have a name, or is it proprietary?

  10. #10
    Registered User
    Join Date
    Dec 2006
    Posts
    2,280

    Re: Loss packets when receiving multi-packets data

    Hi,

    Seriously - it would be a BIG mistake to try to fix this without changing the protocol to the server. You might be able to make it work on your test set-up but there'll be a network somewhere that drops some packets. Also, if it's supposed to be a mobile application then you presumably need to send the data wirelessly at some point. In that case all the channel coding in the world won't save you from a short burst of RF noise destroying one or more of your packets in transit.

    This is definitely a case for fix the design don't patch up the code.

    Sorcery

  11. #11
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    280

    Re: Loss packets when receiving multi-packets data

    I couldn't agree more. I was just asking what the protocol was out of morbid curiosity.

    I was wondering if it was an abuse of some streaming thing. I was also wondering who designed this protocol.

Similar Threads

  1. Receiving Bluetooth Data with Emulator?
    By btuman in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-11-12, 07:06
  2. Receiving Bluetooth Data with Emulator?
    By btuman in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-11-12, 06:54
  3. Receiving Bluetooth Data with Emulator?
    By btuman in forum Bluetooth Technology
    Replies: 1
    Last Post: 2002-11-12, 06:50
  4. Card Phone and receiving data calls
    By chinazou305 in forum Multimodecards
    Replies: 3
    Last Post: 2002-11-05, 18:43
  5. 6360 not receiving or transferrng data but ird is connected
    By mortgagehelper in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2002-08-15, 12:41

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •