Wednesday, July 23, 2008

Routers

Introduction

Welcome to the Routers section. Here we will analyse routers quite some depth; what they do and how they work. I point out to you that you should have some knowlege on the OSI model and understand how data is sent across the network medium. If you find the information a bit too confusing or don't quite understand it, I would suggest you go back to the networking section and do some reading on the OSI model and Protocols.

What are they and what do they do ?

Routers are very common today in every network area, this is mainly because every network these days connect to some other network, whether it's the Internet or some other remote site. Routers get their name from what they do.... which is route data from one network to another.

For example, if you had a company which had an office in Sydney and another one in Melbourne, then to connect the two you would use a leased line to which you would connect a router at each end. Any traffic which needs to travel from one site to another will be routed via the routers, while all the other unecessary traffic is filtered (blocked), thus saving you valuable bandwidth and money.

There are two type of routers: 1) Hardware routers 2) Software routers.

So what's the difference ?

When people talk about routers, they usually don't use the terms "hardware" or "software" router but we are, for the purpose of distinguishing between the two.

Hardware routers are small boxes which run special software created by their vendors to give them the routing capability and the only thing they do is simply route data from one network to another. Most companies prefer hardware routers because they are faster and more reliable, even though their cost is considerably more when compared with a software router.

So what does a hardware router look like? Check the picture below, it displays a Cisco 1600 and 2500 series router along with a Netgear RT338 router. They look like a small box and run special software as we said.

CISCO 1600 Series Router CISCO 2500 Series Router



Netgear RT338 router




Software routers do the same job with the above hardware routers (route data), but they don't come in small flashy boxes. A software router could be an NT server, NetWare server or Linux server. All network servers have built-in routing capabilities.

Most people use them for Internet gateways and firewalls but there is one big difference between the hardware and software routers. You cannot (in most cases) simply replace the hardware router with a software router.Why? Simply because the hardware router has the necessary hardware built-in to allow it to connect to the special WAN link (frame relay, ISDN, ATM etc), where your software router (e.g a NT server) would have a few network cards one of which connects to the LAN and the other goes to the WAN via the hardware router.

I have seen a few cards in the market which allow you to connect an ISDN line directly into them. With these special cards, which retail from $5000 to $15000 depending on their capacity, you don't need the hardware router. But as you can understand, it's a much cheaper solution to buy a hardware router. Plus, the hardware routers are far more advanced and faster than the software routers since they don't have to worry about anything else but routing data, and the special electronic components they have in them are developed with this in mind.

The Flash image below shows us what a router does when it receives packets from the LAN or the Internet. Depending on the source and destination, it will pass them to the other network or send them to the Internet. The router is splitting the below network into 2. Each network has a hub to which all computers on that network connect to. Futher more, the router has one interface connected to each network and one connected to the Internet, this allows it to pass the packets to the right destination:

The picture below illustrates a router's place in the Local Area Network (LAN):

In the example shown, the workstations see the router as their " gateway". This means that any machine on this LAN that wants to send a packet (data) to the Internet or anywhere outside its Local Area Network (LAN) will send the packet via the gateway. The router (gateway) will know where it needs to send it from there on so it can arrive at its destination.

This explains the reason you need to add an Internet Protocol (IP) number for a gateway, when you have a LAN at home or in the office, in your TCP/IP network properties on your windows workstation.

The above figure shows only one example of how routers connect so the LAN gets Internet access. Let's have a look how 2 offices would use routers to connect them.

The routers in the above picture connect using a particular WAN protocol, e.g ISDN.

In reality, there would be a cable (provided by your service provider) which connects to the "WAN" interface of the router and from there the signal goes straight to your service provider's network and eventually ends up at the other router's WAN interface.

Depending on the type of router you get, it will support one of the most commonly used WAN protocols: ISDN, Frame Relay, ATM, HDLC, PPP. These protocols are discused in the protocols section.

It's important to note down and remember a few of the main features of a router:

  • Routers are Layer 3 devices
  • Routers will not propagate broadcasts, unless they are programmed to
  • Most serious routers have their own operating system
  • Routers use special protocols between them to exchange information about each other (not data)

Basics Of Cisco Routers

Introduction

Cisco is well known for its routers and switches. I must admit they are very good quality products and once they are up and running, you can pretty much forget about them because they rarely fail.

We are going to focus on routers here since that's the reason you clicked on this page !

Cisco has a number of different routers, amongst them are the popular 1600 series, 2500 series and 2600 series. The ranges start from the 600 series and go up to the 12000 series (now we are talking about a lot of money).

We are going to begin with the basic components which make up a Cisco router (and switches) and I will be explaining what they are used for, so grab that tea or coffee and let's get going !

The basic components of any Cisco router are :

1) Interfaces

2) The Processor (CPU)

3) Internetwork Operating System (IOS)

4) RXBoot Image

5) RAM

6) NVRAM

7) ROM

8) Flash memory

9) Configuration Register

Now I just hope you haven't looked at the list and thought "Stuff this, it looks hard and complicated" because I assure you, it's less painful than you might think ! In fact, once you read it a couple of times, you will find all of it easy to remember and understand.

Interfaces

These allow us to use the router ! The interfaces are the various serial ports or ethernet ports which we use to connect the router to our LAN. There are a number of different interfaces but we are going to hit the basic stuff only.

Here are some of the names Cisco has given some of the interfaces: E0 (first Ethernet interface), E1 (second Ethernet interface). S0 (first Serial interface), S1 (second Serial interface), BRI 0 (first B channel for Basic ISDN) and BRI 1 (second B channel for Basic ISDN).

In the picture below you can see the back view of a Cisco router, you can clearly see the various interfaces it has:(we are only looking at ISDN routers)

You can see that it even has phone sockets ! Yes, that's normal since you have to connect a digital phone to an ISDN line and since this is an ISDN router, it has this option with the router. I should, however, explain that you don't normally get routers with ISDN S/T and ISDN U interfaces together. Any ISDN line requires a Network Terminator (NT) installed at the customer's premises and you connect your equipment after this terminator. An ISDN S/T interface doesn't have the NT device built in, so you need an NT device in order to use the router. On the other hand, an ISDN U interface has the NT device built in to the router.

Check the picture below to see how to connect the router using the different ISDN interfaces:

...........

Apart from the ISDN interfaces, we also have an Ethernet interface that connects to a device in your LAN, usually a hub or a computer. If connecting to a Hub uplink port, then you set the small switch to "Hub", but if connecting to a PC, you need to set it to "Node". This switch will simply convert the cable from a straight through (hub) to a x-over (Node):

..............

The Config or Console port is a Female DB9 connector which you connect, using a special cable, to your computers serial port and it allows you to directly configure the router.

The Processor (CPU)

All Cisco routers have a main processor that takes care of the main functions of the router. The CPU generates interrupts (IRQ) in order to communicate with the other electronic components in the router. The Cisco routers utilise Motorola RISC processors. Usually the CPU utilisation on a normal router wouldn't exceed 20 %.

The IOS

The IOS is the main operating system on which the router runs. The IOS is loaded upon the router's bootup. It usually is around 2 to 5MB in size, but can be a lot larger depending on the router series. The IOS is currently on version 12, and Cisco periodically releases minor versions every couple of months e.g 12.1 , 12.3 etc. to fix small bugs and also add extra functionality.

The IOS gives the router its various capabilities and can also be updated or downloaded from the router for backup purposes. On the 1600 series and above, you get the IOS on a PCMCIA Flash card. This Flash card then plugs into a slot located at the back of the router and the router loads the IOS "image" (as they call it). Usually this image of the operating system is compressed so the router must decompress the image in its memory in order to use it.

The IOS is one of the most critical parts of the router, without it the router is pretty much useless. Just keep in mind that it is not necessary to have a flash card (as described above with the 1600 series router) in order to load the IOS. You can actually configure most Cisco routers to load the image off a network tftp server or from another router which might hold multiple IOS images for different routers, in which case it will have a large capacity Flash card to store these images.

The RXBoot Image

The RXBoot image (also known as Bootloader) is nothing more than a "cut-down" version of the IOS located in the router's ROM (Read Only Memory). If you had no Flash card to load the IOS from, you can configure the router to load the RXBoot image, which would give you the ability to perform minor maintenance operations and bring various interfaces up or down.

The RAM

The RAM, or Random Access Memory, is where the router loads the IOS and the configuration file. It works exactly the same way as your computer's memory, where the operating system loads along with all the various programs. The amount of RAM your router needs is subject to the size of the IOS image and configuration file you have. To give you an indication of the amounts of RAM we are talking about, in most cases, smaller routers (up to the 1600 series) are happy with 12 to 16 MB while the bigger routers with larger IOS images would need around 32 to 64 MB of memory. Routing tables are also stored in the system's RAM so if you have large and complex routing tables, you will obviously need more RAM !

When I tried to upgrade the RAM on a Cisco 1600 router, I unscrewed the case and opened it and was amazed to find a 72 pin SIMM slot where you needed to attach the extra RAM. For those who don't know what a 72 pin SIMM is, it's basically the type of RAM the older Pentium socket 7 CPUs took, back in '95. This type of memory was replaced by today's standard 168 pin DIMMs or SDRAM.

The NVRAM (Non-Volatile RAM)

The NVRAM is a special memory place where the router holds its configuration. When you configure a router and then save the configuration, it is stored in the NVRAM. This memory is not big at all when compared with the system's RAM. On a Cisco 1600 series, it is only 8 KB while on bigger routers, like the 2600 series, it is 32 KB. Normally, when a router starts up, after it loads the IOS image it will look into the NVRAM and load the configuration file in order to configure the router. The NVRAM is not erased when the router is reloaded or even switched off.

ROM (Read Only Memory)

The ROM is used to start and maintain the router. It contains some code, like the Bootstrap and POST, which helps the router do some basic tests and bootup when it's powered on or reloaded. You cannot alter any of the code in this memory as it has been set from the factory and is Read Only.

Flash Memory

The Flash memory is that card I spoke about in the IOS section. All it is, is an EEPROM (Electrical Eraseable Programmable Read Only Memory) card. It fits into a special slot normally located at the back of the router and contains nothing more than the IOS image(s). You can write to it or delete its contents from the router's console. Usually it comes in sizes of 4MB for the smaller routers (1600 series) and goes up from there depending on the router model.

Configuration Register

Keeping things simple, the Configuration Register determines if the router is going to boot the IOS image from its Flash, tftp server or just load the RXBoot image. This register is a 16 Bit register, in other words has 16 zeros or ones. A sample of it in Hex would be the following: 0x2102 and in binary is : 0010 0001 0000 0010.

No comments: