Chapter 3 outline
合集下载
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
How demultiplexing works
host receives IP datagrams
each datagram has source IP address, destination IP address each datagram carries 1 transport-layer segment each segment has source, destination port number host uses IP addresses & port numbers to direct segment to appropriate socket
logical communication
application transport network data link physical
network data link physical
network data link physical
network data link physical
network data link physical
Transport Layer
3-1
Transport services and protocols
provide
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
Chapter 3 outline
3.1 Transport-layer
services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer
Transport Layer
3-5
Multiplexing/demultiplexing
Demultiplexing at rcv host:
delivering received segments to correct socket
= socket = process P3 P1 P1
Multiplexing at send host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing)
3-11
Connection-oriented demux (cont)
P1 P4 P5 P6 SP: 5775 P2 P1 P3
DP: 80
S-IP: B D-IP:C SP: 9157 SP: 9157
client IP: A
DP: 80 S-IP: A D-IP:C
server IP: C
DP: 80 S-IP: B D-IP:C
3.5 Connection-oriented
transport: TCP
segment structure reliable data transfer flow control connection management
3.6 Principles of
congestion control 3.7 TCP congestion control
many simultaneous TCP sockets:
each socket identified by its own 4-tuple
Web servers have
recv host uses all four
values to direct segment to appropriate socket
32 bits source port # dest port #
other header fields
application data (message)
TCP/UDP segment format
Transport Layer 3-7
Connectionless demultiplexing
P2 P3 P1 P1
SP: 6428 DP: 9157 SP: 9157
SP: 6428 DP: 5775 SP: 5775
client IP: A
DP: 6428
server IP: C
DP: 6428
Client
IP:B
SP provides “return address”
Transport Layer 3-9
Sockets Multiplexing / demultiplexing
Transport Layer 3-13
TCP Socket: like a phone
Create sockets with port When host receives UDP
numbers:
segment:
DatagramSocket mySocket1 = new DatagramSocket(12534); DatagramSocket mySocket2 = new DatagramSocket(12535);
P1 P4 SP: 5775 P2 P1 P3
DP: 80
S-IP: B D-IP:C SP: 9157 SP: 9157
client IP: A
DP: 80 S-IP: A D-IP:C
server IP: C
DP: 80 S-IP: B D-IP:C
Client
IP:B
Transport Layer
relies on, enhances, network layer services
What is the minimum that the Transport layer must do?
in envelopes hosts = houses transport protocol = Ann and Bill network-layer protocol = postal service
different sockets for each connecting client
non-persistent HTTP will have different socket for each requeห้องสมุดไป่ตู้t
Transport Layer 3-10
Connection-oriented demux: Threaded Web Server
3.5 Connection-oriented
transport: TCP
segment structure reliable data transfer flow control connection management
3.6 Principles of
congestion control 3.7 TCP congestion control
services not available: delay guarantees bandwidth guarantees
Transport Layer
3-3
Transport vs. network layer
network layer: logical
communication between hosts
Transport Layer 3-4
Chapter 3 outline
3.1 Transport-layer
services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4 Principles of reliable data transfer
application
transport network link physical
application
transport network link physical
P2
P4
application transport network
link
physical
host 1
host 2
host 3
Transport Layer 3-6
Connection-oriented demux
TCP socket identified
by 4-tuple:
Server host may support
source IP address source port number dest IP address dest port number
UDP socket identified by
checks destination port number in segment directs UDP segment to socket with that port number
two-tuple:
IP datagrams with
(dest IP address, dest port number)
Client
IP:B
Transport Layer 3-12
Review
Transport layer Logical connection between two PORTS Transport layer lives on endpoints
“Anne” and “Bill” Minimum job: multiplexing and demultiplexing Can also provide reliability, ordering, etc…
different source IP addresses and/or source port numbers directed to same socket
Transport Layer 3-8
Connectionless demux (cont)
DatagramSocket serverSocket = new DatagramSocket(6428);
network data link physical
unreliable, unordered
network data link physical
delivery: UDP
no-frills extension of “best-effort” IP
network data link physical application transport network data link physical
network data link physical application transport network data link physical
Transport Layer
3-2
Internet transport-layer protocols
reliable, in-order
delivery (TCP)
Household analogy:
transport layer: logical
communication between processes
12 kids sending letters to 12 kids
processes = kids
app messages = letters
congestion control flow control connection setup
application transport network data link physical
network data link physical
network data link physical