Review
- data Link layer: Aloha, Ethernet, switching, and 802.11
- network layer: IP and routing
- transport layer: TCP and reliable transmission (and flow and
congestion control)
- application layer: HTTP, DNS, bittorrent, and email
- networking principles: performance, error detection, layering, security
data link layer
- responsible for transferring data between directly connected systems
- "directly connected" extended to mean "connected by a network using
only link-layer headers" (circular definition)
- MAC layer is concerned with Medium Access Control, framing, and
identifying interfaces (MAC addresses)
- Ethernet switches learn on which port they receive data from a
sender
- and only forward data to that sender on that interface
- forwarding tables are similar to routing tables, but are
managed automatically
- all other packets are broadcast
- loops in the network can cause broadcast storms, unless
a spanning tree protocol is in use
Aloha
- two frequencies (channels), one from end systems to hub, one
for the hub to broadcast to the end systems
- end systems transmit when ready
- if hub broadcasts packet, assume all have received it
- otherwise, retransmit
- low efficiency, at best about 18% (36% for slotted Aloha)
- so only used when end system is unable to do carrier sensing
Ethernet
- header has destination address, source address, ethernet type
(x800 for IP packets, x806 for ARP packets)
- Carrier Sense Multiple Access with Collision Detection (CSMA/CD):
interface listens for carrier before transmitting, and can detect
collisions
- reliable, in-order delivery of packets if the transmission does
not cause more than 15 collisions
- binary exponential backoff for the first 10 transmissions
- Ethernet addresses are globally unique, used also for other
systems, e.g. 802.11
- Ethernet addresses have a 24-bit OUID and a 24-bit part
assigned by the organization
- range of speeds, so far, 10Mb/s, 100Mb/s, 1Gb/s, 10GB/s
- "plug and play"
802.11
- designed as a wireless equivalent to Ethernet
- Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA):
- Request to Send (RTS)/Clear to Send (CTS) exchange to reserve the
medium around both sender and receiver
- ACK to confirm receipt
- small data and broadcast data sent without RTS/CTS
- ESSID identifies network to connect to, not necessarily
the individual access point
- 802.11 header provides up to 4 addresses, to keep track of original
source and destination while intermediate hosts are relaying on a wired
or wireless mesh network
- encryption provided by WEP (very weak), WPA, or WPA2
Network Layer
- separate networks, identified by network part of the address
- network part of the address defined by netmask (CIDR) or class
- packet forwarding based on routing table
- routing protocol builds and maintains routing table
- end-to-end protocol requires participation from all
intermediate routers (or overlay network)
IP
- connectionless, best-effort, lightweight, "stateless" forwarding
- caching improves performance: ARP cache, route cache
- end-to-end: source address, destination address, protocol number
(1 for ICMP, 6 for TCP, 17 for UDP)
- hop-by-hop: TTL, checksum
- throughout: header length, version, total length
- fragmentation: packet ID, fragment offset, More Fragments and
Don't Fragment flags
- IPv6: larger addresses (128 bits, 16 bytes), fewer header fields,
constant header size, optional functionality shifted to extension headers
- multicast: leaf-initiated join, soft state is remembered as long as
it is refreshed frequently enough
Routing
- link-state (and flooding): OSPF
- distance-vector: RIP, variant in BGP
- Routing Information Protocol: Distance Vector with Split Horizon and
Poisoned Reverse, infinity is 16 hops
- Open Shortest Path First: Link State with flooding, areas used to
decrease the amount of information being distributed, ways of distributing
summary information. Backbone area connects to all other areas
- BGP: path-vector allows policy decisions, cost considers each
Autonomous System as one hop
- one Exterior Gateway Protocol (BGP), two Interior Gateway Protocols (IGPs)
Transport Layer
- assumes existence of unreliable, end-to-end network layer protocol
- demultiplexing to identify applications or services (TCP/UDP port numbers)
- reliable transmission can only be done end-to-end
- stop-and-wait protocol
- window-based flow control
- congestion control: assume data loss means congestion (safe assumption
even when not accurate) and Multiplicatively Decrease, while Additively
Increasing when no loss, AIMD
- UDP: source and destination port, length, checksum
TCP
- source and destination port, 32-bit sequence and acknowledgement,
header length, flags, window, checksum, urgent pointer
- state machine uses flags to keep track of three-way handshake
and closing exchange
- SYN to open, FIN to close (one side), RST to terminate, ACK to confirm
that the acknowledgment field is valid
- cumulative acks acknowledge all that has gone before
- three duplicate acks interpreted as a NAK
- Selective Acknowledgement (SACK) TCP header option
- window scaling options
- carefully tuned adaptive retransmission timer
- TCP is generally optimized for high performance, except
for congestion control
Application Layer
- many, many protocols
- have to solve all issues left unsolved at the lower layers,
e.g. security
- sometimes by providing an overlay network
- client-server or peer-to-peer architecture, or a mix
- functionality, even debuggability is more important than
efficiency, e.g. ASCII-based encodings
- generally interactive (telnet, ssh) or batch transfer (everything
else), though now also hybrid (e.g. AJAX)
HTTP
- client/server, ASCII encoded request and reply protocol over TCP
- header followed by empty line possibly followed by content, and
perhaps additional headers
- main HTTP request methods: GET, HEAD, POST
- response shows status code and readable explanation (similar to FTP)
- many fields allow much flexibility, e.g. languages, multimedia
formats, many different kinds of content
- cookies allow server to store state on client
- many applications built on top of this basic web mechanism
- URL includes DNS name, and system-dependent path
DNS
- Domain Name Service maps names to IP addresses
- request-reply client/server protocol, usually over UDP
- domain name is made up of labels separated by dots
- DNS and routing are essential for the functionality of the web and email
- record types include A, MX, NS
- recursive queries on behalf of requester, iterative queries: "go ask X"
Peer-to-peer data exchanges
- Bit-Torrent: data transfers from the "best" peer that has the data
- downloader becomes available as source
- data split into chunks, each chunk can be downloaded independently
- centralized trackers keep track of which node has which chunks
Electronic Mail
- distributed system using TCP, neither purely client-server nor
purely P2P
- transfer of text, and other media encoded using text
- email address includes system-dependent name @ DNS name
- DNS MX records often different from DNS A record
Networking Principles: Performance
- overall time to complete an operation matters to the user
- for some operations, latency is most important
- latency usually measured as the (average, minimum, or maximum)
round-trip time of small packets (lower latency than large packets)
- for other operations, throughput is most important
- latency measured as the maximum data per second
that can be sent, usually in large packets (lower overhead than
small packets)
- caching pervasive, makes testing harder
- DNS resolution can be a substantial component of a web access
Networking Principles: Error Detection
- parity, checksums, CRCs
- mathematically define which error patterns are detected
- efficient computation of error check code
- efficient verification of error check code
- forward error correction: n-bit-error detection,
m-bit-error correction, n > m
Networking Principles: Security
- encryption, authentication, integrity, intrusion prevention
- symmetric key protocols such as AES, fast, but require key
management
- public-key protocols such as RSA, slower, but only require
distribution of public keys
- SSL/TLS, WEP/WPA/WPA2, IPSec, SSH
the future
- when do you expect to see IPv6 deployed?
- when do you expect to be able to web surf at Waikiki beach? Other
beaches?
- which of facebook, youtube, twitter, and second life is your favorite?
- what is the next hot application?
- how many computers do you expect to have simultaneously connected
to the Internet at some point in the next 10 years?