networking unit 5
networking unit 5
TRANSPORT LAYER
● The transport Layer is the second layer in the TCP/IP model and the fourth layer
in the OSI model.
● It is an end-to-end layer used to deliver messages to a host.
● It is termed an end-to-end layer because it provides a point-to-point connection
rather than hop-to-hop, between the source host and destination host to deliver
the services reliably.
● The unit of data encapsulation in the Transport Layer is a segment.
At the receiver’s side: The transport layer receives data from the Network layer,
reassembles the segmented data, reads its header, identifies the port number, and
forwards the message to the appropriate port in the Application layer.
While Data Link Layer requires the MAC address (48 bits address contained inside the
Network Interface Card of every host machine) of source-destination hosts to correctly
deliver a frame and the Network layer requires the IP address for appropriate routing
of packets, in a similar way Transport Layer requires a Port number to correctly deliver
the segments of data to the correct process amongst the multiple processes running on
a particular host. A port number is a 16-bit address used to identify any client-server
program uniquely.
Process to Process Delivery
The transport layer is also responsible for creating the end-to-end Connection between
hosts for which it mainly uses TCP and UDP. TCP is a secure, connection-oriented
protocol that uses a handshake protocol to establish a robust connection between two
end hosts. TCP ensures the reliable delivery of messages and is used in various
applications. UDP, on the other hand, is a stateless and unreliable protocol that ensures
best-effort delivery. It is suitable for applications that have little concern with flow or
error control and requires sending the bulk of data like video conferencing. It is often
used in multicasting protocols.
Multiplexing(many to one) is when data is acquired from several processes from the
sender and merged into one packet along with headers and sent as a single packet.
Multiplexing allows the simultaneous use of different processes over a network that is
running on a host. The processes are differentiated by their port numbers. Similarly,
Demultiplexing(one to many is required at the receiver side when the message is
distributed into different processes. Transport receives the segments of data from the
network layer and delivers it to the appropriate process running on the receiver’s
machine.
4. Congestion Control
Congestion is a situation in which too many sources over a network attempt to send data
and the router buffers start overflowing due to which loss of packets occurs. As a
result, the retransmission of packets from the sources increases the congestion
further. In this situation, the Transport layer provides Congestion Control in different
ways. It uses open-loop congestion control to prevent congestion and closed-loop
congestion control to remove the congestion in a network once it occurred. TCP provides
AIMD – additive increases multiplicative decrease and leaky bucket technique for
congestion control.
Leaky Bucket Congestion Control Technique
The transport layer checks for errors in the messages coming from the application layer
by using error detection codes, and computing checksums, it checks whether the
received data is not corrupted and uses the ACK and NACK services to inform the
sender if the data has arrived or not and checks for the integrity of data.
The transport layer provides a flow control mechanism between the adjacent layers of
the TCP/IP model. TCP also prevents data loss due to a fast sender and slow receiver by
imposing some flow control techniques. It uses the method of sliding window protocol
which is accomplished by the receiver by sending a window back to the sender informing
the size of data it can receive.
1. UDP PROTOCOL
UDP Header
UDP applications
● Domain Name Services
● Simple Network Management Protocol
● Trivial File Transfer Protocol
● Routing Information Protocol
● Kerberos
● Chatting and online games
● Bootp/DHCP
● Broadcasting and Multicasting applications.
2.TCP PROTOCOL
● TCP stands for Transmission Control Protocol.
● It is a transport layer protocol that facilitates the transmission of packets from
source to destination.
● It is a connection-oriented protocol that means it establishes the connection prior
to the communication that occurs between the computing devices in a network.
● This protocol is used with an IP protocol, so together, they are referred to as a
TCP/IP.
● The main functionality of the TCP is to take the data from the application layer.
Then it divides the data into a several packets, provides numbering to these
packets, and finally transmits these packets to the destination.
● The TCP, on the other side, will reassemble the packets and transmits them to the
application layer.
Services by TCP
Following are some of the services offered by the Transmission Control Protocol (TCP)
to the processes at the application layer:
All the above mentioned TCP services are explained below in detail.
● The sending and receiving processes cannot produce and receive data at the same
speed. Hence, TCP needs a buffer for storage.
● There are two methods of buffers used in each dissection, which are as follows:
➔ Sending Buffer
➔ Receiving Buffer
● A buffer can be implemented by using a circular array of 1-byte location, as shown
in the figure below. The figure shows the movement of data in one direction on
the sending side.
● In practice, the TCP may send only a port of data due to the slowness of the
receiving process or congestion in the network.
● The buffer at the receiver is divided into two parts as mentioned below:
➔ The part was containing empty locations.
➔ The part was containing the received bytes, which the sending process can
consume.
● The buffer has three types of locations, which are as follows:
➔ Empty Locations.
➔ Locations that contain the bytes which have been sent, but not
acknowledged. These bytes are kept in the buffer till an acknowledgment is
received.
➔ The location that contains the bytes which are to be sent by the sending TCP
3. Bytes and Segments
● TCP offers a full-duplex service where the data can flow in both directions
simultaneously.
● Each TCP will then have a sending buffer and receiving buffer. The TCP segments
are sent in both directions.
5. Connection-Oriented Service
6. Reliable Service
● TCP is a reliable protocol as it follows the flow and error control mechanism. It
also supports the acknowledgment mechanism, which checks the state and sound
arrival of the data.
● In the acknowledgment mechanism, the receiver sends either positive or negative
acknowledgment to the sender so that the sender can get to know whether the
data packet has been received or needs to resend.
Features of TCP
● TCP is a reliable protocol. That is, the receiver always sends either positive or
negative acknowledgement about the data packet to the sender, so that the
sender always has a bright clue about whether the data packet has reached the
destination or it needs to resend it.
● TCP ensures that the data reaches the intended destination in the same order it
was sent.
● TCP is connection oriented. TCP requires that connection between two remote
points be established before sending actual data.
● TCP provides error-checking and recovery mechanisms.
● TCP provides end-to-end communication.
● TCP provides flow control and quality of service.
● TCP operates in Client/Server point-to-point mode.
● TCP provides a full duplex server, i.e. it can perform roles of both receiver and
sender.
○ Source port: It defines the port of the application, which is sending the data. So,
this field contains the source port address, which is 16 bits.
○ Destination port: It defines the port of the application on the receiving side. So,
this field contains the destination port address, which is 16 bits.
○ Sequence number: This field contains the sequence number of data bytes in a
particular session.
○ Acknowledgement number: When the ACK flag is set, then this contains the next
sequence number of the data byte and works as an acknowledgment for the
previous data received. For example, if the receiver receives the segment number
'x', then it responds 'x+1' as an acknowledgment number.
○ HLEN: It specifies the length of the header indicated by the 4-byte words in the
header. The size of the header lies between 20 and 60 bytes. Therefore, the value
of this field would lie between 5 and 15.
○ Reserved: It is a 4-bit field reserved for future use, and by default, all are set to
zero.
○ Flags
There are six control bits or flags:
1. URG: It represents an urgent pointer. If it is set, then the data is
processed urgently.
2. ACK: If the ACK is set to 0, then it means that the data packet does not
contain an acknowledgment.
3. PSH: If this field is set, then it requests the receiving device to push the
data to the receiving application without buffering it.
4. RST: If it is set, then it requests to restart a connection.
5. SYN: It is used to establish a connection between the hosts.
6. FIN: It is used to release a connection, and no further data exchange will
happen.
Window size
It is a 16-bit field. It contains the size of data that the receiver can accept. This
field is used for the flow control between the sender and receiver and also
determines the amount of buffer allocated by the receiver for a segment. The
value of this field is determined by the receiver.
Checksum
It is a 16-bit field. This field is optional in UDP, but in the case of TCP/IP, this
field is mandatory.
Urgent pointer
It is a pointer that points to the urgent data byte if the URG flag is set to 1. It
defines a value that will be added to the sequence number to get the sequence
number of the last urgent byte.
Options
It provides additional options. The optional field is represented in 32-bits. If this
field contains the data less than 32-bit, then padding is required to obtain the
remaining bits.
COMPARISON OF TCP VS UDP
Full form It stands for User Datagram It stands for Transmission Control
Protocol. Protocol.
UDP, on the other hand, provides only TCP is more reliable as it provides
basic error checking support using error checking support and also
Reliability checksum. So, the delivery of data to guarantees delivery of data to the
the destination cannot be guaranteed destination router.
in UDP as in case of TCP.
UDP is faster and more efficient than TCP is slower and less efficient in
TCP. performance as compared to UDP. Also
Performance
TCP is heavy-weight as compared to
UDP.
Introduction :
● Application Layer of the internet model i.e TCP/IP model . This is the layer where
all the intersecting applications are found. The application layer allows people to
use the internet.
● The layers below the application layer provide reliable transport but they don’t do
any real work for the users.
1. Structural Components
2. Semantic Components
Architecture of WWW
The WWW is mainly a distributed client/server service where a client using the browser
can access the service using a server. The Service that is provided is distributed over
many different locations commonly known as sites/websites.
● Each website holds one or more documents that are generally referred to as web
pages.
● Where each web page contains a link to other pages on the same site or at other
sites.
● These pages can be retrieved and viewed by using browsers.
In the above case, the client sends some information that belongs to site A. It generally
sends a request through its browser (It is a program that is used to fetch the
documents on the web).
Also the request generally contains other information like the address of the site, web
page(URL).
The server at site A finds the document then sends it to the client. after that when the
user or say the client finds the reference to another document that includes the web
page at site B.
The reference generally contains the URL of site B. And the client is interested to take
a look at this document too. Then after the client sends the request to the new site and
then the new page is retrieved.
Generic Domains
● It defines the registered hosts according to their generic behavior.
● Each node in a tree defines the domain name, which is an index to the DNS
database.
● It uses three-character labels, and these labels describe the organization type.
Country Domain
The format of country domain is the same as a generic domain, but it uses two-
character country abbreviations (e.g., us for the United States) in place of three
character organizational abbreviations.
Inverse Domain
The inverse domain is used for mapping an address to a name. When the server has
received a request from the client, and the server contains the files of only authorized
clients. To determine whether the client is on the authorized list or not, it sends a query
to the DNS server and asks for mapping an address to the Name.
Working of DNS
● DNS is a client/server network communication protocol. DNS clients send requests
to the. server while DNS servers send responses to the client.
● Client requests contain a name which is converted into an IP address known as a
forward DNS lookups while requests containing an IP address which is converted
into a name known as reverse DNS lookups
HTTP Transaction:
The above figure shows the HTTP transaction between client and server. The client
initiates a transaction by sending a request message to the server. The server replies to
the request message by sending a response message.
Question Bank: