The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to...

137
The Network Layer Antonio Carzaniga Faculty of Informatics University of Lugano April 21, 2009 © 2005–2007 Antonio Carzaniga

Transcript of The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to...

Page 1: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

The Network Layer

Antonio Carzaniga

Faculty of InformaticsUniversity of Lugano

April 21, 2009

© 2005–2007 Antonio Carzaniga

Page 2: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Outline

Basic network-layer architecture of a datagram network

Introduction to forwarding

Introduction to routing

General architecture of a router

Switching fabric and queuing

Internet network-layer protocol

The Internet protocol (IP)

Fragmentation

© 2005–2007 Antonio Carzaniga

Page 3: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Application Level

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 4: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Application Level

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 5: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Application Level

web

browser

web

server

GET /carzaniga/ HTTP/1.1

Host: www.inf.unisi.ch

. . .

© 2005–2007 Antonio Carzaniga

Page 6: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Application Level

web

browser

web

server

HTTP/1.1 200 OK

. . .

<html><head>. . . </head><body>

. . .

© 2005–2007 Antonio Carzaniga

Page 7: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Application Level

web

browser

web

server

GET /carzaniga/anto.png HTTP/1.1

Host: www.inf.unisi.ch

. . .

© 2005–2007 Antonio Carzaniga

Page 8: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Application Level

web

browser

web

server

HTTP/1.1 200 OK

. . .

. . .

© 2005–2007 Antonio Carzaniga

Page 9: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Transport Level

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 10: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Transport Level

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 11: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Transport Level

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 12: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Network Layer

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 13: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Network Layer

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 14: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Network Layer

web

browser

web

server

© 2005–2007 Antonio Carzaniga

Page 15: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router

© 2005–2007 Antonio Carzaniga

Page 16: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router

Fundamental component of the network layer

© 2005–2007 Antonio Carzaniga

Page 17: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router

Fundamental component of the network layer

A node in a graph

© 2005–2007 Antonio Carzaniga

Page 18: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router

12

3

4 5

Fundamental component of the network layer

A node in a graph

A finite set of input/output (physical) connections◮ a.k.a., interfaces or ports

© 2005–2007 Antonio Carzaniga

Page 19: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

© 2005–2007 Antonio Carzaniga

Page 20: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

© 2005–2007 Antonio Carzaniga

Page 21: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

© 2005–2007 Antonio Carzaniga

Page 22: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

© 2005–2007 Antonio Carzaniga

Page 23: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

© 2005–2007 Antonio Carzaniga

Page 24: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

“Best-effort” service

© 2005–2007 Antonio Carzaniga

Page 25: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

“Best-effort” service

◮ delivery guarantee: none

© 2005–2007 Antonio Carzaniga

Page 26: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

“Best-effort” service

◮ delivery guarantee: none

◮ maximum latency guarantee: none

© 2005–2007 Antonio Carzaniga

Page 27: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

“Best-effort” service

◮ delivery guarantee: none

◮ maximum latency guarantee: none

◮ bandwidth guarantee: none

© 2005–2007 Antonio Carzaniga

Page 28: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

“Best-effort” service

◮ delivery guarantee: none

◮ maximum latency guarantee: none

◮ bandwidth guarantee: none

◮ in-order delivery guarantee: none

© 2005–2007 Antonio Carzaniga

Page 29: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Focus: “Datagram” Networks

Packet-switched network

◮ information is transmitted in discrete units called datagrams

Connectionless service

◮ a datagram is a self-contained message

◮ treated independently by the network

◮ no connection setup/tear-down phase

“Best-effort” service

◮ delivery guarantee: none

◮ maximum latency guarantee: none

◮ bandwidth guarantee: none

◮ in-order delivery guarantee: none

◮ congestion indication: none

© 2005–2007 Antonio Carzaniga

Page 30: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 31: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 32: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 33: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 34: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 35: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 36: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

© 2005–2007 Antonio Carzaniga

Page 37: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 38: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 39: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 40: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 41: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 42: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 43: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 44: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

© 2005–2007 Antonio Carzaniga

Page 45: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

Potentially asymmetric paths

© 2005–2007 Antonio Carzaniga

Page 46: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

Potentially asymmetric paths

© 2005–2007 Antonio Carzaniga

Page 47: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

Potentially asymmetric paths

© 2005–2007 Antonio Carzaniga

Page 48: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

Potentially asymmetric paths

© 2005–2007 Antonio Carzaniga

Page 49: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

Potentially asymmetric paths

© 2005–2007 Antonio Carzaniga

Page 50: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Datagram Network

Potentially multiple paths for the same source/destination

Potentially asymmetric paths

© 2005–2007 Antonio Carzaniga

Page 51: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

© 2005–2007 Antonio Carzaniga

Page 52: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

A sends a datagram to B

© 2005–2007 Antonio Carzaniga

Page 53: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

to: B. . .

A sends a datagram to B

The datagram is forwarded towards B

© 2005–2007 Antonio Carzaniga

Page 54: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

to: B. . .

A sends a datagram to B

The datagram is forwarded towards B

© 2005–2007 Antonio Carzaniga

Page 55: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

to: B. . .

© 2005–2007 Antonio Carzaniga

Page 56: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

to: B. . .

© 2005–2007 Antonio Carzaniga

Page 57: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

to: B. . .

12

43

forwarding

table

dest. output

. . . . . .

B port 4

. . . . . .

© 2005–2007 Antonio Carzaniga

Page 58: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

12

to: B. . .

43

forwarding

table

dest. output

. . . . . .

B port 4

. . . . . .

© 2005–2007 Antonio Carzaniga

Page 59: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

12

43

to: B. . .

forwarding

table

dest. output

. . . . . .

B port 4

. . . . . .

© 2005–2007 Antonio Carzaniga

Page 60: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

A Bk

c

d

e

f

gh

i

j

12

43

to: B. . .

forwarding

table

dest. output

. . . . . .

B port 4

. . . . . .

© 2005–2007 Antonio Carzaniga

Page 61: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

© 2005–2007 Antonio Carzaniga

Page 62: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

Output: output port

© 2005–2007 Antonio Carzaniga

Page 63: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

Output: output port

Simple design: “forwarding table”

© 2005–2007 Antonio Carzaniga

Page 64: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

Output: output port

Simple design: “forwarding table”

Issues

© 2005–2007 Antonio Carzaniga

Page 65: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

Output: output port

Simple design: “forwarding table”

Issues

◮ how big is the forwarding table?

© 2005–2007 Antonio Carzaniga

Page 66: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

Output: output port

Simple design: “forwarding table”

Issues

◮ how big is the forwarding table?

◮ how fast does the router have to forward datagrams?

© 2005–2007 Antonio Carzaniga

Page 67: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Forwarding

Input: datagram destination

Output: output port

Simple design: “forwarding table”

Issues

◮ how big is the forwarding table?

◮ how fast does the router have to forward datagrams?

◮ how does the router build and maintain the forwarding table?

© 2005–2007 Antonio Carzaniga

Page 68: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Routing

© 2005–2007 Antonio Carzaniga

Page 69: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Routing

A Bk

c

d

e

f

gh

i

j

1 2

1

24

23

2

1

1

3

42

4

12

3

3

3

1

23

2

1

14

2

5

44

3

5

1

3

1 1

© 2005–2007 Antonio Carzaniga

Page 70: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Routing

A Bk

c

d

e

f

gh

i

j

1 2

1

24

23

2

1

1

3

42

4

12

3

3

3

1

23

2

1

14

2

5

44

3

5

1

3

1 1

router k

A 2

B 1

. . .

© 2005–2007 Antonio Carzaniga

Page 71: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router Functions

© 2005–2007 Antonio Carzaniga

Page 72: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router Functions

routing

communications

with neighbors:

routing protocol

routing

table

© 2005–2007 Antonio Carzaniga

Page 73: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router Functions

routing

communications

with neighbors:

routing protocol

routing

table

forwarding

table

© 2005–2007 Antonio Carzaniga

Page 74: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Router Functions

routing

communications

with neighbors:

routing protocol

routing

table

forwarding

table

forwardinginput packets

from input ports

output packets

to output ports

© 2005–2007 Antonio Carzaniga

Page 75: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Anatomy of a Router

© 2005–2007 Antonio Carzaniga

Page 76: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Anatomy of a Router

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

© 2005–2007 Antonio Carzaniga

Page 77: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Anatomy of a Router

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

data link

processing

lookup

forwarding

queuing

© 2005–2007 Antonio Carzaniga

Page 78: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Anatomy of a Router

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

© 2005–2007 Antonio Carzaniga

Page 79: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Anatomy of a Router

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

queuing data link

processing

© 2005–2007 Antonio Carzaniga

Page 80: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

Where does queuing occur?

© 2005–2007 Antonio Carzaniga

Page 81: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

Where does queuing occur?

Input ports

◮ queuing may occur here if the switching fabric is slower than

the aggregate speed of all the input lines. I.e., TS < nTin

© 2005–2007 Antonio Carzaniga

Page 82: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

Where does queuing occur?

Input ports

◮ queuing may occur here if the switching fabric is slower than

the aggregate speed of all the input lines. I.e., TS < nTin

Output ports

◮ queuing may occur here because of the limited throughput of

the output link. I.e., Tout < min(TS ,nTin)

© 2005–2007 Antonio Carzaniga

Page 83: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

© 2005–2007 Antonio Carzaniga

Page 84: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

Scheduling: deciding which packets to process

© 2005–2007 Antonio Carzaniga

Page 85: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

Scheduling: deciding which packets to process

◮ first-come-first-served

© 2005–2007 Antonio Carzaniga

Page 86: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

Scheduling: deciding which packets to process

◮ first-come-first-served

◮ weighted fair queuing: the router tries to be balance traffic

evenly among the different end-to-end connections. Essential

to implement quality-of-service guarantees

© 2005–2007 Antonio Carzaniga

Page 87: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

Scheduling: deciding which packets to process

◮ first-come-first-served

◮ weighted fair queuing: the router tries to be balance traffic

evenly among the different end-to-end connections. Essential

to implement quality-of-service guarantees

Deciding when to drop packets, and which packets to drop

© 2005–2007 Antonio Carzaniga

Page 88: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

Scheduling: deciding which packets to process

◮ first-come-first-served

◮ weighted fair queuing: the router tries to be balance traffic

evenly among the different end-to-end connections. Essential

to implement quality-of-service guarantees

Deciding when to drop packets, and which packets to drop

◮ drop tail: drop arriving packets when queues are full

© 2005–2007 Antonio Carzaniga

Page 89: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Queuing

What happens when packets queue up in a router?

Scheduling: deciding which packets to process

◮ first-come-first-served

◮ weighted fair queuing: the router tries to be balance traffic

evenly among the different end-to-end connections. Essential

to implement quality-of-service guarantees

Deciding when to drop packets, and which packets to drop

◮ drop tail: drop arriving packets when queues are full

◮ active queue management: a set of policies and algorithms to

decide when and how to drop or mark packets in the attempt

to prevent congestion

© 2005–2007 Antonio Carzaniga

Page 90: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

© 2005–2007 Antonio Carzaniga

Page 91: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

Routing: defining paths and compiling forwarding tables

© 2005–2007 Antonio Carzaniga

Page 92: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

Routing: defining paths and compiling forwarding tables

◮ RIP

◮ OSPF

◮ BGP

© 2005–2007 Antonio Carzaniga

Page 93: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

Routing: defining paths and compiling forwarding tables

◮ RIP

◮ OSPF

◮ BGP

IP

© 2005–2007 Antonio Carzaniga

Page 94: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

Routing: defining paths and compiling forwarding tables

◮ RIP

◮ OSPF

◮ BGP

IP

◮ addressing

◮ datagram format

◮ fragmentation and packet handling

© 2005–2007 Antonio Carzaniga

Page 95: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

Routing: defining paths and compiling forwarding tables

◮ RIP

◮ OSPF

◮ BGP

IP

◮ addressing

◮ datagram format

◮ fragmentation and packet handling

ICMP

© 2005–2007 Antonio Carzaniga

Page 96: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Internet Network Layer

Routing: defining paths and compiling forwarding tables

◮ RIP

◮ OSPF

◮ BGP

IP

◮ addressing

◮ datagram format

◮ fragmentation and packet handling

ICMP

◮ error reporting

◮ signaling

© 2005–2007 Antonio Carzaniga

Page 97: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

© 2005–2007 Antonio Carzaniga

Page 98: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers.

© 2005–2007 Antonio Carzaniga

Page 99: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen

© 2005–2007 Antonio Carzaniga

Page 100: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service

© 2005–2007 Antonio Carzaniga

Page 101: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

© 2005–2007 Antonio Carzaniga

Page 102: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

© 2005–2007 Antonio Carzaniga

Page 103: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

time-to-live

© 2005–2007 Antonio Carzaniga

Page 104: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

time-to-live protocol

© 2005–2007 Antonio Carzaniga

Page 105: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

time-to-live protocol header checksum

© 2005–2007 Antonio Carzaniga

Page 106: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

time-to-live protocol header checksum

source address

destination address

© 2005–2007 Antonio Carzaniga

Page 107: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

time-to-live protocol header checksum

source address

destination address

options (if any)

© 2005–2007 Antonio Carzaniga

Page 108: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

IPv4 Datagram Format

0 31

vers. hlen type of service datagram length

identifier flags fragmentation offset

time-to-live protocol header checksum

source address

destination address

options (if any)

data

© 2005–2007 Antonio Carzaniga

Page 109: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

© 2005–2007 Antonio Carzaniga

Page 110: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

© 2005–2007 Antonio Carzaniga

Page 111: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

© 2005–2007 Antonio Carzaniga

Page 112: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

© 2005–2007 Antonio Carzaniga

Page 113: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

© 2005–2007 Antonio Carzaniga

Page 114: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

MTU = 1500b

size = 1000b

© 2005–2007 Antonio Carzaniga

Page 115: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

MTU = 1500b

size = 1000b

MTU = 512b

© 2005–2007 Antonio Carzaniga

Page 116: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

MTU = 1500b

size = 1000b

MTU = 512b

How does the router handle cases where the size of an input

datagram exceeds the maximum transmission unit (MTU) of

the output link?

© 2005–2007 Antonio Carzaniga

Page 117: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

routing

processor

input port

input port

input port

...

output port

output port

output port

...

switch

fabric

MTU = 1500b

size = 1000b

MTU = 512b

How does the router handle cases where the size of an input

datagram exceeds the maximum transmission unit (MTU) of

the output link?

The datagram is fragmented

© 2005–2007 Antonio Carzaniga

Page 118: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

© 2005–2007 Antonio Carzaniga

Page 119: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

© 2005–2007 Antonio Carzaniga

Page 120: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

fragment 1

header

+

fragment 2

header

© 2005–2007 Antonio Carzaniga

Page 121: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

fragment 1

header

+

fragment 2

header

The destination reassembles fragmented datagrams

© 2005–2007 Antonio Carzaniga

Page 122: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

fragment 1

header

+

fragment 2

header

The destination reassembles fragmented datagrams

◮ not intermediate routers

◮ this is mainly to push complexity out of the network

© 2005–2007 Antonio Carzaniga

Page 123: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

fragment 1

header

+

fragment 2

header

The destination reassembles fragmented datagrams

◮ not intermediate routers

◮ this is mainly to push complexity out of the network

◮ a datagram may have to be fragmented further along the path

© 2005–2007 Antonio Carzaniga

Page 124: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

fragment 1

header

+

fragment 2

header

The destination reassembles fragmented datagrams

◮ not intermediate routers

◮ this is mainly to push complexity out of the network

◮ a datagram may have to be fragmented further along the path

The fragmentation scheme must ensure that the destinationhost

◮ can recognize two fragments of the same original datagram

◮ can figure out if and when all the fragments have been received

© 2005–2007 Antonio Carzaniga

Page 125: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

input datagram

header

MTU

fragment 1

header

+

fragment 2

header

The destination reassembles fragmented datagrams

◮ not intermediate routers

◮ this is mainly to push complexity out of the network

◮ a datagram may have to be fragmented further along the path

The fragmentation scheme must ensure that the destinationhost

◮ can recognize two fragments of the same original datagram

◮ can figure out if and when all the fragments have been received

The fragmentation scheme must ensure that the intermediate

routers can fragment a datagram to whatever level necessary

© 2005–2007 Antonio Carzaniga

Page 126: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

© 2005–2007 Antonio Carzaniga

Page 127: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Initial (non-fragmented) datagram format (datasize = 1000)

© 2005–2007 Antonio Carzaniga

Page 128: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Initial (non-fragmented) datagram format (datasize = 1000)

◮ sender host assigns a 16-bit identifier to the datagram (e.g.,

789)

© 2005–2007 Antonio Carzaniga

Page 129: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Initial (non-fragmented) datagram format (datasize = 1000)

◮ sender host assigns a 16-bit identifier to the datagram (e.g.,

789)

◮ the fragment offset is set to 0, indicating that this packet

contains data starting at position 0 of the original datagram

◮ fragment offset is actually the offset in units of 8 bytes

(remember it’s only 13 bits. . . )

© 2005–2007 Antonio Carzaniga

Page 130: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Initial (non-fragmented) datagram format (datasize = 1000)

◮ sender host assigns a 16-bit identifier to the datagram (e.g.,

789)

◮ the fragment offset is set to 0, indicating that this packet

contains data starting at position 0 of the original datagram

◮ fragment offset is actually the offset in units of 8 bytes

(remember it’s only 13 bits. . . )

◮ the “more fragments” flag is set to 0, indicating that no (more)

fragments have been sent

© 2005–2007 Antonio Carzaniga

Page 131: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Initial (non-fragmented) datagram format (datasize = 1000)

◮ sender host assigns a 16-bit identifier to the datagram (e.g.,

789)

◮ the fragment offset is set to 0, indicating that this packet

contains data starting at position 0 of the original datagram

◮ fragment offset is actually the offset in units of 8 bytes

(remember it’s only 13 bits. . . )

◮ the “more fragments” flag is set to 0, indicating that no (more)

fragments have been sent

identifier fragment more header total

offset fragments length length

789 0 0 20 1020

© 2005–2007 Antonio Carzaniga

Page 132: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

© 2005–2007 Antonio Carzaniga

Page 133: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Fragmentation to an MTU of 512

© 2005–2007 Antonio Carzaniga

Page 134: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Fragmentation to an MTU of 512

◮ sender must split the datagram into 3 fragments:

© 2005–2007 Antonio Carzaniga

Page 135: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Fragmentation to an MTU of 512

◮ sender must split the datagram into 3 fragments:

identifier fragment more header total

offset fragments length length

789 0 1 20 508

© 2005–2007 Antonio Carzaniga

Page 136: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Fragmentation to an MTU of 512

◮ sender must split the datagram into 3 fragments:

identifier fragment more header total

offset fragments length length

789 0 1 20 508

identifier fragment more header total

offset fragments length length

789 61 1 20 508

© 2005–2007 Antonio Carzaniga

Page 137: The Network Layer · Outline Basic network-layer architecture of a datagram network Introduction to forwarding Introduction to routing General architecture of a router

Fragmentation

Fragmentation to an MTU of 512

◮ sender must split the datagram into 3 fragments:

identifier fragment more header total

offset fragments length length

789 0 1 20 508

identifier fragment more header total

offset fragments length length

789 61 1 20 508

identifier fragment more header total

offset fragments length length

789 122 0 20 44

© 2005–2007 Antonio Carzaniga