Network Layer (Part V)

131
Network Layer (Part V)

description

Network Layer (Part V). Network-to-Network Communications : ARP operation within a subnet. If a host wants to send data to another host, it must know the destination IP address. - PowerPoint PPT Presentation

Transcript of Network Layer (Part V)

Page 1: Network Layer (Part V)

Network Layer (Part V)

Page 2: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

• If a host wants to send data to another host, it must know the destination IP address.

• If it is unable to locate a MAC address for the destination in its own ARP table, the host initiates a process called an ARP request.

• An ARP request enables it to discover the destination MAC address..

Page 3: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

Page 4: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

Page 5: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

• A host builds an ARP request packet and sends it to all devices on the network.

• To ensure that all devices see the ARP request, the source uses a broadcast MAC address.

• The broadcast address in a MAC addressing scheme has all places set to hexadecimal F.

• Thus, a MAC broadcast address would have the form FF-FF-FF-FF-FF-FF.

Page 6: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

Page 7: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

• Because ARP request packets travel in a broadcast mode, all devices on the local network receive the packets and pass them up to the network layer for further examination.

• If the IP address of a device matches the destination IP address in the ARP request, that device responds by sending the source its MAC address.

• This is known as the ARP reply

Page 8: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

Page 9: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

• Example:Source device 197.15.22.33 is asking for the MAC address of the destination with IP address 197.15.22.126, Destination device 197.15.22.126 picks up the ARP request and responds with an ARP reply containing its MAC address.

Page 10: Network Layer (Part V)
Page 11: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

• Once the originating device receives the ARP reply, it extracts the MAC address from the MAC header, and updates its ARP table.

• The originating device can then properly address its data with both, a destination MAC address, and a destination IP address.

• It uses this new information to perform Layer 2 and Layer 3 encapsulations of the data, before it sends them out over the network.

Page 12: Network Layer (Part V)

Network-to-Network Communications : ARP operation within a subnet

• When the data arrives at the destination, the data link layer makes a match, strips off the MAC header, and transfers the data up to the network layer.

• The network layer examines the data and finds that the IP address matches the destination IP address carried in the IP header.

• The network layer strips off the IP header, and transfers the encapsulated data to the next highest layer in the OSI model, the transport layer (Layer 4).

• This process is repeated until the rest of the packet's partially decapsulated data reaches the application, where the user data may be read.

Page 13: Network Layer (Part V)

Advanced ARP Concepts : Default gateway

• In order for a device to communicate with another device on another network, you must supply it with a default gateway.

• A default gateway is the IP address of the interface on the router that connects to the network segment which the source host is located on.

• The default gateway’s IP address must be in the same network segment as the source host.

Page 14: Network Layer (Part V)

Advanced ARP Concepts : Default gateway

• If no default gateway is defined, communication is possible only on the device’s own logical network segment.

• The computer that sends the data does a comparison between the IP address of the destination and its own ARP table.

• If it finds no match, it must have a default IP address to use.

• Without a default gateway, the source computer has no destination MAC address, and the message is undeliverable.

Page 15: Network Layer (Part V)
Page 16: Network Layer (Part V)

Advanced ARP Concepts : Problems with sending data to nodes on different subnets

• One of the major problems in networking is how to communicate with devices that are not on the same physical network segment.

• There are two parts to the problem.• The first is obtaining the MAC address of the

destination host, and the second is transferring the data packets from one network segment to another, to get to the destination host.

Page 17: Network Layer (Part V)
Page 18: Network Layer (Part V)

Advanced ARP Concepts : How ARP sends data to remote networks

• ARP uses broadcast packets to accomplish its function. • Routers, however, do not forward broadcast packets.• In order for a device to send data to the address of a device that is

on another network segment, the source device sends the data to a default gateway.

• The default gateway is the IP address of the router interface that is connected to the same physical network segment as the source host.

• The source host compares the destination IP address and its own IP address to determine if the two IP addresses are located on the same segment.

• If the receiving host is not on the same segment, the source host sends the data to the default gateway.

Page 19: Network Layer (Part V)
Page 20: Network Layer (Part V)

Advanced ARP Concepts : Proxy ARP

• Proxy ARP is a variation of the ARP protocol.• In this case an intermediate device (e.g. router)

sends an ARP response, on behalf of an end node, to the requesting host.

• Routers running proxy ARP capture ARP packets.

• They respond with their MAC addresses for those requests in which the IP address is not in the range of addresses of the local subnet.

Page 21: Network Layer (Part V)

Advanced ARP Concepts : Proxy ARP

• In the previous description of how data is sent to a host on a different subnet, the default gateway is configured.

• If the source host does not have a default gateway configured, it sends an ARP request.

• All hosts on the segment, including the router, receive the ARP request.

• The router compares the IP destination address with the IP subnet address to determine if the destination IP address is on the same subnet as the source host.

Page 22: Network Layer (Part V)

Advanced ARP Concepts : Proxy ARP

• If the subnet address is the same, the router discards the packet.

• The reason that the packet is discarded is that the destination IP address is on the same segment as the source's IP address.

• This means another device on the segment should respond to the ARP request.

• The exception to this is that the destination IP address is not currently assigned, which will generate an error response on the source host.

Page 23: Network Layer (Part V)

Advanced ARP Concepts : Proxy ARP

• If the subnet address is different, the router will respond with its own MAC address for the interface that is directly connected to the segment on which the source host is located.

• This is the proxy ARP. Since the MAC address is unavailable for the destination host, the router supplies its MAC address in order to get the packet.

• Then the router can forward the ARP request (based on the destination IP address) to the proper subnet for delivery.

Page 24: Network Layer (Part V)

Advanced ARP Concepts:Four Layer 3 flowcharts

Page 25: Network Layer (Part V)

Advanced ARP Concepts:Four Layer 3 flowcharts

• Create flowcharts for the following processes:– ARP – RARP – BOOTP – DHCP

Page 26: Network Layer (Part V)

Routable Protocols : Routed protocols

• IP is a network layer protocol, and because of that, it can be routed over an internetwork, which is a network of networks.

• Protocols that provide support for the network layer are called routed or routable protocols.

Page 27: Network Layer (Part V)
Page 28: Network Layer (Part V)

Routable Protocols:Other routed protocols

• The focus of this course is on the most commonly used routable protocol, which is IP.

• Even though you will concentrate on IP, it is important to know that there are other routable protocols.

• Two of them are IPX/SPX and AppleTalk.

Page 29: Network Layer (Part V)
Page 30: Network Layer (Part V)

Routable Protocols : Routable and non-routable protocols

• Protocols such as IP, IPX/SPX and AppleTalk provide Layer 3 support and are, therefore, routable.

• However, there are protocols that do not support Layer 3; these are classed as non-routable protocols.

• The most common of these non-routable protocols is NetBEUI.

• NetBEUI is a small, fast, and efficient protocol that is limited to running on one segment.

Page 31: Network Layer (Part V)
Page 32: Network Layer (Part V)

Routable Protocols : Characteristics of a routable protocol

• In order for a protocol to be routable, it must provide the ability to assign a network number, as well as a host number, to each individual device.

• Some protocols, such as IPX, only require that you assign a network number; they use a host's MAC address for the physical number.

• Other protocols, such as IP, require that you provide a complete address, as well as a subnet mask.

• The network address is obtained by ANDing the address with the subnet mask.

Page 33: Network Layer (Part V)
Page 34: Network Layer (Part V)

Routing Protocols:Examples of routing protocols

• Routing protocols (Note: Do not confuse with routed protocols.) determine the paths that routed protocols follow to their destinations.

• Examples of routing protocols include the Routing Information Protocol (RIP), the Interior Gateway Routing Protocol (IGRP), the Enhanced Interior Gateway Routing Protocol (EIGRP), and Open Shortest Path First (OSPF).

Page 35: Network Layer (Part V)

Routing Protocols:Examples of routing protocols

• Routing protocols enable routers that are connected, to create a map, internally, of other routers in the network or on the Internet.

• This allows routing (i.e. selecting the best path, and switching) to occur. Such maps become part of each router's routing table.

Page 36: Network Layer (Part V)

Routing Protocols :Definition of routing protocol

• Routers use routing protocols to exchange routing tables and to share routing information.

• Within a network, the most common protocol used to transfer routing information between routers, located on the same network, is Routing Information Protocol (RIP).

Page 37: Network Layer (Part V)

Routing Protocols :Definition of routing protocol

• This Interior Gateway Protocol (IGP) calculates distances to a destination host in terms of how many hops (i.e. how many routers) a packet must pass through.

• RIP enables routers to update their routing tables at programmable intervals, usually every 30 seconds.

• One disadvantage of routers that use RIP is that they are constantly connecting to neighboring routers to update their routing tables, thus creating large amounts of network traffic.

Page 38: Network Layer (Part V)

Routing Protocols :Definition of routing protocol

• RIP allows routers to determine which path to use to send data. It does so by using a concept known as distance-vector.

• Whenever data goes through a router, and thus, through a new network number, this is considered to be equal to one hop.

Page 39: Network Layer (Part V)

Routing Protocols :Definition of routing protocol

• A path which has a hop count of four indicates that data traveling along that path would have to pass through four routers before reaching the final destination on the network.

• If there are multiple paths to a destination, the path with the least number of hops would be the path chosen by the router.

Page 40: Network Layer (Part V)

Routing Protocols :Definition of routing protocol

• Because hop count is the only routing metric used by RIP, it doesn’t necessarily select the fastest path to a destination.

• A metric is a measurement for making decisions. You will soon learn that other routing protocols use many other metrics besides hop count to find the best path for data to travel.

• Nevertheless, RIP remains very popular, and is still widely implemented.

• This may be due primarily to the fact that it was one of the earliest routing protocols to be developed

Page 41: Network Layer (Part V)

Routing Protocols :Definition of routing protocol

• One other problem posed by the use of RIP is that sometimes a destination may be located too far away to be reachable.

• When using RIP, the maximum number of hops that data can be forwarded through is fifteen.

• The destination network is considered unreachable if it is more than fifteen router hops away.

Page 42: Network Layer (Part V)
Page 43: Network Layer (Part V)

Routing Protocols : Routing encapsulation sequence

• At the data link layer, an IP datagram is encapsulated into a frame.

• The datagram, including the IP header, is treated as data.

• A router receives the frame, strips off the frame header, then checks the destination IP address in the IP header.

• The router then looks for that destination IP address in its routing table, encapsulates the data in a data link layer frame, and sends it out to the appropriate interface.

• If it does not find the destination IP address, it may drop the packet.

Page 44: Network Layer (Part V)
Page 45: Network Layer (Part V)

Routing Protocols : Multi-protocol routing

• Routers are capable of supporting multiple independent routing protocols, and of maintaining routing tables for several routed protocols, concurrently.

• This capability allows a router to deliver packets from several routed protocols over the same data links.

Page 46: Network Layer (Part V)
Page 47: Network Layer (Part V)

Other Network Layer Services : Connectionless network services

• Most network services use a connectionless delivery system.

• They treat each packet separately, and send it on its way through the network.

• The packets may take different paths to get through the network, but are reassembled when they arrive at the destination.

• In a connectionless system the destination is not contacted before a packet is sent

Page 48: Network Layer (Part V)

Other Network Layer Services : Connectionless network services

• A good analogy for a connectionless system is a postal system.

• The recipient is not contacted before a letter is sent from one destination to another.

• The letter is sent on its way, and the recipient learns of the letter when it arrives.

Page 49: Network Layer (Part V)
Page 50: Network Layer (Part V)

Other Network Layer Services : Connection-oriented network services

• In connection-oriented systems, a connection is established between the sender and the recipient before any data is transferred.

• An example of a connection-oriented network is the telephone system.

• You place a call, a connection is established, and then communication occurs.

Page 51: Network Layer (Part V)
Page 52: Network Layer (Part V)

Other Network Layer Services : Comparing connectionless and connection-oriented network

processes

• Connectionless network processes are often referred to as packet switched.

• In these processes, as the packets pass from source to destination, they can switch to different paths, as well as (possibly) arrive out of order.

• Devices make the path determination for each packet based on a variety of criteria.

• Some of the criteria (e.g. available bandwidth) may differ from packet to packet.

Page 53: Network Layer (Part V)
Page 54: Network Layer (Part V)

Other Network Layer Services : Comparing connectionless and connection-oriented network

processes

• Connection-oriented network processes are often referred to as circuit switched.

• These processes establish a connection with the recipient, first, and then begin the data transfer.

• All packets travel sequentially across the same physical circuit, or more commonly, across the same virtual circuit

Page 55: Network Layer (Part V)
Page 56: Network Layer (Part V)

Other Network Layer Services : Comparing connectionless and connection-oriented network

processes

• The Internet is one huge connectionless network in which all packet deliveries are handled by IP.

• TCP (Layer 4) adds connection-oriented services on top of IP (Layer 3).

• TCP segments are encapsulated into IP packets for transport across the Internet.

• TCP provides connection-oriented session services to reliably deliver data.

Page 57: Network Layer (Part V)

Other Network Layer Services:IP and the transport layer

• IP is a connectionless system; it treats each packet independently.

• For example, if you use an FTP program to download a file, IP does not send the file in one long stream of data.

• It treats each packet independently. Each packet can travel different paths.

• Some may even get lost.• IP relies on the transport layer protocol to determine whether

packets have been lost, and to request retransmission. • The transport layer is also responsible for reordering the

packets.

Page 58: Network Layer (Part V)
Page 59: Network Layer (Part V)

ARP Tables:Internetworking devices that have ARP tables

• You have learned that the port, or interface, where a router connects to a network, is considered part of that network; therefore, the router interface connected to the network has an IP address for that network.

• Routers, just like every other device on the network, send and receive data on the network, and build ARP tables that map IP addresses to MAC addresses.

Page 60: Network Layer (Part V)
Page 61: Network Layer (Part V)

ARP Tables :Comparing router ARP tables with ARP tables kept by other networking devices

• Routers can be connected to multiple networks, or subnetworks.

• Generally speaking, network devices map the IP addresses and MAC addresses that they see on a regular and repeated basis.

• This means that a typical device contains mapping information pertaining only to devices on its own network.

• It knows very little about devices beyond its LAN.

Page 62: Network Layer (Part V)

ARP Tables :Comparing router ARP tables with ARP tables kept by other networking devices

• Routers build tables that describe all networks connected to them.

• ARP tables kept by routers can contain IP addresses and MAC addresses of devices located on more than one network

Page 63: Network Layer (Part V)
Page 64: Network Layer (Part V)

ARP Tables :Comparing router ARP tables with ARP tables kept by other networking devices

• In addition to mapping IP addresses to MAC addresses, router tables also map ports.

• Can you think of a reason why routers would need to do this? (Note: Examine the router's ARP table below.)

Page 65: Network Layer (Part V)
Page 66: Network Layer (Part V)

ARP Tables : Other router table addresses

• What happens if a data packet reaches a router that is destined for a network to which it is not connected?

• In addition to IP addresses and MAC addresses of devices located on networks to which it connects, a router also possesses IP addresses and MAC addresses of other routers.

• It uses these addresses to direct data toward its final destination.

• If a router receives a packet whose destination address is not in its routing table, it forwards it to the address of another router that most likely does contain information about the destination host in its routing table.

Page 67: Network Layer (Part V)

ARP Tables : ARP requests and ARP replies

• ARP is used only on a local network.• What would happen if a local router wanted

to ask a non-local router to provide indirect routing (next-hop) services, but did not know the MAC address of the non-local router?

Page 68: Network Layer (Part V)

ARP Tables : ARP requests and ARP replies

• When a router does not know the MAC address of the next-hop router, the source router (router that has the data to be sent on) issues an ARP request.

• A router that is connected to the same segment as the source router receives the ARP request.

• This router issues an ARP reply to the router that originated the ARP request.

• The reply contains the MAC address of the non-local router.

Page 69: Network Layer (Part V)

ARP Tables:Proxy ARP

• A device on one network cannot send an ARP request to a device on another network.

• Can you think of a reason why this is so?

Page 70: Network Layer (Part V)

ARP Tables:Proxy ARP

• What happens in the case of subnetworks? • Can a device on one subnetwork find the MAC

address of a device on another subnetwork? • The answer is yes, provided the source directs

its question to the router.• Working through a third party is called proxy

ARP, and it allows the router to act as a default gateway.

Page 71: Network Layer (Part V)

ARP Tables : Indirect routing

• Sometimes a source resides on a network that has a different network number than the desired destination.

• If the source doesn't know the MAC address of the destination it must use the services of a router.

• With the router's aid, the source's data can reach its destination.

• A router that is used for this purpose is called a default gateway.

Page 72: Network Layer (Part V)

ARP Tables : Indirect routing

• To obtain the services of a default gateway, a source encapsulates the data so that it contains the destination MAC address of the router.

• A source uses the destination IP address of the host device, and not that of a router, in the IP header, because it wants the data delivered to the host device and not to a router.

Page 73: Network Layer (Part V)

ARP Tables : Indirect routing

• When a router picks up data, it strips off the data link layer information that is used in the encapsulation.

• It then passes the data up to the network layer where the router examines the destination IP address.

• It compares the destination IP address with information contained in its routing tables.

Page 74: Network Layer (Part V)

ARP Tables : Indirect routing

• If the router locates the mapped destination IP address and the MAC address, and learns that the location of the destination network is attached to one of its ports, it encapsulates the data with the new MAC address information, and forwards it to the correct destination.

• If the router cannot locate the mapped destination address and MAC address of the device of the final target device, it locates the MAC address of another router that can perform this function, and forwards the data to that router.

• This type of routing is referred to as indirect routing.

Page 75: Network Layer (Part V)
Page 76: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Routed protocols and routing

protocols

• You have learned that protocols are like languages.

• One protocol that you have been learning about is IP, or the Internet Protocol.

• You know that IP is a network layer protocol.• Because IP is routed over an internetwork, it is

called a routed protocol.• Examples of other types of routed protocols

include Novell's IPX, and Appletalk.

Page 77: Network Layer (Part V)
Page 78: Network Layer (Part V)
Page 79: Network Layer (Part V)
Page 80: Network Layer (Part V)
Page 81: Network Layer (Part V)
Page 82: Network Layer (Part V)
Page 83: Network Layer (Part V)
Page 84: Network Layer (Part V)
Page 85: Network Layer (Part V)
Page 86: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Routed protocols and routing

protocols

• Routers use routing protocols to exchange routing tables and share routing information. In other words, routing protocols determine how routed protocols are routed. Examples of routing protocols include the following: – RIP - Routing Information Protocol– IGRP - Interior Gateway Routing Protocol– EIGRP - Enhanced Interior Gateway Routing Protocol– OSPF - Open Shortest Path First

Page 87: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : IGPs and EGPs

• Two types of routing protocols are the Exterior Gateway Protocols (EGPs) and the Interior Gateway Protocols (IGPs).

• Exterior Gateway Protocols route data between autonomous systems.

• An example of an EGP is BGP (Border Gateway Protocol), the primary exterior routing protocol of the Internet.

Page 88: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : IGPs and EGPs

• Can you think of an example where an Exterior Gateway Protocol would be used?

• Interior Gateway Protocols route data in an autonomous system. Examples of IGPs are: – RIP– IGRP– EIGRP– OSPF

• Can you think of an example where an Interior Gateway Protocol would be used?

Page 89: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• The most common method to transfer routing information between routers that are located on the same network is RIP.

• This Interior Gateway Protocol calculates distances to a destination.

• RIP allows routers that use this protocol to update their routing tables at programmable intervals, typically every thirty seconds.

• However, because it is constantly connecting neighboring routers, this can cause network traffic to build.

Page 90: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• RIP allows routers to determine which path it will use to send data, based on a concept known as distance-vector.

• Whenever data travels on a router, and thus through a new network number, it is considered to have traveled one hop.

• A path that has a hop count of four indicates that data traveling along that path must have passed through four routers before reaching its final destination on the network.

Page 91: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• If there are multiple paths to a destination, the router, using RIP, selects the path with the least number of hops.

• However, because hop count is the only routing metric used by RIP in determining best path, it is not necessarily the fastest path.

• Nevertheless, RIP remains very popular, and is widely implemented.

• This is primarily because it was one of the earliest routing protocols to be developed.

Page 92: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• Another problem with using RIP is that a destination may be located too far away for the data to reach it.

• With RIP, the maximum number of hops that data can travel is fifteen.

• Because of this, if the destination network is more than fifteen routers away, it is considered unreachable.

Page 93: Network Layer (Part V)
Page 94: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• Dynamic routing protocols like RIP, or IGRP, differ in the metrics they use when calculating the best path.

• RIP uses a metric measured by the number of routers or hops a packet has to go through to reach a destination.

• If multiple path exist to a destination, the path with the least number of hops is the path chosen.

• RIP is not concerned with speed, only the hop count.

Page 95: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• You could compare this to deciding how to drive to work, based only the number of traffic lights and stop signs.

• This might not be the fastest route, since the route with the least number of traffic lights could be the most congested route, have a speed limit of only twenty-five miles per hour, or go through areas under construction.

Page 96: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : RIP

• In other words, even though the hop count is low, the route may be slower than another option.

• This poses the question : if RIP doesn’t necessarily take the quickest route, why is it so popular ?

Page 97: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : IGRP and EIGRP

• GRP and EIGRP are routing protocols that were developed by Cisco Systems, Inc., therefore, they are considered proprietary routing protocols.

• IGRP was developed specifically to address problems associated with routing, in large multi-vendor networks, that were beyond the scope of protocols such as RIP.

Page 98: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : IGRP and EIGRP

• Like RIP, IGRP is a distance-vector protocol; however, when determining the best path, it also takes into consideration such things as bandwidth, load, delay, and reliability.

• Network administrators can determine the importance given to any one of these metrics.

• Or, allow IGRP to automatically calculate optimal path.

Page 99: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : IGRP and EIGRP

• EIGRP is an advanced version of IGRP. • Specifically, EIGRP provides superior operating

efficiency and combines the advantages of link-state protocols with those of distance-vector protocols.

Page 100: Network Layer (Part V)
Page 101: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : OSPF

• OSPF means "open shortest path first".• A better description, however, might be

"determination of optimum path", because this Interior Gateway Protocol actually uses several criteria to determine the best route to a destination.

• These criteria include cost metrics, which factor in such things as route speed, traffic, reliability, and security.

Page 102: Network Layer (Part V)
Page 103: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : How routers recognize networks

• So how does route information get into a routing table in the first place?

• The network administrator can manually enter the information in the router.

• Or, routers can learn the information, on the fly, from each other.

• Manual entries in routing tables are called "static routes".

• Routes learned automatically are called "dynamic routes".

Page 104: Network Layer (Part V)
Page 105: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Examples of static routing

• If routers can learn routing information automatically, it might seem pointless to manually enter information into a router's routing tables.

• However, such manual entries can be useful whenever a network administrator wants to control which path a router will select.

Page 106: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Examples of static routing

• For example, routing tables that are based on static information could be used to test a particular link in the network, or to conserve wide area bandwidth.

• Static routing is also the preferred method for maintaining routing tables whenever there is only one path to a destination network

Page 107: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Examples of static routing

• This type of network is referred to as a stub network.

• There is only one way to get to this network, so it is important to indicate this situation to prevent routers from trying to find another way to this stub network if it's connection fails.

Page 108: Network Layer (Part V)
Page 109: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Example of dynamic routing

• Adaptive, or dynamic, routing occurs when routers send periodic routing update messages to each other.

• Each time a router receives a message containing new information, it recalculates the new best route, and sends the new updated information to other routers.

• By using dynamic routing, routers can adjust to changing network conditions.

Page 110: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Example of dynamic routing

• Before the advent of dynamic updating of routing tables, most vendors had to maintain router tables for their clients.

• This meant that vendors had to manually enter network numbers, their associated distances, and port numbers into the router tables of all the equipment they sold or leased.

Page 111: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Example of dynamic routing

• As networks grew larger, this became an increasingly cumbersome, time-consuming, and ultimately, expensive, task.

• Dynamic routing eliminates the need for network administrators or vendors to manually enter information into routing tables.

Page 112: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) : Example of dynamic routing

• It works best when bandwidth and large amounts of network traffic are not issues.

• RIP, IGRP, EIGRP, and OSPF are all examples of dynamic routing protocols because they allow this process to occur.

• Without dynamic routing protocols, the Internet would be impossible

Page 113: Network Layer (Part V)
Page 114: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• You have a Class B network that is divided into eight subnetworks that are connected by three routers.

• Host A has data it wants to send to host Z.• It passes the data down through the OSI

model, from the application layer to the data link layer, where host A encapsulates the data with information provided by each layer.

Page 115: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• When the data reaches the network layer, source A uses its own IP address and the destination IP address of host Z, because that is where it wants to send the data.

• Then, host A passes the data to the data link layer.

Page 116: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• At the data link layer, source A places the destination MAC address of the router, to which it is connected, and its own MAC address in the MAC header.

• Source A does this because it sees subnetwork 8 as a separate network.

• It knows that it cannot send data directly to a different network, but must pass such data through a default gateway.

• In this example, the default gateway for source A is router 1.

Page 117: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The data packet travels along subnetwork 1. All hosts that it passes by, examine it, but do not copy it, when they see that the destination MAC address carried by the MAC header does not match their own.

• The data packet continues along subnetwork 1 until it reaches router 1.

• Like the other devices on subnetwork 1, router 1 sees the data packet, and picks it up, because it recognizes that its own MAC address is the same as the destination MAC address.

Page 118: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• Router 1 strips off the MAC header of the data and passes the data up to the network layer where it looks at the destination IP address in the IP header.

• The router then searches its routing tables in order to map a route, for the network address of the destination, to the MAC address of the router that is connected to subnetwork 8.

Page 119: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The router is using RIP as its routing protocol, therefore, it determines that the best path for the data is one that places the destination only three hops away.

• Next, the router determines that it must send the data packet through whichever one of its ports is attached to subnetwork 4, in order for the data packet to reach its destination via the selected path.

• The router passes the data down to the data link layer, where it places a new MAC header on the data packet.

Page 120: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The new MAC header contains the destination MAC address of router 2, and the MAC address of the first router that became the new source.

• The IP header remains unchanged. • The first router passes the data packet

through the port that it selects, and on to subnetwork 4.

Page 121: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The data passes along subnetwork 4.• All hosts that it passes by, examine it, but do

not copy it, when they see that the destination MAC address carried by the MAC header does not match their own.

• The data packet continues along subnetwork 4 until it reaches router 2.

Page 122: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• Like the other devices on subnetwork 4, the router 2 sees the data packet.

• This time it picks it up because it recognizes that its own MAC address is the same as the destination MAC address.

Page 123: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• At the data link layer, the router strips off the MAC header, and passes the data up to the network layer.

• There, it examines the destination network IP address, and looks in its routing table.

• The router, using RIP as its routing protocol, determines that the best path for the data is one that places the destination only two hops away.

Page 124: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• Next, the router determines that it must send the data packet through whichever one of its ports is attached to subnetwork 5, in order for the data packet to reach its destination via the selected path.

• The router passes the data down to the data link layer where it places a new MAC header on the data packet

Page 125: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The new MAC header contains the destination MAC address of router 2, and the MAC address of the first router becomes the new source MAC.

• The IP header remains unchanged. The first router passes the data packet through the port that it selects and on to subnetwork 5.

Page 126: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The data passes along subnetwork 5. The data packet continues along subnetwork 5 until it reaches router 3.

• Like the other devices on subnetwork 5, router 3 sees the data packet.

• This time it picks it up because it recognizes that its own MAC address is the same as the destination MAC address.

Page 127: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• At the data link layer, the router strips off the MAC header, and passes it up to the network layer.

• There, it sees that the destination IP address in the IP header matches that of a host that is located on one of the subnetworks to which it is attached.

• Next, the router determines that it must send the data packet through whichever one of its ports is attached to subnetwork 8, in order for the data packet to reach its destination address.

Page 128: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• It places a new MAC header on the data. This time, the new MAC header contains the destination MAC address of host Z, and the source MAC address of router 3.

• As before, the IP header remains unchanged. Router 3 sends the data through the port that is attached to subnetwork 8.

Page 129: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network

• The data packet travels along subnetwork 8. All hosts that it passes by, examine it, but do not copy it, when they see that the destination MAC address carried by the MAC header does not match their own.

• Finally, it reaches host Z, which picks it up because it sees that its MAC address matches the destination MAC address carried in the MAC header of the data packet.

Page 130: Network Layer (Part V)

Interior Gateway Protocol (IGP) and Exterior Gateway Protocol (EGP) :How routers use RIP to route data

through a network• Host Z strips off the MAC header and passes the data to the

network layer. • At the network layer, host Z sees that its IP address, and the

destination IP address carried in the IP header, match.• Host Z strips off the IP header and passes the data up to the

transport layer of the OSI model.• Host Z continues to strip off the layers that encapsulate the

data packet, and to pass the data to the next layer of the OSI model.

• This continues until the data finally arrives at the top layer, the application layer, of the OSI model.

Page 131: Network Layer (Part V)