Escolar Documentos
Profissional Documentos
Cultura Documentos
INF3190 / INF4190
Foreleser: Carsten Griwodz
Email: griff@ifi.uio.no
Application
Application
Layer
Transport
Layer
Transport
Layer
3
1-2
Network
Layer
Network
Layer
1. Addressing
Application
Layer
Transport
Layer
Network
Layer
Application
Transport
Layer
Network
Layer
3
1-2
Application
Transport
Layer
Network
Layer
1-2
1. Addressing
2. End-to-end connection management
Application
Transport
Layer
Network
Layer
1-2
4. Quality of service
Error recovery
Reliability
Flow control
Congestion control
Message header
Message Payload
Frame header
Packet Payload
Frame Payload
Layer
Transport
Network
Data link
Physical
Data Unit
Message
Packet
Frame
Bit/byte (bitstream)
TCP/IP Message
ISO
TPDU
(transport protocol
data unit)
Transport Service
! Connection oriented service
Transport
Protocol
Port
3 phases
Service Interface
! connection set-up
! data transfer
! disconnect
Application
Layer
Application
Layer
Transport
Entity
Transport
Entity
Network
Layer
Network
Layer
! Connectionless service
Transfer of independent
messages
1-2
IP: Message
TCP/IP Port
ISO
TSAP
(transport service
access point)
Transport Service
! Similar services of
! Network service
! Transport service
Transport Service
! Transport layer
Layers above 4
Transport Service
! Transport protocols of TCP/IP protocols
Services provided implicitly (ISO protocols offer more choice)
Connection-oriented service
Connectionless service
Ordered
Partially Ordered
Unordered
Reliable
Partially Reliable
Unreliable
With congestion control
Without congestion control
Multicast support
Multihoming support
Telnet
server
FTP
client
FTP
server
Web
client
Web
server
Transport
Network
Data link
Physical
! Applications
require communication
communicate
! locally by interprocess communication
! between systems via transport services
! Transport layer
Interprocess communication via communication networks
! Internet Protocol IP
Enables endsystem-to-endsystem communication
Not application to application
INF3190 / INF4190 - Data Communication
Processes
5
Transport addresses
Network addresses
Transport
Entity
Transport
Entity
Network
Layer
Network
Layer
1-2
Keyword
UNIX keyword
Description
20
21
22
23
25
37
42
53
80
110
111
119
FTP-DATA
FTP
SSH
TELNET
SMTP
TIME
WINS
DOMAIN
HTTP
POP3
SUN RPC
NNTP
ftp-data
ftp
ssh
telnet
smtp
time
name
nameserver
HTTP
pop3
sunrpc
nntp
this table shows some examples for TCP (read /etc/services for more)
port 80
Web
server
Video
server
TCP
UDP
Network
Layer
port 554
ports
dynamically
chosen
1-2
Video
plugin
Web
browser
UDP
TCP
Network
Layer
Web
server
TCP
IP addr 1
1-2
Video
server
Video
plugin
UDPmultiplexing
Web
browser
UDP
demultiplexing
TCP
IP addr 2
Transport Service
! Transport protocols of TCP/IP protocols
Services provided implicitly (ISO protocols offer more choice)
Connection-oriented service
Connectionless service
Ordered
Partially Ordered
Unordered
Reliable
Partially Reliable
Unreliable
With congestion control
Without congestion control
Multicast support
Multihoming support
UDP Characteristics
No flow control
Application may transmit as fast as it can / wants and its network card
permits
Does not care about the networks capacity
IHL
Type
PRE of service
ToS
Total length
Identification
DM
Fragment offset
Time to live
Protocol
Header checksum
Source address
Destination Address
Options
Source port
Destination port
Packet
length
Checksum
demultiplexing:
Used for
service address
IP header
UDP header
Data
Source port
Packet length
Destination port
Checksum
Optional
16 bit sender identification
Response may be sent there
Receiver identification
Optional in IPv4
Checksum of header and data for
error detection
source IP address
destination IP address
Protocol
length of (UDP) data
00000000
Source address
Destination Address
Protocol=17
UDP segment length
Used by e.g.
DNS:
SNMP:
BOOTP:
TFTP:
NFS:
NTP:
RTP:
! TCP provides
What is TCP?
Transport protocol specification
! TCP specifies
! flow control
! error detection and correction
! connect and disconnect
As a primary abstraction
! a connection
! not just the relationships of ports
(as a queue, like UDP)
TCP Characteristics
! Data stream oriented
! no way for receiver to detect the unit(s) in which data were written
IP header TCP header
A
A B CD
data from / to TCP application
WRITE / READ call
TCP Characteristics
! Virtual connection
! Point-to-point
! Reliable
! Sequence maintained
! No data loss, no duplicates, no modified data
TCP Characteristics
Error detection
Through checksum
Piggybacking
Urgent flag
TCP Characteristics
No broadcast
No possibility to address all applications
With connect, however, not necessarily sensible
No multicasting
Group addressing not possible
No QoS parameters
Not suited for different media characteristics
No real-time support
No correct treatment / communications of audio or video possible
E.g. no forward error correction
Applications
! File transfer (FTP)
! Interactive terminal (Telnet)
! E-mail (SMTP)
! X-Windows
INF3190 / INF4190 - Data Communication
Connection Addressing
TCP service obtained via service endpoints on sender and receiver
Typically socket
Socket number consists of
(2.2.2.2/3/1.1.1.1/1/6)
4
3.3.3.3
IHL
Type
PRE of service
ToS
Total length
Identification
DM
Fragment offset
Time to live
Protocol
Header checksum
Source address
Destination Address
Options
Source port
Destination port
Sequence number
Piggyback acknowledgement
THL
unused U A P R S F
Window
Checksum
Urgent pointer
Options (0 or more 32 bit words)
IP header
TCP header
Data
Transport Protocols
Connection Establishment: TCP
Connection Establishment
! One passive & one active side
Host 1
Client
Host 2
Server
send
SYN(SEQ=x)
! Three-Way-Handshake
receive SYN
time
send
SYN(SEQ=y)
ACK(SEQ=x+1)
receive
SYN+ACK
time
Connection Establishment
! If on server side no process is
waiting on port (no process did
LISTEN)
Host 1
Client
Host 2
No server
send
SYN(SEQ=x)
receive SYN
send
RST
time
time
Connection Establishment
! Call collision
Still only one single connection
will be established even when
! both partners actively try to
establish a connection
simultaneously
Host 1
Client &
Server
Host 2
Client &
Server
send
SYN(SEQ=x)
send
SYN(SEQ=y)
receive SYN
receive SYN
send
SYN(SEQ=x)
ACK(SEQ=y+1)
receive
SYN+ACK
time
send
SYN(SEQ=y)
ACK(SEQ=x+1)
receive
SYN+ACK
time
Connection Release
! Connection release for pairs of simplex connections
each direction is released independently of the other
Connection Release
! Systematic disconnect by 4 packets
between 2nd and 3rd
! 3 packets possible
Host 2
Peer
send
FIN(seq=x)
receive FIN
receive ACK
receive
ACK+FIN
send
ACK(SEQ=y+1)
time
send
ACK(SEQ=x+1)
send
FIN(SEQ=y)
ACK(SEQ=x+1)
receive ACK
time
Description
CLOSED
LISTEN
SYN RCVD
SYN SENT
ESTABLISHED
FIN WAIT 1
FIN WAIT 2
TIMED WAIT
CLOSING
CLOSE WAIT
LAST ACK
States
CLOSED
Timeout
Se
YN CK
vS
A
Rec SYN
d
ST
Sen
vR
Rec
nd
LISTEN
Se
nd
Rec
vA
CK
Send FIN
ESTABLISHED
IN
FIN WAIT 2
ACK
YN K
S
v
C
Rec end A
S
dF
Sen
Recv ACK
SY
SYN RCVD
FIN WAIT 1
SY
N
SYN SENT
Recv FIN
Send ACK
CLOSE WAIT
LAST ACK
Send FIN
CLOSING
Recv ACK
Timeout
TIME WAIT
CLOSED
LISTEN
SYN RCVD
Send SYN
Recv SYN,ACK
Send ACK
data
SYN SENT
ESTABLISHED
CLOSE WAIT
LAST ACK
Send FIN
FIN WAIT 1
CLOSING
Recv ACK
FIN WAIT 2
Timeout
TIME WAIT
CLOSED
Timeout
LISTEN
Recv SYN
Send SYN,ACK
SYN RCVD
SYN SENT
Recv ACK
data
ESTABLISHED
CLOSE WAIT
Recv FIN,
Send ACK
FIN WAIT 1
CLOSING
FIN WAIT 2
TIME WAIT
LAST ACK
Send FIN
Transport layer
Reliability and Ordering: Generic
approaches
! Packet loss
Retransmission
! Used with various ACK and NACK schemes
Duplicates
! Initial Situation: Problem
Network has
!
!
!
Customer
CR
CC
Packets can be
!
!
!
DATA
Manipulated
Duplicated
Resent by the original system after
timeout
Money
transfer
ACK
REL
DUP CR
CC
Bank
D
DUP ATA
ACK
Money
transfer
is repeated
DUP REL
time
time
Duplicates
! Possible error causes and consequences
Cause
!
D
DUP ATA
ACK
DUP REL
Cause
!
Man-in-the-middle attack
Consequence
!
DUP CR
CC
Network capabilities
Result
Consequence
!
!
Receiver cannot
differentiate between
correct data and
duplicated data
Consecutive connections
or
Connections which are being re-established after a crash?
Evaluation
In general not applicable:
process server addressing method not possible, because
Server is reached via a designated port
Some ports always exist as "well known
Evaluation
End-systems must be capable of storing this information
Prerequisite
Connection oriented system
Method
Sequence number basically never gets reset
e.g. 48 bit at 1000 msg/sec: reiteration after ~8930 years
Evaluation
Higher usage of bandwidth and memory
Sensible choice of the sequential number range depends on
The packet rate
A packets probable "lifetime" within the network
Wraparound
ISN
SeqNo
ISN
ISN
Initial Sequence Number
time
Forbidden Region
Width T (max. theoretic packet lifetime)
SeqNo
time
No problem, if
Normal lived session (shorter than wrap-around time) with data rate smaller
than ISN rate (ascending curve less steep)
SeqNo
Same SeqNo
Within T
T
Same SeqNo
Within T
Packet rate
Too high
time
Problems
"
MS
MS
G (s
G (s
T=2t+!
Example 2: Request/response
Taking processing time into account
RE
Q (s
t
Emax
RE
)
S (s
t
T=2t+Emax
Transport layer
Reliability and Ordering: TCP
! TCPs approach
!
!
! Solution: none
today at 1 Gbps
in 17 sec
PAWS RFC1323
!
!
!
!