Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Multiple POSIX Timers with handlers: how to?

Started 1 month, 1 week ago by premudriy
Hello everyone, I'm working on a course project. I need to implement a "pseudo TCP" on top of UDP protocol. I've already implemented sequence and error handling concepts of TCP. Now I need to deal with timers and retransmission of packets, i.e. when acknowledgement for a sent packet doesn't arrive after X seconds, then retransmit that given packet. My plan for timers is as ...
Site: FedoraForum.org - Fedora Core Support Forum & Community  FedoraForum.org - Fedora Core Support Forum & Community - site profile
Forum: Programming   Programming   - forum profile
Total authors: 7 authors
Total thread posts: 17 posts
Thread activity: no new posts during last week
Domain info for: fedoraforum.org

Other posts in this thread:

JN4OldSchool replied 1 month, 1 week ago
Yes, I could shed some light on the TCP timeout concept but...I am not a guru, so...

lewis41 replied 1 month, 1 week ago
I'm not Linus Tornvalds, alias a guru, and so more superficially and with poor knowledge of the subject, I would create a list of objects, with the appropriate functions to manage it (insert, delete, read, write objects, timer, ecc.) and one/more global functions to manage the list. Or if I would have much free time, I would hack some good code written by others.

RupertPupkin replied 1 month, 1 week ago
This is fairly simple to do, but since I'm not a guru then premudriy doesn't want my help.

premudriy replied 1 month, 1 week ago
LOL. Ok. I see what's wrong - the title says for gurus only. I didn't think it's going to be so touchy. Ok. The title means: If you will answer this question, then you're officially a guru. Will this work? But seriously, I didn't mean the title to be accepted as it is by some people. I just wanted a concrete help and not just "Look in the man pages!" answers.

scottro replied 1 month, 1 week ago
I'll change the title, as folks seem to be, as you say, overly touchy. Maybe that will help.

premudriy replied 1 month, 1 week ago
Ok, Scottro, thank you. Next time I'll try make more politically correct titles :-) I'm sorry for it's touchiness. I didn't mean to.

stevea replied 1 month, 1 week ago
This is probably all you should need man timer_create Creating a timer per packet is a profligate use of resources. OK for a "toy" example but totally unrealistic. Let me expand on Lewis41 suggestion. Create linked list method so you can keep the packet handles in ordrer of expiration time. You need to be able to insert packets in expiration time order, remove packet by ID when you ...

premudriy replied 1 month, 1 week ago
Stevea, thanks for replying. This sounds like a very good way to do it and with only one timer.

stevea replied 1 month, 1 week ago
Oops - use man 3p setitimer since you most certainly want signal notification when the timeout occurs. You'll need to think about how to partition the work between the signal handler and the main process, perhaps using a semaphore from sighandler to the main ... Another thought - if your main process/thread is normally waiting on input/output, you can use the timeout parameter of the ...

jpollard replied 1 month, 1 week ago
I also suggest that there be a maximum number of outstanding packets.... You wouldn't want to be sending a 3GB file to a system that goes down... and end up with 80% of your memory with nothing but timeouts and packets to send...

 

Top contributing authors

Name
Posts
premudriy
6
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-09 18:23:00)
Oh, yes, I must not implement NAKs in this project, only ACKs. Acknowledgements are cumulative, i.e. if three packets were received, then I'll send ACK for the last (third) packet, which will mean that all tree packets got through. As for congestion: there's a receiver buffer and ACKs have a special field that tell how much more packets the sender can supply to receiver.
stevea
4
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-09 09:49:00)
Quote: Originally Posted by jpollard Yup - the application specified is using UDP, which doesn't block. That calls for something external to invoke the stall. In this case, I'd suggest a NAK when the count reaches the limit, and drop the data. So much misinformation in such few lines .... /UDP certainly does block, tho' for a smaller set of reasons. This "toy" case is presumable implemented in userspace making...
jpollard
3
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-09 14:25:00)
And none of them implement reliable delivery over UDP without implementing some form of ACK/NAK and sending limits. Reliable delivery of UDP is not a standard... The problem with UDP is that the senders/receivers cannot assume reliable delivery. Reliable delivery can only be supported at the application layer. The original statement was '"pseudo TCP" on top of UDP protocol'. I know TCP works differently. It...
JN4OldSchool
1
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-07 06:56:00)
Yes, I could shed some light on the TCP timeout concept but...I am not a guru, so...
lewis41
1
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-07 07:23:00)
I'm not Linus Tornvalds, alias a guru, and so more superficially and with poor knowledge of the subject, I would create a list of objects, with the appropriate functions to manage it (insert, delete, read, write objects, timer, ecc.) and one/more global functions to manage the list. Or if I would have much free time, I would hack some good code written by others.
RupertPupkin
1
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-07 12:54:00)
This is fairly simple to do, but since I'm not a guru then premudriy doesn't want my help.
scottro
1
user's latest post:
Multiple POSIX Timers with...
Published (2009-11-07 16:45:00)
I'll change the title, as folks seem to be, as you say, overly touchy. Maybe that will help.

Related threads on "FedoraForum.org - Fedora Core Support Forum & Community":

Related threads on other sites:

Thread profile page for "Multiple POSIX Timers with handlers: how to?" on http://www.fedoraforum.org. This report page is a snippet summary view from a single thread "Multiple POSIX Timers with handlers: how to?", located on the Message Board at http://www.fedoraforum.org. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity