Académique Documents
Professionnel Documents
Culture Documents
Distributed Systems
Modes of connection
Circuit-switched
dedicated path
guaranteed (fixed) bandwidth
[almost] constant latency
For computers:
Packet-switched
Page 2
shared connection
data is broken into chunks called packets
each packet contains destination address
available bandwidth channel capacity
variable latency
Page 3
Protocols
Page 4
Protocols
Exist at different levels
understand format of
address and how to
compute checksum
different wavelengths
versus
request web page
Page 5
Page 6
Layering
Layering
Most popular model of guiding
(not specifying) protocol layers is
Page 7
Page 8
Physical
Data Link
Physical
Page 9
Page 10
Provides a consistent
interface for end-to-end
(application-to-application)
communication. Manages
flow control.
Transport
Network
Network
Data Link
Data Link
Physical
Physical
Network interface is
similar to a mailbox.
Services to coordinate
dialogue and manage data
exchange.
5
Session
Transport
Network
Data Link
Physical
Data representation
Software implemented
switch.
Manage multiple logical
connections.
Keep track of who is
talking: establish & end
communications.
Examples: HTTP 1.1, SSL,
NetBIOS
Presentation
Session
Transport
Network
Data Link
Physical
Page 13
Page 14
Application
Presentation
Session
Transport
Network
Data Link
Physical
Some networking
terminology
Examples:
email (SMTP, POP, IMAP)
file transfer (FTP)
directory services (LDAP)
Page 15
Communications network
Page 16
network
computer
Page 17
Page 18
Media
Wires (or RF, IR) connecting together the devices that
make up a LAN
computer
Twisted pair
Most common:
STP: shielded twisted pair
UTP: unshielded twisted pair
(e.g. Telephone cable, Ethernet 10BaseT)
Adapter
expansion slot (PCI, PC Card, USB dongle)
usually integrated onto main board
Coaxial cable
Fiber
Wireless
Page 19
Page 20
Networking Topology
Hub
Switch
Concentrator or repeater
Bridge
Router
Bus Network
Page 21
Networking Topology
Page 22
Networking Topology
Tree Network
Star Network
Page 23
Page 24
Networking Topology
Networking Topology
Mesh Network
Ring Network
Page 25
Transmission networks
Page 26
Broadband: RF broadcasts
Baseband
All nodes share access to network media on an
equal basis
Data uses entire bandwidth of media
Broadband
Data takes segment of media by dividing media into
channels (frequency bands)
Page 28
http://www.ntia.doc.gov/osmhome/allochrt.pdf
Page 27
Broadband/Baseband: Cable TV
6 MHz
Broadband
DOCSIS Modem
audio
+5.75 MHz
cable
tuner
demodulator
MAC
video
+1.25 MHz
network interface
CPU
ethernet interface
(to PC)
modulator
Page 29
Page 30
Baseband: Ethernet
Ethernet media
Bus topology (original design)
Ethernet: 10 Mbps
Fast Ethernet: 100 Mbps
Gigabit Ethernet: 1 Gbps
10 Gbps, 100 Gbps
BNC connector
Page 31
Page 32
Modem
Data modulated over voice spectrum
(300-3400 Hz)
Serial interface to endpoint
V.92: 48 kbps downstream, near 56 kbps up
Use PPP or SLIP to bridge IP protocol
ethernet
Access Point
Page 33
Dedicated T1 or T3 line
LAN
router
CSU/DSU
RS-232C,
RS-449, V.xx
serial line
Page 34
T1 line
Wireless:
WiMax (seems to be dying limited endorsement)
LTE (Long Term Evolution)
Phone
network
Page 36
Client Server
Communication
Page 37
Page 38
Transport provider
Layer of software that accepts a network
message and sends it to a remote machine
Machine address
Two categories:
connection-oriented protocols
versus
connectionless protocols
Transport address
Page 39
Connection-oriented Protocols
1.
2.
3.
4.
Page 40
Connection-oriented Protocols
establish connection
[negotiate protocol]
exchange data
terminate connection
1.
2.
3.
4.
establish connection
[negotiate protocol]
exchange data
terminate connection
Page 41
Page 42
Connectionless Protocols
Connectionless Protocols
analogous to mailbox
- no call setup
- send/receive data
drop letter in mailbox
(each packet addressed) (each letter addressed)
- no termination
- no call setup
- send/receive data
(each packet addressed)
- no termination
datagram service
client is not positive whether message arrived at
destination
no state has to be maintained at client or server
cheaper but less reliable than virtual circuit
service
Page 43
Ethernet
Page 44
Ethernet
Physical (1)
1518-byte MTU
9000-byte MTU
dest addr
src addr
frame
type
data (payload)
CRC
6 bytes
6 bytes
46-1500 bytes
18 bytes + data
Page 45
IP Internet Protocol
Page 46
Internet Protocol
Goal:
Page 48
IP Addressing
IP Address space
32-bit addresses
Page 49
Page 50
remus.rutgers.edu
128.6.13.3
80 06 0D 03
host #
Page 51
IP Addressing
IP Addressing
Expectation:
Page 52
leading bits
7 (128)
24 (16M)
10
14 (16K)
16 (64K)
110
21 (2M)
8 (256)
8 bits
host #
24 bits
network #
18 bits
Page 53
host #
14 bits
Page 54
Huge growth
IP Special Addresses
All bits 0
32-bit-address/bits-for-network-prefix
Page 56
128.6.13.3/16
/27 : 1/8 of a class C (32 hosts)
/24 : class C
/16 : class B
All bits 1
Class D network
Page 57
Page 58
IPv4
External IP address
24.225.217.243
IPv6:
16-byte (128 bit) addresses
3.6 x 1038 possible addresses
8 x 1028 times more addresses than IPv4
4-bit priority field
Flow label (24-bits)
Internal
IP address
192.168.1.x
Page 59
Internal
address
Int
port
24.225.217.243 25
192.168.1.1
3455
24.225.217.243 25
192.168.1.2
11231
24.225.217.243 80
192.168.1.1
12482
24.225.217.243 80
192.168.1.3
21908
.1
Ext
port
.2
.3
.4
.5
Page 60
10
IP driver responsibilities
Get operating parameters from device driver
Routing packets
send data
receive data
IP driver
receive packet
Fragmenting packets
Send operations from higher-layers
send packet
network driver
from wire
to wire
Page 61
Network device
Page 62
IP header
IP data
payload
Page 63
Page 64
Routing
ethernet address
Router
Switching element that connects two or more
transmission lines (e.g., Ethernet)
Page 65
Page 66
11
Routing
Dynamic Routing
else
Static routing
Page 67
Page 68
IP Transport Layer
Protocols
Page 70
Page 71
Page 72
12
IP header
device
header
IP header
TCP/UDP
header
IP data
payload
vers
hlen
fragment identification
TTL
protocol
total length
flags
fragment offset
20 bytes
header checksum
source IP address
destination IP address
options and pad
Page 73
IP header
Page 74
device
header
IP data
IP header
payload
ack number
hdr
len
- flags
checksum
window
20 bytes
dest port
seq number
IP data
payload
UDP header
TCP header
src port
TCP/UDP
header
src port
dest port
seg length
checksum
dest addr
src addr
frame
type
data
CRC
6 bytes
6 bytes
46-1500 bytes
8 bytes
18 bytes + data
urgent ptr
Page 76
Quality of Service
(QoS)
Unreliable delivery
Software to the rescue TCP/IP
Page 77
Page 78
13
IP Flow Detection
FIFO queuing
Priority queues
Flow-based weighted fair queuing
Group all packets from a flow together
Traffic Shaping
Custom queues
Traffic Policing
Inefficient Packets
Page 80
Statistical - no guarantees
TOS bits & Diff-Serv
Head-of-line blocking
Nagles algorithm:
buffer new data if unacknowledged data outstanding
Header/packet compression
Link-to-link
Header compression (RFC 3843)
Payload compression (RFC 2393)
$ delivery vs. $ compression
Page 81
TOS bits
Page 82
Maximum Throughput
[0x08]
ftp-data, www
Maximum reliability
p p p d t r - -
[0x04]
SNMP, DNS
Minimum cost
Reliability: normal/high
[0x02]
Priority: 0-7
NNTP, SMTP
Throughput: normal/high
Delay: normal/low
14
Page 85
Page 86
Late 1980s
Goal: Merge voice & data networking
Payload identification
sequence #
time stamp
ATM
Page 88
ATM
Current standard:
Circuit switching
Too costly
Poor use of resource
Does not lend to multicasting
ATM
Based on
fixed-size packets over virtual circuits
Fixed-size cells provide for
predictive scheduling
Large cells will not hold up smaller ones
Rapid switching
Page 89
CBR
Constant bit-rate
bandwidth
Uncompressed video,
voice
VBR
Variable bit-rate
Avg, peak
bandwidth
Compressed video,
voice
ABR
Available bit-rate
-none-
Page 90
15
ATM
Small cells
lots of interrupts
>100,000/second
Programming Interfaces
Page 91
Sockets
Page 92
Sockets
Page 93
Page 94
Socket
Abstract object from which messages are sent
and received
Looks like a file descriptor
Application can select particular style of
communication
Page 95
Page 96
16
Step 1
Step 2
Create a socket
AF_INET
socket
Address structure
struct sockaddr*
length of
address
structure
Page 97
Step 3a (server)
Page 98
Step 3b (server)
socket
socket
pointer to address
structure
new socket
for this session
Page 99
Step 3 (client)
Page 100
Step 4
Connect to server
Exchange data
length of
address
structure
Address structure
struct sockaddr*
length of
address
structure
Connection-oriented
read/write
recv/send (extra flags)
Connectionless
sendto, sendmsg
recvfrom, recvmsg
Page 101
Page 102
17
Step 5
Sockets in Java
Close connection
java.net package
Two major classes:
shutdown(s, how)
how:
Socket: client-side
ServerSocket: server-side
Page 103
Step 1a (server)
Page 104
Step 1b (server)
ServerSocket svc =
new ServerSocket(port)
Page 105
Step 1 (client)
Page 106
Step 2
Socket s =
new Socket(cs.rutgers.edu, 2211);
Page 107
Exchange data
obtain InputStream/OutputStream from
Socket object
BufferedReader in =
new BufferedReader(
new InputStreamReader(
s.getInputStream()));
PrintStream out =
new PrintStream(s.getOutputStream());
Page 108
18
Step 3
Terminate connection
close streams, close socket
Socket Internals
in.close();
out.close();
s.close();
Page 109
Page 110
Server: svr=socket()
Local addr
Local Foreign
port addr
Server
Local addr
Foreign
port
L?
Local Foreign
port addr
Client
Foreign
port
L?
svr
Page 111
Server: bind(svr)
Local Foreign
port addr
Server
svr
Page 112
Foreign
port
L?
Local addr
Local Foreign
port addr
0.0.0.0
1234
Client
Local addr
Foreign
port
L?
Server
svr
Page 113
Local Foreign
port addr
Foreign
port
L?
Local addr
Local Foreign
port addr
0.0.0.0
1234
Client
Foreign
port
L?
*
Page 114
19
Server: snew=accept(svr)
Client: s=socket()
Local addr
Local Foreign
port addr
Foreign
port
L?
Client
Local addr
Local Foreign
port addr
Foreign
port
L?
Client
s
Server
svr
Local addr
Local Foreign
port addr
0.0.0.0
1234
Foreign
port
L?
*
Server
svr
Local addr
Local Foreign
port addr
0.0.0.0
1234
Foreign
port
Page 115
Client: s=bind(s)
0.0.0.0
Local Foreign
port addr
Foreign
port
L?
Client
7801
Server
svr
Page 116
Client: connect(s)
Local addr
0.0.0.0
Local addr
Local Foreign
port addr
0.0.0.0
1234
Foreign
port
L?
*
Local Foreign
port addr
Foreign
port
L?
Client
7801
Server
svr
snew
Local addr
Local
port
0.0.0.0
1234
192.11.35.15
1234
Foreign
addr
Foreign
port
Client: connect(s)
7801
Local Foreign
port addr
7801
Server
svr
snew
Page 118
Communication
Each message from client is tagged as either data or
control (e.g. connect)
0.0.0.0
L?
*
135.250.68.3
Page 117
Local addr
L?
Foreign
port
192.11.35.15
Local addr
Local
port
0.0.0.0
1234
192.11.35.15
1234
L?
Client
1234
Foreign
addr
s
Foreign
port
L?
*
135.250.68.3
7801
Page 119
Server
svr
snew
Local addr
Local
port
0.0.0.0
1234
192.11.35.15
1234
Foreign
addr
Foreign
port
L?
*
135.250.68.3
7801
Page 120
20
The end.
Page 121
21