Java 7 SDP: Once written, running everywhere, sometimes also run super dazzle!

Source: Internet
Author: User
Tags socket linux

This article will briefly introduce the Java Socket Direct protocol (Sockets Direct PROTOCOL,SDP) introduced in the Java 7 SDK, and this new technology is a very exciting breakthrough. If you want to native access to InfiniBand's remote Direct memory access (Sqlremote direct Memory ACCESS,RDMA), SDP enables ultra-high performance computing (Ultra high Performance Computing, UHPC) Community uses Java-generic features and advantages in this uncommon scenario. RDMA provides a protocol for low latency applications that can directly access the memory of other computers without the need for operating system involvement. The UHPC community has the strictest and most stringent requirements for low latency and high throughput, and uhpc naturally needs to use the best RDMA. As Java 7 introduces the SDP,UHPC community, you can use the Java platform to write application code that directly leverages the InfiniBand RDMA functionality.

Before delving into the new Java SDP, let's briefly review the history of Java Network programming and socket APIs.

The slogan is now well known, as Sun Microsystems launched Java in 1995 and preached that Java could be "written and run Everywhere". We all know that the idea behind this is really simple: applications written in C + + code are extremely difficult to build/deploy in all environments, and it's even harder to get close to "running around" portability, but now you can write application code in a Java-like language. Applications can be built/deployed on virtual machines (not the underlying operating system execution environment). This greatly reduces the concern for the portability of Java application staff, but rather gives portability to the Java Virtual Machine (JVM) for processing. The JVM promises: If your Java code can be built/deployed on a JVM for a particular underlying operating system, the platform will ensure that the exact same code can run on it as long as the other operating systems have a usable, compatible JVM. No additional compilation and preprocessor macro directives are required. (Does anyone remember the #ifdef in C + +?) The JVM can get the application programmer out of this pain. )

This idea is very useful and has been widely accepted by the application programming community. As we know, Java is very quickly popular-accepted at an unprecedented rate, and many programming language platforms in computer history have not been popularized so quickly.

The JVM that Sun first provides can only run on three operating systems: 1, solaris,2, linux,3, Windows. Microsoft released Windows in 1993 with the Winsock protocol stack, so Windows can do TCP/IP network programming and fully support APIs. Various *nix systems have been supporting TCP/IP since the 1970s. Microsoft's introduction of Winsock is absolutely necessary for Java to take shape. Without Winsock, you cannot publish a Windows VM that supports java.net.* and java.io.* these APIs. A VM built without Winsock,java does not have complete network functionality on the operating system that monopolies the world's desktop. As Windows fully supports TCP/IP, the number of desktops running Java may increase by hundreds of thousand.

Things changed.

Of course, Java is still "write once, run everywhere." Portability remains the primary task. But now it's possible to do more with Java 7 and SDP,JVM. Portability is no longer the only focus; for the JVM, meeting the requirements of ultra-high performance use cases is also an important task. With SDP,JVM do not need to modify the network, Socket API, you can directly use the innate ability of InfiniBand. InfiniBand is much faster than Ethernet. The UHPC community often chooses InfiniBand as the provider of the physical network layer.

A 7 VM How to make applications take advantage of InfiniBand native functionality.

There's something interesting to note (especially historically): Java decided to provide SDP support on two operating systems, and Microsoft Windows wasn't there. The two operating systems supported by Java 7 SDP are Solaris and Linux. Solaris provides canonical support for SDP starting with version 10. As long as you have a physical InfiniBand network card, Java 7 SDP can work immediately. Linux supports SDP through the open fabrics Enterprise distribution (ofed) package. To verify that the Linux version has no ofed device drivers configured, simply type the following command after the physical InfiniBand network connection adapter is installed:

Egrep "^[\t]+ib"/proc/net/dev

If the command has an output, it means that you can use Java 7 SDP on this operating system.

All java.net.* and java.io.* application code can still run on Microsoft Windows with Java 7 vm ... But it does not use SDP, the physical layer provider at runtime is still Ethernet. Even if you are running on a version of Windows Server that provides InfiniBand support via the Winsock Direct subsystem, you will not be able to use SDP. All content can still run on windows, but slower than on non-Windows (that is, *nix).

Things have actually changed.

Now let's talk about the API in Java that connects the operating system network protocol stack. First, the following table shows the network layer standard Open Systems Interconnection (OSI) model.

From the OSI network layer perspective, Java 7 SDP enables Java application code to be "closer to the metal" (physical layer). The Java SDP provides a direct (SDP D) way to connect application code and native, physical InfiniBand with the help of a VM. Java 7 support for SDP does not require the application of code that modifies the use of java.net.* and java.io.* APIs. In addition, as long as a specific connection point is configured for the JVM to the InfiniBand operating system device and library (that is, the InfiniBand verbs layer API), using the java.net.* and java.io.* application code can bypass the traditional network protocol stack "direct" Access to the InfiniBand (that is, using Java API for layer fourth Transport layer of OSI, you can bypass the OSI third layer network layer and the second layer of data link layer, direct access to OSI first layer of physical layer). The impact on performance and the returns received are significant.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.