18.12.2012 Views

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

O'Reilly - Practical UNIX & Internet Sec... 7015KB

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

[Chapter 16] 16.2 IPv4: The <strong>Internet</strong> Protocol Version 4<br />

A Class E address is of the form N.M.O.P, where the most significant four bits of N are 1111. These addresses<br />

are currently reserved for experimental use.<br />

16.2.1.3 CIDR addresses<br />

In recent years, a new form of address assignment has been developed. This assignment is the CIDR, or Classless<br />

InterDomain Routing, method. As the name implies, there are no "classes" of addresses as in the classical scheme.<br />

Instead, networks are defined as being the most significant k bits of each address, with the remaining 32-k bits being<br />

used for the host part of the address. Thus, a service provider could be given a range of addresses whereby the first 12<br />

bits of the address are fixed at a particular value (the network address), and the remaining 20 bits represent the host<br />

portion of the address. This method allows the service provider to allocate up to 220 distinct addresses to customers.<br />

In reality, the host portion of an address is further divided into subnets. This subdivision is done by fixing the first<br />

jbits of the host portion of the address to some set value, and using the remaining bits for host addresses. And those<br />

can be further divided into subnets, and so on. A CIDR-format address is of the form k.j.l.(m...n), where each of the<br />

fields is of variable length. Thus, the fictional service-provider network address described above could be subdivided<br />

into 1024 subnets, one for each customer. Each customer would have 210 bits of host address, which they could<br />

further subdivide into local subnets.<br />

The CIDR scheme is compatible with the classical address format, with Class A addresses using an 8-bit network<br />

field, Class B networks using a 16-bit network address, and so on. CIDR is being adopted as this book goes to press.<br />

Combined with new developments in IP address rewriting, there is the potential to spread out the useful life of IPv4<br />

for many years to come.<br />

16.2.2 Routing<br />

Despite the complexity of the <strong>Internet</strong> and addressing, computers can easily send each other messages across the<br />

global network. To send a packet, most computers simply set the packet's destination address and then send the packet<br />

to a computer on their local network called a gateway. If the gateway makes a determination of where to send the<br />

packet next, the gateway is a router. The router takes care of sending the packet to its final destination by forwarding<br />

the packet on to a directly connected gateway that is one step closer to the destination host.<br />

Many organizations configure their internal networks as a large tree. At the root of the tree is the organization's<br />

connection to the <strong>Internet</strong>. When a gateway receives a packet, it decides whether to send it to one of its own<br />

subnetworks, or to direct it towards the root.<br />

Out on the <strong>Internet</strong>, major IP providers such as AT&T, BBN Planet, MCI, and Sprint have far more complicated<br />

networks with sophisticated routing algorithms. Many of these providers have redundant networks, so that if one link<br />

malfunctions other links can take over.<br />

Nevertheless, from the point of view of any computer on the <strong>Internet</strong>, routing is transparent, regardless of whether<br />

packets are being sent across the room or across the world. The only information that you need to know to make a<br />

connection to another computer on the <strong>Internet</strong> is the computer's 32-bit IP address - you do not need to know the route<br />

to the host, or on what type of network the host resides. You do not even need to know if the host is connected by a<br />

high-speed local area network, or if it is at the other end of a modem-based SLIP connection. All you need to know is<br />

its address, and your packets are on their way.<br />

Of course, if you are the site administrator and you are configuring the routing on your system, you do need to be<br />

concerned with a little more than the IP number of a destination machine. You must know at least the addresses of<br />

gateways out of your network so you can configure your routing tables. We'll assume you know how to do that,[7] but<br />

we will point out that if your routes are fairly stable and simple, you would be safer by statically setting the routes<br />

rather than allowing them to be set dynamically with a mechanism such as the routed daemon.<br />

[7] If not, you should consult your vendor manual, or one of the references in Appendix D, Paper<br />

file:///C|/Oreilly Unix etc/<strong>O'Reilly</strong> Reference Library/networking/puis/ch16_02.htm (5 of 15) [2002-04-12 10:44:38]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!