Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ack/Nack proprietary protocol implementation

 
omario Azzouz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21385
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 !!
 
omario Azzouz
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21385
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21385
84
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic