Chapter 7
Chapter 7
2
3
4
Introduction Transport layer
5
Transport Layer
◉ Transport protocol similar to data link protocols
◉ Both do error control and flow control
◉ However, significant differences exist
6
Introduction Transport layer
7
Elements of Transport Protocols
◉ Addressing
◉ Connection establishment
◉ Connection refuse
◉ Flow control and buffers
◉ Multiplexing
◉ Crash recovery
8
Addressing (The process to Process Delivery)
9
10
Addressing (The process to Process Delivery)
◉ In the Internet model, the port numbers are 16-bit integers between 0 and
65,535
◉ The client program defines itself with a port number, chosen randomly by the
transport layer software running on the client host
11
12
Connection Establishment
❑ Issues:
◉ lose, delay, corrupt, duplicate packets
◉ Protocols must work correct all cases
◉ To simplify problem, restrict packet lifetime
❑ restricted network design: prevent looping
❑ hop counter in each packet: -1 at each hop
❑ timestamp in each packet: clock must be synced
13
Connection Establishment
14
Connection Establishment
15
Connection Establishment
16
Connection Release
❑ Asymmetric release
◉ the way telephone works
◉ 1 party hangs up, call broken abrupt;
may cause data loss
◉ better protocol needed
17
Connection Release
❑ symmetric release
◉ Normal release sequence
1. H1 send DR, start timer
2. H2 responds with DR
3. when H1 recvDR, release
4. when H2 recvACK, release
18
Final ACK lost: Host 2 times out Lost DR: H1 starts over
19
Extreme: Many lost DRs both release after N
20
FLOW CONTROL AND BUFFERING
21
FLOW CONTROL AND BUFFERING
◉ Chained Fixed-size Buffers: If most TPDUs are nearly the same size, the
buffers are organized as a pool of identical size buffers, with one TPDU per
buffer.
22
FLOW CONTROL AND BUFFERING
23
FLOW CONTROL AND BUFFERING
24
Multiplexing and Demultiplexing
25
Multiplexing and Demultiplexing
◉ Demultiplexing
◉ At the receiver site, the relationship is one-to-many and requires
demultiplexing.
◉ The transport layer receives datagrams from the network layer
◉ After error checking and dropping of the header, the transport
layer delivers each message to the appropriate process based on
the port number.
26
27
28
Crash Recovery
◉ If hosts and routers are subject to crashes and connections are long-
lived (e.g., large software or media downloads), recovery from these
crashes becomes an issue
◉ A more troublesome problem is how to recover from host crashes than
router crash
◉ Ex: if server crashed
◉ the server might send a broadcast segment to all other hosts, announcing
that it has just crashed and requesting that its clients inform it of the
status of all open connections
29
Crash Recovery
30
Crash Recovery
◉ write has been done but the crash occurs before the acknowledgement
can be sent.
◉ The client will be in state S1 and thus retransmit, leading to an
undetected duplicate segment in the output stream to the server
application process
31
Classification of port numbers
32
Classification of port numbers
◉ Registered port
◉ The range of registered port is 1024 to 49151. The registered ports
are used for the user processes.
◉ These processes are individual applications rather than the common
applications that have a well-known port.
◉ Dynamic ports
◉ These port numbers are assigned to the client application
dynamically when a client creates a connection.
33
User datagram protocol (UDP)
34
User datagram protocol (UDP)
35
Features of UDP protocol
❑ Connectionless
◉ It does not create a virtual path to transfer the data.
◉ It does not use the virtual path, so packets are sent in different paths between
the sender and the receiver
◉ Which leads to the loss of packets or received out of order
❑ Ordered delivery of data is not guaranteed.
◉ The datagrams are sent in some order will be received in the same order is
not guaranteed as the datagrams are not numbered
❑ Ports : uses different port numbers so that the data can be sent to the correct
destination
36
Features of UDP protocol
37
Features of UDP protocol
❑ Stateless
◉ the sender does not get the acknowledgement for the packet which has
been sent.
❑ Why do we require the UDP protocol?
◉ where the acknowledgement packets share significant amount of
bandwidth along with the actual data
◉ EX: in case of video streaming, thousands of packets are forwarded
◉ Acknowledging all the packets may contain huge amount of bandwidth
wastage.
◉ Loss of few packets in video and voice traffic goes unnoticed.
38
UDP Header Format
39
UDP Header Format
◉ Source port number: It is 16-bit information that identifies which
port is going t send the packet.
◉ port number can range from 0 to 65,535
◉ Destination port number: It identifies which port is going to accept
the information.
◉ It is 16-bit information which is used to identify application-level
service on the destination machine.
◉ If the destination host is the server (a client sending a request), the
port number, in most cases, is a well-known port number.
40
UDP Header Format
41
UDP Header Format
42
UDP Operation
❑ Connectionless Services:
◉ Each user datagram sent by UDP is an independent datagram
◉ The user datagrams are not numbered
◉ there is no connection establishment and no connection termination
◉ This means that each user datagram can travel on a different path.
❑ Flow and Error Control
◉ There is no flow control and hence
◉ no window mechanism. The receiver may overflow with incoming messages
43
UDP Operation
44
UDP Operation
◉ Queuing:
◉ when a process starts, it requests a port number from the operating system
◉ Some implementations create both an incoming and an outgoing queue
associated with each process Other implementations create only an incoming
queue
45
UDP Operation
◉ The queues function as long as the process is running. When the process
terminates, the queues are destroyed.
◉ UDP removes the messages one by one and, after adding the UDP header,
delivers them to IP.
◉ An outgoing queue can overflow. If this happens, the operating system can
ask the client process to wait before sending any more messages.
◉ When a message arrives for a client, UDP checks to see if an incoming
queue has been created for the port number specified in the destination port
number field of the user datagram.
46
UDP Operation
◉ If there is no such queue, UDP discards the user datagram and asks
◉ the ICMP protocol to send a port unreachable message to the server.
47