Legal Information |
|
The OSI model is just a theoretical model, but it is a great way to visualize how all of these protocols, addresses and network devices (like routers) fit together. Layers 2 and 3 of the OSI model are what apply here.
Layer 2, the Data Link layer, is where the Ethernet protocol, MAC addresses and switches fit in. Layer 3, the Network layer, is where the IP protocol, IP addresses and routers fit in. Remember that all traffic is sent from your computer starting with Layer 7 (your network application) and going down to Layer 1 (physical). With the physical layer, the traffic is going across your network medium (such as your network cable or your wireless airwaves).
Traffic goes to a router only if it is not on your local LAN. Routers work primarily at Layer 3 but must understand Layers 1-3, at a minimum. Many routers understand traffic all the way up to Layers 4-7 in varying ways, but we like to think of them as working only at Layer 3 (network) because that is their primary function.
How routers use Ethernet MAC addresses and IP addressesLayer 2 is the Ethernet protocol and Ethernet addressing -- the MAC address (a.k.a. physical address or Ethernet address). In Layer 3 is your IP protocol and IP addressing. Today, almost all networking is done using Ethernet and IP. Thus, in general, every packet on the network has an Ethernet MAC address source and destination -- and an IP address source and destination. Keep this in mind.
What a router does with your network trafficRouters understand these Ethernet and IP addresses. Routers are primarily interested in the destination IP address of the packet you are sending to the router. The router takes this destination (say it is 63.248.129.2) and looks that up in its routing table. Here is an example of a routing table:
Location-A# show ip routeRoutes in the routing table are learned from either static routes (entered by you) or dynamic routes. Using the routing table, the router tries to find the best route for your traffic. There may be only one route. Often, this is a "default route" (a.k.a. "gateway of last resort"). The default route just says: "If there are no better routes to send this traffic, send it here."
10.0.0.0/24 is subnetted, 2 subnets
R 10.2.2.0 [120/1] via 63.248.129.2, 00:00:16, Serial0C 10.1.1.0 is directly connected, Ethernet0
63.0.0.0/30 is subnetted, 1 subnets
C 63.248.129.0 is directly connected, Serial0
Location-A#
Just about every home and small business user has just a single Internet connection. In that case, they have a default route and all traffic is sent to their Internet service provider (ISP). In the case of ISPs, however, there may be many places they can send this traffic. Their routers must compare many hundreds of thousands of routes and select the best one for your traffic. This happens in milliseconds. And to get your traffic through the Internet and back, it may pass through hundreds of routers.
To the user it appears almost instantaneously (depending on many factors).
If it doesn't find a valid route for your traffic, the router discards your traffic and sends an ICMP "destination unreachable" message back to you. When the router does find the best route and is ready to send your traffic, it has to do a number of things:
Search Knowledge Base | Feedback |