4th Edition: Chapter 1 - Technical University of Denmark

Download Report

Transcript 4th Edition: Chapter 1 - Technical University of Denmark

02220 Distributed Systems:
Computer Networking Basics
Alessio Di Mauro ([email protected])
Xenofon Fafoutis ([email protected])
Chapter 1
Introduction
Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Introduction 1-2
What’s the Internet: “nuts and bolts” view
 millions
PC
server
wireless
laptop
smartphone
of connected
computing devices:
 hosts = end systems
 running network apps
 communication
wireless
links
wired
links
links
 fiber, copper, radio,
satellite
global ISP
home
network
regional ISP
 Packet
router
switches: forward
packets (chunks of data)
 routers and switches
mobile network
institutional
network
Introduction 1-3
What’s a protocol?
human protocols:



“what’s the time?”
“I have a question”
introductions
… specific msgs sent
… specific actions taken
when msgs received, or
other events
network protocols:


machines rather than
humans
all communication activity
in Internet governed by
protocols
protocols define format, order
of msgs sent and received
among network entities,
and actions taken on msg
transmission, receipt
Introduction 1-4
What’s a protocol?
a human protocol and a computer network protocol:
Hi
TCP connection
request
Hi
TCP connection
response
Got the
time?
Get http://www.awl.com/kurose-ross
2:00
<file>
time
Introduction 1-5
A closer look at network structure:

network edge:




mobile network
hosts: clients and servers
servers often in data
centers
access networks, physical
media: wired, wireless
communication links
global ISP
home
network
regional ISP
network core:
 interconnected routers
 network of networks
institutional
network
Introduction 1-6
The network core


mesh of interconnected
routers
packet-switching: hosts
break application-layer
messages into packets
 forward packets from one
router to the next, across
links on path from source
to destination
Introduction 1-7
Protocol “layers”
Networks are complex,
with 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?
Introduction 1-8
Organization of air travel
ticket (purchase)
ticket (complain)
baggage (check)
baggage (claim)
gates (load)
gates (unload)
runway takeoff
runway landing
airplane routing
airplane routing
airplane routing

a series of steps
Introduction 1-9
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
Introduction 1-10
Why layering?
dealing with complex systems:

explicit structure allows identification,
relationship of complex system’s pieces
 layered reference model for discussion

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

layering disadvantages?
Introduction 1-11
Internet protocol stack

application: supporting network
applications
 FTP, SMTP, HTTP

transport: process-process data
transfer
 TCP, UDP

network: routing of datagrams
from source to destination
 IP, routing protocols

link: data transfer between
neighboring network elements
application
transport
network
link
physical
 Ethernet, 802.111 (WiFi), PPP

physical: bits “on the wire”
Introduction 1-12
ISO/OSI reference model
presentation: allow applications
to interpret meaning of data,
e.g., encryption, compression,
machine-specific conventions
 session: synchronization,
checkpointing, recovery of data
exchange
 Internet stack “missing” these
layers!

 these services, if needed, must be
implemented in application
 needed?
application
presentation
session
transport
network
link
physical
Introduction 1-13
Encapsulation
source
message
segment
M
Ht
M
datagram Hn Ht
M
frame
M
Hl Hn Ht
application
transport
network
link
physical
link
physical
switch
M
Ht
M
Hn Ht
M
Hl Hn Ht
M
destination
Hn Ht
M
application
transport
network
link
physical
Hl Hn Ht
M
network
link
physical
Hn Ht
M
router
Introduction 1-14
Chapter 2
Application Layer
Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith
Ross
Addison-Wesley
March 2012
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Application Layer 2-15
Some network apps







e-mail
web
text messaging
remote login
P2P file sharing
multi-user network games
streaming stored video
(YouTube, Hulu, Netflix)






voice over IP (e.g., Skype)
real-time video
conferencing
social networking
search
…
…
Application Layer 2-16
Creating a network app
write programs that:
 run on (different) end systems
 communicate over network
 e.g., web server software
communicates with browser
software
no need to write software for
network-core devices
 network-core devices do not
run user applications
 applications on end systems
allows for rapid app
development, propagation
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
Application Layer 2-17
Application architectures
possible structure of applications:
 client-server
 peer-to-peer (P2P)
Application Layer 2-18
Client-server architecture
server:



always-on host
permanent IP address
data centers for scaling
clients:

client/server



communicate with server
may be intermittently
connected
may have dynamic IP
addresses
do not communicate directly
with each other
Application Layer 2-19
P2P architecture




no always-on server
arbitrary end systems
directly communicate
peers request service from
other peers, provide service
in return to other peers
 self scalability – new
peers bring new service
capacity, as well as new
service demands
peers are intermittently
connected and change IP
addresses
 complex management
peer-peer
Application Layer 2-20
Processes communicating
process: program running
within a host


within same host, two
processes communicate
using inter-process
communication (defined by
OS)
processes in different hosts
communicate by exchanging
messages
clients, servers
client process: process that
initiates communication
server process: process that
waits to be contacted

aside: applications with P2P
architectures have client
processes & server
processes
Application Layer 2-21
Sockets


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 to deliver message to socket at
receiving process
application
process
socket
application
process
transport
transport
network
network
link
physical
Internet
link
controlled by
app developer
controlled
by OS
physical
Application Layer 2-22
Addressing processes



to receive messages,
process must have identifier
host device has unique 32bit IP address
Q: does IP address of host
on which process runs
suffice for identifying the
process?
 A: no, many processes
can be running on same
host


identifier includes both IP
address and port numbers
associated with process on
host.
example port numbers:
 HTTP server: 80
 mail server: 25

to send HTTP message to
gaia.cs.umass.edu web
server:
 IP address: 128.119.245.12
 port number: 80
Application Layer 2-23
App-layer protocol defines




types of messages
exchanged,
 e.g., request, response
message syntax:
 what fields in messages
& how fields are
delineated
message semantics
 meaning of information
in fields
rules for when and how
processes send & respond
to messages
open protocols:
 defined in RFCs
 allows for interoperability
 e.g., HTTP, SMTP
proprietary protocols:
 e.g., Skype
Application Layer 2-24
What transport service does an app need?
data integrity
 some apps (e.g., file transfer,
web transactions) require
100% reliable data transfer
 other apps (e.g., audio) can
tolerate some loss
timing
 some apps (e.g., Internet
telephony, interactive
games) require low delay
to be “effective”
throughput
 some apps (e.g.,
multimedia) require
minimum amount of
throughput to be
“effective”
 other apps (“elastic apps”)
make use of whatever
throughput they get
security
 encryption, data integrity,
…
Application Layer 2-25
Transport service requirements: common apps
application
data loss
throughput
file transfer
e-mail
Web documents
real-time audio/video
no loss
no loss
no loss
loss-tolerant
stored audio/video
interactive games
text messaging
loss-tolerant
loss-tolerant
no loss
elastic
no
elastic
no
elastic
no
audio: 5kbps-1Mbps yes, 100’s
video:10kbps-5Mbps msec
same as above
few kbps up
yes, few secs
elastic
yes, 100’s
msec
yes and no
time sensitive
Application Layer 2-26
Internet transport protocols services
TCP service:
UDP service:






reliable transport between
sending and receiving
process
flow control: sender won’t
overwhelm receiver
congestion control: throttle
sender when network
overloaded
does not provide: timing,
minimum throughput
guarantee, security
connection-oriented: setup
required between client and
server processes

unreliable data transfer
between sending and
receiving process
does not provide:
reliability, flow control,
congestion control,
timing, throughput
guarantee, security,
orconnection setup,
Q: why bother? Why is
there a UDP?
Application Layer 2-27
Internet apps: application, transport protocols
application
e-mail
remote terminal access
Web
file transfer
streaming multimedia
Internet telephony
application
layer protocol
underlying
transport protocol
SMTP [RFC 2821]
Telnet [RFC 854]
HTTP [RFC 2616]
FTP [RFC 959]
HTTP (e.g., YouTube),
RTP [RFC 1889]
SIP, RTP, proprietary
(e.g., Skype)
TCP
TCP
TCP
TCP
TCP or UDP
TCP or UDP
Application Layer 2-28
Chapter 3
Transport Layer
Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Transport Layer 3-29
Transport services and protocols



provide logical communication
between app processes
running on different hosts
transport protocols run in
end systems
 send side: breaks app
messages into segments,
passes to network layer
 rcv side: reassembles
segments into messages,
passes to app layer
more than one transport
protocol available to apps
 Internet: TCP and UDP
application
transport
network
data link
physical
application
transport
network
data link
physical
Transport Layer 3-30
Transport vs. network layer
network layer: logical
communication
between hosts
 transport layer:
logical
communication
between processes

 relies on, enhances,
network layer
services
household analogy:
12 kids in Ann’s house sending
letters to 12 kids in Bill’s
house:
 hosts = houses
 processes = kids
 app messages = letters in
envelopes
 transport protocol = Ann
and Bill who demux to inhouse siblings
 network-layer protocol =
postal service
Transport Layer 3-31
Multiplexing/demultiplexing
multiplexing at sender:
handle data from multiple
sockets, add transport header
(later used for demultiplexing)
demultiplexing at receiver:
use header info to deliver
received segments to correct
socket
application
application
P3
P1
P2
application
P4
transport
transport
network
transport
network
link
network
physical
link
link
physical
socket
process
physical
Transport Layer 3-32
How demultiplexing works

host receives IP datagrams
 each datagram has source IP
address, destination IP
address
 each datagram carries one
transport-layer segment
 each segment has source,
destination port number

host uses IP addresses &
port numbers to direct
segment to appropriate
socket
32 bits
source port #
dest port #
other header fields
application
data
(payload)
TCP/UDP segment format
Transport Layer 3-33
Connectionless demultiplexing

recall: created socket has
host-local port #:

DatagramSocket mySocket1
= new DatagramSocket(12534);

when host receives UDP
segment:
 checks destination port #
in segment
 directs UDP segment to
socket with that port #
recall: when creating
datagram to send into
UDP socket, must specify
 destination IP address
 destination port #
IP datagrams with same
dest. port #, but different
source IP addresses
and/or source port
numbers will be directed
to same socket at dest
Transport Layer 3-34
Connectionless demux: example
DatagramSocket
mySocket2 = new
DatagramSocket
(9157);
DatagramSocket
serverSocket = new
DatagramSocket
(6428);
application
application
P3
transport
DatagramSocket
mySocket1 = new
DatagramSocket
(5775);
application
P1
P4
transport
transport
network
network
link
network
link
physical
link
physical
physical
source port: 6428
dest port: 9157
source port: 9157
dest port: 6428
source port: 6428
dest port: 5775
source port: 5775
dest port: 6428
Transport Layer 3-35
Connection-oriented demux

TCP socket identified
by 4-tuple:





source IP address
source port number
dest IP address
dest port number
demux: receiver uses
all four values to direct
segment to appropriate
socket

server host may support
many simultaneous TCP
sockets:
 each socket identified by
its own 4-tuple

web servers have
different sockets for
each connecting client
Transport Layer 3-36
Connection-oriented demux: example
application
application
P4
P3
application
P5 P6
P2
transport
transport
transport
network
network
link
network
link
physical
link
physical
host: IP
address A
P3
server: IP
address B
source IP,port: B,80
dest IP,port: A,9157
source IP,port: A,9157
dest IP, port: B,80
three segments, all destined to IP address: B,
dest port: 80 are demultiplexed to different sockets
physical
source IP,port: C,5775
dest IP,port: B,80
host: IP
address C
source IP,port: C,9157
dest IP,port: B,80
Transport Layer 3-37
Connection-oriented demux: example
threaded server
application
application
application
P4
P3
P2
transport
transport
transport
network
network
link
network
link
physical
link
physical
host: IP
address A
server: IP
address B
source IP,port: B,80
dest IP,port: A,9157
source IP,port: A,9157
dest IP, port: B,80
P3
physical
source IP,port: C,5775
dest IP,port: B,80
host: IP
address C
source IP,port: C,9157
dest IP,port: B,80
Transport Layer 3-38
Chapter 4
Network Layer
Computer
Networking: A Top
Down Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Network Layer 4-39
IP addressing: introduction


IP address: 32-bit
223.1.1.1
identifier for host, router
interface
223.1.1.2
interface: connection
between host/router and
physical link
223.1.2.1
223.1.1.4
223.1.3.27
223.1.1.3
223.1.2.2
 router’s typically have
multiple interfaces
 host typically has one or
two interfaces (e.g., wired
Ethernet, wireless 802.11)

IP addresses associated
with each interface
223.1.2.9
223.1.3.1
223.1.3.2
223.1.1.1 = 11011111 00000001 00000001 00000001
223
1
1
1
Network Layer 4-40
Subnets
 IP
address:
subnet part - high order
bits
host part - low order
bits
 what
’s a subnet ?
device interfaces with
same subnet part of IP
address
can physically reach
each other without
intervening router
223.1.1.1
223.1.1.2
223.1.1.4
223.1.2.1
223.1.2.9
223.1.2.2
223.1.1.3
223.1.3.27
subnet
223.1.3.1
223.1.3.2
network consisting of 3 subnets
Network Layer 4-41
Subnets
223.1.1.0/24
223.1.2.0/24
recipe
 to determine the
subnets, detach each
interface from its host
or router, creating
islands of isolated
networks
 each isolated network
is called a subnet
223.1.1.1
223.1.1.2
223.1.1.4
223.1.2.1
223.1.2.9
223.1.2.2
223.1.1.3
223.1.3.27
subnet
223.1.3.1
223.1.3.2
223.1.3.0/24
subnet mask: /24
Network Layer 4-42
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
subnet
part
host
part
11001000 00010111 00010000 00000000
200.23.16.0/23
Network Layer 4-43
IP addresses: how to get one?
Q: How does a host get IP address?

hard-coded by system admin in a file
 Windows: 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”
Network Layer 4-44
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”
Network Layer 4-45