fall 2010cmsc 1501 internetworking. fall 2010cmsc 1502 assumptions data pipe from every machine to...

23
Fall 2010 CMSC 150 1 Internetworking

Upload: coral-jennings

Post on 29-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 1Fall 2010

Internetworking

Page 2: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 2Fall 2010

Assumptions

• Data pipe from every machine to every other machine.– Need not be single link (and in most cases will

involve several links and several networks).– Pipe can lose or corrupt data (think postal system

analogy – vast majority of time it arrives, but not always).

– We transmit data in discrete chunks called “packets” • So what info do we need to build a single

“logical” network (either reliable or unreliable)?

Page 3: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 3Fall 2010

Issues• Getting various technologies to work with one

another (I.e. creating a single “network” from many heterogeneous systems).– Problem magnified since packet may need to

traverse several different networks (and network technologies), each with their own addressing schemes, service models, media access protocols, etc.

• Scale: It’s the big issue– How can you find an efficient path through a network

with millions (and perhaps billions eventually) of nodes?

– How do you provide addressing for a network with this many nodes?

Page 4: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 4Fall 2010

Internetwork:

• Arbitrary collection of possibly heterogeneous networks interconnected to provide host-to-host packet delivery service.

• Network: Directly connected or switched network that uses a single technology (i.e. ATM, 802.5, Ethernet).– Could be many physical networks creating a single logical network.

– E.g. several Ethernet networks connected on a university campus

Page 5: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 5Fall 2010

Internetwork

• Internet—THE internetwork.– Runs the Internet Protocol (Kahn-Cerf)– Interesting because it has faced the problems of

scale• internet—abstract internetwork

Page 6: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 6Fall 2010

IP is a big deal

• Vint Cerf and Bob Kahn with Pres. Bush at 2006 ceremony where they received the Presidential Medal of Freedom for their work on IP.

White House News & Policies photo

Page 7: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 7Fall 2010

IP Internet

• Concatenation of NetworksNote Hn denotes host,Rn denotes router.

Page 8: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 8Fall 2010

IP Internet

• Protocol Stack

R1

ETH FDDI

IPIP

ETH

TCP R2

FDDI PPP

IP

R3

PPP ETH

IP

H1

IP

ETH

TCP

H8

Page 9: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 9Fall 2010

The Internet

Outline Best Effort Service ModelGlobal Addressing Scheme

Page 10: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 10Fall 2010

Service Model

• Connectionless (datagram-based)– So each packet must be “self-contained”

• Best-effort delivery (unreliable service)– packets are lost– packets are delivered out of order– duplicate copies of a packet are

delivered (?!)– packets can be delayed for a long time

Page 11: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 11Fall 2010

Why?!

• Best Effort service model is as simple a model as you can design, and this is a strong point!– If you provide best effort service over a network

technology that provides reliable delivery, you’re fine– If you provide reliable delivery over a network

technology that is unreliable, then you’ve got a problem: you need lots of extra functionality in the routers to handle the network deficiencies, and keeping the routers as simple as possible was an IP design goal. (Why?)

• Note: IP today runs over many technologies that were not in existence when IP was invented!

Page 12: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 12Fall 2010

IP Datagram Format

V ersion HLen TOS Length

Ident Flags Offset

TTL Protocol Checksum

SourceAddr

DestinationAddr

Options (variable)Pad

(variable)

0 4 8 16 19 31

Data

In 32 bit wordsIn bytes

Note: fieldsaligned on32 bit boundaries

Page 13: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 13Fall 2010

Fields

• Version: note placement at front of packet (why?)

• Header Length: in 32 bit words (20 bytes when no options)

• Type of service: later• Length: of entire packet in bytes (note max of

65,535 bytes because of 16 bit length field)• Ident, flags, offset all deal with fragmentation• Time to live: first seconds, but evolved to be

hop count

Page 14: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 14Fall 2010

Fields

• Protocol: demux key specifying higher level protocol that gets datagram

• Checksum: take IP header as sequence of 16 bit words, add them using ones complement, take ones complement of result. – Relatively easy to calculate in software– Not as strong error detection as CRC– Bad packets discarded

• Src, dest address: pretty clear (and these are unique!)

• Options: rare, but complete IP implementation must handle them all! Presence determined by header length field

Page 15: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 15Fall 2010

Fragmentation and Reassembly

• Each network has some MTU (why?)– Why not some uniform standard?– What is a reasonable choice for a given host?

• Strategy– fragment when necessary (MTU < Datagram length)– try to avoid fragmentation at source host– re-fragmentation is possible – fragments are self-contained datagrams– delay reassembly until destination host– do not recover from lost fragments

Page 16: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 16Fall 2010

Fragmentation and Reassembly

• Ident field: chosen by sending host, intended to be unique among all datagrams that might be received at this dest from this source over reasonable time period.– All fragments keep this same ident value

• Offset: specifies 8 bytes chunk of data (why?)• Flags: M is “more” flag

Page 17: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 17Fall 2010

Example

H1 R1 R2 R3 H8

ETH IP (1400) FDDI IP (1400) PPP IP (512)

PPP IP (376)

PPP IP (512)

ETH IP (512)

ETH IP (376)

ETH IP (512)

Ident = x Offset = 0

Start of header

0

Rest of header

1400 data bytes

Ident = x Offset = 0

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 512

Start of header

1

Rest of header

512 data bytes

Ident = x Offset = 1024

Start of header

0

Rest of header

376 data bytes

MTU 532 bytes

Note: fragmentation can occurat multiple hops!

Page 18: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 18Fall 2010

Global Addresses

• Properties– globally unique (don’t want anyone with my phone

#)• Why not just use Ethernet address?!

– hierarchical: network + host (really interface)

• Dot Notation– 10.3.2.4– 128.96.33.81– 192.12.69.77

Network Host

7 24

0A:

Network Host

14 16

1 0B:

Network Host

21 8

1 1 0C:

Page 19: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 19Fall 2010

IP Internet Note Hn denotes host,Rn denotes router.

Routers need twoIP addresses.All hosts on same

network have samenetwork part ofIP address

Page 20: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 20Fall 2010

Terminology

• Routing Mechanism: How a router selects the link over which to forward a packet

• Routing Protocol: Policies that determine what is placed in the routing tables.

These are not the same thing!

Page 21: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 21Fall 2010

Datagram Forwarding • Strategy

– every datagram contains destination’s address– if directly connected to destination network, then

forward to host– if not directly connected to destination network, then

forward to some router– forwarding table maps network number into next hop– each host has a default router– each router maintains a forwarding table

• Example (R2) Network Number Next Hop

1 R3 2 R1 3

interface 1 4

interface 0

Page 22: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 22Fall 2010

Recall:

R2

R1

H4

H5

H3H2H1

Network 2 (Ethernet)

Network 1 (Ethernet)

H6

Network 3 (FDDI)

Network 4

(point-to-point)

H7 R3 H8

Page 23: Fall 2010CMSC 1501 Internetworking. Fall 2010CMSC 1502 Assumptions Data pipe from every machine to every other machine. –Need not be single link (and

CMSC 150 23Fall 2010

Pseudocode

if (networknum dest = networknum my interface)deliver packet over that interface

elseif (networknum in my routing table)

deliver packet to next hop routerelse

deliver packet to default router