TCP/IP First-Step [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

TCP/IP First-Step [Electronic resources] - نسخه متنی

Mark A. Sportack

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید






Using IP Addresses


An IP address uniquely describes a single device connected to a network. That means you can use it to establish a connection to any specific machine connected to the network. In the case of the Internet, that means you can single out just one machine of the millions connected.

As you might have noticed, IP addresses aren't the friendliest things to use. More to the point, most people can spend a lifetime connected to the Internet and other IP-based networks and never even see an IP address. That might seem like a real paradox: IP addresses are what makes the Internet's vast resources accessible, and yet most people never even see them!

The answer to that paradox is quite simple. There's no reason the average person using an IP network has to use an IP address directly. Many other available tools enable resources networked via an IP network to be accessed using more familiar words or phrases. For example, you could use a browser to access the Cisco Systems website at Chapter 11 reveals more about this. For now, suffice it to say there is a mechanism that takes your words (such as Routersnetwork devices that interconnect LANs to form a WANuse IP addresses as input to a mathematical process that enables them to pick the best path for your packets. You see, there can be a huge number of paths for your packets in a large and complicated network such as the Internet. Picking the best path is known as routing, and routers use IP addresses to share information with each other about known destinations and paths to those destinations.

The third and fourth uses of an IP address are highly interrelated and help you better understand exactly how IP addresses are used in a network.

How Can You Tell a Host Address from a Network Address?


Various types of devices make up a network. The role of these devices is to accept packets sent by other network devices, by computers, or by other machines that inhabit a network, and then decide what to do with them. That decision is based on each packet's destination IP address.

There is no magic herejust applied mathematics. Essentially, every computer, every printer, every anything that connects to an IP network gets an IP address. The network devices (such as routers and switches) typically won't care about application information, so they won't benefit by looking at TCP or UDP headers. However, the IP header contains all the information needed to figure out where each packet is going. After identifying each packet's destination, network devices figure out where to send it so that it reaches its destination. That implies that every network device knows how to reach every device connected to the network. In the case of the Internet, that's a tall order!

Although memory and computing power have both gotten inexpensive over the last few years, it is still beyond a router to remember how to get to every device on the Internet. This is where the two-level hierarchy of an IP address makes things much easier.

One Address, Two Parts


To this point, the chapter has treated IP addresses as a whole. Truth be told, each IP address contains at least two main parts: a network address and a host address. This two-part construction makes it possible to organize the chaos and makes the Internet feasible. The Internet is just too big for any one device to track all the other attached devices. That's significant because, despite technological advances made in computing, it's impractical and impossible for any one computer to keep track of every other computer, printer, and server in the world. There are just too many of them.

By deconstructing an IP address into a host and a network address, you can reduce the router's workload and figure out how to reach every device connected to the Internet. Each router only has to remember the path to a network address, rather than to every host's address. Each network consists of many different hosts, each of which shares the same network address. Figure 6-8 shows how this works.

Figure 6-8. All Hosts Share a Network Address

In Figure 6-7 is 255.255.255.0. Having walked through the binary mathematics that are the foundation on which the IP address is built, you can probably quickly surmise that the first three numbers when translated to binary represent a string of 24 consecutive 1s.

Remember: An IP address is actually a 32-bit binary number, and each of the 4 decimal numbers is 8 binary digits. Thus, this particular 32-bit string is 1111111111111111111111100000000. This might seem like a strange address, but not coincidentally the 1s and 0s appear in a consistent, unbroken series. That's the mask! The 1s signify all the bits in the real IP address and identify the network address within the IP address. All the 0s are the bits that identify the bits used for the host address.

Getting back to the example, all the hosts in Figure 6-8 start with 10.1.2. Given a mask of 255.255.255.0, you can avoid guessing and know that the network's address is 10.1.2.0. Sometimes you see it identified as 10.1.2 or even 10.1.2.x. Either way, it means the same thing.

Although ipconfig is a useful tool, it wasn't designed to reveal your network's address. You saw how to use it for that purpose, but also it identifies the bits that identify the subnetwork to which your computer connects. It doesn't identify the network. That's a subtle distinction, and in some cases there's no difference at all. As the word subnetwork implies, a network can contain numerous subnetworks. A subnetwork's address is an extension of a network address. That extension is made possible by borrowing some of the bits from the host address.

This creates a bit of a dilemma: How can you tell how many of the bits indicated by 1s in a subnet mask constitute the network address, and how many are used for the subnetwork address? The answer lies in understanding the architecture of IP network addresses. Fortunately, there are only two different architectures and one is obsolete. These two approaches are known as classical (or classful) and classless addressing.

Classical IP: The Way It Was


As you start investigating the world of IP addressing, you might come across the words class and classical. When the IPv4 address system was first deployed, the engineers at the IETF recognized that a few large organizations might need Internet connectivity. Their logic continued that there would be a moderate quantity of medium-sized organizations and a lot of little organizations. Consequently, they carved the address space into mathematical zones known as classes. Each class was identified with an alphabetic character from A to D.

A Class A network address contains more than 16,000,000 host addresses, but there are only about 128 of them. There are thousands of Class B network addresses (each of which contain more than 65,000 host addresses) and even more Class C network addresses, which contain just 255 host addresses each. Class D addresses serve a different purpose, and do not identify network or host addresses. This approach to class-based allocation of the IPv4 address space has come to be known as classical IP.

Under the rules of classical IP, routers quickly figure out how much of an IP address identified the network's address. They do so by examining the address's first few bits. The classes form rigid numeric boundaries, and it is easy to tell whether an address is a Class A, B, or C network just by looking at the value of the first decimal number. If the number is between 0 and 127, it is Class A. If the number is greater than 128 but less than 191, it is Class B. If it is greater than 191 but less than 223, it is Class C.

The Class A address uses the first group of 8 bits for the network address and the remaining 24 bits for host addresses within that network. The Class B network address splits the 32-bit address right down the middle: 16 bits for the network address and 16 for the host addresses inside that network address. The Class C network, as you might predict, uses 24 bits for the network address and just 8 bits for the host addresses within each network address. Obviously, the more bits in any address field, the more addresses mathematically possible. These three classes represent different tradeoffs between the number of network addresses you can make and the number of hosts that can be created within each network address.

Over time, the underlying assumptions about the sizes proved incorrect. The small size network address (i.e., Class C) was too small, and the jump to the medium network address was too big. Organizations that needed more than 255 addresses typically were given a chunk of 65,000 addresses. Needless to say, that wasted a lot of addresses; in the mid-1990s, an address shortage threatened to disrupt the Internet's growth. This crisis led to an amazing burst of creativity within the IETF as they sought to prevent the Internet's impending collapse. One such effort was to apply the technique that creates subnetworks to networks. In other words, classes would be abolished in favor of the ability to create network addresses of varying sizes. This approach became known as classless IP.

Classless IP: The Way It Is


That's probably the wrong way to word it. Even though today the Internet has moved away from class-based network addresses, don't misconstrue the current system as having no class. It's not the Rodney Dangerfield of the Internet. In fact, it's quite elegant, flexible, and efficient. This new system is known as Classless Interdomain Routing or CIDR (pronounced just like the warm holiday drink made from squished apples).Chapter 7 goes into more detail on how subnetworks work. For right now, accept that CIDR was based directly on subnetwork addressing. The only real difference between subnetwork addresses and CIDR network addresses is that CIDR doesn't borrow any bits from the host address bits.

Perhaps the most significant implication of that difference is that the entire CIDR network address is routable, whereas only the network portion of a subnetworked IP address is routable. Routable identifies the part of an IP address that routers use when they share information about networks that each knows about, as well as possible paths to those networks. The subnetwork bits and the host bits remain unused by routers and, consequently, are regarded as unroutable pieces of information.

With CIDR, a new form of shorthand emerged. Rather than use the familiar old mask such as the 255.255.255.0, a new notation hides this mask from you. The new notation is much simpler and doesn't saddle you with any mathematics exercises. Instead, the number of bits used for the network (or subnetwork) is explicitly identified using decimal numbers. To make this a bit more real, the mask of 255.255.255.0 contains 24 consecutive 1s indicating the network portion of the IP address.

A more concise way of expressing that same fact relative to the IP address is 10.1.2.0/24. Notice the slash and the 24? That's the mask or 255.255.255.0. The expression reads like this: The network address begins at 10.1.2.0, uses 24 bits to identify the network, and uses 8 bits to identify hosts within that network address.


/ 133