Data and Computer Communications: Tenth Edition by William Stallings
Data and Computer Communications: Tenth Edition by William Stallings
Data and Computer Communications: Tenth Edition by William Stallings
Communications
Tenth Edition
by William Stallings
OnHumanCommunication,
ColinCherry
The Need for a Protocol
Architecture
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:
A Simple Protocol Architecture
Communication Layers
Applications
1 2
() ()
Transport
Network access
Applications
Computer A
1 2 3 4
() ()()()
Transport
Communications Port, or
Network access network Serviceaccess
point (SAP)
Computer C Applications
1 2 3
() () ()
Transport
Network address
Network access
Computer B
1 2
() ()
"to port 2 on computer B"
from to data
1 2
()
"to computer B"
from to from to data
A B 1 2
Communications
Network
Entity Y data
1 2
() ()
from to data
1 2
()
"this is to me"
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.
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
Quality of service
Protocols
Communications/networking
Synchronization
Compression
User interface
Database
Operatingsystem
Computer architecture
MEDIA TYPE
MM e-mail
Collaborativework systems
MM conferencing
Streamingaudio/video
VoIP
APPLICATION
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
Functions
connect( ) Connect sockfd Socket on which the connection is to be
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 54 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