OSI Network Layer Network Fundamentals Chapter 5 Objectives

OSI Network Layer Network Fundamentals – Chapter 5

Objectives l Upon completion of this chapter, you will be able to: l l l Identify the role of the Network layer as it describes communication from one end device to another end device. Examine the most common Network layer protocol, Internet Protocol (IP), and its features for providing connectionless and best-effort service. Understand the principles used to guide the division, or grouping, of devices into networks. Understand the hierarchical addressing of devices and how this allows communication between networks. Understand the fundamentals of routes, next-hop addresses, and packet forwarding to a destination network.

OSI network layer l l OSI model layer 3 TCP/IP model Internet layer Application Presentation Session Transport Network Data link Physical Data stream HTTP, FTP, TFTP, SMTP etc Segment TCP, UDP Packet IP Frame Ethernet, WAN technologies Bits Application Transport Internet Network Access

Purpose of layer 3 l Decide how to get the data from source to destination, then route it.

Layer 3 protocol A layer 3 protocol such as IP version 4 must: l Provide an addressing scheme to identify networks and individual hosts l Encapsulate a segment from layer 4 into a packet and include addresses l Direct the packet across one or many networks to the destination host l Decapsulate (remove the packet header) and give the segment to layer 4.

Network layer protocols l l l Internet Protocol version 4 (IPv 4) – the most common Internet Protocol version 6 (IPv 6) – designed to replace version 4 eventually Novell Internetwork Packet Exchange (IPX) Apple. Talk Connectionless Network Service (CLNS/DECNet)

IP characteristics l l Designed with low overhead for speed – it does only what it needs to do. Connectionless – does not set up connection with destination before sending packet.

IP Characteristics l Best effort (unreliable) no guarantee of safe delivery, no checking or resending.

IP Characteristics l Independent of media, but does need to know maximum packet size.

Network layer encapsulation Segment from transport layer Packet header added to make IP packet Sent to data link layer for further encapsulation into frame

IPv 4 packet header fields IP address of source host, needed so reply can be sent. IP address of destination host, needed so routers can find route.

IPv 4 packet header fields Reduced by 1 at each router. Packet dropped if it goes to 0. TCP or UDP used in Transport layer.

IPv 4 packet header fields Priority for Qo. S. E. g. voice data has higher priority than e-mail. For checking if header has been corrupted.

IPv 4 packet header fields Shows if packet has been fragmented or must not be fragmented. If router has to split a packet, this gives order for putting pieces together.

IPv 4 packet header fields Version 4. Header length. Length of whole packet.

Splitting up networks Fully switched network, each device has its own bandwidth. You could have hundreds of computers. Why split it up? Too large to manage efficiently Too much broadcast traffic - congestion Too many addresses for switches to remember Lack of security

How to split the network l l l Geographically – different sites Purpose – what software and shared resources do people use? How much bandwidth do they use? Ownership – different companies or departments in a company, security requirements

Use a router l l l Limits broadcasts Can provide security Addressing scheme based on networks hierarchical

IPv 4 hierarchical address l l 32 bits in four 8 -bit octets, written in decimal Network part then host part Here network part (prefix) is 24 bits /24 Length of network part can vary.

Message to same network

Message to different network

Default gateway l l Each PC is configured with an IP address and a default gateway. The default gateway is the IP address of a router port on the same network as the PC. It is the router’s job to handle messages to other networks. Each router port is on a different network and has a different IP address.

Hops l l l A packet may pass through many routers on its journey. The trip from one router to the next is called a hop and the next router is called the next hop router. Each router looks at the IP address in the packet header and decides what to do with the packet next.

Routing table and forwarding l l Each router has a routing table. This contains a list of known networks and the best way to get there – outgoing port and address of nexthop router. The router looks at the IP address of a packet. It decides which network this address is on. If it knows the network it forwards the packet. If it does not know the network it drops the packet.

Directly connected The networks of the router’s own interfaces go into the routing table.

Other networks l l l Routes to other networks can be configured by an administrator (static routes) Or they can be learned from another router using a routing protocol (dynamic routes) A router can have a default route. Packets for unknown networks go on this route instead of being dropped.

Routing table entries Directly connected shown by C

Routing table entries Static, configured by administrator, shown by S

Routing table entries Default, configured by administrator, shown by S*

Routing table entries Learned from another router using RIP routing protocol, shown by R

Router has a route

Routing protocols l l l Routers learn routes from each other and put them in their routing tables. A routing protocol is the set of rules they use to swap information. These routes are dynamic routes

Static routes l l l Entered by administrator Time consuming, different for each router Must be updated if routes change Little processing No bandwidth used Gives nothing away Dynamic routes l l l Learned from other routers Start the protocol then it runs by itself Automatically updates when routes change More processing Uses bandwidth Gives away information

Shortest Paths & Routing l l Many possible paths connect any given source and to any given destination Routing involves the selection of the path to be used to accomplish a given transfer Typically it is possible to attach a cost or distance to a link connecting two nodes Routing can then be posed as a shortest path problem

Routing Metrics Means for measuring desirability of a path l Path Length = sum of costs or distances l Possible metrics l l l Hop count: rough measure of resources used Reliability: link availability; BER Delay: sum of delays along path; complex & dynamic Bandwidth: “available capacity” in a path Load: Link & router utilization along path Cost: $$$

Shortest Path Approaches Distance Vector Protocols l Neighbors exchange list of distances to destinations l Best next-hop determined for each destination l Ford-Fulkerson (distributed) shortest path algorithm Link State Protocols l Link state information flooded to all routers l Routers have complete topology information l Shortest path (& hence next hop) calculated l Dijkstra (centralized) shortest path algorithm

Link-State Algorithm l Basic idea: two step procedure l l l Each source node gets a map of all nodes and link metrics (link state) of the entire network Find the shortest path on the map from the source node to all destination nodes Broadcast of link-state information l l Every node i in the network broadcasts to every other node in the network: l ID’s of its neighbors: Ni=set of neighbors of i l Distances to its neighbors: {Cij | j Ni} Flooding is a popular method of broadcasting packets

Dijkstra Algorithm: Finding shortest paths in order Closest node to s is 1 hop away Find shortest paths from source s to all other destinations 2 nd closest node to s is 1 hop away from s or w” 3 rd closest node to s is 1 hop away from s, w”, or x w' z w s x w" z' x'

Dijkstra’s algorithm l l N: set of nodes for which shortest path already found Initialization: (Start with source node s) l l l Step A: (Find next closest node i) l l l N = {s}, Ds = 0, “s is distance zero from itself” Dj=Csj for all j s, distances of directly-connected neighbors Find i N such that Di = min Dj for j N Add i to N If N contains all the nodes, stop Step B: (update minimum costs) l l l For each node j N Dj = min (Dj, Di+Cij) Go to Step A Minimum distance from s to j through node i in N

Execution of Dijkstra’s algorithm 2 1 5 4 1 2 4 1 6 2 3 1 3 2 5 4 3 1 2 2 5 6 2 3 3 1 3 2 5 4 Iteration N D 2 D 3 D 4 D 5 D 6 Initial {1} 3 2 5 1 {1, 3} 3 2 4 3 2 {1, 2, 3} 3 2 4 7 3 3 {1, 2, 3, 6} 3 2 4 5 3 4 {1, 2, 3, 4, 6} 3 2 4 5 5 {1, 2, 3, 4, 5, 6} 3 2 4 5 3 3

Shortest Paths in Dijkstra’s Algorithm 2 1 5 3 2 2 5 3 2 1 2 5 6 2 3 3 2 4 5 5 2 1 3 5 6 2 4 1 2 2 3 3 4 1 4 4 1 6 2 2 1 3 1 5 4 2 5 4 5 2 2 3 3 4 1 1 6 2 3 4 2 1 3 6 2 1 5 4 5 2 1 3 3 4 1 2 1 6 2 3 1 1 3 2 4 5

THANK YOU !
- Slides: 42