Kurose ch4 3ed, Study notes of Network Programming

networks layer

Typology: Study notes

2014/2015

Uploaded on 09/03/2015

hamza77
hamza77 🇩🇿

2 documents

1 / 67

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Network Layer 4-1
Chapter 4
Network Layer
Computer Networking:
A Top Down Approach
Featuring the Internet
,
3rd edition.
Jim Kurose, Keith Ross
Addison-Wesley, July
2004.
A note on the use of these ppt slides:
We’re making these slides freely available to all (faculty, students, readers).
They’re in PowerPoint form so you can add, modify, and delete slides
(including this one) and slide content to suit your needs. They obviously
represent a lot of work on our part. In return for use, we only ask the
following:
If you use these slides (e.g., in a class) in substantially unaltered form,
that you mention their source (after all, we’d like people to use our book!)
If you post any slides in substantially unaltered form on a www site, that
you note that they are adapted from (or perhaps identical to) our slides, and
note our copyright of this material.
Thanks and enjoy! JFK/KWR
All material copyright 1996-2004
J.F Kurose and K.W. Ross, All Rights Reserved
Network Layer 4-2
Chapter 4: Network Layer
Chapter goals:
understand principles behind network layer
services:
routing (path selection)
dealing with scale
how a router works
advanced topics: IPv6, mobility
instantiation and implementation in the
Internet
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43

Partial preview of the text

Download Kurose ch4 3ed and more Study notes Network Programming in PDF only on Docsity!

Network Layer 4-

Chapter 4

Network Layer

Computer Networking: A Top Down Approach Featuring the Internet, 3 rd^ edition. Jim Kurose, Keith Ross Addison-Wesley, July

A note on the use of these ppt slides: We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: ‰ If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) ‰ If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material.

Thanks and enjoy! JFK/KWR

All material copyright 1996- J.F Kurose and K.W. Ross, All Rights Reserved

Network Layer 4-

Chapter 4: Network Layer

Chapter goals:

ˆ understand principles behind network layer

services:

 routing (path selection)

 dealing with scale

 how a router works

 advanced topics: IPv6, mobility

ˆ instantiation and implementation in the

Internet

Network Layer 4-

Chapter 4: Network Layer

ˆ 4. 1 Introduction

ˆ 4.2 Virtual circuit and

datagram networks

ˆ 4.3 What’s inside a

router

ˆ 4.4 IP: Internet

Protocol

 Datagram format  IPv4 addressing  ICMP  IPv

ˆ 4.5 Routing algorithms

 Link state  Distance Vector  Hierarchical routing

ˆ 4.6 Routing in the

Internet

 RIP

 OSPF

 BGP

ˆ 4.7 Broadcast and

multicast routing

Network Layer 4-

Network layer

ˆ transport segment from

sending to receiving host

ˆ on sending side

encapsulates segments

into datagrams

ˆ on rcving side, delivers

segments to transport

layer

ˆ network layer protocols

inevery host, router

ˆ Router examines header

fields in all IP datagrams

passing through it

network data link physical

network data link physical

network data link physical

network data link physical

network data link physical

network data link physical

network data link physical

network data link physical

application transport network data link physical

application transport network data link physical

Network Layer 4-

Connection setup

ˆ 3 rd^ important function insome network

architectures:

 ATM, frame relay, X.

ˆ Before datagrams flow, two hosts and

intervening routers establish virtual

connection

 Routers get involved

ˆ Network and transport layer cnctn service:

 Network: between two hosts

 Transport: between two processes

Network Layer 4-

Network service model

Q: Whatservice model for “channel” transporting

datagrams from sender to rcvr?

Example services for

individual datagrams:

ˆ guaranteed delivery

ˆ Guaranteed delivery

with less than 40 msec

delay

Example services for a

flow of datagrams:

ˆ In-order datagram

delivery

ˆ Guaranteed minimum

bandwidth to flow

ˆ Restrictions on

changes in inter-

packet spacing

Network Layer 4-

Network layer service models:

Network Architecture

Internet

ATM

ATM

ATM

ATM

Service Model

best effort

CBR

VBR

ABR

UBR

Bandwidth

none

constant rate guaranteed rate guaranteed minimum none

Loss

no

yes

yes

no

no

Order

no

yes

yes

yes

yes

Timing

no

yes

yes

no

no

Congestion feedback

no (inferred via loss) no congestion no congestion yes

no

Guarantees?

Network Layer 4-

Chapter 4: Network Layer

ˆ 4. 1 Introduction

ˆ 4.2 Virtual circuit and

datagram networks

ˆ 4.3 What’s inside a

router

ˆ 4.4 IP: Internet

Protocol

 Datagram format  IPv4 addressing  ICMP  IPv

ˆ 4.5 Routing algorithms

 Link state  Distance Vector  Hierarchical routing

ˆ 4.6 Routing in the

Internet

 RIP

 OSPF

 BGP

ˆ 4.7 Broadcast and

multicast routing

Network Layer 4-

VC implementation

A VC consists of:

1. Path from source to destination

2. VC numbers, one number for each link along

path

3. Entries in forwarding tables in routers along

path

ˆ Packet belonging to VC carries a VC

number.

ˆ VC number must be changed on each link.

 New VC number comes from forwarding table

Network Layer 4-

Forwarding table

12 22 32 1 2 3

VC number

interface number

Incoming interface Incoming VC # Outgoing interface Outgoing VC #

1 12 2 22 2 63 1 18 3 7 2 17 1 97 3 87 … … … …

Forwarding table in

northwest router:

Routers maintain connection state information!

Network Layer 4-

Virtual circuits: signaling protocols

ˆ used to setup, maintain teardown VC

ˆ used in ATM, frame-relay, X.

ˆ not used in today’s Internet

application transport network data link physical

application transport network data link physical

  1. Initiate call (^) 2. incoming call
  2. Call connected 3. Accept call
  3. Data flow begins 6. Receive data

Network Layer 4-

Datagram networks

ˆ no call setup at network layer

ˆ routers: no state about end-to-end connections

 no network-level concept of “connection”

ˆ packets forwarded using destination host address

 packets between same source-dest pair may take different paths

application transport network data link physical

application transport network data link physical

  1. Send data (^) 2. Receive data

Network Layer 4-

Datagram or VC network: why?

Internet

ˆ 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

ˆ evolved from telephony ˆ human conversation:  strict timing, reliability requirements  need for guaranteed service ˆ “dumb” end systems  telephones  complexity inside network

Network Layer 4-

Chapter 4: Network Layer

ˆ 4. 1 Introduction

ˆ 4.2 Virtual circuit and

datagram networks

ˆ 4.3 What’s inside a

router

ˆ 4.4 IP: Internet

Protocol

 Datagram format  IPv4 addressing  ICMP  IPv

ˆ 4.5 Routing algorithms

 Link state  Distance Vector  Hierarchical routing

ˆ 4.6 Routing in the

Internet

 RIP

 OSPF

 BGP

ˆ 4.7 Broadcast and

multicast routing

Network Layer 4-

Router Architecture Overview

Two key router functions:

ˆ run routing algorithms/protocol (RIP, OSPF, BGP)

ˆ forwarding datagrams from incoming to outgoing link

Network Layer 4-

Input Port Functions

Decentralized switching : ˆ given datagram dest., lookup output port using forwarding table in input port memory ˆ goal: complete input port processing at ‘line speed’ ˆ queuing: if datagrams arrive faster than forwarding rate into switch fabric

Physical layer: bit-level reception

Data link layer: e.g., Ethernet see chapter 5

Network Layer 4-

Switching Via a Bus

ˆ datagram from input port memory

to output port memory via a shared

bus

ˆ bus contention: switching speed

limited by bus bandwidth

ˆ 1 Gbps bus, Cisco 1900: sufficient

speed for access and enterprise

routers (not regional or backbone)

Network Layer 4-

Switching Via An Interconnection

Network

ˆ overcome bus bandwidth limitations

ˆ Banyan networks, other interconnection nets

initially developed to connect processors in

multiprocessor

ˆ Advanced design: fragmenting datagram into fixed

length cells, switch cells through the fabric.

ˆ Cisco 12000: switches Gbps through the

interconnection network

Network Layer 4-

Output Ports

ˆ Buffering required when datagrams arrive from

fabric faster than the transmission rate

ˆ Scheduling discipline chooses among queued

datagrams for transmission

Network Layer 4-

Output port queueing

ˆ buffering when arrival rate via switch exceeds

output line speed

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

Network Layer 4-

The Internet Network layer

forwarding table

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

Network

layer

Network Layer 4-

Chapter 4: Network Layer

ˆ 4. 1 Introduction

ˆ 4.2 Virtual circuit and

datagram networks

ˆ 4.3 What’s inside a

router

ˆ 4.4 IP: Internet

Protocol

 Datagram format  IPv4 addressing  ICMP  IPv

ˆ 4.5 Routing algorithms

 Link state  Distance Vector  Hierarchical routing

ˆ 4.6 Routing in the

Internet

 RIP

 OSPF

 BGP

ˆ 4.7 Broadcast and

multicast routing

Network Layer 4-

IP datagram format

ver (^) length

32 bits

data (variable length, typically a TCP or UDP segment)

16-bit identifier Internet checksum

time to live 32 bit source IP address

IP protocol version number header length (bytes)

max number remaining hops (decremented at each router)

for fragmentation/ reassembly

total datagram length (bytes)

upper layer protocol to deliver payload to

head. len

type of service “type” of data (^) flgs fragment offset upper layer

32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit.

how much overhead with TCP?

ˆ 20 bytes of TCP

ˆ 20 bytes of IP

ˆ = 40 bytes + app layer overhead

Network Layer 4-

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 datagram out: 3 smaller datagrams

reassembly

Network Layer 4-

IP Addressing: introduction

ˆ IP address: 32-bit

identifier for host,

routerinterface

ˆ interface: connection

between host/router

and physical link

 router’s typically have multiple interfaces  host may have multiple interfaces  IP addresses associated with each interface

223.1.1.

223.1.1.

223.1.1.

223.1.1.4 223.1.2.

223.1.2.

223.1.2.

223.1.3.1 223.1.3.

223.1.3.

223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1

Network Layer 4-

Subnets

ˆ IP address:

 subnet part (high order bits)  host part (low order bits)

ˆ What’s a subnet?

 device interfaces with same subnet part of IP address  can physically reach each other without intervening router

223.1.1.

223.1.1.

223.1.1.

223.1.1.4 223.1.2.

223.1.2.

223.1.2.

223.1.3.1 223.1.3.

223.1.3.

network consisting of 3 subnets

LAN

Network Layer 4-

Subnets

223.1.1.0/24 (^) 223.1.2.0/

223.1.3.0/

Recipe

ˆ To determine the

subnets, detach each

interface from its

host or router,

creating islands of

isolated networks.

Each isolated network

is called a subnet.

Subnet mask: /

Network Layer 4-

Subnets

How many? 223.1.1.

223.1.1.

223.1.1.

223.1.2.1 223.1.2.

223.1.2.

223.1.3.1 223.1.3.

223.1.3.

223.1.1.

223.1.7.

223.1.7. 223.1.8.1 223.1.8.

223.1.9.

223.1.9.