km4arr / openpgm

Automatically exported from code.google.com/p/openpgm
0 stars 0 forks source link

How to implement recovery in PGM. Needed is an example showing how PGM receiver sends PGM NAK to the sender. #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
On Linux box is started an PGM sender that does chunking for approx. 1MB buffer 
into chunks of 1500 bytes and then tries to send these chunks to the PGM 
receiver on another Linux Box (also using Ubuntu 11.04).  
2. The receiver ends up with IO_STATUS_RESET. How to recover from this? 
In general, expected is that whole buffer is completely transferred.
This is not the case. My question is how the PGM receiver can send  NAK to the 
sender?

Seems to me reasonable that receiver in such case sends NAK as unicast message. 
How to do this? Finally, how PGM sender knows which packets should retransmit. 
In other words how to properly retransmit packets?

I'm using OpenPGM 5.1.118,  Ubuntu 11.04

An example showing how PGM receiver could send NAK to the PGM sender 
(preferably using unicast) would be of great help.
Thanks in advance.

Original issue reported on code.google.com by nenad_le...@yahoo.com on 6 Oct 2011 at 9:51

GoogleCodeExporter commented 9 years ago
I'll work on some additional documentation to cover this area.  Update later.

Original comment by fnjo...@gmail.com on 6 Oct 2011 at 10:04

GoogleCodeExporter commented 9 years ago
Please consider reviewing the following articles:

http://openpgmdev.blogspot.com/2011/10/pgmiostatusnormal.html

http://openpgmdev.blogspot.com/2011/10/pgmiostatuswouldblock.html

http://openpgmdev.blogspot.com/2011/10/pgmiostatustimerpending.html

So a basic example of send NAKs would be:

pgm_sock_t* sock;
char buf[2000];
for (;;) {
  int status = pgm_recv (sock, buf, sizeof (buf), 0, NULL, NULL);
  if (PGM_IO_STATUS_NORMAL == status)
    printf ("Received \"%s\"\n", buf);
}

NAK generation and re-transmission is all handled by the pgm_recv function call.

Original comment by fnjo...@gmail.com on 7 Oct 2011 at 6:53