Friday, December 8, 2006

How Intranet Routers Work

Just as routers direct traffic on the Internet, sending information to its proper destination, and routers on an intranet perform the same function. Routers-equipment that is a combination of hardware and software-can send the data to a computer on the same sub network inside the intranet, to another network on the intranet, or outside to the Internet. They do this by examining header information in IP packets, and then sending the data on its way. Typically, a router will send the packet to the next router closest to the final destination, which in turn sends it to an even closer router, and so on, until the data reaches its intended recipient.

1. A router has input ports for receiving IP packets, and output ports for sending those packets toward their destination. When a packet comes to the input port, the router examines the packet header, and checks the destination in it against a routing table-a database that tells the router how to send packets to various destinations.

2. Based on the information in the routing table, the packet is sent to a particular output port, which sends the packet to the next closest router to the packets destination.

3. If packets come to the input port more quickly than the router can process them, they are sent to a holding area called an input queue. The router then processes packets from the queue in the order they were received. If the number of packets received exceeds the capacity of the queue called the length of the queue, packets may be lost. When this happens, the TCP protocol on the sending and receiving computers will have the packets re-sent.

4. In a simple intranet that is a single, completely self-contained network, and in which there are no connections to any other network or the intranet, only minimal routing need be done, and so the routing table in the router is exceedingly simple with very few entries, and is constructed automatically by a program called ifconfig.

5. In a slightly more complicated intranet which is composed of a number of TCP/IP-based networks, and connects to a limited number of TCP/IP-based networks, static routing will be required. In static routing, the routing table has specific ways of routing data to other networks. Only those pathways can be used. Intranet administrators can add routes to the routing table. Static routing is more flexible than minimal routing, but it cant change routes as network traffic changes, and so isnt suitable for many intranets.

6. In more complex intranets, dynamic routing will be required. Dynamic routing is used to permit multiple routes for a packet to reach its final destination. Dynamic routing also allows routers to change the way they route information based on the amount of network traffic on some paths and routers. In dynamic routing, the routing table is called a dynamic routing table and changes as network conditions change. The tables are built dynamically by routing protocols, and so constantly change according to network traffic and conditions.

7. There are two broad types of routing protocols: interior and exterior. Interior routing protocols are typically used on internal routers inside an intranet that routes traffic bound only for inside the intranet. A common interior routing protocol is the Routing Information Protocol RIP. Exterior protocols are typically used for external routers on the Internet. AÊcommon exterior protocol is the Exterior Gateway Protocol EGP.

Intranets come in different sizes. In a small company, an intranet can be composed of only a handful of computers. In a medium-sized business, it may include dozens or hundreds of computers. And in a large corporation, there may be thousands of computers spread across the globe, all connected to a single intranet. When intranets get large, they need to be subdivided into individual subnets or subnetworks.

To understand how subnetting works, you first need to understand IP addresses. Every IP address is a 32-bit numeric address that uniquely identifies a network and then a specific host on that network. The IP address is divided into two sections: the network section, called the netid, and the host section, called the hostid.

Each 32-bit IP address is handled differently, according to what class of network the address refers to. There are three main classes of network addresses: Class A, Class B, and Class C. In some classes, more of the 32-bit address space is devoted to the netid, while in others, more of the address space is devoted to the hostid. In a Class A network, the netid is composed of 8 bits, while the hostid is composed of 24 bits. In a Class B network, both the netid and the hostid are composed of 16 bits. In a Class C network, the netid is composed of 24 bits, while the hostid is composed of 8 bits. Theres a simple way of knowing what class a network is in. If the first number of the IP address is less than 128, the network is a Class A address. If the first number is from 128 to 191, its a Class B network. If the first number is from 192 to 223, its a Class C network. Numbers above 223 are reserved for other purposes. The smaller the netid, the fewer number of networks that can b!

e subnetted, but the larger number of hosts on the network. A Class A rating is best for large networks while a Class C is best for small ones.

To create a subnet, the demarcation line on the IP address is moved between the netid and the hostid, to give the netid more bits to work with and to take away bits from the hostid. To do this, a special number called a subnet mask is used.

Subnetting is used when intranets grow over a certain size and they begin to have problems. One problem is management of host IP addresses-making sure that every computer on the network has a proper, up-to-date host address, and that old host addresses are put out of use until needed in the future. In a corporation spread out over several locations-or across the world-its difficult, if not impossible, to have one person responsible for managing the host addresses at every location and department in the company.

Another problem has to do with a variety of hardware limitations of networks. Dissimilar networks may all be part of an intranet. An intranet may have some sections that are Ethernet, other sections that are Token Ring networks, and conceivably other sections that use different networking technologies altogether. There is no easy way for an intranet router to link these dissimilar networks together and route the information to the proper places.

Another set of problems has to do with the physical limitations of network technology. In some kinds of networks, there are some strict limitations on how far cables can extend in the network. In other words, you cant go over a certain distance of cabling without using repeaters or routers. A "thick" Ethernet cable, for example, can only be extended to 500 meters, while a "thin" Ethernet cable can only go to 300 meters. Routers can be used to link these cables together, so that an intranet can be extended well beyond those distances. But when that is done, each length of wire is essentially considered its own subnetwork.

Yet one more set of problems has to do with the volume of traffic that travels across an intranet. Often in a corporation, in a given department, most of the traffic is intradepartmental traffic-in other words, mail and other data that people within a department send to each another. The volume of traffic outside to other departments is considerably less. Whats called for is a way to confine intradepartmental traffic inside the departments, to cut down on the amount of data that needs to be routed and managed across the entire intranet.

Subnetting solves all these problems and more. When an intranet is divided into subnets, one central administrator doesnt have to manage every aspect of the entire intranet. Instead, each subnet can take care of its own administration. That means smaller organizations within the larger organization can take care of problems such as address management and a variety of troubleshooting chores. If an intranet is subnetted by divisions or departments, it means that each division or department can guide the development of its own network, while adhering to general intranet architecture. Doing this allows departments or divisions more freedom to use technology to pursue their business goals.

Subnets also get around problems that arise when an intranet has within it different kinds of network architecture, such as Ethernet and Token Ring technologies. Normally-if there is no subnetting-a router cant link these different networks together because they dont have their own addresses. However, if each of the different networks is its own subnet-and so has its own network address-routers can then link them together and properly route intranet traffic.

Subnetting can also cut down on the traffic traveling across the intranet and its routers. Since much network traffic may be confined within departments, having each department be its own subnet means that all that traffic need never cross an intranet router and cross the intranet-it will stay within its own subnet.

Subnetting can also increase the security on an intranet. If the payroll department, for example, were on its own subnet, then much of its traffic would not have to travel across an intranet. Having its data traveling across the intranet could mean that someone could conceivably hack into the data to read it. Confining the data to its own subnet makes that much less likely to happen.

Dividing an intranet into subnets can also make the entire intranet more stable. If an intranet is divided in this way, then if one subnet goes down or is often unstable, it wont affect the rest of the intranet.

This all may sound rather confusing. To see how its done, lets take a look at a network, and see how to use the IP address to create subnets. Lets say we have a Class B network. That network is assigned the address of 130.97.0.0. When a network is given an address, it is assigned the netid numbers-in this case, the 130.97-and it can assign the host numbers in this case, 0.0 in any way that it chooses.

The 130.97.0.0 network is a single intranet. Its getting too large to manage, though, and weve decided to divide it into two subnets. What we do is fairly straightforward. We take a number from the hostid field and use it to identify each of the subnets. So one subnet gets the address 130.97.1.0, and the other gets the address 130.97.2.0. Individual machines on the first subnet get addresses of 130.97.1.1, 130.97.1.2, and so on. Individual machines on the second subnet get addresses of 130.97.2.1, 130.97.2.2 and so on.

Sounds simple. But we have a problem. The Internet doesnt recognize 130.97.1.0 and 130.97.2.0 as separate networks. It treats them both as 130.97.0.0 since the "1" and "2" that were using as a netid is only known to the Internet as a hostid. So our intranet router will not be able to route incoming traffic to the proper network.

To solve the problem, a subnet mask is used. A subnet mask is a 32-bit number in IP form used by intranet routers and hosts that will help routers understand how to route information to the proper subnet. To the outside Internet, there is still only one network, but the subnet mask allows routers inside the intranet to send traffic to the proper host.

A subnet mask is a number such as 255.255.255.0 the built-in default for Class C addresses; the Class B default is 255.255.0.0 and the default for Class A is 255.0.0.0. A router takes the subnet mask and applies that number against the IP number of incoming mail to the network by using it to perform a calculation. Based on the resulting IP number, it will route mail to the proper subnet, and then to a particular computer on the subnet. For consistency, everyone in a particular intranet will use the same subnet mask.