Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering...

67
Chap 10 Routing and Add ressing Andres, Wen-Yuan Liao Department of Computer Science and Engineer ing De Lin Institute of Technology [email protected] http://www.cse.dlit.edu.tw/~andres

Transcript of Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering...

Page 1: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Chap 10 Routing and Addressing

Andres, Wen-Yuan Liao

Department of Computer Science and Engineering

De Lin Institute of Technology

[email protected]

http://www.cse.dlit.edu.tw/~andres

Page 2: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 3: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Importance of a Network Layer

Identifiers

Segmentation and autonomous systems

Communication between separate networks

Layer 3 network devices

Page 4: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Identifiers Move data through a set of networks (internetwork)

Network layer: hierarchical addressing Unique addresses across network b

oundariesA method for finding a path

MAC addresses: flat addressing

Page 5: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Segmentation and autonomous systems

Multiple networks are necessary The growth in size of each networkThe growth in the number of

networks

Network segments (or just segments)

Page 6: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Communication between separate networks

Internet is a collection of network segments

Internet service providers (ISPs) offering services that tie together multiple network segment

Page 7: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Layer 3 network devices

Routers are internetworking devices which operate at OSI Layer 3

Tie together, or interconnect, network segments or entire networks

Page 8: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Layer 3 network devices

Routers make logical decisions regarding the best path on an internetwork and then direct packets

Routing is sometimes referred to as Layer 3 switching

Page 9: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 10: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Path Determination

Path determination Network layer addressing Layer 3 and computer mobility Comparing flat and hierarchical addressing

Page 11: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Path determination

Routing the packetThe process that the router uses

to choose the next hop in the path for the packet to travel to its destination

Make their decisions based on the traffic density and the speed of the link

Page 12: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 13: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Network layer addressing

Network addressThe router uses the network a

ddress to identify the destination network of a packet within an internetwork.

Host address

Page 14: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 15: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Layer 3 and computer mobility

A MAC address can be compared to your name

The network address to your mailing address

Page 16: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Comparing flat and hierarchical addressing

A flat addressing scheme Assigns a device the next

available address

The postal system ZIP codes are a good example of hierarchical addressing

Page 17: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

IP Addresses within the IP Header

Network layer datagrams

Network layer fields

IP header source and destination fields

IP address as a 32-bit binary number

IP address component fields

Page 18: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 19: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 20: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 21: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 22: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 23: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

IP address component fields

The network number of an IP address identifies the network to which a device is attached

The host portion of an IP address identifies the specific device on that network

Page 24: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 25: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

IP Address Classes

IP address classes

IP addresses as decimal numbers

Page 26: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 27: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

The first (leftmost) bit is always 0

First octet of its IP address: 0-126

A Class A IP address can have assigned up to 224 - 2 or 16,777,214, possible IP addresses

Class A

Page 28: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Class B

The first 2 bits: 10

First octet of its IP address:128 to 191

A Class B IP address can have assigned up to 216 - 2, or 65,534, possible IP addresses

Page 29: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Class C

The first 3 bits: 110

First octet of its IP address:192 to 223

A Class C IP address can have assigned up to 28 - 2, or 254, possible IP addresses

Page 30: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 31: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Reserved Address Space Purposes for network IDs and broadcast addresses Network ID Network ID analogy Broadcast address analogy Hosts for classes of IP addresses

Page 32: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Purposes for network IDs and broadcast addresses

An IP address that ends with binary 0s in all host bits is reserved for the network address The wire address

Class A network: 113.0.0.0 Contain the host 113.1.2.3

Page 33: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 34: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Network & Host ID A network IDEnable a router to put a packet onto

the appropriate network segment

The host IDHelp the router address the Layer 2

frame to the specific host on that network

Page 35: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 36: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 37: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Basics of Subnetting Classical IP Addressing

Subnetwork

Purpose for subnetting

Subnet mask

Boolean operations: AND, OR, and NOT

Performing the AND function

Page 38: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Classical IP Addressing

Network administrators sometimes need to divide networks into smaller networks

SubnetworksProvide addressing flexibilityBe simply referred to as subnet

Page 39: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Subnetwork Subnet addresses includeThe Class A, Class B, or Class C

network portionA subnet fieldA host field

To create a subnet addressBorrows bits from the original host

portion

Page 40: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 41: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 42: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 43: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 44: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Subnetwork

The minimum number of bits that can be borrowed is 2

The maximum number of bits that can be borrowed can be any number that leaves at least 2 bits remaining, for the host number

Page 45: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 46: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Purpose for subnetting

A primary reason for using subnets is to reduce the size of a broadcast domain

Page 47: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Subnet mask

The subnet mask determines which part of an IP address is the network field and which part is the host field

Page 48: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 49: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

SubnetRouters determine the destination network/subnet addressPerform a logical AND using the

destination host's IP address and the subnet mask

The result will be the network/subnet address

Page 50: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 51: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Creating a Subnet

Range of bits needed to create subnets

Determining subnet mask size

Computing subnet mask and IP address

Computing hosts per subnetwork

Boolean AND operation

IP configuration on a network diagram

Host/subnet schemes

Private addresses

Page 52: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 53: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 54: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

The subnet field always follows immediately after the network number The subnet field always follows immediately after the network number The subnet field always follows immediately after the network number

Page 55: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Example

Class C address 197.15.22.131

Subnet mask of 255.255.255.224

224:11100000

Been extended by 3 bits: 27 bits

The 131: the third usable host address in the subnet 197.15.22.128

Page 56: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

ExampleThe routers in the Internet (that don't know the subnet mask) will only worry about routing to the Class C network 197.15.22.0The routers inside that network, knowing the subnet mask, will be looking at 27 bits to make a routing decision

Page 57: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 58: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Example

Class B network:subnet mask of 255.255.240.0

The number 240 decimal is 11110000

4 bits for the subnet field.

Page 59: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Example

Number - 0000 ~ 1111 (15)Sixteen subnetsCannot use subnet 0 (network

address), and subnet 15 (1111) (broadcast address)

Fourteen usable subnets (1-14)

Page 60: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Computing hosts per subnetwork

Borrow 2 bits from the default 8 bit host field

The total number of possible hosts: 64 (26)

The number of usable host numbers would be reduced to 62

Page 61: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 62: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

IP configuration on a network diagram

When you configure routers, you must connect each interface to a different network segment

Then each of these segments will become a separate subnet

Page 63: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 64: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 65: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Private addresses

There are certain addresses in each class of IP address that are not assignedPrivate addresses might be used by hosts that use network address translation (NAT), or a proxy server, to connect to a public network

Page 66: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.
Page 67: Chap 10 Routing and Addressing Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw andres.

Summary

Network addressing and best path selection Flat and hierarchical. Three classes of IP addresses Subnetworks or subnets Subnet masks