EE 122: Introduction To Communication Networks

Download Report

Transcript EE 122: Introduction To Communication Networks

Networks & Protocols
EE 122: Intro to Communication Networks
Fall 2010 (MW 4-5:30 in 101 Barker)
Scott Shenker
TAs: Sameer Agarwal, Sara Alspaugh, Igor Ganichev, Prayag Narula
http://inst.eecs.berkeley.edu/~ee122/
Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson
and other colleagues at Princeton and UC Berkeley
1
TA: Sara Alspaugh
• Taking over Igor’s section
• Will post office hours, etc.
2
Goals for Today’s Class
• Type of Networks
– And the key concept of multiplexing
• What’s a Protocol?
3
Postal System
• Write address
• Put stamp
• Close envelop
• Verify postage
• “Route” letter
Take letter to
local post office
Drop letter
Take letter to
destination’s
postal office
• Check address
• Open envelope
Take letter to
destination
Check
destination
address
4
Other Information Networks
Sending messages by birds
Fire signals
5
Other Networks
6
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
7
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
Broadcast
Communication
Network
8
Broadcast Communication Networks
• Information transmitted by any node is
received by every other node in the network
– Usually only in LANs (Local Area Networks)
 E.g., WiFi, Ethernet (classical, but not current)
 E.g., lecture!
• What problems does this raise?
• Problem #1: limited range (the killer)
• Problem #2: privacy of communication
• Problem #3: coordinating access to the shared
communication medium (Multiple Access
Problem)
9
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
Switched
Communication
Network
Broadcast
Communication
Network
10
Switched Communication Networks
• Information transmitted along a path of
intermediary nodes
– “switches” or “routers”
• Each switch acts as a small switchboard
– Information comes in on one link
– Switch directs it out some other link
• Basic issue: how do the switches figure out the
next hop along the path?
11
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
Switched
Communication
Network
Broadcast
Communication
Network
Circuit-Switched
Communication
Network
12
Circuit Switching (e.g., Phone Network)
• Establish: source creates circuit to destination
– Nodes along the path store connection info
– Nodes generally reserve resources for the connection
– If circuit not available: “Busy signal”
• Transfer: source sends data over the circuit
– No destination address, since nodes know path
• Teardown: source tears down circuit when done
13
Circuit Switching
• Node (switch) in a circuit switching network
incoming links
Node
outgoing links
How does the node connect the incoming link to
the outgoing?
14
Telephone Network
• Alexander Graham Bell
– 1876: Demonstrates the telephone at US
Centenary Exhibition in Philadelphia
Circuit Switching With Human Operator
16
Telephone Network
• Almon Brown Strowger (1839 - 1902)
– 1889: Invents the “girl-less, cuss-less” telephone system
-- the mechanical switching system
Timing in Circuit Switching
Host 1
Switch 1
Switch 2
Host 2
time
18
Timing in Circuit Switching
Host 1
Circuit
Establishment
Switch 1
Switch 2
Host 2
propagation delay
between Host 1
and Switch1
time
19
Timing in Circuit Switching
Host 1
Switch 1
Switch 2
Host 2
Transmission delay
Circuit
Establishment
propagation delay
between Host 1
and Switch1
time
20
Timing in Circuit Switching
Host 1
Switch 1
Switch 2
Host 2
Transmission delay
Circuit
Establishment
propagation delay
between Host 1
and Switch1
time
21
Timing in Circuit Switching
Host 1
Switch 1
Switch 2
Host 2
Transmission delay
Circuit
Establishment
propagation delay
between Host 1
and Switch1
propagation delay
between Host 1
and Host 2
time
22
Timing in Circuit Switching
Host 1
Switch 1
Switch 2
Host 2
Transmission delay
propagation delay
between Host 1
and Switch1
Circuit
Establishment
propagation delay
between Host 1
and Host 2
Transfer
Information
time
23
Timing in Circuit Switching
Host 1
Switch 1
Switch 2
Host 2
Transmission delay
propagation delay
between Host 1
and Switch1
Circuit
Establishment
propagation delay
between Host 1
and Host 2
Transfer
Information
time
Circuit
Teardown
24
Circuit Switching
• Node (switch) in a circuit switching network
incoming links
Node
outgoing links
How do the black and orange circuits share the
outgoing link?
25
Circuit Switching: Multiplexing a Link
– Each circuit allocated
certain time slots
time
• Frequency-division
– Each circuit allocated
certain frequencies
frequency
• Time-division
time
26
Time-Division Multiplexing/Demultiplexing
Frames
Slots = 0 1 2 3 4 5
0 1 2 3 4 5
• Time divided into frames; frames into slots
• Relative slot position inside a frame determines to which
conversation data belongs
– E.g., slot 0 belongs to orange conversation
• Requires synchronization between sender and receiver—
surprisingly non-trivial!
• In case of non-permanent conversations
– Need to dynamically bind a slot to a conversation
• If a conversation does not use its circuit the capacity is lost!
27
5 Minute Break
Questions Before We Proceed?
28
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
Switched
Communication
Network
Circuit-Switched
Communication
Network
Broadcast
Communication
Network
Packet-Switched
Communication
Network
29
Packet Switching
• Data sent as chunks of formatted bit-sequences (Packets)
• Packets have following structure:
Header
Data
Trailer
(sometimes)
 Header and Trailer carry control information
(e.g., destination address, checksum)
• Each packet traverses the network from node to node
along some path (Routing) based on header info.
• Usually, once a node receives the entire packet, it stores it
(hopefully briefly) and then forwards it to the next node
(Store-and-Forward Networks)
30
Packet Switching
• Node in a packet switching network
incoming links
Node
outgoing links
Memory
31
Packet Switching: Multiplexing/Demultiplexing
• Data from any conversation can be transmitted at any
given time
– Single conversation can use the entire link capacity if it is alone
• How to tell them apart?
– Use meta-data (header) to describe data
32
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
Switched
Communication
Network
Circuit-Switched
Communication
Network
Broadcast
Communication
Network
Packet-Switched
Communication
Network
Datagram
Network
33
Datagram Packet Switching
• Each packet is independently switched
– Each packet header contains full destination address
• No resources are pre-allocated (reserved) in
advance
• Leverages “statistical multiplexing” (or stat-muxing)
– Gambling that packets from different conversations won’t
all arrive at the same time, so we don’t need enough
capacity for all of them at their peak transmission rate
– Assuming independence of traffic sources, can compute
probability that there is enough capacity
• Example: IP networks; postal system
34
Timing of Datagram Packet Switching
Host 1
Node 1
Packet 1
Node 2
Host 2
propagation
delay between
Host 1 and
Node 1
35
Timing of Datagram Packet Switching
Host 1
transmission
time of Packet 1
at Host 1
Node 1
Packet 1
Node 2
Host 2
propagation
delay between
Host 1 and
Node 1
36
Timing of Datagram Packet Switching
Host 1
transmission
time of Packet 1
at Host 1
Node 1
Packet 1
Host 2
Node 2
propagation
delay between
Host 1 and
Node 1
Packet 1
processing
delay of
Packet 1 at
Node 2
Packet 1
37
Timing of Datagram Packet Switching
Host 1
transmission
time of Packet 1
at Host 1
Node 1
Packet 1
Host 2
Node 2
propagation
delay between
Host 1 and
Node 1
Packet 2
Packet 1
Packet 3
processing
delay of
Packet 1 at
Node 2
Packet 2
Packet 3
Packet 1
Packet 2
Packet 3
38
Datagram Packet Switching
Host C
Host D
Host A
Node 1
Node 2
Node 3
Node 5
Host B
Node 6
Node 7
Host E
Node 4
39
Datagram Packet Switching
Host C
Host D
Host A
Node 1
Node 2
Node 3
Node 5
Host B
Node 6
Node 7
Host E
Node 4
40
Datagram Packet Switching
Host C
Host D
Host A
Node 1
Node 2
Node 3
Node 5
Host B
Node 6
Node 7
Host E
Node 4
41
Taxonomy of Communication Networks
• Communication networks can be classified based on
the way in which the nodes exchange information:
Communication
Network
Switched
Communication
Network
Circuit-Switched
Communication
Network
Broadcast
Communication
Network
Packet-Switched
Communication
Network
Datagram
Network
A hybrid of circuits and
packets; headers include a
“circuit identifier” established
during a setup phase
Virtual Circuit Network
42
Advantages of Circuit Switching
• Guaranteed bandwidth
– Predictable communication performance
– Not “best-effort” delivery with no real guarantees
• Simple abstraction
– Reliable communication channel between hosts
– No worries about lost or out-of-order packets
• Simple forwarding
– Forwarding based on time slot or frequency
– No need to inspect a packet header
• Low per-packet overhead
– Forwarding based on time slot or frequency
– No IP (and TCP/UDP) header on each packet
43
Disadvantages of Circuit Switching
• Wasted bandwidth
– Bursty traffic leads to idle connection during silent period
– Unable to achieve gains from “statistical multiplexing”
• Blocked connections
– Connection refused when resources are not sufficient
– Unable to offer “okay” service to everybody
• Connection set-up delay
– No communication until the connection is set up
– Unable to avoid extra latency for small data transfers
• Network state
– Network nodes must store per-connection information
– Unable to avoid per-connection storage and state
– This makes failures more disruptive!
44
Packet-Switching vs. Circuit-Switching
• Performance advantage of packet-switching over circuit
switching: Exploitation of statistical multiplexing
• Reliability advantage: since routers don’t know about
individual conversations, when a router or link fails, it’s:
Easy to fail over to a different path
• Deployability advantage: easier for different parties to link
their networks together because they’re not promising to
reserve resources for one another
• Disadvantage: packet-switching must handle congestion
– More complex routers (more buffering, sophisticated dropping)
– Harder to provide good network services (e.g., delay and
bandwidth guarantees)
45
Combinations
• Can a packet switched network run over a circuitswitched one?
• Can a circuit-switched network run over a packetswitched one?
46
What kinds of networks are these?
47
Postal System
• Write address
• Put stamp
• Close envelop
• Verify postage
• “Route” letter
Take letter to
local post office
Drop letter
Take letter to
destination’s
postal office
• Check address
• Open envelope
Take letter to
destination
Check
destination
address
48
Other Information Networks
Sending messages by birds
Fire signals
49
Other Networks
50
Questions?
51
What Is A Protocol?
• A protocol is an agreement on how to
communicate
• Includes syntax and semantics
– How a communication is specified & structured
 Format, order messages are sent and received
– What a communication means
 Actions taken when transmitting, receiving, or when a timer
expires
52
Examples of Protocols in Human Interactions
•
Telephone
1.
2.
3.
4.
5.
6.
(Pick up / open up the phone.)
Listen for a dial tone / see that you have service.
Dial.
Should hear ringing …
Callee: “Hello?”
Caller: “Hi, it’s Alice ….”
Or: “Hi, it’s me” ( what’s that about?)
7. Caller: “Hey, do you think … blah blah blah …” pause
8. Callee: “Yeah, blah blah blah …” pause
53
Examples of Protocols in Human Interactions
•
Asking a question
1. Raise your hand.
2. Wait to be called on.
3. Or: wait for speaker to pause and vocalize
54
Example: HyperText Transfer Protocol
GET /courses/archive/spring06/cos461/ HTTP/1.1
Host: www.cs.princeton.edu
Request
User-Agent: Mozilla/4.03
CRLF
HTTP/1.1 200 OK
Date: Mon, 6 Feb 2006 13:09:03 GMT
Server: Netscape-Enterprise/3.5.1
Last-Modified: Mon, 6 Feb 2006 11:12:23 GMT
Response Content-Length: 21
CRLF
Site under construction
55
Example: The Internet Protocol (IP)
• Problem:
– Many different network technologies
– e.g., Ethernet, Token Ring, ATM, Frame Relay, etc.
– How can you hook them together?
 n x n translations?
• IP was invented to glue them together
– n translations
– Minimal requirements (datagram)
• The Internet is founded on IP
– “IP over everything”
56
What does an internet protocol do?
• What would the protocol need to communicate?
57
Example: IP Packet
4-bit
4-bit Header
8-bit Type of
Version Length Service (TOS)
16-bit Total Length (Bytes)
16-bit Identification
3-bit
13-bit Fragment Offset
Flags
8-bit Time to
Live (TTL)
8-bit Protocol
16-bit Header Checksum
20-byte
header
32-bit Source IP Address
32-bit Destination IP Address
Options (if any)
Payload
58
Which fields are critical?
• IPv6 kept:
– Addresses, payload length, hop limit, traffic class
• IPv6 dropped:
– Header length, total length, identification, flags
– Fragmentation, protocol, header checksum
• IPv6 added:
– Next header
– Flow label
59
IP: “Best-Effort” Packet Delivery
• Datagram packet switching
– Send data in packets
– Header with source & destination address
• Service it provides:
– Packets may be lost
– Packets may be corrupted
– Packets may be delivered out of order
source
destination
IP network
60
Example: Transmission Control Protocol
• Communication service
– Ordered, reliable byte stream
– Simultaneous transmission in both directions
• Key mechanisms at end hosts
–
–
–
–
Retransmit lost and corrupted packets
Discard duplicate packets and put packets in order
Flow control to avoid overloading the receiver buffer
Congestion control to adapt sending rate to network
load
TCP connection
source
network
destination
61
Protocol Standardization
• Ensure communicating hosts speak the same
protocol
– Standardization to enable multiple implementations
– Or, the same folks have to write all the software
• Standardization: Internet Engineering Task Force
– Based on working groups that focus on specific issues
– Produces “Request For Comments” (RFCs)
 Promoted to standards via rough consensus and running code
– IETF Web site is http://www.ietf.org
– RFCs archived at http://www.rfc-editor.org
• De facto standards: same folks writing the code
– P2P file sharing, Skype, <your protocol here>…
62
Summary
• Types of communication networks
– Broadcast, circuit-switched, packet-switched
– Advantages & disadvantages of each
• Protocols: agreement on how to communicate
– For networks, often requires formal standardization
63
Next Lecture(s)
• Holiday on Monday
• Sockets on Wednesday
– HW #1 assigned on Wednesday
• If you haven’t already:
– Pick up class computer account forms
– Take the survey
– Join the mailing list
• Office hours: I will hang around after class and
then will move back to Soda when no one else is
waiting (or they kick me out)
64