Download presentation
Presentation is loading. Please wait.
Published byDarlene Eger Modified over 9 years ago
2
I N THE N AME OF G OD C OMPUTER N ETWORKS C HAPTER 6: T HE T RANSPORT L AYER Dr. Shahriar Bijani Shahed University May 2014
3
References: Computer Networks A. S. Tanenbaum and D. J. Wetherall, Computer Networks (5th Edition), Pearson Education, the book slides, 2011. B. A. Forouzan, Introduction to the Transport Layer, TCP/IP Protocol Suite, 5th Edition, McGraw Hill, lecture slides, 2012. 2
4
T HE OSI M ODEL TCP/IP 3 PHYSICAL DATA LINK NETWORK TRANSPORT SESSION PRESENTATION APPLICATION
5
T HE T RANSPORT LAYER DUTIES Packetizing Sender side: breaks application messages into segments, passes them to network layer Transport layer at the receiving host deliver data to the receiving process Connection control Connection-oriented Connectionless Addressing Port numbers to identify which network application Reliability Flow control Error Control
6
PROCESS-TO-PROCESS DELIVERY The transport layer is responsible for process- to-process delivery: the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship,The transport layer is responsible for process- to-process delivery: the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship, In Client/Server communication, four entities must be defined: Sending Node Local Host IP Local Process Port number Receiving Node Remote host IP Remote Process ID Port number
7
Types of data deliveries
8
P ROCESSES COMMUNICATING ACROSS NETWORK Process is an instance of a program in execution. Processes on two hosts communicate with each other by sending and receiving messages The process receives messages from, and sends messages into the network through its socket A socket is the interface between the application layer and the transport layer within a host. Sockets are the programming interface used to build network applications over the internet. Programmers can select which transport layer protocol (UDP or TCP) to be used by the application and select few transport-layer parameters (maximum buffer size, Maximum segment size, starting sequence number of segment).
9
T RANSPORT S ERVICE Upper Layer Services Transport Service Primitives Berkeley Sockets
10
S ERVICES P ROVIDED TO THE U PPER L AYERS The network, transport, and application layers
11
T RANSPORT S ERVICE P RIMITIVES (1) The primitives for a simple transport service
12
T RANSPORT S ERVICE P RIMITIVES (2) Nesting of TPDUs, packets, and frames.
13
B ERKELEY S OCKETS (1) A state diagram for a simple connection management scheme. Transitions labeled in italics are caused by packet arrivals. The solid lines show the client’s state sequence. The dashed lines show the server’s state sequence.
14
B ERKELEY S OCKETS (2) The socket primitives for TCP
15
E XAMPLE OF S OCKET P ROGRAMMING : A N I NTERNET F ILE S ERVER (1)... Client code using sockets
16
E XAMPLE OF S OCKET P ROGRAMMING : A N I NTERNET F ILE S ERVER (2)... Client code using sockets
17
E XAMPLE OF S OCKET P ROGRAMMING : A N I NTERNET F ILE S ERVER (3)... Client code using sockets
18
E XAMPLE OF S OCKET P ROGRAMMING : A N I NTERNET F ILE S ERVER (4)... Server code
19
E XAMPLE OF S OCKET P ROGRAMMING : A N I NTERNET F ILE S ERVER (5)... Server code...
20
E XAMPLE OF S OCKET P ROGRAMMING : A N I NTERNET F ILE S ERVER (6)... Server code
21
E LEMENTS OF T RANSPORT P ROTOCOLS (1) Addressing Connection establishment Connection release Error control and flow control Multiplexing Crash recovery
22
E LEMENTS OF T RANSPORT P ROTOCOLS (2) (a) Environment of the data link layer. (b) Environment of the transport layer.
23
A DDRESSING TSAPs (Transport Service Access Points)= port number NSAPs (Network Service Access Points)
24
A DDRESSING How a user process in host 1 establishes a connection with a mail server in host 2 via a process server.
25
Port numbers Transport layer at the receiving host delivers data to the socket There should be a unique identifier for each socket. Socket identifier is called socket address Socket address = IP address & Port number
26
Port numbers
27
IP addresses versus port numbers Process-to-Process delivery needs IP address and Port number
28
IANA ranges Port numbers are 16-bit integers between 0 - 65535 Well-known: Assigned and controlled by Internet Assigned Numbers Authority IANA for example: FTP 20,21, TELNET 23, SMTP 25, HTTP 80
29
Well-known ports used with UDP
30
Well-known ports used by TCP
31
Error control Why we need error control at the transport layer?
32
C ONNECTION E STABLISHMENT Establishing a connection sounds easy, but it is actually surprisingly tricky. At first glance, it would seem sufficient for one transport entity to just send a CONNECTION REQUEST TPDU to the destination and wait for a CONNECTION ACCEPTED reply. The problem occurs when the network can lose, store, and duplicate packets. This behavior causes serious complications. Restrict packet lifetime Equipping each host with a time-of-day clock. Three-way handshake
33
C ONNECTION E STABLISHMENT Techniques for restricting packet lifetime Restricted network design. Putting a hop counter in each packet. Timestamping each packet.
34
C ONNECTION E STABLISHMENT (2) (a) TPDUs may not enter the forbidden region. (b) The resynchronization problem.
35
C ONNECTION E STABLISHMENT Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Normal operation.
36
C ONNECTION E STABLISHMENT Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Old duplicate CONNECTION REQUEST appearing out of no-where.
37
C ONNECTION E STABLISHMENT Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Duplicate CONNECTION REQUEST and duplicate ACK
38
C ONNECTION R ELEASE Sudden disconnection with loss of data
39
C ONNECTION R ELEASE (2) The two-army problem
40
C ONNECTION R ELEASE Four protocol scenarios for releasing a connection. (a) Normal case of three-way handshake
41
C ONNECTION R ELEASE (4) Four protocol scenarios for releasing a connection. (b) Final ACK lost.
42
C ONNECTION R ELEASE (5) Four protocol scenarios for releasing a connection. (c) Response lost
43
C ONNECTION R ELEASE (6) Four protocol scenarios for releasing a connection. (d) Response lost and subsequent DRs lost.
44
M ULTIPLEXING (a) Multiplexing. (b) Inverse multiplexing.
45
44 M ULTIPLEXING / DEMULTIPLEXING segment - unit of data exchanged between transport layer entities Demultiplexing: delivering received segments to correct app layer processes application transport network M P2 application transport network receiver H t H n segment M application transport network P1 MMM P3 P4 segment header application-layer data How hosts handle more than one session simultaneously sender A sender B
46
45 M ULTIPLEXING / DEMULTIPLEXING multiplexing/demultiplexing in the Internet: based on sender, receiver port numbers, IP addresses source, dest port #s in each segment recall: well-known port numbers for specific applications gathering data from multiple app processes, enveloping data with header (later used for demultiplexing) source port #dest port # 32 bits application data (message) other header fields TCP/UDP segment format Multiplexing:
47
46 M ULTIPLEXING / DEMULTIPLEXING : EXAMPLES host A server B source port: x dest. port: 23 source port:23 dest. port: x port use: simple telnet app (Note how port 23 at server must be shared whereas port x at host can be reserved) Web client host A Web server B Web client host C Source IP: C Dest IP: B source port: x dest. port: 80 Source IP: C Dest IP: B source port: y dest. port: 80 port use: Web server Source IP: A Dest IP: B source port: x dest. port: 80 Q: how does the server know which packets go with which process?
48
Encapsulation and decapsulation
49
Multiplexing and demultiplexing
50
C ONGESTION C ONTROL Desirable bandwidth allocation Regulating the sending rate
51
T HE I NTERNET T RANSPORT L AYER The Internet supports two transport layer protocols: The Transport Control Protocol (TCP) for reliable service The Unreliable (User) Datagram Protocol (UDP)
52
Position of UDP in the TCP/IP protocol suite
53
U SER D ATAGRAM P ROTOCOL (UDP) Connectionless No handshaking between UDP sender, receiver Each UDP segment handled independently of others A server application that uses UDP serves only ONE request at a time. All other requests are stored in a queue waiting for service. Unreliable protocol has no flow and error control A UDP segment can be lost, arrive out of order, duplicated, or corrupted Checksum field checks error in the entire UDP segment. It is Optional UDP doe not do anything to recover from an error it simply discard the segment Application accepts full responsibility for errors It uses port numbers to multiplex/demultiplex data from/to the application layer. Advantages: Simple, minimum overhead, no connection delay Services provided by UDP: Process-to-Process delivery Error checking (however, if there is an error UDP does NOT do anything to recover from error. It will just discard the message
54
Queues in UDP
55
UDP A PPLICATIONS Used for applications that can tolerate small amount of packet loss: Multimedia applications, Internet telephony, real-time-video conferencing Domain Name System messages Audio Routing Protocols
56
User datagram format Header size = 8 bytes Minimum UDP process data size 0 bytes Maximum UDP process data size= 65535 – 20 (network layer headers) - 8 (UDP headres)= 65507 bytes
57
UDP length = IP length – IP header’s length
58
T RANSMISSION C ONTROL P ROTOCOL (TCP) Transmission Control Protocol properties: Connection-oriented (establishment & termination) Reliable Full-duplex
59
C ONNECTION -O RIENTED Connection oriented means that a virtual connection is established before any data is transferred. Connection ensures that the receiving process is available and ready before the data is sent Three-way handshaking connection establishment procedure because TCP is full-duplex both side must initialize communication and get approval from the other side before any data transfer, Virtual connection since TCP protocol will make sure that segments are given to the receiver application in the same order as they were sent by the sender even if they travel through different physical paths A server application that uses TCP can handle many client requests at the same time each has its own connection.
60
Connection establishment and termination Connection establishment Connection release Combined into one step
61
Stream delivery TCP establishes a virtual connection TCP will deliver segments to the applications in order and without error, lost, or duplicates
62
F ULL D UPLEX Data segments can flow in both directions at the same time. Each TCP connection has its own sending and receiving buffers.
63
F LOW CONTROL AND R ELIABILITY Flow control (process-to-process): TCP makes sure that the sender does not cause the receiver buffer to overflow By defining the amount of data that can be sent before receiving an acknowledgement from the receiver (sliding – window protocols) Error control (process-to-process): entire message arrives at the receiving transport layer without error, loss, duplication and in the same order they were sent Error detection is done using checksum and correction by retransmission Implemented by a sliding window ARQ Every transmission of data is acknowledged by the receiver. Acknowledgements are cumulative. If the sender does not receive ACK within a specified amount of time, the sender retransmits the data. Accepts out of order but does Not send negative acknowledgements, if a segment is not acknowledged before time-out, it is considered to be either corrupted or lost and the sender will retransmit the segment only when it times-out
64
TCP A PPLICATIONS Following applications require reliable data transfer through TCP: WWW using HTTP Electronic mail using SMTP Telnet File transfer using FTP
65
TCP segment format Minimum header length is 20 bytes and the maximum is 60 bytes when there are options
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.