lecture 9: internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...keep plugging...

16
Lecture 9: Internetworking CSE 123: Computer Networks Alex C. Snoeren

Upload: others

Post on 11-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Lecture 9:Internetworking

CSE 123: Computer NetworksAlex C. Snoeren

Page 2: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

FDDIEthernet

Router

TCP HTTPIPEth

data packet data packet

TCP HTTPIPFDDI

2

IP Networking

CSE 123 – Lecture 8: Internetworking

CSE 123 – Lecture 9: Internetworking

What does the destination address in the Ethernet frame header correspond to?

A. Host A B. Host BC. The routerD. The closest bridge/switch to host A

Host AHost B

Page 3: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Routers● A router is a store-and-forward device

u Routers are connected to multiple networksu On each network, looks just like another hostu A lot like a switch, but supports multiple datalink layers and makes decisions at the

network layer

● Must be explicitly addressed by incoming frames (L2)u Not at all like a bridge or switch, which are transparentu Removes link-layer header, parses IP header (L3)

● Looks up next hop, forwards on appropriate networku Each router need only get one step closer to destination

3

CSE 123 – Lecture 8: Internetworking

CSE 123 – Lecture 9: Internetworking

Page 4: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

● Impose few demands on networku Make few assumptions about what network can dou No QoS, no reliability, no ordering, no large packetsu No persistent state about communications; no connections

● Manage heterogeneity at hosts (not in network)u Adapt to underlying network heterogeneityu Re-order packets, detect errors, retransmit lost messages…u Persistent network state only kept in hosts (fate-sharing)

● Service model: best effort, a.k.a. send and pray

4

IP Philosophy

CSE 123 – Lecture 8: Internetworking

CSE 123 – Lecture 9: Internetworking

Page 5: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

So what does IP do?● Addressing – compicated topic so we’ll save it for later● Fragmentation

u E.g. FDDI’s maximum packet is 4500 bytes while Ethernet is 1500 bytes, how to manage this?

● Some error detection● Routers only forward packets to next hop

u They do not:» Detect packet loss, packet duplication» Reassemble or retransmit packets

● We’ll start by deconstructing the header…

5

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 6: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

length

0 15 16

options (if any)

data (if any)

31

20 bytes

ver HL TOS

identificationRES

MFDF offset

TTL protocol header checksum

source address

destination address

IP Packet Header

6

CSE 123 – Lecture 8: Internetworking

CSE 123 – Lecture 9: Internetworking

Page 7: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Version field● Which version of IP is this?

u Plan for changeu Very important!

7

CSE 123 – Lecture 8: Internetworking

What versions of IP are in use today?

A. IPv4B. IPv6C. BothD. More than two

CSE 123 – Lecture 9: Internetworking

Page 8: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Header length● How big is IP header?

u Counted in 32-bit wordsu Variable length

» Optionsu Engineering consequences of variable length…

● Most IP packet headers are 20 bytes long

8

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

What is the content of the HL field for most IP packets?

A. 20B. 5C. Something else

Page 9: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Type-of-Service● How should this packet be treated?

u Care/don’t care for delay, throughput, reliability, cost

u How to interpret, how to apply on underlying net?

u Largely unused until 2000 (hijacked for new purposes, ECN & Diffserv)

9

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 10: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

TTL (Time-to-Live)

● How many more routers can this packet pass through?u Designed to limit packet from looping

forever● Each router decrements TTL field● If TTL is 0 then router discards

packet

10

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 11: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Protocol● Which transport protocol is the data using?

u i.e. how should a host interpret the data

● TCP = 6● UDP = 17

11

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 12: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

IP Checksum● Header contains simple checksum

u Validates content of header only

● Recalculated at each hopu Routers need to update TTLu Hence straightforward to modify

● Ensures correct destination receives packet

12

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 13: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Length● How long is whole packet in bytes?

u Includes headeru Limits total packet to 64Ku Redundant?

13

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 14: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

Fragmentation● Different networks may have different

maximum frame sizesu Maximum Transmission Unit (MTUs)u Ethernet 1.5K, FDDI 4.5K

● Router breaks up single IP packet into two or more smaller IP packetsu Each fragment is labeled so it can be correctly

reassembledu End host reassembles them into original packet

R1

H4

H5

H3H2H1

Network 2 (Ethernet)

H6

Network 3 (FDDI)

Fragment?

14

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 15: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

IP ID and Bitflags● Source inserts unique value in identification field

u Also known as the IPIDu If packet is fragmented, the router copies this value into any

fragments● Offset field indicates position of current fragment (in bytes/8)

u Zero for non-fragmented packet

15

● Bitflags provide additional informationu More Fragments bit helps identify last fragmentu Don’t Fragment bit prohibits (further) fragmentationu Note recursive fragmentation easily supported—just requires care with More Fragments bit

CSE 123 – Lecture 11: Fragmentation & Addressing

CSE 123 – Lecture 9: Internetworking

Page 16: Lecture 9: Internetworkingcseweb.ucsd.edu/classes/fa19/cse123-a/lectures/123-fa19...Keep plugging away on Project 1 CSE 123–Lecture 9: Internetworking 16 Title 123-fa19-l9 Author

For Next Time

● Keep reading 3.2 in P&D

● Keep plugging away on Project 1

16CSE 123 – Lecture 9: Internetworking