Documente Academic
Documente Profesional
Documente Cultură
Communications
Tenth Edition
by William Stallings
—On Human Communication,
Colin Cherry
The Need for a Protocol
Architecture
desired destination system
the network of the identity of the 2.) The source system must
communications path or inform ascertain that the destination
activate the direct system is prepared to receive
1.) The source must either data
To transfer data
several tasks
must be
performed:
3.) The file transfer application on are different
the source system must ascertain formats used on the two systems
that the file management program or the other system if the file
on the destination system is may need to be performed by one
prepared to accept and store the 4.) A format translation function
file for this particular user
Functions of Protocol
Architecture
Breaks logic into subtask modules which
are implemented separately
Modules are arranged in a vertical stack
• Each layer in the stack performs a
subset of functions
• Relies on next lower layer for primitive
functions
• Provides services to the next higher layer
• Changes in one layer should not require
changes in other layers
Key Features of a Protocol
A protocol is a set of rules or conventions
that allow peer layers to communicate
The key features of a protocol are:
• Format of data
Syntax blocks
• Control
information for
Semantics coordination and
error handling
• Speed matching
Timing and sequencing
A Simple Protocol Architecture
Communication Layers
Network address
Network access
Computer B
1 2 t
() () or
nsp
"to port 2 on computer B" a
Tr
from to data
1 2
k
() or
tw ss
e e
"to computer B" N acc
a
dat from to from to data
to A B 1 2
m 2
fro
to 1
m B
fro
A
Communications
Network
fr A
om
C
om
to
n
B
pu
io
fr 1
te at
om
r
B il c
Entity Y pp
data A
to
2
1 2
da
t
() () or
ta
nsp
a
from to data Tr
1 2
k
() or
tw ss
"this is to me" e e
N acc
from to from to data
A B 1 2
Transport
Transfer of data between
end points. May provide TCP, UDP
error control, flow control,
congestion control, reliable
delivery.
Internet ICMP,
OSPF,
Shield higher layers from
RSVP
details of physical network IPv4, IPv6 ARP
configuration. Provides
routing. May provide QoS,
congestion control.
Network Access/
Data Link
Logical interface to network Ethernet, WiFi, ATM, frame relay
hardware. May be stream or
packet oriented. May
provide reliable delivery.
Physical
Transmission of bit stream;
specifies medium, signal Twisted pair, optical fiber, satellite,
encoding technique, data terrestrial microwave
rate, bandwidth, and
physical connector.
Interne
Internet Layer
t Layer
Uses the
Implemented Internet
in end Protocol (IP)
systems and to provide
routers routing
function
Host-to-Host (Transport) Layer
• May provide
TCP
reliable end-to-end
service or merely • Most commonly
an end-to-end used protocol to
delivery service provide this
without reliability functionality
mechanisms
Transmission
Control Protocol
Application Layer
Contains the logic needed to support the
various user applications
A separate module is needed for each
different type of application that is peculiar
to that application
Host A Host B
App X App Y
App Y App X
Port
1 2 3 2 4 6
Logical connection
(TCP connection)
TCP TCP
Global internet
IP address IP
NAP 1 NAP 2
Network 1 Network 2
Physical Physical
TCP TCP
header segment
IP IP
header datagram
Network Network-level
header packet
SequenceNumber
20 octets
Acknowledgement Number
Header
Reserved Flags Window
length
Options +Padding
Bit: 0 16 31
SourceAddress
Destination Address
Options +Padding
Bit: 0 4 10 12 16 24 31
Bit: 0 4 10 12 16 24 31
SourceAddress
40 octets
Destination Address
Figure2.7 IP Headers
MIME
TCP UDP
IP
Physical
Layer
Request Request
Indication Indication
Response
Confirm
• Used to send files from one system to another under user command
• Both text and binary files are accommodated
Quality of service
Protocols
Communications/networking
Synchronization
Compression
User interface
Database
Operatingsystem s
d hic n
t n ap tio
x u r o
Computer architecture Te So G M
MEDIA TYPE
MM e-mail
Collaborativework systems
MM conferencing
Streamingaudio/video
VoIP
APPLICATION
Educational systems
• Electronic books with a
multimedia component,
simulation and modeling
applets, and other teaching
support systems
Multimedia Technologies
Sometechnologies that are relevant to the
support of multimedia applications are:
Communication Quality of
Compression Protocols
s/networking service (QoS)
type
(AF_UNIX, AF_INET, AF_INET6)
Type of socket to be opened (stream, datagram,
raw)
Table
2.4
protocol Protocol to be used on socket (UDP, TCP, ICMP)
bind( ) Bind a socket to a sockfd Socket to be bound to the port address
port address localaddress Socket address to which the socket is bound
addresslength Length of the socket address structure
listen( ) Listen on a socket sockfd Socket on which the application is to listen
for inbound queuesize Number of inbound requests that can be queued
connections at any time
accept( ) Accept an
inbound
sockfd Socket on which the connection is to be
accepted Core
connection remoteaddress Remote socket address from which the
connection was initiated
addresslength Length of the socket address structure
Socket
Connect sockfd Socket on which the connection is to be
Functions
connect( )
outbound to a opened
server remoteaddress Remote socket address to which the
connection is to be opened
addresslength Length of the socket address structure
send( ) Send and receive sockfd Socket across which the data will be sent or read
recv( )
data on a stream data Data to be sent, or buffer into which the read
read( ) socket (either data will be placed
write( ) send/recv or datalength Length of the data to be written, or amount of
read/write can be data to be read
used)
sendto( ) Send and receive sockfd Socket across which the data will be sent or read
recvfrom( ) data on a data Data to be sent, or buffer into which the read
datagram socket data will be placed (Table can be found
datalength Length of the data to be written, or amount of on page 78 in
data to be read textbook)
close( ) Close a socket sockfd Socket which is to be closed
Server Client
socket() Open communication
endpoint
Register well-known
bind()
address with system
blocksuntil
connection Open communication
from client socket() endpoint
connection
accept() creates
establishment Set up connection
a new socket to connect()
to server
servethenew
client request
data (request)
receive() send() Send/receivedata
process
request
data (reply)
send() receive() Send/receivedata