Sie sind auf Seite 1von 6

1

Chapter-6
Transport Layer
6.1 Services provided to upper layer

The transport layer provides a logical connection between a source host and a destination host.
Transport protocols segment and reassemble data sent by upper-layer applications into the same
data stream, or logical connection, between end points.
• Creates packet from bytes stream received from the application layer.
• Uses port number to create process to process communication.
• Uses a sliding window protocol to achieve flow control.
• Uses acknowledgement packet, timeout and retransmission to achieve error
control.
The primary duty of the transport layer is to provide end-to-end control and reliability as data
travels through this cloud. This is accomplished through the use of sliding windows, sequence
numbers, and acknowledgments. The transport layer also defines end-to-end connectivity between
host applications. Transport layer protocols include TCP and UDP. TCP is a connection-oriented
transport layer protocol that provides reliable full-duplex data transmission. TCP is part of the
TCP/IP protocol stack. In a connection-oriented environment, a connection is established between
both ends before the transfer of information can begin. TCP breaks messages into segments,
reassembles them at the destination, and resends anything that is not received. TCP supplies a
virtual circuit between end-user applications.

6.2 TCP Header Format:


TCP uses only a single type of protocol data unit, called a TCP segment. The header
is shown in
Figure. Because one header must serve to perform all protocol mechanisms, it is
rather large, with a minimum length of 20 octets.

The following protocols use TCP:


• FTP
• HTTP

Compiled by: Er. Raju Dhakal


2

• SMTP
• Telnet

The following are the definitions of the fields in the TCP segment:
• Source port – Number of the port that sends data
• Destination port – Number of the port that receives data
• Sequence number – Number used to ensure the data arrives in the
correct order
• Acknowledgment number – Next expected TCP octet
• HLEN – Number of 32-bit words in the header
• Reserved – Set to zero
• Code bits – Control functions, such as setup and termination of a
session
• Window – Number of octets that the sender will accept
• Checksum – Calculated checksum of the header and data fields
• Urgent pointer – Indicates the end of the urgent data
• Option – One option currently defined, maximum TCP segment size
• Data – Upper-layer protocol data

Code Bits or Flags (6 bits).


• URG: Urgent pointer field significant.
• ACK: Acknowledgment field significant.
• PSH: Push function.
• RST: Reset the connection.
• SYN: Synchronize the sequence numbers.
• FIN: No more data from sender.

6.3 UDP (User Datagram Protocol): UDP is the connectionless transport protocol in the TCP/IP
protocol stack. UDP is a simple protocol that exchanges datagrams without guaranteed delivery.
It relies on higher-layer protocols to handle errors and retransmit data. UDP does not use windows
or ACKs. Reliability is provided by application layer protocols. UDP is designed for applications
that do not need to put sequences of segments together.
The following protocols use UDP:

Compiled by: Er. Raju Dhakal


3

• TFTP
• SNMP
• DHCP
• DNS

The following are the definitions of the fields in the UDP segment:
• Source port – Number of the port that sends data
• Destination port – Number of the port that receives data
• Length – Number of bytes in header and data
• Checksum – Calculated checksum of the header and data fields
• Data – Upper-layer protocol data

TCP vs UDP:

Compiled by: Er. Raju Dhakal


4

6.4 Stream Control Transmission Protocol (SCTP)

Stream Control Transmission Protocol (SCTP) is a transport-layer protocol that can be used on top
of IP networks for end-to-end communications. SCTP is an IETF standard developed by
the Transport Area Working Group. SCTP has been standardized by the IETF in a series of RFCs
that define the protocol, its applicability to other protocols, and its management. SCTP was
originally defined in RFC 2960 in October 2000, but was then updated with RFC 4960 in
September 2007.

SCTP is similar to TCP in many ways. They are both unicast connection-oriented protocols that
provide reliable transport, in-sequence packet delivery and rate-adaptive congestion control. TCP
has an additive 16-bit checksum (RFC 1071) and SCTP has a 32-bit CRC (RFC 4960).

SCTP does provide some functions not found in TCP. SCTP is message-oriented whereas TCP is
stream-oriented. SCTP can handle multiple simultaneous streams and multiplexed streams where
TCP can handle only a single stream of data per connection. SCTP's stream-aware connection
control is one of its most notable features. SCTP also provides for multihoming in that the end
points can use multiple IP addresses for the connection. The SCTP connection endpoints can use
IP addresses from different ISPs for network-level fault tolerance. If, during the connection, one
of those ISPs were to fail, the connection would just use the IP address from the operational ISP
for the connections. Therefore, multihoming is supported without requiring the sites to have their
own AS number and run BGP.

6.5 Ports and Sockets

On a TCP/IP network every device must have an IP address. The IP address identifies the
device e.g. computer. However, an IP address alone is not sufficient for running network
applications, as a computer can run multiple applications and/or services. Just as the IP address
identifies the computer, The network port identifies the application or service running on the
computer. The use of ports allow computers/devices to run multiple services/applications. The
diagram below shows a computer to computer connection and identifies the IP addresses and ports.

Compiled by: Er. Raju Dhakal


5

If you use a house or apartment block analogy the IP address corresponds to the street address. All
of the apartments share the same street address. However each apartment also has an apartment
number which corresponds to the Port number. Port Number Ranges and Well Known Ports A
port number uses 16 bits and so can therefore have a value from 0 to 65535 decimal Port numbers
are divided into ranges as follows:

Port numbers 0-1023 – Well known ports. These are allocated to server services by
the Internet Assigned Numbers Authority (IANA). e.g Web servers normally use port 80 and
SMTP servers use port 25 (see diagram above).

Ports 1024-49151- Registered Port -These can be registered for services with the IANA and
should be treated as semi-reserved. User written programs should not use these ports.

Ports 49152-65535– These are used by client programs and you are free to use these in client
programs. When a Web browser connects to a web server the browser will allocate itself a port in
this range. Also known as ephemeral ports.

A connection between two computers uses a socket. A socket is the combination of IP address
plus port {outline]Each end of the connection will have a socket.{/outline] Imagine sitting on your

Compiled by: Er. Raju Dhakal


6

PC at home, and you have two browser windows open. One looking at the Google website, and
the other at the Yahoo website. The connection to Google would be:

Your PC – IP1+port 60200 ——– Google IP2 +port 80 (standard port)

The combination IP1+60200 = the socket on the client computer and IP2 + port 80 = destination
socket on the Google server. The connection to Yahoo would be:

your PC – IP1+port 60401 ——–Yahoo IP3 +port 80 (standard port)

The combination IP1+60401 = the socket on the client computer and IP3 + port 80 = destination
socket on the Yahoo server.

Compiled by: Er. Raju Dhakal

Das könnte Ihnen auch gefallen