ccna r&s-05-fundamentals of ipv4 addressing and routing

40
©2015 Amir Jafari – www.amir-Jafari.com Routing and Switching 200-120 5 - Fundamentals of IPv4 Addressing and Routing

Upload: amir-jafari

Post on 21-Aug-2015

30 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

©2015 Amir Jafari – www.amir-Jafari.com

Routing and Switching 200-1205 - Fundamentals of IPv4 Addressing and Routing

Page 2: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Fundamentals of IPv4 Addressing and Routing

©2015 Amir Jafari – www.amir-Jafari.com

Agenda

Overview of Network Layer Functions IPv4 Addressing IPv4 Routing IPv4 Routing Protocols Other Network Layer Features

Page 3: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

Network Layer Routing (Forwarding) Logic

Routers and end-user computers work together to perform IP routing

The term path selection is sometimes used to refer to the routing process.

At other times path selection , it refers to routing protocols, specifically how routing protocols select the best route among the competing routes to the same destination.

Page 4: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

Host Forwarding Logic: Send the Packet to the Default Router

PC1 analyzes the destination address and realizes that PC2’s address (168.1.1.1) is not on the same LAN as PC1. So PC1’s logic tells it to send the packet to a device whose job it is to know where to route data.

The default router is also referred to as the default gateway.

Page 5: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

R1 and R2’s Logic: Routing Data Across the Network

All routers use the same general process to route the packet: Each router keeps an IP routing table.

This table lists IP address groupings, called IP networks and IP subnets.

When a router receives a packet, it compares the packet’s destination IP address to the entries in the routing table and makes a match.

This matching entry also lists directions that tell the router where to forward the packet next.

Page 6: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

How Network Layer Routing Uses LANs and WANs

The routing process forwards the network layer packet from end to end through the network

Each successive data link layer frame moves the packet to the next device that thinks about network layer logic

Page 7: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

How Network Layer Routing Uses LANs and WANs

Network Layer and Data Link Layer Encapsulation

Page 8: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

How Network Layer Routing Uses LANs and WANs

Because the routers build new data link headers and trailers, and because the new headers contain data link addresses, the PCs and routers must have some way to decide what data link addresses to use.

An example of how the router determines which data link address to use is the IP Address Resolution Protocol (ARP).

ARP dynamically learns the data link address of an IP host connected to a LAN.

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.

Page 9: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

IP Addressing and How Addressing Helps IP Routing

TCP/IP groups IP addresses together so that IP addresses used on the same physical network are part of the same group. IP calls these address groups an IP network or an IP subnet.

Numerically, the addresses in the same group have the same value in the first part of the addresses.

Similarly, to make routing more efficient, network layer protocols group addresses, both by their location and by the actual address values.

A router can list one routing table entry for each IP network or subnet, instead of one entry for every single IP address.

Page 10: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

IP Addressing and How Addressing Helps IP Routing

The routing process also makes use of the IPv4 header

IPv4 Header, Organized as Four Bytes Wide for a Total of 20 Bytes

Page 11: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

Routing Protocols

For routing logic to work on both hosts and routers, each needs to know something about the TCP/IP internetwork:

1. Hosts need to know the IP address of their default router so that hosts can send packets to remote destinations.

2. Routers, however, need to know routes so that routers know how to forward packets to each and every IP network and IP subnet.

If network engineers enable the same routing protocol on all the routers in a TCP/IP internetwork, with the correct settings, the routers will send routing protocol messages to each other. As a result, all the routers will learn routes for all the IP networks and subnets in the TCP/IP internetwork.

Page 12: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Overview of Network Layer Functions

©2015 Amir Jafari – www.amir-Jafari.com

Routing Protocols

Example of How Routing Protocols Advertise About Networks and Subnets

Page 13: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

Rules for IP Addresses

IP addresses consist of a 32-bit number, usually written in dotted-decimal notation (DDN)

Each DDN has four decimal octets

Each network interface uses a unique IP address

Routers typically have many network interfaces that forward IP packets, have an IP address for each interface

Page 14: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

Rules for Grouping IP Addresses

The addresses in a single IP network have the same numeric value in the first part of all addresses in the network, Network identifier (network ID)

Page 15: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

Rules for Grouping IP Addresses

Two important facts about how IPv4 groups IP addresses:1. All IP addresses in the same group must not be separated from

each other by a router2. IP addresses separated from each other by a router must be in

different groups

IP routing relies on all addresses in one IP network or IP subnet to be in the same location. Otherwise, the routers might deliver IP packets to the wrong locations

Page 16: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

Class A, B, and C IP Networks

The IPv4 address space includes all possible combinations of numbers for a 32-bit IPv4 address

IP standards first subdivide the entire address space into classes, as identified by the value of the first octet:1. Class A gets roughly half of the IPv4 address space, with all

numbers that begin with 1– 1262. Class B gets one-fourth of the address space, with all numbers

that begin with 128–1913. Class C gets one-eighth of the address space, with all numbers

that begin with 192–223

Page 17: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

Class A, B, and C IP Networks

Size of Network and Host Parts of Class A, B, and C Addresses

Page 18: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

Class A, B, and C IP Networks

Size of Network and Host Parts of Class A, B, and C Addresses

Page 19: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

The Actual Class A, B, and C IP Networks

The network ID is just one reserved DDN value per network that identifies the IP network

The network ID cannot be used by a host as an IP address

Page 20: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

The Actual Class A, B, and C IP Networks

Sampling of IPv4 Class A Networks

Page 21: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

The Actual Class A, B, and C IP Networks

Sampling of IPv4 Class B Networks

Page 22: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

The Actual Class A, B, and C IP Networks

Sampling of IPv4 Class C Networks

Page 23: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

The Actual Class A, B, and C IP Networks

The term classful IP network refers to any Class A, B, or C network, because it is defined by Class A, B, and C rules

All Possible Valid Network Numbers

Page 24: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

IP Subnetting

Subnetting defines methods of further subdividing the IPv4 address space into groups that are smaller than a single IP network

IP subnetting defines a flexible way for anyone to take a single Class A, B, or C IP network and further subdivide it into even smaller groups of consecutive IP addresses

Then, in each location where you used to use an entire Class A, B, or C network, you can use a smaller subnet, wasting fewer IP addresses

Page 25: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

IP Subnetting

Example That Uses Five Class B Networks (classful networks)

Page 26: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Addressing

©2015 Amir Jafari – www.amir-Jafari.com

IP Subnetting

As a result of using subnetting, the network engineer has saved many IP addresses

Using Subnets for the Same Design as the Previous Figure

Page 27: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Routing

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Host Routing

Hosts actually use two-step routing logic when choosing where to send a packet:

1. If the destination IP address is in the same IP subnet as I am, send the packet directly to that destination host.

2. Otherwise, send the packet to my default gateway, also known as a default router. (This router has an interface on the same subnet as the host)

Page 28: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Routing

©2015 Amir Jafari – www.amir-Jafari.com

Router Forwarding Logic

When a frame arrives, the router uses the following logic on the data link frame:

1. Use the data link Frame Check Sequence (FCS) field to ensure that the frame had no errors; if errors occurred, discard the frame

2. Assuming that the frame was not discarded at Step 1

3. Compare the IP packet’s destination IP address to the routing table, and find the route that best matches the destination address. This route identifies the outgoing interface of the router, and possibly the next-hop router IP address

4. Encapsulate the IP packet inside a new data link header and trailer, appropriate for the outgoing interface, and forward the frame

Page 29: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Routing

©2015 Amir Jafari – www.amir-Jafari.com

A Detailed Routing Example

Simple Routing Example, with IP Subnets

Page 30: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Routing Protocols

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Protocols

The goals of a routing protocol:

To dynamically learn and fill the routing table with a route to each subnet in the internetwork.

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

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

To work quickly when adding new routes or replacing lost routes To prevent routing loops

Page 31: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Routing Protocols

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Protocols

Routing protocols use the same general steps for learning routes:

1. Each router, independent of the routing protocol, adds a route to its routing table for each subnet directly connected to the router.

2. Each router’s routing protocol tells its neighbors about the routes in its routing table, including the directly connected routes, and routes learned from other routers.

3. After learning a new route from a neighbor, the router’s routing protocol adds a route to its IP routing table, with the next-hop router of that route typically being the neighbor from which the route was learned

Routers sends a routing protocol message, called a routing update, to other routers, to learn about subnets

Page 32: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

IPv4 Routing Protocols

©2015 Amir Jafari – www.amir-Jafari.com

IPv4 Routing Protocols

Router R1 Learning About Subnet 150.150.4.0

Page 33: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Other Network Layer Features

©2015 Amir Jafari – www.amir-Jafari.com

Using Names and the Domain Name System

TCP/IP needs a way to let a computer find the IP address used by the listed host name, and that method uses the Domain Name System (DNS)

Page 34: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Other Network Layer Features

©2015 Amir Jafari – www.amir-Jafari.com

Using Names and the Domain Name System

DNS defines much more than just a few messages. DNS defines protocols, as well as standards for the text names used throughout the world, and a worldwide set of distributed DNS servers

no single DNS server knows all the names and matching IP addresses, but the information is distributed across many DNS servers. So, the DNS servers of the world work together, forwarding queries to each other, until the server that knows the answer supplies the desired IP address information

Page 35: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Other Network Layer Features

©2015 Amir Jafari – www.amir-Jafari.com

The Address Resolution Protocol

On Ethernet LANs, whenever a host or router needs to encapsulate an IP packet in a new Ethernet frame, the host or router knows all the important facts to build that header except for the destination MAC address.

TCP/IP defines the Address Resolution Protocol (ARP) as the method by which any host or router on a LAN can dynamically learn the MAC address of another IP host or router on the same LAN.

ARP defines a protocol that includes the ARP Request, which is a message that asks the simple request “if this is your IP address, please reply with your MAC address.”

ARP also defines the ARP Reply message, which indeed lists both the original IP address and the matching MAC address.

Page 36: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Other Network Layer Features

©2015 Amir Jafari – www.amir-Jafari.com

The Address Resolution Protocol

Sample ARP Process

Page 37: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Other Network Layer Features

©2015 Amir Jafari – www.amir-Jafari.com

The Address Resolution Protocol

Hosts remember the ARP results, keeping the information in their ARP cache or ARP table.

A host or router only needs to use ARP occasionally, to build the ARP cache the first time. Each time a host or router needs to send a packet encapsulated in an Ethernet frame, it first checks its ARP cache for the correct IP address and matching MAC address.

Hosts and routers will let ARP cache entries time out to clean up the table, so occasional ARP Requests can be seen.

Page 38: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Other Network Layer Features

©2015 Amir Jafari – www.amir-Jafari.com

ICMP Echo and the ping Command

After implementing a TCP/IP internetwork, need to test basic IP connectivity without relying on any applications to be working.

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.

ICMP does not rely on any application, so it really just tests basic IP connectivity—Layers 1, 2, and 3 of the OSI model

Page 39: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Fundamentals of IPv4 Addressing and Routing

©2015 Amir Jafari – www.amir-Jafari.com

IP routing: The process of hosts and routers forwarding IP packets

IP addressing: Addresses used to identify a packet’s source and destination host computer

IP routing protocol: A protocol that aids routers by dynamically learning about the IP address groups so that a router knows where to route IP packets so that they go to the right destination host

Other utilities: The network layer also relies on other utilities. For TCP/IP, these utilities include Domain Name System (DNS), Address Resolution Protocol (ARP), and ping

Page 40: CCNA R&S-05-Fundamentals of IPv4 Addressing and Routing

Fundamentals of IPv4 Addressing and Routing

©2015 Amir Jafari – www.amir-Jafari.com

References

1) Cisco Systems, Inc, www.cisco.com/

2) Wendell Odom ,”Cisco CCENT/CCNA ICND1 100-101 Official Cert Guide”, Cisco Press, USA, 2013