aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Ack/Nack proprietary protocol implementation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Ack/Nack proprietary protocol implementation" Watch "Ack/Nack proprietary protocol implementation" New topic
Author

Ack/Nack proprietary protocol implementation

omario Azzouz
Greenhorn

Joined: Aug 12, 2014
Posts: 2
Using Java, I have to implement a new proprietary protocol over UDP and based on Ack and Nack mechanism. This protocol is transactional using Transaction ID and Sequence Number in each packet. Retransmission management must be implemented also to avoid packet lost. Is there any Java framework that can help me to implement this protocol?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

omario Azzouz wrote:Using Java, I have to implement a new proprietary protocol over UDP and based on Ack and Nack mechanism. This protocol is transactional using Transaction ID and Sequence Number in each packet. Retransmission management must be implemented also to avoid packet lost. Is there any Java framework that can help me to implement this protocol?


Take a look at the DatagramSocket class to create a UDP "connection" to a unicast address. Take a look at the MulticastSocket class to create a UDP "connection" on a multicast group. And take a look at the DatagramPacket class to create the payload for those two socket classes.

Henry

PS... welcome to the ranch !!


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
omario Azzouz
Greenhorn

Joined: Aug 12, 2014
Posts: 2
Thanks Henry for your reply,
Perhaps I didn`t well explain. Sure I will use DatagramSocket and DatagramPacket, but I am looking for a framework that facilitate transaction and state management, timers management for retransmissions and concurrent request.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

omario Azzouz wrote:
Perhaps I didn`t well explain. Sure I will use DatagramSocket and DatagramPacket, but I am looking for a framework that facilitate transaction and state management, timers management for retransmissions and concurrent request.


Well, Java does have Executors that can execute jobs on a schedule -- basically, timers and concurrency stuff. Not sure about transactions and state management, but I would guess that it depends on how you implement the protocol. There are some transaction stuff, but they all depend on the protocol -- such as EJB, JMS, Databases, etc.

Henry
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40


And BTW, the concept of reliable multicast, meaning a reliable layer (with gap detection and retransmission) on top of UDP multicast, is pretty common. There are many commercial messaging products with these protocols. There are even a few open-source versions of reliable multicast.

As for reliable unicast, meaning a reliable layer on top of UDP unicast, well, that is less common. However, a few messaging environments do support it -- since it is arguably more flexible than TCP. The counter argument is, of course, why not just use TCP?

Perhaps you can search the web, for an open source version (with source code), as a starting point for your implementation.

Henry
 
 
subject: Ack/Nack proprietary protocol implementation