cmpt 371

35
© Janice Regan, CMPT 128, 2007-2012 1 CMPT 371 Data Communications and Networking Network Layer Internet Protocol (IP) layer Introduction

Upload: jamil

Post on 15-Feb-2016

51 views

Category:

Documents


0 download

DESCRIPTION

CMPT 371. Data Communications and Networking Network Layer Internet Protocol (IP) layer Introduction. Internetworking Terms (1). Communications Network: Facility that provides data transfer service between devices attached to the network - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CMPT 371

© Janice Regan, CMPT 128, 2007-20121

CMPT 371Data Communications and Networking

Network Layer Internet Protocol (IP) layerIntroduction

Page 2: CMPT 371

© Janice Regan, 2007-2012 2

Internetworking Terms (1) Communications Network: Facility that provides data

transfer service between devices attached to the network

internet: Collection of communications networks interconnected by bridges, level 2 switches (bridges), level 3 switches (routers)

The Internet: The global collection of thousands of individual machines and networks

Intranet: Corporate internet operating within a single organization and using Internet (TCP/IP and http) technology to deliver documents and resources and sometimes connectivity to the Internet

Page 3: CMPT 371

© Janice Regan, 2007-2012 3

Internetworking Terms (2) End System (ES): Device attached to

one of the networks of an internet Supports end-user applications or services

Intermediate System (IS): Device used to connect two networks Performs relaying and routing functions Provides a communication path between end

stations on the connected networks

Page 4: CMPT 371

Internetworking terms (3) Repeater or Hub: physical/data link layer

device Provide no intelligent forwarding Forward every frame (unicast, multicast, broadcast)

out every port except the port it arrived on Half duplex, may either transmit or receive

© Janice Regan, 2007-2012 4

Page 5: CMPT 371

© Janice Regan, 2007-2012 5

Internetworking Terms (4) Switch: An IS used to connect two LANs

within the data link layer (layer 2) (cut through, store+forward) both LANS are in the same broadcast domain.

Forwards broadcast packets When powered on acts like a hub. Then builds

MAC-address (Ethernet address) forwarding tables by examining the source MAC address in each frame passing through the switch

Forwards based on destination MAC address. Sends frames out through selected interfaces

only Does not modify the contents of the frames

Page 6: CMPT 371

© Janice Regan, 2007-2012 6

Internetworking Terms (5) Router: An IS connecting two (possibly

dissimilar) networks within the network layer (Layer 3) Connects different broadcast domains. Does not

forward broadcast packets Uses internet protocol in each router and end

system Forwards based on IP destination address Builds/updates forwarding tables based on

information gathered using a routing protocol Sometimes called a layer 3 switch

Page 7: CMPT 371

© Janice Regan, 2007-2012 7

Internetworking Terms (6) A host is a source or destination of IP

packets. A host usually has 1 network interface (IPv4

address) A host does not forward packets it receives

from other hosts (act as a router) Hosts must make some routing decisions

A host must decide which router, directly attached to their own network, to send a particular packet to

Page 8: CMPT 371

© Janice Regan, 2007-2012 8

Internetworking Terms (7) A multi-homed host is a host connected

to multiple networks. Each network is accessed using a different network interface

A multi homed host may forward packets. Packets may arrive at one interface and leave by a different interface A multi homed host may act as a (slow) router. Forwarding must be enabled on a multi homed

host if that multi homed host is to function as a router

Page 9: CMPT 371

© Janice Regan, 2007-2012 9

Internetworking Requirements Provides linkage between networks Provides routing and delivery of data

between processes on different networks Provides accounting services and

maintains status information Provides these services independent of

individual network architectures, and must accommodate differences between networks

Page 10: CMPT 371

© Janice Regan, 2007-2012 10

Main protocol functions in the network layer

Routing Determining a path through the Internet

through a series of hosts/routers to the destination

Addressing/ Forwarding Sending packets along the determined path

Datagram lifetime Removing packets that are ‘lost’ or ‘damaged’

Fragmentation and re-assembly Dealing with networks having different

maximum datagram sizes

Page 11: CMPT 371

© Janice Regan, 2007-2012 11

Deciding where to go Two major components are required to

determine a path through the internet Routing: Building a forwarding table for each

host and router. The entries in a forwarding table are determined statically (input by administrator) or dynamically based on time varying routing data sent from one router to another

Forwarding: Using the forwarding tables at a single router (IS) to determine packet’s next hop on its path toward the destination..

Page 12: CMPT 371

© Janice Regan, 2007-2012 12

Routing + forwarding calculations An IP routing algorithm uses the

information supplied by the routing protocol to build, and for dynamic routing update, the forwarding table at each router. The IP routing algorithm will run on each router to update (as necessary) the forwarding table on that router

An IP forwarding algorithm uses the information in the forwarding table to determine which interface of the router to transmit the IP packet through to efficiently deliver the packet to its destination (determines the direction of the best next hop)

Page 13: CMPT 371

© Janice Regan, 2007-2012

13

Routing protocols Routing protocols

specify how information about current conditions in the network will be transferred between routers (for the purpose of updating forwarding tables)

Specify how such information will be used to update the receiving routers forwarding table

For dynamic routing (changing over time) Each router will receive information from other routers via the

routing protocol Each router will use the routing protocol to send information

(periodically and/or when the local conditions or the local forwarding table changes)

Each router will use the information supplied to it using the routing protocol to create / update it forwarding tables

Page 14: CMPT 371

© Janice Regan, 2007-2012 14

Routers A router is a system that routes and forwards packets

normally has a processor, network interfaces and a high speed switching matrix

will not normally be the source or destination of packets (except routing information packets transmitted using a dynamic routing protocol)

will forward packets using a forwarding (routing) table For dynamic routing will regularly update the forwarding table

The processor of a router will normally run a protocol stack that includes the network layer and below The network layer implements the routing protocol and the IP

routing algorithm and the IP forwarding algorithm

Page 15: CMPT 371

© Janice Regan, 2007-2012 15

Direct Delivery Direct delivery occurs when a datagram is delivered

from one host to another on the same physical network. It is not necessary for the packet to pass through a router If the network specific portion of a packets destination IP

address and source IP address are the same then the packet can usually be delivered directly

Direct delivery is also the last step of the delivery of any IP datagram. Once the datagram has reached a router connected to the same physical network as the destination the datagram is encapsulated in a local data link layer packet and directly delivered

Page 16: CMPT 371

© Janice Regan, 2007-2012 16

Indirect Delivery If the final destination of the IP datagram is not on the

local physical network The datagram must be encapsulated in a link layer frame and

sent to a router connected to the local physical network. That router will extract the datagram from the link layer frame

and use it routing capabilities to find another router on an efficient path to the final destination to send the datagram to.

The router then encapsulates the datagram in a link layer frame and transmits it to the next router.

This process continues until the packet reaches a router directly connected to the same local physical network as the destination host.

The datagram can then be directly delivered to the destination.

Page 17: CMPT 371

Internetworking operation

© Janice Regan, 2007-2012 17

applicationtransport

NETWORKData linkphysical

applicationtransport

NETWORKData linkphysical

NETWORKData linkphysical

applicationtransport

NETWORKData linkphysical

NETWORKData linkphysical

NETWORKData linkphysical

NETWORKData linkphysical

applicationtransport

NETWORKData linkphysical

host

router

Multi homed host (router)

Data linkphysical

Page 18: CMPT 371

Using a router

Janice Regan © Sept. 2007-2013 18

Physical

Data link

network

transport

application

Physical

Data link

network

transport

application

Network

Data link

Physical

Page 19: CMPT 371

Using a relay (switch)

Janice Regan © Sept. 2007-2013 19

Physical

Data link

network

transport

application

Data link

PhysicalPhysical

Data link

network

transport

application

Page 20: CMPT 371

© Janice Regan, 2007-2012 20

Encapsulation Data is transferred in blocks called

Protocol Data Units (PDU) Each PDU contains control information

and sometimes data Control Information includes

Address Error Detection code (checksums) Protocol Control

The addition of control information to data is referred to as Encapsulation

Page 21: CMPT 371

Encapsulation PDUs for TCP/IP

Janice Regan © Sept. 2007-2013 21

Physical

Data link

network

transport

application Application data

Application data

Application data

Application data

TCP segment

IP datagram

Ethernetframe

TCP/UDP

TCP/UDP

TCP/UDP

IP

IPEthernet

Page 22: CMPT 371

© Janice Regan, 2007-2012 22

Choosing the next hop If it has been determined that the datagram cannot be

delivered directly then If the datagram originates on the present host then choosing the

next hop means choosing a router, attached to the same physical network as the host, that is an acceptable next hop in the path to the final destination

If the datagram has arrived at the router from another host or router then an efficient next hop in the path to the destination must be found

The next hop (for both cases) is determined by consulting a forwarding table. That table will indicate where a datagram destined for a particular IP address should be sent to reach that destination efficiently

Page 23: CMPT 371

© Janice Regan, 2007-2012 23

Contents of a forwarding table

Each entry in the forwarding table includes An address prefix (Destination) and mask

(Genmask) which indicate a particular network or networks

The IP address of the next router or host along the path to the final destination (called the first hop router or gateway)

The network interface that should be used to transmit the packet so it can reach the next hop address

A metric that can be used to compare the relative “goodness” of alternate routes.

Possible implementation specific additional information

Page 24: CMPT 371

24© Janice Regan, 2007-2012

A sample forwarding tableDestination Gateway Genmask Metric Iface

172.17.1.253 * 255.255.255.255 0 Eth1

172.16.1.253 * 255.255.255.255 0 Eth0

172.16.0.0 * 255.255.0.0 0 Eth0

172.17.0.0 * 255.255.0.0 0 Eth1

172.18.0.0 172.16.1.254 255.255.0.0 1 Eth0

172.19.0.0 172.17.1.2 255.255.0.0 1 Eth0

127.0.0.0 * 255.0.0.0 0 Lo

224.0.0.0 * 240.0.0.0 0 Eth0

0.0.0.0 172.16.1.1 0.0.0.0 0 Eth0

Page 25: CMPT 371

© Janice Regan, 2007-2012 25

The IP forwarding algorithm Extract the IP destination address from the

packet If the destination address is on the local

network directly deliver the datagram OTHERWISE

For each forwarding table entry check to see if the IP destination address is part of the indicated network.

If it is send the packet through the interface for that network

If there is no match send a routing error back to the source and/or drop the packet

Page 26: CMPT 371

© Janice Regan, 2007-2012 26

Datagram Lifetime Datagrams could loop indefinitely

Problems with routing or addressing can cause datagrams to travel in circles or on circuitous paths rather than reach their destination promptly

Consumes resources Internet protocol may need upper bound on datagram life

Datagram marked with lifetime Time To Live field in IP Once lifetime expires, datagram discarded (not forwarded) Hop count

Decrement time to live on passing through a each router Time count

Need to know how long since last router

Page 27: CMPT 371

© Janice Regan, 2007-2012 27

Fragmentation / Reassembly Different packet sizes for different networks (can be set by

administrator) The data in the PDU must be broken into smaller pieces or

fragmented if the PDU is too large for any network it passes through

Results in a possibility that packets get smaller as a datagram is transmitted from its source through the Internet to its destination

The data in the fragmented PDU is reassembled, usually at the receiver. Why not reassemble at IS? Need large buffers at intermediate routers which may fill and

overflow All fragments must exit the network through same router. Places

difficult to define constraints on an otherwise simple dynamic routing forwarding algorithm

Page 28: CMPT 371

© Janice Regan, 2007-2012 28

Internet addresses 32 bit global internet (IP) address is used to uniquely

identify a particular network interface connected to a particular host as a destination for communication

Each IP address is split into two parts (netid, hostid) to identify the host and the network to which the host is connected

The netid (network address or prefix) identifies the network to which the host belongs.

The hostid identifies the particular host (network interface for a multi homed host)

Page 29: CMPT 371

© Janice Regan, 2007-2012 29

Addressing: Each Internet Protocol address (IP

address) must be globally applicable and globally unique Must have global nonambiguity, must

uniquely identify the host and interface globally

Must have global applicablity, must be accessible via address from any other node on the Internet

IP addresses are used to route PDU from the destination through ISs to the destination. Routes the PDU through the internet or Internet.

Page 30: CMPT 371

© Janice Regan, 2007-2012 30

Transmission Modes Unicast:

uses an address referring to a single system, sending only to that system

Broadcast: Uses an address indicating all entities within

a particular domain or network as recipients of the data

Multicast uses an address that identifies multiple

simultaneous recipients for data

Page 31: CMPT 371

© Janice Regan, 2007-2012 31

Connectionless Internetworking Advantages

Flexible and Robust(failure of single router does not cause failure of transmission as for connection orientented system)

Minimal overhead (no connection overhead) Disadvantages

Delivery not guaranteed Order of delivery not guaranteed Reliability is responsibility of next layer up

(e.g. TCP, transport layer) Support for quality of service is difficult

increased probability of congestion

Page 32: CMPT 371

© Janice Regan, 2007-2012 32

Connection oriented networks Also need to consider connection management in a circuit

switched or virtual circuit type network. IP (not connection oriented) is not the only available protocol

for the network layer. IP grew from the need to transfer information between computers, a task that does not require continuous transmission and is well suited to a datagram network model

Other network layer protocols like ATM, frame relay and X.25 originated in the world of telephony. They were originally designed to carry continuous voice transmission a task more suited to circuit switching or virtual circuit networks. These protocols are connection oriented (do not provide datagram service)

Page 33: CMPT 371

Virtual Circuit networks Do NOT use IP or other connectionless network

layer service Have connections that are established within the

network layer (not the transport layer) by the network layer protocol

Network layer connection oriented service is implemented both by edge systems and routers in the network core. (Not just the end systems as is transport layer connection oriented systems like TCP)

© Janice Regan, 2007-2012 33

Page 34: CMPT 371

© Janice Regan, 2007-2012 34

Advantages / Disadvantages Connection oriented services

Support for quality of service much easier Delivery susceptible to failure of router in

circuit Path setup overhead Reduced addressing overhead per

connection , identifier shorter than full address but router table space needed for ever connection passing through the router

Page 35: CMPT 371

© Janice Regan, 2007-2012 35

Desired Transmission Services IP best effort delivery Other protocols: Network service model

(may include) Guaranteed delivery Guaranteed delivery with bounded delay In order delivery Guaranteed minimum bandwidth

No packet lost, all packets arrive within a specified host to host delay IF transmission of data uses no more that the minimum bandwidth

Guaranteed maximum jitter The time delay between packets at the

destination will not vary from the time delay between packets at the source by more than the maximum value of jitter