Lecture 9: Internetworking
CSE 123: Computer Networks Aaron Schulman
HW 1 due TODAY Combing Networks
● Main challenge is heterogeneity of link layers: u Addressing » Each network media has a different addressing scheme
u Bandwidth » Modems to terabits u Latency » Seconds to nanoseconds u Frame size » Dozens to thousands of bytes
u Loss rates » Differ by many orders of magnitude u Service guarantees » “Send and pray” vs reserved bandwidth
CSE 123 – Lecture 8: From networks to Internetworks 2 Internetworking
● Cerf & Kahn74, “A Protocol for Packet Network Intercommunication”
u Foundation for the modern Internet
● Routers forward packets from source to destination
u May cross many separate networks along the way
● All packets use a common Internet Protocol
u Any underlying data link protocol
u Any higher layer transport protocol
CSE 123 – Lecture 8: From networks to Internetworks 3 TCP/IP Protocol Stack
host host
HTTP Application Layer HTTP
TCP Transport Layer TCP
router router
I I Network Layer I I P P P P
Ethernet Ethernet SONET SONET Ethernet Ethernet interface interface interfaceLink Layerinterface interface interface
CSE 123 – Lecture 9: Internetworking 4 IP Networking
Router
WiFi Ethernet data packet data packet
Eth IP TCP HTTP FDDI IP TCP HTTP
CSE 123 – Lecture 9: Internetworking 5 Routers
● A router is a store-and-forward device
u Routers are connected to multiple networks
u On each network, looks just like another host
u 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 switch, which is transparent
u Removes link-layer header, parses IP header (L3)
● Looks up next hop, forwards on appropriate network
u Each router need only get one step closer to destination
CSE 123 – Lecture 9: Internetworking 6 IP Philosophy
● Impose few demands on network
u Make few assumptions about what network can do
u No QoS, no reliability, no ordering, no large packets
u No persistent state about communications; no connections
● Manage heterogeneity at hosts (not in network)
u Adapt to underlying network heterogeneity
u 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
CSE 123 – Lecture 9: Internetworking 7 IP Packet Header
0 15 16 31 ver HL TOS length R M D identification E F F offset S TTL protocol header checksum 20 bytes source address destination address
options (if any)
data (if any)
CSE 123 – Lecture 9: Internetworking 8 Version field
● Which version of IP is this?
u Plan for change
u Very important!
● Current versions
u 4: most of Internet today
u 6: new protocol with larger addresses
u What happened to 5? Standards body politics.
CSE 123 – Lecture 9: Internetworking 9 Header length
● How big is IP header?
u Counted in 32-bit words
u Variable length » Options
u Engineering consequences of variable length…
● Most IP packet headers are 20 bytes long
CSE 123 – Lecture 9: Internetworking 10 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)
CSE 123 – Lecture 9: Internetworking 11 Length
● How long is whole packet in bytes?
u Includes header
u Limits total packet to 64K
u Redundant?
CSE 123 – Lecture 9: Internetworking 12 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
CSE 123 – Lecture 9: Internetworking 13 Protocol
● Which transport protocol is the data using?
u i.e. how should a host interpret the data
● TCP = 6
● UDP = 17
CSE 123 – Lecture 9: Internetworking 14 IP Checksum
● Header contains simple checksum
u Validates content of header only
● Recalculated at each hop
u Routers need to update TTL
u Hence straightforward to modify
● Ensures correct destination receives packet
CSE 123 – Lecture 9: Internetworking 15 So what does IP do?
● Addressing
● 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
● Today we’ll talk about fragmentation
CSE 123 – Lecture 9: Internetworking 16 For Next Time
● Read 3.2.5 in P&D
● Homework 1 due TODAY
● Homework 2 out on Monday
● Project 1 due in 1.5 weeks!
CSE 123 – Lecture 9: Internetworking 17