First of all: before investing time and effort into a sliding-window layer on top of UDP, check whether you need such an exotic solution. TCP already does that kind of stuff, and many people have invested lots of time in getting it right and robust. But there are of course valid reasons to implement such a solution. The next step should be to google around, chances are there are already dozens of very similar programs around. Especially because you don't seem to have a lot of experience with Java's networking API's it's probably a whole lot more efficient to start from a working piece of Java code than from an example from a book that's more geared toward learning people networking concepts.
Anyways, if you want to reimplement the protocol above start by reading the Javadoc for the DatagramSocket class. It has a setSoTimeout method that can replace the timer thing in the code above, the main difference being that upon timeout receive will throw a SocketTimeoutException, and that may complicate your program's flow a little. Forget the from_physical and to_physical bits, all that stuff is wrapped by the Socket classes.