IP

The network delivers data packets between any two computers connected to it. The protocol used on the network is IP, which is simply an abbreviation of Internet Protocol. Using IP, a computer can send a data packet to another. The package contains a header and the data content. The header contains the Internet addresses of the sender and the target machine, other flags, and information about the package. Since the machines are not connected to each other directly, routers forward the packets. It is like post offices sending mails to each other till it gets into the hands of the postman you know, who can directly deliver it to your mailbox. To do that, the routers use the information in the header. The algorithm and organization of how the routers interact are complex and something we need not know to be Java professionals.

If you ever need to program in order to send IP packets directly, you should look at java.net.DatagramPacket, and the rest is implemented in the JDK, the operating system, and on the firmware of the network card. You can create a data packet; sending it and changing the modulated voltage on the network card or emitting photons to the fiber is not your headache. However, you will all know whether you really need to program datagrams directly.

IP has two versions. The old version still in use is IPv4. The new version that coexists with the old one is IPv6 or IPng (ng stands for new generation). The major difference that may concern a Java developer is that version 4 uses 32-bit addresses and version 6 uses 128-bit addresses. When you see a version-4 address, you will see something like 192.168.1.110, which contains the four bytes in a decimal format separated by dots. IPv6 addresses are expressed as 2001:db8:0:0:0:0:2:1, as eight 16-bit numbers expressed in hexadecimal separated by colons.

The Web is a bit more complex than sending data packets. If sending a data packet is like sending a one-page letter, then a web page download is like discussing a contract in paper mail. There should be an agreement in the initial paper mail as to what to send, what to answer, and so on, until the contract is signed. On the Internet, that protocol is called Transmission Control Protocol (TCP). While it is highly unlikely (but possible) that you will meet IP routing issues, being a Java developer, you certainly may meet TCP programming. Therefore, we will cover shortly how the TCP works. Be aware that this is very brief. Really. You will not become a TCP expert reading the next section, but you will get a glimpse of the most important issues that affect web programming.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.70.101