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

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

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

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

Mark A. Sportack

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

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

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






Routers Route!


It's true: Routers routebut that's not all they do. Despite all outward appearances, routers live complicated, hard-working lives. Routers continuously perform these functions:

Communicate information about known destinations with their neighboring routers

Discover new destinations

Compare different paths to the same destination

Select the best path to each known destination

Store that path in a table filled with other best paths

Send packets of data en route to their destination via the best known path


That sounds like quite a load for the router, and it is. Luckily for you, it's easier understanding how a router works. Start by looking at what a router is, what it does, and what it doesn't do.

Routers actually perform a multitude of tasks, but not all are directly related to routing. For example, routers can filter unwanted packets that might try to enter your network, keep detailed event logs, and translate addresses. As important as these tasks are, they are not an integral part of routing. Thus, they were left out of the bulleted list on critical router functions.

What Is a Router?


A router is a specialized device designed to push IP packets (or other protocols' packets) through a network. Routing is actually a function that can be performed on a variety of physical platforms. A PC, for example, can be configured as a router, but it isn't a good or robust one. A software routing application can be run on a general-purpose computer such as a PC. Such routers are known as software-based routers. Cisco Systems makes a highly specialized line of routers, known as hardware-based routers, of all shapes and sizes to fit any network niche.

Regardless of its form, a router interconnects networks and regulates the flow of IP packets between those networks. For that to occur, a router must have the ability to interface with many types of physical networks.

For the purposes of routing, a network is defined as the collection of end systems and networking equipment bound by a common IP network address. Routers sit at the edge of that network and decide what to do with each packet it receives based on the IP network address in each IP packet's destination address field.

What Does a Router Do?


To route, a router must form the boundary, or edge, of a network so it can pass IP packets back and forth between two or more networks or subnetworks. So far, so good. What's not so clear is what a network is.

A network could be a local-area network (LAN). Ethernet has become the dominant type of LAN in the world today and is found in homes, small offices, and large enterprises. A network could also be a wide-area network (WAN). A WAN is a collection of LANs interconnected with routers, so you can think of a WAN as being a network of networks. Recall the example network in Chapter 7, "More Fun with IP Addresses," which shows how a router can create a series of subnetworks from within a single network. That's yet another example of a different type of network.

Regardless of a network's shape, a router has a paradoxical role in a network. It must simultaneously separate yet interconnect networks. Figure 11-1 illustrates this.

Figure 11-1. A Router Interconnects and Separates LANs

[View full size image]

In Figure 11-1, you see a simple network consisting of two LANs interconnected by a small router. All share the same IP network address of 192.168.0.0/23, but that network address is subdivided into two subnetworks of equal size. The LAN on the left uses 192.168.0.0/24, which gives it host addresses that range from 192.168.0.1 to 192.168.0.255. The LAN on the right uses the other half of the /23 network, which forms the subnetwork 192.168.1.0/24. The valid host addresses in that subnetwork range from 192.168.1.0 through 192.168.1.255. The router's paradoxical job is to separate yet interconnect these two LANs.

The key to understanding the seemingly self-contradictory role and, subsequently, routing's function, is to recognize that the separation and interconnection occur at different levels.

Recall the OSI reference model mentioned throughout this book. Remember that IP operates at Layer 3the network layerof that model. LANs, such as Ethernet networks, operate at Layers 1 and 2 of that same model. Take a look at Figure 11-2, which is an abstract view of the network illustrated in Figure 11-1.

Figure 11-2. An Abstract View of the Network Using the OSI Reference Model

[View full size image]

In Figure 11-2, you see that each LAN is just an OSI reference model's physical and data link layers. The router interconnects them at the network layer, but maintains separation at the physical and data link layers.

Now that you have the abstract perspective, take another look at the network itself. In Figure 11-3, you see the same network from Figure 11-1. The difference is that Figure 11-3 has dotted squares around the different network environments, indicating how a router both interconnects and separates.

Figure 11-3. The Router Separates Layers 1 and 2, but Interconnects at Layer 3

[View full size image]

By comparing Figures 11-1, 11-2, and 11-3, you can see that a router physically interconnects different networks using IP, but logically separates those networks at Layers 1 and 2. The big question is how that works.

How Does That Work?


Dig a little deeper and see how that router in routing protocol. Routing protocols, just like every other protocol in the TCP/IP family of protocols, is a highly specialized piece of software. These protocols don't run on desktop computers or other devices that humans use. Instead, they run on routers. Routing protocols enable routers to do the first five of the six critical functions identified in Table 11-1. The last function, forwarding packets, is a native function of a router's hardware and operating system and is independent of a routing protocol's presence.

There are many routing protocols and at least two schools of thought about what constitutes a best path. Focus on the mechanics of a router using the same small network used throughout this chapter; then you are ready to look at different ways to interpret the best way to get there from here!

Please remember that as you read the remainder of this chapter that routing is an extremely complex science. The goal isn't to make you an expert at all the nuances of routing, but rather to impart a basic understanding.

Learning About New Destinations


One of any routing protocol's basic functions is enabling routers that use the same protocol to communicate with each other. That communication enables a router to essentially tell its neighbor, "Hi! I'm connected to network 192.168.5.0/24. What networks do you know about?" In this chapter's example, the neighbors aren't two different routers, but two different ports or interfaces on the same router. Each interface must be configured to use the same routing protocol. That's just like telling them to speak the same language. Each interface keeps its own track of best paths to known destinations and shares its list with its neighbors. In the real world you wouldn't set up a network this way, but this simple example helps get the point across.

Figure 11-4 shows this first basic step in the routing process. The two interfaces on neighboring routers establish contact with each other and share what they know about destinations they can reach. This contact is limited to direct neighbors, but those neighbors share all they know about the rest of the network. The arrowed lines interconnecting the network clouds in Figure 11-4 indicate the two-way exchange of information between direct neighbors in a network.

Figure 11-4. Step 1: Saying Hi!

[View full size image]

Routers don't actually say "Hi" to each other, but router interfaces that speak the same language do talk to each other. How they do that varies by the specific routing protocol. You understand later what they say when they communicate.

Remembering Best Paths


As a router's network interfaces exchange information with other routers, each one begins piecing together a picture of what the network looks like. That picture consists of just three basic pieces of information:

The destination network IP address.

The router interface used to get to that destination network.

Some measure of that path's cost. Cost is not necessarily a financial term in this sense, but it does indicate some measure of the reachability of known destination networks.


These pieces of information are stored and kept correlated in a structure known as a routing table. Whenever a router needs to forward a data packet, it checks each packet's destination address against the contents of this table. That's how it knows where to send each packet.

Using the sample network depicted in Figure 11-4, it is time to see what information might be communicated between neighbors. Although the actual information exchange is dictated by the routing protocol, it is useful to understand the function of information exchanges between neighbors without the complexity that specific routing protocols can introduce.

Many routing protocols use the concept of cost to compare different routes to the same destination. The lower the cost, the better the route. That much is logical. However, the cost metric often has nothing to do with money! Instead, routing cost measures the number of routers that lie along the path between any given source and destination networks.

Table 11-2 shows the simple set of routing tables that exist in the example network. Rather than map out all routing table updates for all the networks, simplify the chore and look only at what the router in network 10.10.20.0/24 would share with its neighboring router in network 10.10.10.0/24.

Table 11-2. Step 2: Communicating Best Paths to Known Networks

Interface Number

Reachable Networks

Routing Cost

S0

10.10.10.0/24

1

S0

10.10.30.0/24

2

S1

10.10.40.0/24

1

S1

10.10.50.0/24

2

S1

10.10.60.0/24

3

S1

10.10.70.0/24

2

S1

10.10.80.0/24

3

S1

10.10.90.0/24

3

The 10.10.20.0/24 network is a good example because it only contains two direct connections: one to 10.10.10.0/24 via its serial interface #0 (S0) and another to 10.10.40.0/24 via its serial interface #1 (S1). These two connections enable it to reach every other network, albeit indirectly. Table 11-2 shows what the information updates would look like.

There might be many ways to reach a given destination network, but the routing protocol has selected these as the best or shortest path. That's a simple, if not trivial, example. This network's extreme smallness means you probably wouldn't use a routing protocol in real life. Still, it makes for a marvelous example absent the clutter of detail.

You return to calculating routes a bit later in this chapter. For right now, finish exploring the functions of a router. The next step in routing is the easiest piece of all: forwarding packets.

Forwarding Packets


A router's mission in life is to route packets. That is, it accepts packets sent by devices at the edge of a network, such as your computer, and forwards them to their intended destination. You already say how routers communicate and use that ability to build routing tables. The last piece of the puzzle is what they do with packets. You see, routers don't create packetsthey can create frames.Chapter 10, "Special Delivery for Special Messages," routers are capable of creating IP packets that contain system-level information. Those packets are delivered to other systems (not end-user applications) using Internet Control Message Protocol (ICMP).

The point about routers creating frames and not packets might sound like word games. Frames and packets are critically different. Both function as an envelope and carry a user's or application's data through a network, but that's where the similarities stop! Packets are persistent and are created once. Frames are only good for one link in a network.

In Figure 11-5 you see a computer connected to network 192.168.0.0/24 sending a packet addressed to a server in the 192.168.1.0/24 network. Although the computer can create an IP packet (thanks to its TCP/IP protocol stack), it cannot place the IP packet on that network. At least, it can't do that directly. The network is an Ethernet network, so it wraps that IP packet inside an Ethernet frame and places that frame on the network. That Ethernet frame is addressed to the Media Access Control (MAC) address of the router's E0 interface.

Figure 11-5. Ethernet Frame Is Launched

[View full size image]

This is a subtle but important point: The IP packet embedded in that Ethernet frame bears the destination IP address of the server in network 192.168.1.0/24. However, Ethernet doesn't look at, use, or understand IP addresses. Ethernet uses MAC addresses.

Figure 11-6 shows you the next step in the process. Upon arrival at the router's E0 interface, the IP packet is pulled out of the frame and the frame is discarded. It has done its job! The IP packet, however, has some work to do. Specifically, it needs to get its data to its intended destinationthe server in network 192.168.1.0/24.

Figure 11-6. IP Packet Is Extracted from the Ethernet Frame

[View full size image]

The routing protocol on the E0 interface takes a look at the destination IP address and sees that it is the network connected via its E1 interface. The packet is handed off to the E1 interface. The E1 interface must again wrap that IP packet in an Ethernet frame for transport through the next Ethernet network. This time, the Ethernet frame bears the destination MAC address of the server itself, rather than an intermediary network interface (as shown in Figure 11-5). This step is illustrated in Figure 11-7.

Figure 11-7. IP Packet Is Wrapped in a New Ethernet Frame

[View full size image]

The server accepts this incoming Ethernet frame, strips it to reveal the IP packet inside, and processes that packet's contents. If nothing else, this sequence of illustrations shows you that packets are persistent, that frames are transient, and how that applies to the process by which routers forward packets.

Packets forwarded by routers must be rewrapped in a network frame, such as an Ethernet frame. Remember: IP packets operate at Layer 3 of the OSI reference model and network frames operate at Layer 2. Packets are persistent and, unless damaged or lost in transit, remain intact from source to destination. Network frames, on the other hand, are highly transient creations good for only one trip through a network. This iterative process of wrapping and unwrapping continues until the packet reaches its destination or is discarded.


/ 133