0% found this document useful (0 votes)
2 views

Session 4 Transport Layer Updated

The document discusses the transport layer of networking, focusing on its responsibilities for process-to-process message delivery using protocols like TCP and UDP. TCP ensures reliable data transfer through a connection-oriented approach, while UDP offers a connectionless, unreliable service. It also covers port numbers, connection establishment, and termination processes, along with the structure of TCP and UDP segments.

Uploaded by

cmokshith27
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Session 4 Transport Layer Updated

The document discusses the transport layer of networking, focusing on its responsibilities for process-to-process message delivery using protocols like TCP and UDP. TCP ensures reliable data transfer through a connection-oriented approach, while UDP offers a connectionless, unreliable service. It also covers port numbers, connection establishment, and termination processes, along with the structure of TCP and UDP segments.

Uploaded by

cmokshith27
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Session-4

Transport Layer Tasks


and Protocols
Session delivered by:
Dr. Jyothi A P

1
Session Objectives

• To study and understand the duties and operation of transport layer


protocols.

• To study the datagram formats of TCP and UDP protocols and to


understand the significance of various data fields.

• To understand the various error control schemes used by the transport


layer.

2
22
Session Topics
• Transport Layer
• Position of Transport Layer
• Transport Layer Duties
• IP Addresses Vs Port Numbers
• Multiplexing & Demultiplexing
• Connection Establishment
• Connection Termination
• User Datagram Protocol (UDP)
• User Datagram Format
• Transmission Control Protocol (TCP)
• Well-known ports used by TCP
• TCP Segments
• TCP Segment Format
• State Transition Diagram.
• TCP Sliding Windows 3
33
Transport Layer

• The transport layer is responsible for the process to


process delivery of the entire message.

4
44
Transport Layer

• TCP stands for Transmission Control Protocol.

• Using this method, the computer sending the data connects directly to
the computer it is sending the data to, and stay connected for the
duration of the transfer.

• With this protocol, the two computers can guarantee that the data has
arrived safely and correctly, and then they disconnect the connection.

5
55
Transport Layer

• This method of transferring data tends to be quicker and more


reliable, but puts a higher load on the computer as it has to monitor
the connection and the data going across it.

• A real life comparison to this method would be to pick up the phone


and call a friend.

• You have a conversation and when it is over, you both hang up,
releasing the connection.

6
66
Transport Layer
• The transport layer is responsible for delivery of a message from one
process to another.

• The Transport layer is the core of the Internet model.

• Protocols at this layer oversee the delivery of data from a process, a


running application program, on one computer to a process on another
computer.

• It receives services from the network layer and provides services to the
application layer.
7
77
Position of Transport Layer

8
8
Transport Layer Duties

9
99
Process-to-Process Delivery

• The transport layer is responsible for process-to-


process data delivery.
10
10
10
Port Numbers

11
11
IP Addresses and Port
Numbers

12
12
IP Addresses and Port Numbers
• As you know every computer or device on the Internet must have a
unique number assigned to it called the IP address.

• This IP address is used to recognize your particular computer out of


the millions of other computers connected to the Internet.

• When information is sent over the Internet to your computer how


does your computer accept that information? It accepts that
information by using TCP or UDP ports.

13
13
13
IP Addresses and Port Numbers

• You have an IP address, and then many ports on that IP address.

• You can have a total of 65,535 TCP Ports and another 65,535 UDP
ports.

• When a program on your computer sends or receives data over the


Internet it sends that data to an IP address and a specific port on the
remote computer, and receives the data on a usually random port on
its own computer.

14
14
14
IP Addresses and Port Numbers
• If it uses the TCP protocol to send and receive the data then it will
connect and bind itself to a TCP port.

• If it uses the UDP protocol to send and receive data, it will use a UDP
port.

• Once an application binds itself to a particular port, that port can not be
used by any other application.

• It is first come, first served.


15
15
15
IANA Ranges

16
16
IANA Ranges

• The IANA(Internet Assigned Number Authority) has divided the port


numbers into three ranges:
• Well-Known,
• Registered, and
• Dynamic(or private).

17
17
17
IANA Ranges

• Well Known ports.


• The ports ranging from 0 to 1023 are assigned and controlled by IANA. These are
the well-known ports.

• Registered ports.
• The ports ranging from 1024 to 49,151 are not assigned or controlled by IANA.
They can only be registered with IANA to prevent duplication.

• Dynamic ports.

• The ports ranging from 49,152 to 65,535 are neither controlled nor registered.
They can be used by any process.
18
18
18
Socket Address

19
19
Multiplexing &
Demultiplexing

20
20
Client-Server Model

21
21
Client-Server Relationship

22
22
Client-Server Iterative Server

23
23
Connection Oriented Concurrent
Server

24
24
Types of Sockets

• Are error free

TCP Sockets • Sequence of packets are preserved


• Use Transmission Control Protocol

• Use User Datagram Protocol

UDP Sockets
• They are connectionless in nature
• The packets are not guaranteed to be in sequence or error free

• Bypass encapsulation and de-encapsulation of TCP/IP layers

Raw Sockets • Pass the packet to the application that needs it


• Application is responsible for removing headers and analyzing packet

25
25
TCP Socket – Function Calls

26
26
Socket Interface for Connectionless
Iterative Server

27
27
User Datagram Protocol (UDP)
• UDP is a connectionless, unreliable protocol that has no flow and error
control. It uses port numbers to multiplex data from the application
layer.

• UDP stands for User Datagram Protocol.

• Using this protocol, the computer sending the data, packetizes the
information into small packets and releases it into the network with the
hopes that it will get to the right place.

28
28
28
User Datagram Protocol (UDP)

• What this means is that UDP does not connect directly to the
receiving computer like TCP does, but rather sends the data out and
relies on the devices in between the sending computer and the
receiving computer to get the data where it is supposed to go
properly.

• This method of transmission does not provide any guarantee that


the data you send will ever reach its destination.

29
29
29
User Datagram Protocol (UDP)

• On the other hand, this method of transmission has a very low


overhead and is therefore very popular to use for services that are
not that important to work on the first try.

• A comparison you can use for this method is the plain Postal Service.

• You place your mail in the mailbox and hope the Postal Service will
get it to the proper location.

• Most of the time they do, but sometimes it gets lost along the way.
30
30
30
Well-known Ports Used by UDP
Port Protocol Description
7 Echo Echoes a received datagram back to the sender
9 Discard Discards any datagram that is received
11 Users Active users
13 Daytime Returns the date and the time
17 Quote Returns a quote of the day
19 Chargen Returns a string of characters
53 Nameserver Domain Name Service
67 Bootps Server port to download bootstrap information
68 Bootpc Client port to download bootstrap information
69 TFTP Trivial File Transfer Protocol
111 RPC Remote Procedure Call
123 NTP Network Time Protocol
161 SNMP Simple Network Management Protocol
162 SNMP Simple Network Management Protocol (trap)

31
31
User Datagram Format

32
32
User Datagram Format

• The calculation of checksum and its inclusion in the user datagram are
optional.

• UDP is a convenient transport-layer protocol for applications that


provide flow and error control. It is also used by multimedia
applications.

33
33
33
Transmission Control Protocol (TCP)

• Transmission Control Protocol(TCP) is a connection-oriented, reliable,


stream transport-layer protocol in the Internet Protocol.

• TCP uses a sliding window mechanism for flow control.

• The unit of data transfer between two devices using TCP software is
called a segment.

• It has 20 to 60 bytes of header, followed by data from the application


program.
34
34
34
Well-known Ports Used by TCP

Port Protocol Description


7 Echo Echoes a received datagram back to the sender

9 Discard Discards any datagram that is received


11 Users Active users
13 Daytime Returns the date and the time
17 Quote Returns a quote of the day
19 Chargen Returns a string of characters
20 FTP, Data File Transfer Protocol (data connection)
21 FTP, Control File Transfer Protocol (control connection)
23 TELNET Terminal Network
25 SMTP Simple Mail Transfer Protocol
53 DNS Domain Name Server
67 BOOTP Bootstrap Protocol
79 Finger Finger
80 HTTP Hypertext Transfer Protocol
111 RPC Remote Procedure Call 35
35
Stream Delivery

36
36
Sending & Receiving Buffers

37
37
TCP Segments

38
38
TCP Segments
• The bytes of data being transferred in each connection are numbered
by TCP. The numbering starts with a randomly generated number.

• The value of the sequence number field in a segment defines the


number of the first data byte contained in that segment.

• The value of the acknowledgment field in a segment defines the


number of the next byte a party expects to receive.The
acknowledgment number is cumulative.

39
39
39
TCP Segment Format
❑ Source port address. This is a 16-bit field that defines the port number
of the application program in the host that is sending the segment.
❑ Destination port address. This is a 16-bit field that defines the port
number of the application program in the host that is receiving the segment.
❑ Sequence number. This 32-bit field defines the number assigned to the
first byte of data contained in this segment.
❑ Acknowledgment number. This 32-bit field defines the byte number that
the receiver of the segment is expecting to receive from the other party.
❑ Header length. This 4-bit field indicates the number of 4-byte words in
the TCP header. The length of the header can be between 20 and 60 bytes.
Therefore, the value of this field is always between 5 (5 × 4 = 20) and 15 (15
× 4 = 60).
❑ Control. This field defines 6 different control bits or flags. One or more of
these bits can be set at a time. These bits enable flow control, connection
establishment and termination, connection abortion, and the mode of data
transfer in TCP.
❑ Window size. This field defines the window size of the sending TCP in
bytes
❑ Checksum. This 16-bit field contains the checksum. The calculation of the
checksum for TCP follows the same procedure as the one described for UDP.
However, the use of the checksum in the UDP datagram is optional, whereas
the use of the checksum for TCP is mandatory.
❑ Urgent pointer. This 16-bit field, which is valid only if the urgent flag is
set, is used when the segment contains urgent data. It defines a value 40 that
must be added to the sequence number to obtain the number of the last
Control Field

The PSH flags instruct the operating system to send (for the sending side) and
receive (for the receiving side) the data immediately.

41
41
Connection Establishment
• Three protocol scenarios for establishing a connection using a three-
way handshake
• CR denotes CONNECTION REQUEST

• (a) Normal operation


• (b) Old CONNECTION REQUEST
• (c) Duplicate CONNECTION REQUEST

42
42
Connection Release

43
43
Connection Release
• Four protocol scenarios for releasing a connection
• (a)Normal case of a three-way handshake
• (b) final ACK lost

44
44
Connection Release
• (c) Response lost
• (d) Response lost and subsequent DRs lost

6-14, c,d

45
45
Summary
• The transport layer is responsible for the process to process delivery
of the entire message.

• With Transmission Control Protocol, the two computers can


guarantee that the data has arrived safely and correctly, and then
they disconnect the connection.

• UDP is a connectionless, unreliable protocol that has no flow and


error control. It uses port numbers to multiplex data from the
application layer.

46
46
46
References
• Behrouz A. Forouzan, Data Communication and Networking, 2nd
edition, Tata McGraw-Hill, 2000

• Behrouz A. Forouzan, TCP/IP Protocol Suite, 3rd edition, Tata McGraw-


Hill, 2007

• http://www.opengroup.org/onlinepubs/.html

• http://www.e-zest.net/socket_programming-India.html

47
47
47

You might also like