JDK Tutorials - Herong's Tutorial Examples - Version 6.00, by Dr. Herong Yang

What Is a Datagram?

This section describes what is a datagram - An independent and self-contained message sent over the network whose arrival, arrival time, and content are not guaranteed.

Datagram: An independent and self-contained message sent over the network whose arrival, arrival time, and content are not guaranteed. This definition is copied from the Sun's Java tutorial document. A datagram should at least contain the following information:

  • Address: The Internet address of the remote system.
  • Port: The port number of the remote system.
  • Data: The data contained in the datagram.

Datagram Socket: A logical concept represents the contact point on the local system of a datagram communication link.

Internet Address: A unique number to identify each computer system on the Internet.

Port: A number representing an entry point of on a computer system on the Internet, where a two-way communication link can be established.

Local System: The computer system at this end of a communication link.

Remote System: The computer system at the other end of a two-way communication link.

A datagram communication link on the Internet involves:

  • Two computer systems, each has its own Internet address.
  • A port number on each computer system that is used only by this communication link during the transmission period.
  • A program on each computer system that uses this communication link. One program must act as the receiver of the datagram, and the other program must act as the sender.
  • The receiver must create a datagram socket to represent the receiving point of the communication link.
  • The sender must create a datagram socket to represent the sending point of the communication link.

The following diagram illustrates how application programs can use datagram socket send data to another computer system through a datagram communication link on the Internet:

Computer System I                                  Computer System II

         Datagram|Address a|  Internet  |Address b|Datagram
Sender<--->Socket|Port 1   |----------->|   Port 2|Socket<--->Receiver

Last update: 2014.

Table of Contents

 About This JDK Tutorial Book

 Downloading and Installing JDK 1.8.0 on Windows

 Downloading and Installing JDK 1.7.0 on Windows

 Downloading and Installing JDK 1.6.2 on Windows

 Java Date-Time API

 Date, Time and Calendar Classes

 Date and Time Object and String Conversion

 Number Object and Numeric String Conversion

 Locales, Localization Methods and Resource Bundles

 Calling and Importing Classes Defined in Unnamed Packages

 HashSet, Vector, HashMap and Collection Classes

 Character Set Encoding Classes and Methods

 Character Set Encoding Maps

 Encoding Conversion Programs for Encoded Text Files

 Socket Network Communication

Datagram Network Communication

What Is a Datagram?

 Establishing a Datagram Communication Link

 DatagramServer.java - A Datagram Server Application

 DatagraClient.java - A Datagram Client Application

 DOM (Document Object Model) - API for XML Files

 SAX (Simple API for XML)

 DTD (Document Type Definition) - XML Validation

 XSD (XML Schema Definition) - XML Validation

 XSL (Extensible Stylesheet Language)

 Message Digest Algorithm Implementations in JDK

 Private key and Public Key Pair Generation

 PKCS#8/X.509 Private/Public Encoding Standards

 Digital Signature Algorithm and Sample Program

 "keytool" Commands and "keystore" Files

 KeyStore and Certificate Classes

 Secret Key Generation and Management

 Cipher - Secret Key Encryption and Decryption

 The SSL (Secure Socket Layer) Protocol

 SSL Socket Communication Testing Programs

 SSL Client Authentication

 HTTPS (Hypertext Transfer Protocol Secure)

 Outdated Tutorials

 References

 PDF Printing Version

What Is a Datagram? - Updated in 2014, by Dr. Herong Yang