Game Development Reference
In-Depth Information
servers, FTP sites, whatever you want. You just have to know what IP address to con-
nect to, how to format the bytes you send, and how to parse the bytes you receive.
Internet Addresses
Every computer that has TCP/IP installed has an IP address to identify the com-
puter on the network. I say
very specifically
because not every network is visible to the Internet. Some, like the one in my
house and the network where I work, are hidden from the Internet at large. They
act like their very own mini-Internets. The computers on these mini-Internets only
need a unique IP address for their network. Other computers, like the one that hosts
my website, are attached directly. These computers need a unique IP address for the
Internet at large.
Right now there are two common Internet protocols, IPv4 and IPv6. IPv4 has been
around since the early 1980s and is most commonly used throughout the world. But
that is beginning to change because the address space of IPv4 is quickly running out.
IPv6 increases the address size from 32 bits to 128 bits, basically giving every person
on the planet Earth approximately 4.8 × 10 28 addresses for his personal use. There
are many other improvements and differences, which after you read this chapter
you
the network
and not
the Internet
ll have enough knowledge to absorb. Since IPv6 is still fairly new and not every-
one can use it, this chapter will focus on IPv4.
The IPv4 address is a 4-byte number, something you can store in an unsigned int.
Here ' s the address for the computer that hosts my website, for example:
3486000987, or expressed in hexadecimal: 0xCFC8275B. People usually write Internet
addresses in dotted decimal format to make them easier to remember. The above
address would be expressed like this: 207.200.39.91. This may be easier to remember
than 3486000987, but it
'
s still no cakewalk.
This address has two parts: the network ID number and the host ID number. The
host ID is the individual computer. Different networks have different sizes, and the
designers of the Internet were wise to realize this. If they had simply chosen to use
two bytes to represent the network ID and the host ID, the Internet would be limited
to 65,536 networks and 65,536 computers on each network. While that might have
seemed fine back in 1969 when the first four computers inaugurated ARPANET, as
it was called, it would hardly seem sufficient now. The solution was to separate the
network into address classes, as shown in Table 19.1.
Table 19.1 provides a summary of the IP address classes that are used to create IP
addresses. The total size of the Internet, if you have a calculator handy, is about 3.7
billion computers on 2.1 million networks of various sizes, most of them very small.
'
 
 
Search WWH ::




Custom Search