cs 372 – introduction to computer networks* friday july 16, 2010

32
Chapter 4, slide: 1 CS 372 – introduction to computer networks* Friday July 16, 2010 Announcements: Chapter 4 wledgement: slides drawn heavily from Kurose & Ross d in part on slides by Bechir Hamdaoui and Paul D. Paulson.

Upload: yen

Post on 14-Jan-2016

25 views

Category:

Documents


1 download

DESCRIPTION

Announcements: Chapter 4. CS 372 – introduction to computer networks* Friday July 16, 2010. * Based in part on slides by Bechir Hamdaoui and Paul D. Paulson. Acknowledgement: slides drawn heavily from Kurose & Ross. Chapter 4: Network Layer. Chapter goals: - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 1

CS 372 – introduction to computer networks*Friday July 16, 2010

Announcements:

Chapter 4

Acknowledgement: slides drawn heavily from Kurose & Ross

* Based in part on slides by Bechir Hamdaoui and Paul D. Paulson.

Page 2: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 2

Chapter 4: Network Layer

Chapter goals: understand principles behind network

layer services: network layer service models forwarding versus routing subnetting and IP addressing routing algorithms (path selection) advanced topics: IPv6

Page 3: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 3

Chapter 4: Network Layer

Introduction

IP: Internet Protocol IPv4 addressing NAT IPv6

Routing algorithms Link state Distance Vector

Routing in the Internet RIP OSPF BGP

Page 4: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 4

Network layer network layer

protocols run at end systems & routers

Sender side: get segments from

transport layer encapsulates segments

into IP datagrams

router examines header fields in all IP datagrams

Receiver side: delivers segments to

transport layer

application

transportnetworkdata linkphysical

application

transportnetworkdata linkphysical

networkdata linkphysical network

data linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysical

networkdata linkphysicalnetwork

data linkphysical

Page 5: CS 372 – introduction to computer networks* Friday July 16, 2010

local forwarding tableheader value

0100010101111001

3221

output link

Chapter 4, slide: 5

routing algorithm

Interplay between routing and forwarding

routing process: find route taken by packets from source to dest.

forwarding table: a lookup table for figuring out output port for each input pkt

routing algorithm: constructs routing tables

forwarding process: move pkts from input to output

1

23

0111

value in arrivingpacket’s header

Destination

Page 6: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 6

Two Key Network-Layer Functions

forwarding: move packets from router’s input to appropriate router output

routing: determine route taken by packets from source to dest.

routing algorithms

analogy:

routing: process of planning trip from source to dest

forwarding: process of getting through single interchange

Important !!

Page 7: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 7

Network service model

Q: What services are needed/offered to transport datagrams from sender to receiver?

Example services for individual datagrams:

Reliability Guaranteed delivery

End-to-end delay guaranteed delivery

within 40 msec delay

Example services for a flow of datagrams:

In-order in-order datagram delivery

Throughput guaranteed minimum

bandwidth to flow

Jitter delay restrictions on changes in

inter-packet spacing

Page 8: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 8

Network layer: connection and connection-less services Network-layer versus transport-layer services

datagram network provides network-layer connectionless service

Virtual Circuit (VC) network provides network-layer connection service

Transport layer Network layer

Service Process to process

Host to host

Choice Reliable (TCP) and unreliable (UDP)

Unreliable only (Best effort)

Implementation

Edge (Hosts) Core (routers)

Page 9: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 9

Virtual circuits

call setup/teardown for each call before data can flow VC identifier in each packet (not destination address) Maintain state for each VC in every router on the source-

dest. path Allocate resources for each VC: bandwidth, buffers in

links, routers involved in the VC

“source-to-dest path behaves much like telephone circuit” performance-wise network actions along source-to-dest path

Page 10: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 10

VC implementation

a VC consists of:1. path from source to destination2. VC numbers, one number for each link along

path3. entries in forwarding tables in routers along

path

packet belonging to VC carries VC number (rather than dest. address)

VC number can be changed on each link. New VC number comes from forwarding table

Page 11: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 11

Forwarding table

12 22 32

1 23

VC number

interfacenumber

Incoming interface Incoming VC # Outgoing interface Outgoing VC #

1 12 3 222 63 1 18 3 7 2 171 97 3 87… … … …

Forwarding table innorthwest router:

Routers maintain connection state information!

Page 12: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 12

Virtual circuits: signaling protocols

used to setup, maintain teardown VC used in ATM, frame-relay, X.25 not used in today’s Internet

application

transportnetworkdata linkphysical

application

transportnetworkdata linkphysical

1. Initiate call 2. incoming call

3. Accept call4. Call connected5. Data flow begins 6. Receive data

Page 13: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 13

Datagram networks no call setup at network layer no state about end-to-end connections is kept in

routers no network-level concept of “connection”

packets forwarded using dest. host address packets (same source-dest pair) may take different paths

application

transportnetworkdata linkphysical

application

transportnetworkdata linkphysical

1. Send data 2. Receive data

Page 14: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 14

Forwarding table

Destination Address Range Link Interface

11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111

11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111

11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111

otherwise 3

4 billion possible entries

Page 15: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 15

Longest prefix matching

Prefix Match Link Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3

DA: 11001000 00010111 00011000 10101010

Examples

DA: 11001000 00010111 00010110 10100001 Which interface?

Which interface?

Page 16: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 16

Datagram or VC network: why?

Internet (datagram) data exchange among

computers “elastic” service, no

strict timing req. “smart” end systems

(computers) can adapt, perform

control, error recovery simple inside network,

complexity at “edge” many link types

different characteristics uniform service difficult

ATM (VC) evolved from telephony voice conversation:

strict timing, reliability requirements

need for guaranteed service

“dumb” end systems telephones complexity inside

network

Page 17: CS 372 – introduction to computer networks* Friday July 16, 2010

Router Architecture:a little about hardware

Two key router functions: run routing algorithms/protocol (OSPF, BGP) forwarding datagrams from incoming to outgoing link

Chapter 4, slide: 17

Page 18: CS 372 – introduction to computer networks* Friday July 16, 2010

Input Port Functions

Decentralized switching: Lookup: given datagram dest., lookup output port

using forwarding table in input port memory forward: forward to appropriate output port queuing: if datagrams arrive faster than

forwarding rate into switch fabric

Physical layer:bit-level reception

Data link layer:e.g., Ethernetsee chapter 5

Chapter 4, slide: 18

Page 19: CS 372 – introduction to computer networks* Friday July 16, 2010

Three types of switching fabrics

Chapter 4, slide: 19

Page 20: CS 372 – introduction to computer networks* Friday July 16, 2010

Output Port Functions

Buffering required when datagrams arrive from fabric faster than the transmission rate

Scheduling discipline chooses among queued datagrams for transmission

Chapter 4, slide: 20

Page 21: CS 372 – introduction to computer networks* Friday July 16, 2010

Input Port Queuing

Fabric slower than input ports combined -> queueing may occur at input queues

Head-of-the-Line (HOL) blocking: queued datagram at front of queue prevents others in queue from moving forward

queueing delay and loss due to input buffer overflow!

Chapter 4, slide: 21

Page 22: CS 372 – introduction to computer networks* Friday July 16, 2010

Output port queueing

buffering when arrival rate via switch exceeds output line speed

queueing (delay) and loss due to output port buffer overflow!

Chapter 4, slide: 22

Page 23: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 23

Chapter 4: Network Layer

Introduction

IP: Internet Protocol IPv4 addressing NAT IPv6

Routing algorithms Link state Distance Vector

Routing in the Internet RIP OSPF BGP

Page 24: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 24

The Internet Network layer

forwardingtable

Host, router network layer functions:

Routing protocols•path selection•RIP, OSPF, BGP

IP protocol•addressing conventions•datagram format•packet handling conventions

ICMP protocol•error reporting•router “signaling”

Transport layer: TCP, UDP

Link layer

physical layer

Networklayer

Page 25: CS 372 – introduction to computer networks* Friday July 16, 2010

The Internet Protocol (IP) TCP accepts data, destination (source

port, destination address/port) Encapsulates data segments, ports, other

info Gives TCP packet, destination address to IP

UDP is similar IP accepts TCP / UDP packets,

destination address Encapsulates packets, source address,

destination address, other info Provides “best-effort”, host-to-host delivery

The IP unit is called a datagram Chapter 4, slide: 25

Page 26: CS 372 – introduction to computer networks* Friday July 16, 2010

IP datagram format

ver length

32 bits

data (variable length,typically a TCP

or UDP segment)

16-bit identifier

header checksum

time tolive

32 bit source IP address

IP protocol versionnumber

header length (4-byte units)

max numberremaining hops

(decremented at each router)

forfragmentation/reassembly

total datagramlength (bytes)

upper layer protocolto deliver payload to

head.len

type ofservice

“type” of data flgsfragment

offsetupper layer

32 bit destination IP address

Options (if any) E.g. timestamp,record routetaken, specifylist of routers to visit.

How much overhead with TCP?

At least:20 bytes of TCP20 bytes of IP= 40 bytes for every

packet Chapter 4, slide: 26

Page 27: CS 372 – introduction to computer networks* Friday July 16, 2010

IP datagram header VERS - version of IP (currently 4) H. LEN - header length (number of 4-byte units) SERVICE TYPE - sender's preference for low latency, high

reliability (rarely used) TOTAL LENGTH - total octets in datagram IDENT, FLAGS, FRAGMENT OFFSET - used with

fragmentation (later) TTL - time to live; decremented in each router; datagram

discarded when TTL = 0 TYPE - type of protocol carried in datagram; e.g., TCP, UDP HEADER CHECKSUM - 1s complement of sum SOURCE IP ADDRESS - IP address of original source DEST IP ADDRESS - IP address of ultimate destination

Chapter 4, slide: 27

Page 28: CS 372 – introduction to computer networks* Friday July 16, 2010

IP datagram options Added to IP header:

Record route (e.g., traceroute) Source route (e.g., for connection-oriented services) Timestamp

Header with no options has H. LEN field value 5; TCP/UDP header begins immediately after DESTINATION IP ADDRESS

Options added in multiples of 32 bits between DESTINATION IP ADDRESS and DATA. Padding added if necessary

Header with 1 to 32 bits of options has H. LEN field value 6

Chapter 4, slide: 28

Page 29: CS 372 – introduction to computer networks* Friday July 16, 2010

IP Datagram

Datagrams can have different sizes Header area usually fixed (20 octets*) but can

have options Total length can be between 0 and 65,535 Usually, data area is much larger than header,

but not even close to maximum size• Try to balance efficiency and reliability

TCP/UDP header is part of datagram “data” *octet: usually same as byte

called "octet" in internet protocols for historical reasons

Chapter 4, slide: 29

Page 30: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 30

IP Fragmentation & Reassembly network links have MTU

(max.transfer size) - largest possible link-level frame. different link types,

different MTUs large IP datagram divided

(“fragmented”) within net one datagram becomes

several datagrams “reassembled” only at

final destination IP header bits used to

identify, order related fragments

fragmentation: in: one large datagramout: 3 smaller datagrams

reassembly

Page 31: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 31

IP Fragmentation & Reassembly (ctd)

ID=x

offset=0

fragflag=0

length=4000

One large datagram becomesseveral smaller datagrams

Example 4000 byte datagram

= 20 (header) + 3980 (data)

MTU = 1500 bytes

Page 32: CS 372 – introduction to computer networks* Friday July 16, 2010

Chapter 4, slide: 32

IP Fragmentation & Reassembly (ctd)

ID=x

offset=0

fragflag=0

length=4000

ID=x

offset=0

fragflag=1

length=1500

ID=x

offset=185

fragflag=1

length=1500

ID=x

offset=370

fragflag=0

length=1040

One large datagram becomesseveral smaller datagrams

Example 4000 byte datagram

= 20 (header) + 3980 (data)

MTU = 1500 bytes

1480 bytes in data field

offset =1480/8

1040= 20 (header) + 1020 (data)1020 (data) =3980 – 1480 -1480