In this article, I will explain how a router (Layer 3 switching) is used in an internetwork, and I will discuss the details of the Network layer.
Routers have been around commercially since the late 1980s. They were not really prevalent until the early 1990s and have increased their position in the internetwork directly because of the Internet. It is important to understand that routers, in some fashion, will never go away.
What is a router?
Routers are hardware devices that use software to perform routing of packets in an internetwork. Routing is the term used to define the process of taking a packet of data from a device on one network and sending it through the router to another device on a different network. If your network has no routers, then you are not routing. Routers are used within a network to route traffic to all the networks in your internetwork.
In Figure A, notice how both LANs and WANs are connected to a router. This is the main purpose of a router—to break up broadcast domains. By connecting multiple networks to a router, you create an internetwork. The E0, E1, etc., are 10Base-T Ethernet links, and the Fa interfaces are Fast Ethernet connections.
|Notice how both LANs and WANs are connected to a router.|
Once you connect networks to a router, you must provide logical addressing to each device so it can communicate on the internetwork. Which brings up a very important point: You must be able to uniquely identify every device on the internetwork, regardless of where these devices are located. This is called logical addressing.
Let’s define the difference between a logical address and a hardware address:
- A logical address uniquely identifies a device on an internetwork.
- A hardware (MAC) address uniquely identifies a device on a LAN.
Figure B shows how a device communicates on a LAN using the hardware address of the device and how the same device communicates to another device on the internetwork using a logical address.
|Devices communicate on a LAN using the hardware address of the device.|
In my article about the OSI reference model, I also explained how hardware addresses were used to find unique hosts on a LAN. However, if a device on a LAN wants to communicate to a device on another network, it must use its logical address. Typically, this would be Internet Protocol (IP), but it can just as easily be IPX from the Novell stack or Datagram Delivery Protocol (DDP) from the AppleTalk stack, for example.
The benefit of routers
Unlike switches (bridges), routers by default break up broadcast domains. This is a good thing, if the network is designed correctly. (I’ll further explain domains in the next section of this article.)
Routers provide security by filtering the network. By placing routers in optimal positions in your network, you can effectively allow and deny packets from being transmitted all over the internetwork. These filters are called access lists.
Routers also provide connection to WAN services. Although many switches allow a card to be placed in the switch to provide this service, this is a Layer 3 technology, and a router or Layer 3 device is needed to provide WAN connection services.
Routers break up broadcast domains
In a previous article, I also discussed collision domains and how switches break up collision domains by default. However, switches create one large broadcast domain.
A collision domain is defined as a network segment that shares bandwidth with every device connected to this particular segment. If one device transmits, all other devices on this segment must listen and not transmit. If a second device does transmit at the same time, a collision occurs. By using switches, we can create individual collision domains, but if one host sends any type of broadcast, all segments connected to the switch must listen. To break up broadcast domains in a Layer 2 switched internetwork, you have two options: routers or Virtual LANs (VLANs).
Routers plug in to a hub or switch port, and every device connected to that hub or switch is in the same physical broadcast domain. For any device to transmit data to another host on a different network (broadcast domain), the devices must be configured with logical network addresses. If not, only local communication can take place.
Designing broadcast domains is the key to success in any network design and implementation. Typically, a broadcast domain should be created by groups of users that share the same network resources. This is not always possible with routers because network broadcast domains are created by physical location. Take a look at Figure C. Notice that each floor has its own switch and that each switch is connected to the router on the first floor. This is a good design that has worked well for many years.
|The first floor holds the finance department, the second floor holds the sales department, and the third floor holds the marketing department.|
Also in Figure C, notice how each floor holds a different department. Everything works well since each floor is its own broadcast domain. However, problems can occur if you have to place users from one department into the wrong broadcast domain.
What if, for example, a salesperson was hired to work with the sales team, but the second floor has no room for the new salesperson? The accounting department, which sits on the first floor, has plenty of room, and this new salesperson now sits on the first floor. Where do you plug in the computer for this new salesperson? This salesperson’s computer is placed physically into the accounting department’s broadcast domain. For this salesperson to reach the network resources for the sales department, his or her information must go through the router. This can cause latency, which is the measurement of time that a packet takes to get from a transmitting device to a receiving device. This is not the biggest problem, however. When the sales server, which sits on the second floor, broadcasts application information designed to provide network services to the sales force, the salesperson on the first floor does not see the broadcast.
To solve this problem, you could make the accounting department’s broadcast domain part of the sales department’s broadcast domain by connecting the two networks together without the router, but that would defeat the purpose of creating broadcast domains for better network response time and security. Do you really want all those salespeople on the same network as the accountants? Another solution may be to run a cable to the second floor switch so that the new salesperson is plugged in to the right network. A third solution would be to add another switch on the first floor that plugs in to a fourth router interface, which would create a new broadcast domain. The salesperson would have to go through the router to send and receive any information via computer, but at least the computer would not be part of the accounting broadcast domain.
All of the solutions I provided above are terrible! You’re probably saying, “There has got to be a better way,” and there is. If you have a business requirement problem of creating broadcast domains by physical location, you can instead create Virtual LANs (VLANs) with Layer 2 switches. A VLAN is a broadcast domain created in a Layer 2 switched internetwork.
The beauty of VLANs is that you do not have to create broadcast domains by physical location like you do with routers. You can create VLANs by assigning any switch port, on any switch in your internetwork, to any VLAN.
Figure D shows how our network could look if we used VLANs instead of router interfaces to break up our broadcast domains.
|This is a look at how a network might look if we used VLANs to break up our broadcast domains.|
Notice that each floor has a salesperson, marketing person, and accounting person, and each person is in the appropriate broadcast domain. Although you can still create broadcasts by physical location with VLANs, the solution I showed you here is the most typical configuration. This is dependant solely on the business requirements, however.
Do you still need routers if you are using VLANs? Absolutely! For the broadcast domains to communicate, a Layer 3 device is needed. There are a few different ways to configure the router for inter-VLAN communication, and I will cover this in a future article. Just understand that you need a router, or Layer 3 card in a switch, for a device on each VLAN to communicate to another device in a different VLAN.
Routers are packet switches!
Routers are called routers because their main purpose in life is to route data from one network to another network. To be able to move data, however, a router must switch packets of information from the interface it was received on to the destination exit interface. This is called packet switching.
Obviously, this is different from frame (LAN) switching. Frame switching uses only the hardware destination address found in the frame header to find the exit port on the switch. A router uses the logical destination address found in the packet header to find the exit interface on the router.
Routers create maps of the internetwork
By running routing protocols, the router learns about remote networks from neighbor routers. The router then builds a routing table that describes how to find the remote networks. If the network is directly connected, the router already knows how to get to the network. If the networks are not attached, the router must learn how to get to the remote network with either static routing—which means that the administrator must manually type all network locations into the routing table—or the administrator can turn on dynamic routing.
Dynamic routing is used to allow routers to broadcast information about all the networks known by this transmitting router to neighboring routers. The receiving router (or routers), in turn will add these routes into its own routing table and then broadcast this information to its neighbors, which will add the routes to its routing table. Any changes that occur in the network are automatically propagated to all routers through a routing protocol like RIP, IGRP, or OSPF, for example. If a router is not running a routing protocol, but instead, static routing, the administrator has to make all changes to all routers by hand.
The routers can only send packets to remote networks by looking at the routing table and finding out how to get to the remote networks. What happens when a router receives a packet with a network that is not listed in the routing table? It discards it! It doesn’t send a broadcast looking for the remote network—the router just throws it out. Period.
Routers are an important part of the Internet and any medium- to large-size network. By understanding the configuration of the different protocols used with routers, you prepare yourself for a promising and prosperous career; however, studying and getting as much hands-on experience is a must before working on large, corporate-routed networks.
In a later Daily Drill Down, I will discuss IP addressing and routing—a critical part in routers and router configurations—in detail.
The authors and editors have taken care in preparation of the content contained herein but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.