Download CMPT 880: Internet Architectures and Protocols

Document related concepts

Net neutrality wikipedia , lookup

AppleTalk wikipedia , lookup

Peering wikipedia , lookup

Multiprotocol Label Switching wikipedia , lookup

Net neutrality law wikipedia , lookup

Distributed firewall wikipedia , lookup

TCP congestion control wikipedia , lookup

Asynchronous Transfer Mode wikipedia , lookup

Network tap wikipedia , lookup

Computer network wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Airborne Networking wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Zero-configuration networking wikipedia , lookup

IEEE 1355 wikipedia , lookup

Deep packet inspection wikipedia , lookup

Packet switching wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

UniPro protocol stack wikipedia , lookup

Internet protocol suite wikipedia , lookup

Net bias wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Transcript
School of Computing Science
Simon Fraser University
CMPT 880: Internet Architectures and Protocols
Instructor: Dr. Mohamed Hefeeda
1
Course Objectives
 Understand
 principles of designing and operating computer
networks
 structure and protocols of the Internet
 services that can/cannot be offered by the Internet
 Know how to
 analytically analyze performance of a system/protocol
 implement network protocols and applications
 And, more importantly, …
 Have fun!
2
Course Info
 Most of the course will be lectures given by the
instructor
 Last three weeks, each student presents at most one
chapter/paper
 Course web page
http://nsl.cs.surrey.sfu.ca/teaching/06/880/
Or access it from my web page:
http://www.cs.sfu.ca/~mhefeeda
3
Course Info: Textbooks and References
 All are on reserve in SFU Surrey Library
 Kurose and Rose, Computer Networking: A topdown Approach Featuring the Internet, 2005
 Background materials
 Ch 7: Multimedia Networking and QoS
 Hassan and Jain, High Performance TCP/IP
Networking, 2004
 Several chapters on analyzing TCP/IP in different
environments
 Stallings, High-speed Networks and Internets:
Performance and Quality of Service, 2002
 Three chapters on (basics of) probability and queuing
 Papers: will be posted on the course web page
4
Course Info: Grading
 Homework:
20%
 3 – 4 problem sets
 Projects:
30%
 3 projects; later two of them are group projects
 Class participation: 15%
 Ask and answer questions
 Present one chapter/paper
 Final exam:
35%
 Comprehensive
5
Course Info: Schedule

Schedule is posted on the course
web page
Let us quickly review it
6
Review of Basic Networking Concepts
7
Review of Basic Networking Concepts
 Internet structure
 Protocol layering and encapsulation
 Internet services and socket programming
 Network Layer
 Network types: Circuit switching, Packet switching
 Addressing, Forwarding, Routing
 Transport layer
 Reliability and congestion control
 TCP, UDP
 Link Layer
 Multiple Access Protocols
 Ethernet
8
The Internet
 Millions of hosts (end systems)
 Inter-connected, running
network apps
 Diverse communication links
router
server
workstation
mobile
local ISP
 fiber, copper, radio, satellite
regional ISP
 Routers
 forward packets
 Internet: “network of networks”
 loosely hierarchical
 Public, versus private intranet
company
network
9
“Cool” Internet appliances
Web-enabled toaster +
weather forecaster
IP picture frame
http://www.ceiva.com/
World’s smallest web server
http://www-ccs.cs.umass.edu/~shri/iPic.html
Internet phones
10
Internet structure: network of networks
 roughly hierarchical
 at center: “tier-1” ISPs (e.g., MCI, Sprint, AT&T, Cable and
Wireless), national/international coverage
 treat each other as equals
Tier-1
providers
interconnect
(peer)
privately
Tier 1 ISP
Tier 1 ISP
NAP
Tier-1 providers
also interconnect
at public network
access points
(NAPs)
Tier 1 ISP
11
Tier-1 ISP: e.g., Sprint
Sprint US backbone network
Seattle
Tacoma
DS3 (45 Mbps)
OC3 (155 Mbps)
OC12 (622 Mbps)
OC48 (2.4 Gbps)
POP: point-of-presence
to/from backbone
Stockton
…
…
Kansas City
.
…
Anaheim
peering
…
…
San Jose
Cheyenne
New York
Pennsauken
Relay
Wash. DC
Chicago
Roachdale
Atlanta
to/from customers
Fort Worth
Orlando
12
Internet structure: Tier-2 ISPs
 “Tier-2” ISPs: smaller (often regional) ISPs
 Connect to one or more tier-1 ISPs, possibly other tier-2
ISPs
Tier-2 ISP pays
tier-1 ISP for
connectivity to
rest of Internet
Tier-2 ISP is
customer of
tier-1 provider
Tier-2 ISP
Tier-2 ISP
Tier 1 ISP
Tier 1 ISP
Tier-2 ISP
NAP
Tier 1 ISP
Tier-2 ISPs
also peer
privately with
each other,
interconnect
at NAP
Tier-2 ISP
Tier-2 ISP
13
Internet structure: Tier-3 ISPs
 “Tier-3” ISPs and local ISPs
 last hop (“access”) network (closest to end systems)
local
ISP
Local and tier3 ISPs are
customers of
higher tier
ISPs
connecting
them to rest
of Internet
Tier 3
ISP
Tier-2 ISP
local
ISP
local
ISP
local
ISP
Tier-2 ISP
Tier 1 ISP
Tier 1 ISP
Tier-2 ISP
local
local
ISP
ISP
NAP
Tier 1 ISP
Tier-2 ISP
local
ISP
Tier-2 ISP
local
ISP
14
Internet structure: packet journey
 a packet passes through many networks!
local
ISP
Tier 3
ISP
Tier-2 ISP
local
ISP
local
ISP
local
ISP
Tier-2 ISP
Tier 1 ISP
Tier 1 ISP
Tier-2 ISP
local
local
ISP
ISP
NAP
Tier 1 ISP
Tier-2 ISP
local
ISP
Tier-2 ISP
local
ISP
15
A snapshot of the Internet in 1999 showing major ISPs
16
Review of Basic Networking Concepts
 Internet structure
 Protocol layering and encapsulation
 Internet services and socket programming
 Network Layer
 Network types: Circuit switching, Packet switching
 Addressing, Forwarding, Routing
 Transport layer
 Reliability and congestion control
 TCP, UDP
 Link Layer
 Multiple Access Protocols
 Ethernet
17
Protocol Layers
Networks are complex!
 many “pieces”:
 hosts
 routers
 links of various
media
 applications
 protocols
 hardware, software
Question:
Is there any hope of
organizing structure of
network?
Or at least our discussion of
networks?
18
Layering of Airline Functionality
ticket (purchase)
ticket (complain)
ticket
baggage (check)
baggage (claim
baggage
gates (load)
gates (unload)
gate
runway (takeoff)
runway (land)
takeoff/landing
airplane routing
airplane routing
airplane routing
departure
airport
airplane routing
airplane routing
intermediate air-traffic
control centers
arrival
airport
Layers: each layer implements a service
 via its own internal-layer actions
 relying on services provided by layer below
19
Why layering?
Dealing with complex systems:
 explicit structure allows identification,
relationship of complex system’s pieces
 modularization eases maintenance, updating of
system
change of implementation of layer’s service
transparent to rest of system
e.g., change in gate procedure doesn’t affect
rest of system
 What is the downside of layering?
20
Internet protocol stack
 application: supporting network
applications
 FTP, SMTP, HTTP
 transport: host-host data transfer
 TCP, UDP
 network: routing of datagrams
from source to destination
 IP, routing protocols
 link: data transfer between
neighboring network elements
 PPP, Ethernet
application
transport
network
link
physical
 physical: bits “on the wire”
21
source
message
segment Ht
datagram Hn Ht
frame
Hl Hn Ht
M
M
M
M
Encapsulation
application
transport
network
link
physical
Hl Hn Ht
M
link
physical
Hl Hn Ht
M
switch
destination
M
Ht
M
Hn Ht
Hl Hn Ht
M
M
application
transport
network
link
physical
Hn Ht
Hl Hn Ht
M
M
network
link
physical
Hn Ht
Hl Hn Ht
M
M
router
22
Review of Basic Networking Concepts
 Internet structure
 Protocol layering and encapsulation
 Internet services and socket programming
 Network Layer
 Network types: Circuit switching, Packet switching
 Addressing, Forwarding, Routing
 Transport layer
 Reliability and congestion control
 TCP, UDP
 Link Layer
 Multiple Access Protocols
 Ethernet
23
Internet Services
 View the Internet as a communication infrastructure
that provides services to apps
 Web, email, games, e-commerce, file sharing, …
 Two communication services
 Connectionless unreliable
 Connection-oriented reliable
24
Internet Services
 Connection-oriented
 Prepare for data transfer
ahead of time
 establish connection 
set up state in the two
communicating hosts
 Usually comes with
reliability, flow and
congestion control
 TCP: Transmission
Control Protocol
 Connectionless
 No connection set up,
simply send
 Faster, less overhead
 No reliability, flow control,
or congestion control
 UDP: User Datagram
Protocol
How can we access these services?
25
Network (Socket) Programming
 Process sends/receives
messages to/from its socket
 Socket analogous to door
 sending process shoves
message out door
 sending process relies on
transport infrastructure
on other side of door
which brings message to
socket at receiving
process
host or
server
host or
server
process
controlled by
app developer
process
socket
socket
TCP with
buffers,
variables
Internet
TCP with
buffers,
variables
controlled
by OS
 Socket is the interface (API) between application and transport
layer
26
Addressing Processes
 For a process to receive
messages, it must have an
identifier
 A host has a unique32-bit
IP address
 Q: does the IP address of
the host on which the
process runs suffice for
identifying the process?
 A: No, many processes can
be running on same host 
 We use ports
 Process is identified by:
 IP address,
 Transport protocol, and
 Port number
 Example port numbers:
 HTTP server: 80 (TCP)
 Mail server: 25 (TCP)
27
Socket Programming
 Socket API
 introduced in BSD 4.1 UNIX, 1981
 explicitly created, used, released by apps
 client/server paradigm
 provides two services
• reliable, byte stream-oriented
• unreliable datagram
28
Socket Programming using TCP
 TCP service: reliable transfer of bytes from one
process to another
 virtual pipe between sender and receiver
controlled by
application
developer
controlled by
operating
system
process
process
socket
TCP with
buffers,
variables
host or
server
internet
socket
TCP with
buffers,
variables
controlled by
application
developer
controlled by
operating
system
host or
server
29
Socket Programming using TCP
Server (running on hostid)
Client
create socket,
port=x, for
incoming request:
welcomeSocket =
ServerSocket()
TCP
wait for incoming
connection request connection
connectionSocket =
welcomeSocket.accept()
read request from
connectionSocket
write reply to
connectionSocket
close
connectionSocket
setup
create socket,
connect to hostid, port=x
clientSocket =
Socket()
send request using
clientSocket
read reply from
clientSocket
close
clientSocket
30
Socket Programming using TCP
 Server process must first be running, and
 creates a socket (door) that welcomes client’s contact,
then wait
 Client contacts server by creating local TCP socket using IP
address, port number of server process
 When client creates socket
 client TCP establishes connection to server TCP
 When contacted by client
 server TCP creates new socket for server process to
communicate with client
• allows server to talk with multiple clients
• source port numbers and IPs used to distinguish clients
31
Socket programming using UDP
 UDP Service: unreliable transfer of groups of
bytes (datagrams) between client and server
 no connection between client and server
 no handshaking
 sender explicitly attaches IP address and port of
destination to each packet
 server must extract IP address, port of sender from
received packet
 transmitted data may be received out of order, or lost
32
Socket Programming using UDP
Server (running on hostid)
create socket,
port=x, for
incoming request:
serverSocket =
DatagramSocket()
read request from
serverSocket
write reply to
serverSocket
specifying client
host address,
port number
Client
create socket,
clientSocket =
DatagramSocket()
Create datagram (hostid,port=x,data)
send datagram request
using clientSocket
read reply from
clientSocket
close
clientSocket
33
Review of Basic Networking Concepts
 Internet structure
 Protocol layering and encapsulation
 Internet services and socket programming
 Network Layer
 Network types: Circuit switching, Packet switching
 Addressing, Forwarding, Routing
 Transport layer
 Reliability and congestion control
 TCP, UDP
 Link Layer
 Multiple Access Protocols
 Ethernet
34
The Network Core
 Mesh of interconnected
routers
 The fundamental question:
how is data transferred
through net?
 circuit switching:
dedicated circuit per call:
telephone net
 packet-switching: data
sent thru net in discrete
“chunks”
35
Network Core: Circuit Switching
 Network resources (e.g., bandwidth) divided into
“pieces” using
 Frequency division multiplexing (FDM)
 Time division multiplexing (TDM)
 Pieces allocated to “calls” (connections)
  guaranteed performance
 Resource piece idle if not used by owning call
 no sharing
 Connection setup is required
 Examples
 (Traditional) Telephone network
36
Circuit Switching: Dedicated Circuits
37
Network Core: Packet Switching
each end-end data stream
divided into packets
resource contention:
 packets from different users
share network resources
 aggregate resource
demand can exceed
amount available
 each packet uses full link
bandwidth
 congestion: packets
queue, wait for link use
 resources used as needed
 store and forward: packets
move one hop at a time
 Node receives complete packet
before forwarding
Bandwidth division into “pieces”
Dedicated allocation
Resource reservation
38
Packet Switching: Statistical Multiplexing
10 Mb/s
Ethernet
A
B
statistical multiplexing
C
1.5 Mb/s
queue of packets
waiting for output
link
D
E
Sequence of A & B packets does not have fixed pattern, shared on
demand  statistical multiplexing
In contrast, in TDM each host gets same slot in revolving TDM
frame
39
Packet Switching: Efficiency
Packet switching allows more users to use network!
 1 Mb/s link
 each user:
 100 kb/s when “active”
 active 10% of time
 circuit-switching:
 10 users
N users
1 Mbps link
 packet switching:
 with 35 users,
probability > 10 active
less than 0 .0004
Q: how did we get value 0.0004?
40
Packet Switching
 Advantages
 no call setup  simpler
 resource sharing (statistical multiplexing) 
• better resource utilization
• more users or faster transfer (a single user can use
entire bw)
• Well suited for bursty traffic (typical)
 Disadvantages
 Congestion may occur 
• packet delay and loss
• need protocols to control congestion and ensure
reliable data transfer
41
Packet Switching: Two Classes
 Datagram network
 Example: The Internet
 Virtual-circuit network
 Examples: ATM (Asynchronous Transfer Mode), frame
relay, X.25
42
Packet-switched Datagram Networks
 no call setup at network layer
 routers: no state about end-to-end connections
 no network-level concept of “connection”
 packets forwarded using destination host address
 packets between same source-dest pair may take different
paths
application
transport
network
data link 1. Send data
physical
application
transport
2. Receive data network
data link
physical
43
Packet-switched VC Networks
 Source-to-dest path behaves much like telephone circuit”
  performance-wise
 connection setup, teardown for each call before data can
flow
 each packet carries VC identifier (not destination address)
 every router on source-dest path maintains state for each
passing connection
 link, router resources (bandwidth, buffers) may be allocated
to VC
 Examples:
 ATM (Asynchronous Transfer Mode), frame relay, X.25
44
VC Networks: Connection Setup
 Signaling protocols are used to
 setup, maintain, and teardown VCs
 Note: not used in the current Internet
application
transport 5. Data flow begins
network 4. Call connected
data link 1. Initiate call
physical
6. Receive data application
3. Accept call transport
2. incoming call network
data link
physical
45
VC Networks: VC Implementation
 A VC consists of:
1. Path from source to destination
2. VC numbers, one number for each link along path
3. Entries in forwarding tables in routers along path
 Packet belonging to VC carries same VC
number
 VC number must be changed on each link
 New VC number comes from forwarding table
46
VC Networks: Forwarding table
VC number
22
12
1
Forwarding table in
northwest router:
Incoming interface
1
2
3
1
…
2
32
3
interface
number
Incoming VC #
12
63
7
97
…
Outgoing interface
3
1
2
3
…
Outgoing VC #
22
18
17
87
…
Each routers maintains connection state information!
47
ATM vs. Internet: QoS
Network
Architecture
Internet
Service
Model
Guarantees ?
Congestion
Bandwidth Loss Order Timing feedback
best effort none
ATM
CBR
ATM
VBR
ATM
ABR
ATM
UBR
constant
rate
guaranteed
rate
guaranteed
minimum
none
no
no
no
yes
yes
yes
yes
yes
yes
no
yes
no
no (inferred
via loss)
no
congestion
no
congestion
yes
no
yes
no
no
48
Network Taxonomy
Telecommunication
networks
Circuit-switched
networks
FDM
TDM
Packet-switched
networks
Networks
with VCs
Datagram
Networks
49
Review of Basic Networking Concepts
 Internet structure
 Protocol layering and encapsulation
 Internet services and socket programming
 Network Layer
 Network types: Circuit switching, Packet switching
 Addressing, Forwarding, Routing
 Transport layer
 Reliability and congestion control
 TCP, UDP
 Link Layer
 Multiple Access Protocols
 Ethernet
50
Network Layer
 Network layer protocols in
every host and router
 Network layer’s goal
 transport data from
sending host to receiving
host
application
transport
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
 We focus on datagram
networks (Internet)
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
network
data link
physical
application
transport
network
data link
physical
51
Network Layer in the Internet
Host, router network layer functions:
Transport layer: TCP, UDP
Network
layer
IP protocol
•addressing conventions
•datagram format
•packet handling conventions
Routing protocols
•path selection
•RIP, OSPF, BGP
forwarding
table
ICMP protocol
•error reporting
•router “signaling”
Link layer
physical layer
52
Routing vs. Forwarding
 Routing
 determine route taken by
packets from source to
destination
 Routing algorithms, e.g.,
RIP, OSPF, BGP
 Forwarding
 move packets from
router’s input to
appropriate output
 use forwarding table
populated by routing
algorithm
routing algorithm
local forwarding table
header value output link
0100
0101
0111
1001
3
2
2
1
value in arriving
packet’s header
0111
1
3 2
 E.g., IP forwarding
function
53
IP Datagram Format
IP protocol version
number
header length
(bytes)
Provides some QoS
max number
remaining hops
(decremented at
each router)
upper layer protocol
to deliver payload to
how much overhead
with TCP?
 20 bytes of TCP
 20 bytes of IP
32 bits
type of
ver head.
len service
length
fragment
16-bit identifier flgs
offset
upper
time to
Internet
layer
live
checksum
total datagram
length (bytes)
for
fragmentation/
reassembly
32 bit source IP address
32 bit destination IP address
Options (if any)
data
(variable length,
typically a TCP
or UDP segment)
E.g. timestamp,
record route
taken, specify
list of routers
to visit.
 = 40 bytes + app
layer overhead
IP ver 4.0
54
IP Addressing: Introduction
 IP address:
 32-bit identifier for each host, router network interface
 Represented in Dotted-decimal notation
11011111 00000001 00000001 00000001
223
1
1
1
223.1.1.1
55
IP Addressing
 Network interface:




connection between host/router and physical link
routers typically have multiple interfaces
host typically has one interface
Unique IP addresses associated with each interface
223.1.1.1
223.1.2.1
How do we assign IPs?
223.1.1.2
223.1.1.4
223.1.1.3
223.1.2.9
223.1.3.27
223.1.2.2
Divide network into subnets,
each has a common ID
223.1.3.1
223.1.3.2
56
223.1.1.0/24
Subnets
223.1.2.0/24
 Subnet is:
 a group of devices that can
reach each other without
intervening router
 identified by high order bits of
IP addresses
11011111 00000001 00000001 00000001
223.1.3.0/24
Subnet ID
Host ID
223.1.1.0/24
/24: # bits in subnet portion of address, subnet mask
57
Subnets
 How many subnets?
223.1.1.1
223.1.9.2
 Recipe:
 Each isolated network
is a subnet
223.1.1.4
223.1.1.3
 6 subnets
 detach each interface
from its host or router,
creating isolated
networks
223.1.1.2
223.1.7.0
223.1.9.1
223.1.7.1
223.1.8.1
223.1.8.0
223.1.3.27
223.1.2.6
223.1.2.1
223.1.2.2
223.1.3.1
223.1.3.2
58
IP Addressing: CIDR
 CIDR: Classless InterDomain Routing
 subnet portion of address of arbitrary length
 address format: a.b.c.d/x, where x is # bits in subnet portion of
address
 Old Classful Addressing:
 Subnet length had to be /8 (class A), /16 (class B), /24 (class C)
 Why CIDR?
 Finer control over address allocation  reduce waste of
addresses
 Ex: company with 2000 machines would have to get class B,
wasting 63,000+ addresses
subnet
part
host
part
11001000 00010111 00010000 00000000
200.23.16.0/23
59
IP Addresses: How to Get One?
Q: How does host get IP address?
 hard-coded by system admin in a file
 WIN: control-panel->network->configuration->tcp/ip>properties
 UNIX: /etc/rc.config
 DHCP: Dynamic Host Configuration Protocol: dynamically
get address from as server
 “plug-and-play”
60
IP Addresses: How to Get One?
Q: How does network get subnet part of IP addr?
A: gets allocated portion of its provider ISP’s address
space
ISP's block
11001000 00010111 00010000 00000000
200.23.16.0/20
Organization 0
Organization 1
Organization 2
...
11001000 00010111 00010000 00000000
11001000 00010111 00010010 00000000
11001000 00010111 00010100 00000000
…..
….
200.23.16.0/23
200.23.18.0/23
200.23.20.0/23
….
Organization 7
11001000 00010111 00011110 00000000
200.23.30.0/23
61
Hierarchical Addressing: Route Aggregation
Hierarchical addressing allows efficient advertisement of routing
information:
Organization 0
200.23.16.0/23
Organization 1
200.23.18.0/23
Organization 2
200.23.20.0/23
Organization 7
.
.
.
.
.
.
Fly-By-Night-ISP
“Send me anything
with addresses
beginning
200.23.16.0/20”
Internet
200.23.30.0/23
ISPs-R-Us
“Send me anything
with addresses
beginning
199.31.0.0/16”
62
IP Addressing: the last word...
Q: How does an ISP get block of addresses?
A: ICANN: Internet Corporation for Assigned Names and
Numbers
 allocates addresses
 manages DNS
 assigns domain names, resolves disputes
63