The purpose of the network layer is to route packets from source host to destination host. In a point-to-point network such as the Internet, there are two models; virtual circuits, in which the complete path is laid out prior to any data being transmitted, or best effort packet switching. The Internet Protocol (IP) uses the latter. Most other protocols, such as ATM or frame relay, use virtual circuits. Virtual Circuits can provide higher reliability and more stable delivery times (all packets take the same route), at the cost of bandwidth efficiency.
An IP router has four components
Large routers may have to process a million or more packets a second, so the routing table search cannot be linear. The Cisco 8500 router has 64K of content addressable memory for each input port so it can perform the lookup in constant time.
Here is a link to a description of the fields of the IP header
traceroute There is a utility called traceroute
which can be used to determine a route that packets take to get from
your computer to any destination on the Internet.
Here is the route
that packets take to get from the computer in my office to
Chamlers, a technical university in Sweden.
Here is a link to a web site which explains classful and classless routing
Subnetting A large organization like Rensselaer would divide its network into subnets. To the outside world, Rensselaer has just one IP address, the network address 128.113.xxx.xxx. However, it could have as many as 64K hosts, which is far too big for a single router. The least significant 16 bits, which represent the individual hosts within Rensselaer, can be divided into two parts, the network part and the host part. Suppose the first 6 bits are the network part. Rensselaer can now have 64 separate subnets, each with up to 1K of hosts. Each subnet has its own router. This means that the master router only needs to have at most 64 entries in its routing table, one for each of the up to 64 subnets. Each department (subnet) has its own router, which can have up to 1K entries.
Here is a web site which discusses subnetting along with classful and classless routing
DHCP Subnetting is hard to implement if students are walking around with laptops and plugging them into various subnets all over campus. Rensselaer and most other organizations solve this problem by dynamically assigning IP addresses using the Dynamic Host Configuration Protocol (DHCP). Here is a somewhat sketchy description of DHCP
One solution to the problem that we are running out of IP addresses is NAT (Network Address Translation), in which a single IP address is assigned to an organization (or home) and a NAT Box translates IP addresses and ports. Here is a web site on Network Address Translation