This site is on my web server. It is located on its own network. In order to access my web server, you did not connect a cable into your computer, get in your car, and drive hundreds of miles while running cable to my house in order to connect your cable into my web server. Instead, you buy Internet service from your ISP, and connect your computer (or router) to their service. Data gets sent to the ‘Internet cloud,’ which is then ‘routed’ to my server. In order to access my website, you have entered ‘http://www.richardallenhughes.com’ in the address bar of your web browser. However, my web address does not tell where in the world my web server is located. The files to my website need to be on a server somewhere. Is this server in New York? Maybe it is in Florida or Hawaii. If it is in Florida, what cable or cables does the files for my website need to travel in order to reach your computer? What route does it need to take? All of this magic takes place on layer 3 of the OSI model, the network layer.
The purpose of the Network Layer is to route data packets from the source computer to the destination computer. Packet is the layer 3 PDU (Protocol Data Unit.) There are lots of protocols that are on layer 3 in order for this to happen. However, most can be divided into two categories: routed protocols and routing protocols. A routed protocol is a protocol that has an address which is logical, so that it can be routed to the destination. They work the same way your phone number to your LAN line works. Area codes for phone numbers are geographically grouped together. The first three numbers are usually geographically grouped together as well. A routing protocol is used to route the routed protocol to its destination. Routing protocol information is shared among routers so that routers know which way (which port) to forward data to the destination. A router is a layer 3 device that routes data packets to the destination. Using routing protocols, routers create routing tables. Routing tables contains information of the network so routers know which port to send data.
A great analogy would be to compare the network layer to a family vacation. You and your family are planning a driving route to get to the fun park of your dreams. You and your family is like the packets being sent over the network. You have the address of the park. The address of the park is like a routed protocol. The map you use to plan your route is like a routing table. If you are driving from Orlando, Florida to San Fransisco, California, a map will tell you which roads to take in order to get to your destination. There are different kinds of maps you can choose. Your map can be an atlas, it can be from Google Earth, or it might be a bunch of maps, each map being a state you will drive through. The map type is like a routing protocol. The road intersections are like routers. A router connects different lines together, kind of like a hub or a switch. However, in computer networks, the router decides what route packets take. In your family vacation, you decide which way to take.
There are different routed protocols out there. However, there is one that is definitely the most dominant. You probably know it. It is called IP (Internet Protocol). It is usually written in conjunction with a layer 4 protocol as ‘TCP/IP.’ However, layer 4 and TCP will be discussed in a later post. IP is known for its address. There are two versions of IP used: version 4 and version 6. IP version 4 (IPv4) consists of a 4 number dotted decimal digits, with each digit being 8 bits in length. Since there is a fear of running out of IP version 4 addresses, IP version 6 was created. IP version 6 (IPv6) is 8 groups of 4 hexadecimal numbers. While IPv4 is 32 bits, IPv6 is 128 bits. IPv6 is superior to IPv4 due to addressing space, performance and security. However, most companies are dragging their feet to implement it, mostly because they have to reconfigure their network, change equipment and work with hexadecimal numbers.
AppleTalk and IPX/SPX are other protocols that can be routed. AppleTalk is Apple’s legacy design for connecting computers, servers and peripherals together on a network. AppleTalk uses DDP (Datagram Delivery Protocol) as its routed protocol. IPX/SPX (Internetwork Packet Exchange/Sequence Packet Exchange) is a legacy protocol for Novell Netware. IPX is the routed protocol, and consists of a 12 byte (96 bit) hexadecimal number. However, TCP/IP is the dominant protocol used, which is also a requirement to connect to the Internet.
In order to effectively use a routed protocol, the routing protocol needs to support it (just about any of them supports IPv4 and most support IPv6 as well.) Routing protocols can be divided into two categories: IGP and EGP. IGP (Interior Gateway Protocol) are routing protocols that are used inside a local area network while EGP (Exterior Gateway Protocol) are routing protocols used by an outside network (like your ISP.) Metrics are used by routing protocols to determine which is the best route to take in order to get to the destination. There are two major types that routing protocols use: distant vector and link-state. Distant vector uses distance and direction in order to determine the best route. For distance, hops are used. A hop is a device (such as a router) a packet has to go through in order to get to its destination. If the packet’s destination is three hops, it must travel through three devices in order to be received by the destination. Usually, when a routing protocol is used, routers exchange table information at regular intervals. This means that if a router is added or goes down on a network, it may take a while for that information to be passed to the other routers. RIP (Routing Information Protocol) and Cisco’s IGRP (Interior Gateway Routing Protocol) are distant vector protocols.
Link-state is more sophisticated than distant vector. Link-state uses many metrics such as load, bandwidth, delay and reliability in order to determine the best route to the destination. If link-state is used, usually routers exchange information when an event triggers it (such as a down router or one added.) This means that when a change is made, every router knows about the change almost instantaneously. This also means that a lot of bandwidth is used during the change. OSPF (Open Shortest Path First), IS-IS (Intermediate System to Intermediate System), and Cisco’s EIGRP (Enhanced IGRP) are all link-state protocols. Since most of us do not need to setup routing protocols at home, I will not go over each of their differences.
When a router goes down and the routers are configured in a mesh, something interesting may happen. Consider this, router 5 fails and is no longer part of the network. So, router 1 receives a data packet. It passes it to router 2. Router 2 then passes router 3. Router 3 knows that the data cannot go through router 4 because router 5 is down. However, there is another path that the data can go in order to get to the destination: routers 1, 6, 7, 8, 9 and 10. So, the data is passed back to router 1. Router 1 does not know router 5 failed, and the shortest path is through routers 2, 3, 4 and 5. So, the packet gets passed around in a circle. This is called a routing loop. In order to prevent this from going on indefinitely, the packet header has a field called a TTL (Time to Live). This consists of a number. This number gets subtracted every time it passes in a hop. As soon as this number reaches zero, the packet is dropped and does not reach its destination.
Not every layer 3 protocol is a routed or a routing protocol. In legacy computer networks, connecting to the Internet may not have been the scope of the network. They were set up to share files and resources locally only. So, a layer 3 protocol might have been used in order to provide connectivity, but the protocol might not have been routable. Great examples are Microsoft’s legacy NetBIOS, and NetBEUI (NetBIOS Extended User Interface).
Couple useful utilities
Ping
Ping is used to test network connectivity. In Windows, go to start->run, type ‘cmd’ and click on ‘OK.’ In the command window, type ‘ping www.google.com.’ If you are connected to the Internet, you should see four replies along with Google’s IP address and the around trip time it took for your ping to send and receive the packet. If you have connection problems, you will see ‘request timed out.’
Trace route
So, you want to know how many ‘hops’ and what your data has to go through in order to get to Google? Type ‘tracert www.google.com’. What your computer does is it sends a ping starting with the TTL being a 1. Then it sends another one with the TTL being a 2. It keeps on auto-incrementing until it reaches the destination: www.google.com.
I still did not explain how your computer gets routed to my web server when you type ‘http://www.richardallenhughes.com’ in your address bar. That will be explained in another post.
Resources
http://www.dummies.com/how-to/content/looking-into-routed-versus-routing-protocols-for-t.html
http://compnetworking.about.com/od/tcpiptutorials/a/ipaddrnotation.htm
http://www.mactech.com/articles/mactech/Vol.03/03.04/AppleTalkFundamentals/
http://www.linktionary.com/i/ipx.html
http://www.networkdictionary.com/protocols/routing.php
http://www.answers.com/topic/netbeui
Join the forum discussion on this post
