Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

32
Stejarel Veres <[email protected]> Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st , 2005

Transcript of Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

Page 1: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

Stejarel Veres <[email protected]>

Network Layer Fundamentals

3rd Tutorial Session for CEG3180BFebruary 1st, 2005

Page 2: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

2Stejarel Veres <[email protected]>

The ISO OSI Model A conceptual, layered model for designing

networked systems (i.e., both the hardware and software components that relate to networking a certain system)

7 Layers (from top to bottom): Application, Presentation, Session, Transport, Network, Data Link, Physical

The higher the layer, the more abstract its functions are with respect to the actual physical transmission

Page 3: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

3Stejarel Veres <[email protected]>

The ISO OSI Model A conceptual, layered model for designing

networked systems (i.e., both the hardware and software components that relate to networking a certain system)

7 Layers (from top to bottom): Application, Presentation, Session, Transport, Network, Data Link, Physical

The higher the layer, the more abstract its functions are with respect to the actual physical transmission

Page 4: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

4Stejarel Veres <[email protected]>

The ISO OSI Model (cont’d)

Allows for transparent peer-to-peer communication between same layers of two networked systems

Top four layers: “network layers”; the other three layers: “host layers”

Beginning with the upmost half of the Data Link Layer (the LLC Sub-Layer), operations are media-independent

Page 5: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

5Stejarel Veres <[email protected]>

The Network Layer

Two fundamental functions: Logical network topology and Addressing Path determination (i.e., Datagram

routing) The rest of this discussion focuses on

the IP (Internet Protocol), version 4 (IPv4) of the TCP/IP Protocol Stack

Page 6: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

6Stejarel Veres <[email protected]>

Original IPv4 Addressing

32-bit addresses (010010111…) Most of the times written in the

“dotted-decimal” format: 4 numbers between 0 and 255, separated by dots

E.g., 137.122.14.100 Theoretically to yield 232 ~ 4.3 billion

addresses

Page 7: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

7Stejarel Veres <[email protected]>

Original IPv4 Addressing (cont’d)

Address space divided into “classes of addresses” based on the size of the networks it was supposed to be allocated to: Class A – large size networks Class B – medium size networks Class C – small size networks Class D – special (multicast) Class E – special (reserved)

Page 8: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

8Stejarel Veres <[email protected]>

Original IPv4 Addressing (cont’d)

Address space divided into “classes of addresses” based on the size of the networks it was supposed to be allocated to: Class A – large size networks Class B – medium size networks Class C – small size networks Class D – special (multicast) Class E – special (reserved)

Page 9: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

9Stejarel Veres <[email protected]>

Path Determination

I.e., datagram (packet) routing The “hop-by-hop” routing paradigm:

packet passes from router to router, each step bringing it closer to the destination

If a packet travels too many hops, it is discarded (in order to prevent routing loops)

Page 10: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

10Stejarel Veres <[email protected]>

Path Determination

I.e., datagram (packet) routing The “hop-by-hop” routing paradigm:

packet passes from router to router, each step bringing it closer to the destination

If a packet travels too many hops, it is discarded (in order to prevent routing loops)

Page 11: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

11Stejarel Veres <[email protected]>

Path Determination (cont’d)

Routers maintain “routing tables” containing, for each known destination network address: The output interface for that destination The next hop address for that destination

Routing tables updated statically (“by hand”) or dynamically (by using dynamic routing protocols)

Page 12: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

12Stejarel Veres <[email protected]>

Static vs. Dynamic Routing Static is:

Simpler to configure, yet more difficult to maintain Very low CPU time-consuming and memory-

consuming Not at all suited for large networks and only

marginally suited for redundant topologies Dynamic is:

More difficult to configure, but need not be manually maintained up to date

Usually more CPU time-consuming and memory-consuming

Virtually a must for redundant topologies and larger networks

Page 13: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

13Stejarel Veres <[email protected]>

Simple Routing Algorithm

1. Examine destination address to determine if class A, B or C

2. Extract the network part from the address3. Search for the destination network in the

routing table4. If found, and next hop is reachable: route

out the specified interface to the next hop5. Otherwise, discard the packet and send

ICMP Destination Host/Network Unreachable message to the sender

Page 14: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

14Stejarel Veres <[email protected]>

Original IPv4 Addressing Issues

1. Inefficient address space allocation - a large part of the address space is being wasted

2. Inefficient routing – large routing tables, routing processes very CPU intensive

Page 15: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

15Stejarel Veres <[email protected]>

Solutions Devised

1. Subnetting2. Default routing; Classless Inter-

Domain Routing (CIDR), also known as “Supernetting”

Page 16: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

16Stejarel Veres <[email protected]>

Subnetting “Borrowing” bits from the host portion

for the network portion of the address Network addresses expressed as pairs

of “address” and “subnet mask” The concept of “classes” becomes

obsolete, yet designs have sometimes to accommodate older equipment with no knowledge of subnetting

Page 17: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

17Stejarel Veres <[email protected]>

“Borrowing” bits from the host portion for the network portion of the address

Network addresses expressed as pairs of “address” and “subnet mask”

The concept of “classes” becomes obsolete, yet designs have sometimes to accommodate older equipment with no knowledge of subnetting

Subnetting

Page 18: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

18Stejarel Veres <[email protected]>

Subnet Masks

32-bit strings with a contiguous left side of 1’s and a contiguous right side of 0’s

The number of 1’s (the “length” of the subnet mask): how many bits of the address corresponds to the network part

Page 19: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

19Stejarel Veres <[email protected]>

Subnet Masks (cont’d)

Written either in dotted-decimal format, or as /number_of_1’s (/length)

Original classes of addresses: A – 255.0.0.0 (/8) B – 255.255.0.0 (/16) C – 255.255.255.0 (/24)

Page 20: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

20Stejarel Veres <[email protected]>

Default Routing Specifies a way to handle packets for

which no specific entry exists in the routing table

“Fall-back”: the packed is routed via a “default gateway” that is supposed to know better what to do with it

Especially useful for “stub networks” Helps keeping routing tables small Default route entry: 0.0.0.0/0

Page 21: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

21Stejarel Veres <[email protected]>

Classless Inter-Domain Routing

Grouping a number of contiguous network addresses into a larger routing table entry

E.g., 192.168.8.0/24 through 192.168.15.0/24 can be written as 192.168.8.0/21

Helps keeping routing tables small

Page 22: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

22Stejarel Veres <[email protected]>

Modified Routing Algorithm1. For each routing table entry: perform AND

between destination address and entry subnet mask; if result equals the entry network address and entry more specific (i.e., longer subnet mask) than the previous one, keep it and discard the other

2. If matched, and next hop is reachable: route out the specified interface to the next hop

3. Otherwise, discard the packet and send ICMP Destination Host/Network Unreachable message to the sender

Page 23: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

23Stejarel Veres <[email protected]>

Subnetting Examples Given the following two address/mask

pairs, how can we tell whether they are on the same subnet or not?

192.168.0.5/28 and 192.168.0.18/281. AND 192.168.0.5 and 255.255.255.240

(/28) = 192.168.0.02. AND 192.168.0.18 and 255.255.255.240 =

192.168.0.16 NO (192.168.0.0 != 192.168.0.16)

Page 24: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

24Stejarel Veres <[email protected]>

Subnetting Examples (cont’d) Given the following two address/mask pairs,

how can we tell whether they are on the same subnet or not?

192.168.0.66/26 and 192.168.0.90/261. AND 192.168.0.66 and 255.255.255.192

(/26) = 192.168.0.642. AND 192.168.0.90 and 255.255.255.192 =

192.168.0.64 YES (192.168.0.64 == 192.168.0.64)

Page 25: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

25Stejarel Veres <[email protected]>

Subnetting Examples (cont’d) Given the following address/mask pair, can

you determine the subnet address and the address range for that subnet?

192.168.32.115/291. AND 192.168.32.115 and 255.255.255.248

(/29) = 192.168.32.112 (subnet address)2. OR 192.168.32.112 and NOT

255.255.255.248 = 192.168.32.119 (broadcast address)

Address range: 192.168.32.112-119 (6 usable addresses, 113-118)

Page 26: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

26Stejarel Veres <[email protected]>

Routing Table Example Given the following routing table:

192.168.1.0 255.255.255.0 Serial0192.168.1.0 255.255.255.240 Serial10.0.0.0 0.0.0.0 Serial2

Address 192.168.1.20 will route by entry 1 Address 192.168.1.5 will route by entry 2 Address 192.168.3.35 will route by entry 3

(via the default gateway)

Page 27: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

27Stejarel Veres <[email protected]>

Dynamic Routing Protocols Can be classified from multiple points of view By the algorithm they use for building routing tables:

Distance Vector: use “distance” metrics Link State: use “cost” metrics and SPF algorithms Hybrid

By the way they use and advertise subnet information: Classless: they accept and advertise subnets Classful: they ignore and don’t advertise subnets

By their intended use: Exterior Gateway Protocols (EGP): inter-AS Interior Gateway Protocols (IGP): intra-AS

Page 28: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

28Stejarel Veres <[email protected]>

Examples of Routing Protocols RIPv1: IGP, distance vector, classful RIPv2: IGP, distance vector, classless IGRP (Cisco): IGP, distance vector,

classful EIGRP (Cisco): IGP, advanced distance

vector (sometimes called “hybrid”), classless

OSPF, IS-IS: IGP, link state, classless BGP-4: EGP, hybrid, classless

Page 29: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

29Stejarel Veres <[email protected]>

Distance Vector vs. Link State Distance Vector are:

Simpler Less CPU time-consuming and often less memory-

consuming Slower-converging More bandwidth-consuming Less scalable

Link State are: More complicated CPU and memory intensive Faster-converging Less bandwidth-consuming Very scalable

Page 30: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

30Stejarel Veres <[email protected]>

So, Which One To Choose?

Distance vector: in small and simple networks, or in networks with slower-CPU and small-sized memory routers

Link state: in large networks, and in networks requiring Shortest Path Tree calculation for the purpose of Traffic Engineering (i.e., MPLS-TE)

Page 31: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

31Stejarel Veres <[email protected]>

Our Labs

Will consist of configuring Cisco routers for Static Routing (Lab 2), for OSPF routing within a single area (Lab 3), and for OSPF routing within a multi-area topology (Lab 4)

Technical documentation to be consulted listed in the References section of this presentation

Page 32: Stejarel Veres Network Layer Fundamentals 3 rd Tutorial Session for CEG3180B February 1 st, 2005.

32Stejarel Veres <[email protected]>

References1. J. Postel, STD0005/RFC0791: Internet Protocol2. J. Postel, STD0005/RFC0792: Internet Control Message Protocol3. J. C. Mogul, J. Postel, STD0005/RFC0950: Internet Standard

Subnetting Procedure4. Y. Rekhter, T. Li, RFC1518: An Architecture for IP Address

Allocation with CIDR5. IANA, RFC3330: Special-Use IPv4 Addresses6. Y. Rekhter, B. Moskowitz, D. Karrenberg, G. J. de Groot, E. Lear,

RFC1918: Address Allocation for Private Internets7. Cisco IOS IP Command Reference, Volume 1 of 4: Addressing and

Services, Release 12.3

http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/ipras_r/ip1bookg.pdf

8. Cisco IOS IP Command Reference, Volume 2 of 4: Routing Protocols, Release 12.3

http://www.cisco.com/univercd/cc/td/doc/product/software/ios123/123cgcr/iprrp_r/ip2bookg.pdf