data communication part 8

24
Data Communication Part 8

Upload: alex-fernandez

Post on 15-Apr-2017

147 views

Category:

Technology


3 download

TRANSCRIPT

Page 1: Data communication part 8

Data CommunicationPart 8

Page 2: Data communication part 8

THE WONDERFUL WORLD

OF ROUTING◎ The true beauty, the amazing power of TCP/IP lies in one word:

routing.

◎ Routing enables us to interconnect individual LANs into WANs. Routers, those magic boxes that act as the interconnection points, have all the built-in smarts to inspect incoming packets and forward them toward their eventual LAN destination. Routers are for the most part automatic. They require very little in terms of maintenance once their initial configuration is complete because of their capability to talk to each other to determine the best way to send IP packets. The goal of this chapter is to take you into the world of routers and show you exactly how they do this.

◎ The chapter discusses how routers work, including an in-depth look at different types of Network Address Translation (NAT), and then dives into an examination of various dynamic routing protocols. You’ll learn about distance vector protocols, Routing Information Protocol (RIP), and Border Gateway Protocol (BGP), among others.

Page 3: Data communication part 8

HOW ROUTERS WORK

◎ A router is any piece of hardware or software that forwards packets based on their destination IP address. Routers work, therefore, at Layer 3, the Network layer.

◎ routers are dedicated boxes

◎ that contain at least two connections, although

◎ many routers contain many more connections.

◎ In a larger business setting, for example, you might see a Cisco 2600 Series device, one of the most popular routers ever made. The 2611

◎ router shown in Figure 8.1 has two connections (the other connections are used for maintenance and configuration)

Page 4: Data communication part 8
Page 5: Data communication part 8
Page 6: Data communication part 8
Page 7: Data communication part 8

ROUTING TABLES◎ with a routing table that tells the router exactly where to

send the packets.

◎ Figure 8.7 shows the routing table for a typical home router. This router has only two ports internally: one that connects to whichever service provider you use to bring the Internet into your home (cable/

◎ DSL/fiber or whatever)—labeled as Interface WAN in the table—and another one that connects to a built-in four-port switch—labeled LAN in the table. Figure 8.8 is a diagram for the router.

◎ The routing table is the key to the process of forwarding packets to their proper destination.

Page 8: Data communication part 8
Page 9: Data communication part 8
Page 10: Data communication part 8
Page 11: Data communication part 8

◎ Each row in the routing table defines a single route. Each column identifies specific criteria. Reading Figure 8.7 from left to right shows the following:

◎ ■ Destination LAN IP A defined network ID. Every network ID directly connected to one of the router’s ports is always listed here.

◎ ■ Subnet Mask To define a network ID, you need a subnetmask (described in Chapter 7).

Page 12: Data communication part 8

◎ router uses the combination of the destination LAN IP and subnet mask to see if a packet matches that route.

◎ For example, if you had a packet with the destination 10.12.14.26 coming into the router, the router would check the network ID and subnet mask.

◎ It would quickly determine that the packet matches the first route shown in Figure 8.7.

◎ The other two columns in the routing table then tell the router what to do with the packet

Page 13: Data communication part 8

GATEWAY ◎ The IP address for the next hop router; in other words,

where the packet should go. If the outgoing packet is for a network ID that’s not directly connected to the router, the Gateway column tells the router the IP address of a router to which to send this packet.

◎ That router then handles the packet and your router is done (you count on well-configured routers to make sure your packet will get to where it needs to go!). If the network ID is directly connected, then you don’t need a gateway.

◎ So this is set to 0.0.0.0 or to the IP address of the directly connected port.

◎ ■ Interface Tells the router which of its ports to use. On this router it uses the terms “LAN” and “WAN.” Other routing tables will use the port’s IP address or some other type of abbreviation.

Page 14: Data communication part 8

◎ The router compares the destination IP address on a packet to every listing in the routing table and then sends the packet out. There is no top- down or bottom-up to this comparison process; every line is read and then the router decides what to do. The most important trick to reading a routing table is to remember that a zero (0) means “anything.” For example, in Figure 8.7 the first route’s destination LAN IP is 10.12.14.0.

◎ You can compare that to the subnet mask (255.255.255.0) to confirm that this is a /24 network.

Page 15: Data communication part 8
Page 16: Data communication part 8

◎ This tells you that any value (between 1 and 254) is acceptable for the last value in the 10.12.14/24 network ID.

◎ Routing tables tell you a lot about how the network connects. From just this sin-gle routing table, for example, the diagram in Figure 8.9 can be drawn.

◎ So how do I know the 76.30.4.1 port connects to an-other network? The third line of the routing table shows the default route for this router, and every router has one. (There’s one excep-tion to this.

◎ See the Tech Tip “Top o’ the Internet.”) This line says (Any destination address) (with anysubnet mask) (forward it to 76.30.4.1) (using my WAN port)

Page 17: Data communication part 8

◎ The default route is very important because this tells the router exactly what to do with every incoming packet unless another line in the routing table gives another route. Excellent!

◎ Interpret the other two lines of the routing table in Figure 8.7 in the same fashion: (Any packet for the 10.12.14.0) (/24 network ID) (don’t use a gateway) (just ARP on the LAN interface to get the MAC address and send it directly to the recipient).

Page 18: Data communication part 8

◎ (Any packet for the 76.30.4.0) (/23 network ID) (don’t use a gateway) (just ARP on the WAN interface to get the MAC address and send it directly to the recipient).

◎ Destination LAN IP Subnet Mask Gateway Interface

◎ 76.30.4.0 255.255.254.0 0.0.0.0 WAN

Page 19: Data communication part 8

◎ Routers aren’t the only devices that use routing tables. In fact, every node (computer, printer, TCP/IP-capable soda dispenser, whatever) on the network also has a routing table.

◎ At first this may seem silly doesn’t every ⎯computer only have a single Ethernet connection and therefore all data traffic has to go out that port?

◎ First of all, many computers have more than one NIC

Page 20: Data communication part 8
Page 21: Data communication part 8

◎ A metric is just a relative value that defines the “cost” of using this route.

◎ The power of TCP/IP is that a packet can take more than one route to get to the same place. Figure 8.10 shows a networked router with two routes to the same place. The router has a route to network X with a metric of 1 using router X, and a second route to network X using router Y with a metric of 10.

Page 22: Data communication part 8
Page 23: Data communication part 8
Page 24: Data communication part 8

◎ Connections go up and down all the time and routers (with multiple routes) constantly talk to each other, detecting when a connection goes down and automatically switching to alternate routes.