You are on page 1of 7

OSI does define a unique Layer 3 protocol called Connectionless Network Services (CLNS), but, as usual with OSI

protocols, you rarely see it in networks today other network layer protocols, such as Internet Protocol (IP), Novell Internetwork Packet Exchange (IPX), or AppleTalk Datagram Delivery Protocol (DDP) IP does not require any overhead agreements or messages before sending a packet, making IP a connectionless protocol. IP tries to deliver each packet, but if a router or hosts IP process cannot deliver the packet, it is discardedwith no error recovery Rounting (forwarding)

Because PC2 is not on the same Ethernet as PC1, PC1 needs to send the packet to a router that is attached to the same Ethernet as PC1. The sender sends a data-link frame across the medium to the nearby router; this frame includes the packet in the data portion of the frame. That frame uses data link layer (Layer 2) addressing in the data-link header to ensure that the nearby router receives the frame. The routing table for any particular network layer protocol contains a list of network layer address groupings. Instead of a single entry in the routing table per individual destination network layer address, there is one routing table entry per group. The router compares the destination network layer address in the packet to the entries in the routing table and makes a match. This matching entry in the routing table tells this router where to forward the packet next.

When the network layer protocol is processing the packet, it decides to send the packet out the appropriate network interface. Before the actual bits can be placed onto that physical interface, the network layer must hand off the packet to the data link layer protocols, which, in turn, ask the physical layer to actually send the data. the data link layer adds the appropriate header and trailer to the packet, creating a frame, before sending the frames over each physical network. The routing process forwards the packet, and only the packet, end-to-end through the network, discarding data-link headers and trailers along the way. The network layer processes deliver the packet end-to-end, using successive data-link headers and trailers just to get the packet to the next router or host in the path. Each successive data link layer just gets the packet from one device to the next. how the routerdetermines which data-link address to use is the IP Address Resolution Protocol (ARP). ARP is used to dynamically learn the data-link address of an IP host connected to a LAN. Routing as covered so far has two main concepts: The process of routing forwards Layer 3 packets, also called Layer 3 protocol data units (L3 PDU), based on the destination Layer 3 address in the packet.

The routing process uses the data link layer to encapsulate the Layer 3 packets into Layer 2 frames for transmission across each successive data link.

Each computer that needs to communicate will have (at least) one network layer address so that other computers can send data packets to that address, expecting the network to deliver the data packet to the correct computer. something about the numeric value of an address implies a group or set of addresses, all of which are considered to be in the same grouping. With IP addresses, this group is called a network or a subnet. Routing relies on the fact that Layer 3 addresses are grouped. The routing tables for each network layer protocol can have one entry for the group, not one entry for each individual address In most cases, routers build their routing table entries dynamically using a routing protocol. Routing protocols learn about all the locations of the network layer groups in a network and advertise the groups locations. As a result, each router can build a good routing table dynamically. Routing protocols define message formats and procedures, just like any other protocol. The end goal of each routing protocol is to fill the routing table with all known destination groups and with the best route to reach each group.

A routing protocol learns routes and puts those routes in a routing table. A routed protocol defines the type of packet forwarded, or routed, through a network. In Figures 5-1 and 5-2, the figures represent how IP packets are routed, so IP would be the routed protocol. If the routers used Routing Information Protocol (RIP) to learn the routes, RIP would be the routing protocol. the following two rules summarize the facts about which IP addresses need to be in the same grouping: All IP addresses in the same group must not be separated by a router. IP addresses separated by a router must be in different groups. Classes of networks RFC 791 defines the IP protocol, including several different classes of networks. IP defines three different network classes for addresses used by individual hostsaddresses called unicast IP addresses. These three network classes are called A, B, and C. TCP/IP defines Class D (multicast) addresses and Class E (experimental) addresses as well. By definition, all addresses in the same Class A, B, or C network have the same numeric value network portion of the addresses. The rest of the address is called the host portion of the address.

number and the broadcast address are the valid, useful IP addresses that can be used to address interfaces in the network.

Each computer connected to the Internet needs a unique, nonduplicated IP address.

Administratively, a central authority assigned Class A, B, or C networks to companies, governments, school systems, and ISPs based on the size of their IP network (Class A for large networks, Class B for medium networks, and Class C for small networks). The central authority assigned each network number to only one organization, helping ensure unique address assignment worldwide. Each organization with an assigned Class A, B, or C network then assigned individual IP addresses inside its own network. Table 5-5 summarizes the possible network numbers that ICANN and other agencies could have assigned over time. Note the total number for each network class and the number of hosts in each Class A, B, and C network.

Even though the network numbers look like addresses because of their dotted-decimal format, network numbers cannot be assigned to an interface to be used as an IP address. Note that the first reserved value, the network number, has all binary 0s in the host part of the number (see Table 5-4). The other reserved value is the one with all binary 1s in the host part of the number. This number is called the network broadcast or directed broadcast address. This reserved number cannot be assigned to a host for use as an IP address. However, packets sent to a network broadcast address are forwarded to all devices in the network Also, because the network number is the lowest numeric value inside that network and the broadcast address is the highest numeric value, all the numbers between the network

When subnetting, a third part of an IP address appears between the network and host parts of the addressnamely, the subnet part of the address. This field is created by stealing or borrowing bits from the host part of the address. The size of the network part of the address never shrinks. In other words, Class A, B, and C rules still apply when defining the size of the network part of an address. The host part of the address shrinks to make room for the subnet part of the address. Figure 5-7 shows the format of addresses when subnetting, representing the number of bits in each of the three parts of an IP address.

Step 2 If the destination IP address is not in the same subnet as I am, send the packet to my

default gateway (a routers Ethernet interface on the subnet). A router uses the following logic when receiving a data-link framea frame that has an IP packet encapsulated in it:
Step 1 Use the data-link FCS field to ensure that the frame had no errors; if errors

occurred, discard the frame.


Step 2 Assuming the frame was not discarded at step 1, discard the old data-link header

and trailer, leaving the IP packet.


Step 3 Compare the IP packets destination IP address to the routing table, and find the

Note that the concepts shown in Figure 5-7, with three parts of an IP address (network, subnet, and host), are called classful addressing. The term classful addressing refers to how you can think about IP addressesspecifically, that they have three parts. In particular, classful addressing means that you view the address as having a network part that is determined based on the rules about Class A, B, and C addressinghence the word classful in the term. Because the routing process considers the network and subnet parts of the address together, you can take an alternative view of IP addresses called classless addressing. Instead of three parts, each address has two parts:

route that matches the destination address. This route identifies the outgoing interface of the router, and possibly the next-hop router.
Step 4 Encapsulate the IP packet inside a new data-link header and trailer,

To match a routing table entry, the router thinks like this: Network numbers and subnet numbers represent a group of addresses that begin with the same prefix. In which of the groups in my routing table does this packets destination address reside?
Step A PC1 sends the packet to its default gateway. PC1 first builds the IP packet, with

The part on which routing is based The host part

a destination address of PC2s IP address (150.150.4.10). PC1 needs to send the packet to R1 (PC1s default gateway) because the destination address is on a different subnet. PC1 places the IP packet into an Ethernet frame, with a destination Ethernet address of R1s Ethernet address. PC1 sends the frame onto the Ethernet.
Step B R1 processes the incoming frame and forwards the packet to R2.

This first partthe part on which routing is basedis the combination of the network and subnet parts from the classful addressing view. This first part is often simply called the subnet part, or sometimes the prefix.

Because the incoming Ethernet frame has a destination MAC of R1s Ethernet MAC, R1 copies the frame off the Ethernet for processing. R1 checks the frames FCS, and no errors have occurred (Step 1). R1 then discards the Ethernet header and trailer (Step 2). Next, R1 compares the packets destination address (150.150.4.10) to the routing table and finds the entry for subnet 150.150.4.0which includes addresses 150.150.4.0 through 150.150.4.255 (Step 3). Because the destination address is in this group, R2 forwards the packet outgoing interface Serial0 to next-hop router R2 (150.150.2.7) after encapsulating the packet in an HDLC frame (step 4).
Step C R2 processes the incoming frame and forwards the packet to R3.

Hosts actually use some simple routing logic when choosing where to send a packet. This two-step logic is as follows:
Step 1 If the destination IP address is in the same subnet as I am, send the packet directly

R2 repeats the same general process as R1 when R2 receives the HDLC frame.

to that destination host.

If a route is removed from the routing table and another route through another neighboring router is available, to add the route to the routing table. (Many people view this goal and the preceding one as a single goal.)

To add new routes, or to replace lost routes, with the best currently available route as quickly as possible. The time between losing the route and finding a working replacement route is called convergence time.

To prevent routing loops.

Routing protocols follow these general steps for advertising routes in a network:
Step 1 Each router adds a route to its routing table for each subnet directly connected to the

router.
Step 2 Each router tells its neighbors about all the routes in its routing table, including the

directly connected routes and routes learned from other routers.


Step 3 After learning a new route from a neighbor, the router adds a route to its routing

table, with the next-hop router typically being the neighbor from which the route was learned.
Step A R3 learns a route that refers to its own E0 interface because subnet 150.150.4.0 is

directly connected (Step 1).


Step B R3 sends a routing protocol message, called a routing update, to R2, causing R2 to

learn about subnet 150.150.4.0 (Step 2).


Step D R3 processes the incoming frame and forwards the packet to PC2.

Like R1 and R2, R3 checks the FCS, discards the old data-link header and trailer, and matches its own route for subnet 150.150.4.0. R3s routing table entry for 150.150.4.0 shows that the outgoing interface is R3s Ethernet interface, but there is no next-hop router, because R3 is connected directly to subnet 150.150.4.0. All R3 has to do is encapsulate the packet inside an Ethernet header and trailer, with a destination Ethernet address of PC2s MAC address, and forward the frame. The goals described in the following list are common for any IP routing protocol, regardless of its underlying logic type:

Step C R2 sends a similar routing update to R1, causing R1 to learn about subnet

150.150.4.0 (Step 2).


Step D R1s route to 150.150.4.0 lists 150.150.2.7 (R2s IP address) as the nexthop address

because R1 learned about the route from R2. The route also lists R1s outgoing interface as Serial0, because R1 learned about the route from the update that came in serial0 (at Step C in the figure).

To dynamically learn and fill the routing table with a route to all subnets in the network. If more than one route to a subnet is available, to place the best route in the routing table.

To notice when routes in the table are no longer valid, and to remove them from the routing table.

Dns
Hannah knows the IP address of a DNS server because the address was either preconfigured on Hannahs machine or was learned with DHCP, as covered later in this chapter. As soon as Hannah somehow identifies the name of the other computer (for example, jessie.example.com), she sends a DNS request to the DNS, asking for Jessies IP address. The DNS replies with the address, 10.1.1.2.

Hannah simply sends a DNS request to the server, supplying the name jessie, or jessie.example.com, and the DNS replies with the IP address (10.1.1.2 in this case).

ARP
As soon as a host knows the IP address of the other host, the sending host may need to know the MAC address used by the other computer. For example, Hannah still needs to know the Ethernet MAC address used by 10.1.1.2, so Hannah issues something called an ARP broadcast. An ARP broadcast is sent to a broadcast Ethernet address, so everyone on the LAN receives it. Because Jessie is on the same LAN, she receives the ARP broadcast. Because Jessies IP address is 10.1.1.2 and the ARP broadcast is looking for the MAC address associated with 10.1.1.2, Jessie replies with her own MAC address

Hosts may or may not need to ARP to find the destination hosts MAC address based on the two-step routing logic used by a host. If the destination host is on the same subnet, the sending host sends an ARP looking for the destination hosts MAC address, as shown in Figure 5-14. However, if the sending host is on a different subnet than the destination host, the sending hosts routing logic results in the sending host needing to forward the packet to its default Gateway. Additionally, hosts need to use ARP to find MAC addresses only once in a while. Any device that uses IP should retain, or cache, the information learned with ARP, placing the information in its ARP cache. Each time a host needs to send a packet encapsulated in an Ethernet frame, it first checks its ARP cache and uses the MAC address found there. If the correct information is not listed in the ARP cache, the host then can use ARP to discover the MAC address used by a particular IP address. Also, a host learns ARP information when receiving an ARP as well.

you know that the network can deliver a packet from one host to the other, and back. ICMP does not rely on any application, so it really just tests basic IP connectivityLayers 1, 2, and 3 of the OSI model

DHCP
DHCP supplies IP addresses to clients, and it also supplies other information. For example, hosts need to know their IP address, plus the subnet mask to use, plus what default gateway to use, as well as the IP address(es) of any DNS servers.

Ping
The primary tool for testing basic network connectivity is the ping command. ping (Packet Internet Groper) uses the Internet Control Message Protocol (ICMP), sending a message called an ICMP echo request to another IP address. The computer with that IP address should reply with an ICMP echo reply.

You might also like