02-architecture
02-architecture
The Internet
But how does your laptop know
where the google.com server is,
and how to reach it?
But how does your laptop know
where the google.com server is,
and how to reach it?
Addressing
Both your laptop and google.com
have many addresses.
But how does your laptop know
where the google.com server is,
and how to reach it?
Routing
There may be many kinds of networks
between you and google, each using its
own way to stitch together the path
Addressing
Rutgers campus
The Internet
network
TCP UDP
Transport: provide guarantees to apps
IP
Network Network
Transport Transport
7 6
1 8 authoritative DNS server
dns.cs.umass.edu
requesting host
Recursive query: #1 cis.poly.edu
Iterative queries: #2, 4, 6 gaia.cs.umass.edu
Routing
19
Path computation: Routing
• “I know where you are, but how do I get there?”
• End-to-end paths (e.g., source routing)
• Each node picks the best end-to-end path
• Spanning tree (e.g., Ethernet)
• One tree that connects every pair of nodes
• Shortest paths (e.g., OSPF, IS-IS, RIP)
• Shortest-path tree rooted at each node
• Locally optimal paths (e.g., BGP)
• Each node selects the best among its neighbors
• More on this in the next lecture…
20
The Internet’s approach to routing
aggregate routers into regions known as
“autonomous systems” (AS) (a.k.a. “domains”)
22
What happens when you browse?
(1) Request gmail.com for your mail
(2) Google churns on your request
(3) Receive & display the response!
The Internet
24
The roles of endpoint network software
• Bootstrapping the host into the network
• How does the endpoint get an address?
• How does the endpoint make itself known to others?
• Providing an interface to networked applications
• How do higher-level applications access the network?
• What abstractions does the host provide to apps?
• Distributed resource sharing
• What roles does the host play in network resource allocation
decisions?
•25 … apart from other things.
(1) Bootstrapping host into network
adapter
• The lowest level address is hard-wired
Applications • The network adapter (NIC) comes with MAC address
• Higher-level addresses can be statically or
dynamically configured
Transport
• IP address
• Statically configured, or dynamically with DHCP
Network • TCP port
• Pick a transient value, ex. HTTP src port
• … or a value agreed upon a priori, ex. HTTP dst port
Link layer such as 80
Dynamic Host Configuration Protocol
DHCP
disco
(broa ver
d cast)
arriving
endpoint o ffer
HC P
D
Host learns
IP address, DHCP DHCP server
Subnet mask, reque
(broa st
Gateway address, d cast)
DNS server(s),
and a lease time.
AC K
H C P
D
(2) Socket: the interface to applications
• Best-effort packet delivery is a clumsy abstraction
• Applications typically want higher-level abstractions
• Messages, uncorrupted data, reliable in-order delivery
User process User process
socket socket
Operating Operating
System System
• Applications communicate using “sockets”
• Stream socket: reliable stream of bytes (like a file)
• Message socket: unreliable message delivery
28
Two Basic Transport Features
• Demultiplexing: port numbers Server host 128.2.194.242
Service request for
Client host
128.2.194.242:80 Web server
(port 80)
(i.e., the Web server)
Client OS
Echo server
(port 7)
IP payload
29 detect corruption
Two Main Transport Layers
• User Datagram Protocol (UDP)
• Just provides demultiplexing and error detection
• Header fields: port numbers, checksum, and length
• Low overhead, good for query/response and multimedia
• Transmission Control Protocol (TCP)
• Adds support for a “stream of bytes” abstraction
• Retransmitting lost or corrupted data
• Putting out-of-order data back in order
• Preventing overflow of the receiver buffer
• Adapting the sending rate to alleviate congestion
• Higher overhead, good for most stateful applications
30
Socket: the interface to applications
User process User process
socket socket
Operating Operating
System System
32
(3) Distributed sharing of the network
• Best-effort network easily becomes overloaded
• No mechanism to “block” excess calls
• Instead excess packets are simply dropped
• Examples
• Shared Ethernet medium: frame collisions
• Ethernet switches and IP routers: full packet buffers
• Quickly leads to congestion collapse
“congestion
Increase in load that results in a
Useful work collapse” decrease in useful work done.
33
Load
Endpoints adjust to congestion
• End hosts adapt their sending rates: congestion control
• In response to network conditions
• Learning that the network is congested
• Shared Ethernet: carrier sense multiple access
• Seeing your own frame collide with others
• IP network: observing your end-to-end performance
• Packet delay or loss over the end-to-end path
• Adapting to congestion
• Slowing down the sending rate for the greater good
• Slow down too little: don’t effectively relieve congestion
34
• Slow down too much: lose application performance
Ethernet back-off mechanism
Loss
Window
halved
time
36 Other mechanisms: slow start, fast retransmit vs. timeout loss, etc.
Discussion
• What role should the network play in resource allocation?
• Explicit feedback to the endpoints?
• Enforcing an explicit rate allocation?
37