Category: Computer Networks

TCP in Networking | TCP Protocol

Transport Layer Protocols-

 

There are mainly two transport layer protocols that are used on the Internet-

 

 

  1. Transmission Control Protocol (TCP)
  2. User Datagram Protocol (UDP)

 

In this article, we will discuss about Transmission Control Protocol (TCP).

Learn about User Datagram Protocol.

 

Transmission Control Protocol-

 

  • TCP is short for Transmission Control Protocol.
  • It is a transport layer protocol.
  • It has been designed to send data packets over the Internet.
  • It establishes a reliable end to end connection before sending any data.

 

Characteristics Of TCP-

 

Point-01:

 

TCP is a reliable protocol.

 

This is because-

  • It guarantees the delivery of data packets to its correct destination.
  • After receiving the data packet, receiver sends an acknowledgement to the sender.
  • It tells the sender whether data packet has reached its destination safely or not.
  • TCP employs retransmission to compensate for packet loss.

 

Read More- TCP Retransmission

 

Point-02:

 

TCP is a connection oriented protocol.

 

This is because-

  • TCP establishes an end to end connection between the source and destination.
  • The connection is established before exchanging the data.
  • The connection is maintained until the application programs at each end finishes exchanging the data.

 

Point-03:

 

TCP handles both congestion and flow control.

 

  • TCP handles congestion and flow control by controlling the window size.
  • TCP reacts to congestion by reducing the sender window size.

 

Read More- TCP Congestion Control

 

Point-04:

 

TCP ensures in-order delivery.

 

  • TCP ensures that the data packets get deliver to the destination in the same order they are sent by the sender.
  • Sequence Numbers are used to coordinate which data has been transmitted and received.

 

Point-05:

 

TCP connections are full duplex.

 

  • TCP connection allows to send data in both the directions at the same time.
  • So, TCP connections are Full Duplex.

 

Point-06:

 

TCP works in collaboration with Internet Protocol.

 

  • A TCP connection is uniquely identified by using-

Combination of port numbers and IP Addresses of sender and receiver.

  • IP Addresses indicate which systems are communicating.
  • Port numbers indicate which end to end sockets are communicating.
  • Port numbers are contained in the TCP header and IP Addresses are contained in the IP header.
  • TCP segments are encapsulated into an IP datagram.
  • So, TCP header immediately follows the IP header during transmission.

 

Point-07:

 

TCP can use both selective & cumulative acknowledgements.

 

  • TCP uses a combination of Selective Repeat and Go back N protocols.
  • In TCP, sender window size = receiver window size.
  • In TCP, out of order packets are accepted by the receiver.
  • When receiver receives an out of order packet, it accepts that packet but sends an acknowledgement for the expected packet.
  • Receiver may choose to send independent acknowledgements or cumulative acknowledgement.
  • To sum up, TCP is a combination of 75% SR protocol and 25% Go back N protocol.

 

Point-08:

 

TCP is a byte stream protocol.

 

  • Application layer sends data to the transport layer without any limitation.
  • TCP divides the data into chunks where each chunk is a collection of bytes.
  • Then, it creates a TCP segment by adding IP header to the data chunk.
  • TCP segment = TCP header + Data chunk.

 

Point-09:

 

TCP provides error checking & recovery mechanism.

 

TCP provides error checking and recovery using three simple techniques-

  1. Checksum
  2. Acknowledgement
  3. Retransmission

 

Also Read- Checksum

 

To gain better understanding about Transmission Control Protocol,

Watch this Video Lecture

 

Next Article- TCP Header

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

DNS | SMTP Vs POP3 | HTTP Vs FTP

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will compare all these application layer protocols.

 

Comparison of Application Layer Protocols-

 

The following table compares all the important application layer protocols-

 

DNS HTTP SMTP POP FTP
Stateful / Stateless Stateless Stateless Stateless Stateful Stateful
Transport Protocol Used UDP TCP TCP TCP TCP
Connectionless / Connection Oriented Connectionless Connectionless Connection Oriented Connection Oriented Connection Oriented
Persistent / Non-persistent Non-persistent HTTP 1.0 is non-persistent.

HTTP 1.1 is persistent.

Persistent Persistent Control connection is persistent.

Data connection is non-persistent.

Port Number Used 53 80 25 110 20 for data connection.

21 for control connection.

In band / Out-of-band In band In band In band In band Out-of-band

 

Next Article- Cryptography and Network Security

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

File Transfer Protocol | FTP Protocol

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about File Transfer Protocol (FTP).

 

File Transfer Protocol-

 

  • FTP is short for File Transfer Protocol.
  • It is an application layer protocol.

 

Purpose-

 

  • It is used for exchanging files over the internet.
  • It enables the users to upload and download the files from the internet.

 

Working-

 

FTP establishes two TCP connections between the client and the server.

  • One connection is used for transferring data.
  • Other connection is used for transferring control information.

 

 

Characteristics of FTP-

 

  • FTP uses TCP at the transport layer.
  • FTP uses port number 21 for control connection.
  • FTP uses port number 20 for data connection.
  • FTP uses persistent TCP connections for control connection.
  • FTP uses non-persistent connections for data connection.
  • FTP is a connection oriented protocol.
  • FTP is an out-of-band protocol as data and control information flow over different connections.
  • SMTP is a stateful protocol.

 

Important Notes-

 

Note-01:

 

Emails can’t be sent using FTP.

 

This is because-

  • FTP requires the connection establishment between the client and server before transferring the files.
  • So, both have to be online at the same time.
  • That is why, emails are not sent using FTP.

 

Note-02:

 

FTP can transfer one file at a time.

 

  • FTP is used for transferring one file at a time in either direction between the client and the server.

 

Note-03:

 

FTP is a stateful protocol.

 

This is because-

  • The client establishes control connection for the duration of an FTP session.
  • It typically spans multiple data transfers.
  • So, FTP is a stateful protocol.

 

To gain better understanding about File Transfer Protocol,

Watch this Video Lecture

 

Next Article- Comparison of Application Layer Protocols

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

POP Protocol | IMAP Protocol | POP Vs IMAP

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about Post Office Protocol (POP).

 

Post Office Protocol-

 

  • POP is short for Post Office Protocol.
  • It is an application layer protocol.

 

Purpose-

 

  • It is a message access protocol.
  • It enables the clients to receive or download the emails from their remote mail server.
  • POP version 3 (POP3) is the most popularly used version.

 

Working-

 

To retrieve a message from the mail server-

  • Client establishes a TCP connection using port 110.
  • Client identifies itself to the server.
  • Client issues a series of POP3 commands.

 

 

Characteristics of POP-

 

  • POP is a pull protocol.
  • POP uses TCP at the transport layer.
  • POP uses port number 110.
  • POP uses persistent TCP connections.
  • POP is a connection oriented protocol.
  • POP is an in-band protocol.
  • POP is a stateful protocol until the mail is downloaded as well as stateless across sessions.

 

Internet Message Access Protocol-

 

  • IMAP is short for Internet Message Access Protocol.
  • It is an application layer protocol.
  • It also enables the clients to receive or download the emails from their remote mail server.

 

POP has been largely superseded by Internet Message Access Protocol (IMAP).

 

Characteristics of IMAP-

 

  • IMAP is a pull protocol.
  • IMAP uses TCP at the transport layer.
  • IMAP uses port number 143.
  • IMAP uses persistent TCP connections.
  • IMAP is a connection oriented protocol.
  • IMAP is an in-band protocol.
  • IMAP is a stateful protocol.
  • IMAP distributes mail boxes across multiple servers.

 

POP Vs IMAP-

 

The following table lists the differences between POP and IMAP-

 

Post Office Protocol Internet Message Access Protocol
POP allows you to read the mail only after downloading it. IMAP allows you to check the mail content before downloading.

So, with IMAP you can choose to download your messages or just delete them.

The email message is downloaded to the local computer and the copy at the server is deleted. The email message is stored on the mail server itself.
The user can not organize mails in the mail box of the mail server. The user can organize mails on the server.
Mails can only be accessed from a single device. Mails can be accessed from multiple devices which is the biggest advantage.
In POP, the mail server and client’s mail account are not synced.

So, changes made in the client’s mail account are not visible on the web mail inbox.

 

Example-

 

If you are using POP and marks a mail as read, it does not get marked as read in the web mail inbox because the mails are downloaded to the computer and so the changes won’t be visible on the server.

In IMAP, the mail server and the client’s mail account are synced.

So, changes made in the client’s mail account are instantly visible on the web mail inbox.

 

Example-

 

If you are using IMAP and marks a mail as read, it gets marked as read in the web mail inbox too because the changes are taking place on the server.

POP is a stateful protocol until the mail is downloaded as well as stateless across sessions. IMAP is a stateful protocol because the IMAP server has to maintain a folder hierarchy for each of its users.
POP is a better choice for those who hardly checks their mail on any other computer. IMAP is a better choice for those who frequently check their mails on other computers.

 

To gain better understanding about POP Protocol and IMAP Protocol,

Watch this Video Lecture

 

Next Article- File Transfer Protocol | FTP

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.

Simple Mail Transfer Protocol | SMTP Protocol

Application Layer Protocols-

 

Important application layer protocols are-

 

 

  1. Domain Name Service (DNS)
  2. Hyper Text Transfer Protocol (HTTP)
  3. Simple Mail Transfer Protocol (SMTP)
  4. Post Office Protocol (POP)
  5. File Transfer Protocol (FTP)

 

In this article, we will discuss about Simple Mail Transfer Protocol (SMTP).

 

Simple Mail Transfer Protocol-

 

  • SMTP is short for Simple Mail Transfer Protocol.
  • It is an application layer protocol.
  • It is used for sending the emails efficiently and reliably over the internet.

 

Working-

 

  • SMTP server is always on a listening mode.
  • Client initiates a TCP connection with the SMTP server.
  • SMTP server listens for a connection and initiates a connection on that port.
  • The connection is established.
  • Client informs the SMTP server that it would like to send a mail.
  • Assuming the server is OK, client sends the mail to its mail server.
  • Client’s mail server use DNS to get the IP Address of receiver’s mail server.
  • Then, SMTP transfers the mail from sender’s mail server to the receiver’s mail server.

 

 

While sending the mail, SMTP is used two times-

  1. Between the sender and the sender’s mail server
  2. Between the sender’s mail server and the receiver’s mail server

 

NOTE-

 

To receive or download the email,

  • Another protocol is needed between the receiver’s mail server and the receiver.
  • The most commonly used protocols are POP3 and IMAP.

 

Characteristics of SMTP-

 

  • SMTP is a push protocol.
  • SMTP uses TCP at the transport layer.
  • SMTP uses port number 25.
  • SMTP uses persistent TCP connections, so it can send multiple emails at once.
  • SMTP is a connection oriented protocol.
  • SMTP is an in-band protocol.
  • SMTP is a stateless protocol.

 

Important Points-

 

Note-01:

 

SMTP is a pure text based protocol.

 

  • SMTP can only handle the messages containing 7 bit ASCII text.
  • SMTP can not transfer other types of data like images, video, audio etc.
  • SMTP can not transfer executable files and binary objects.
  • SMTP can not transfer the text data of other languages like French, Japanese, Chinese etc.

(since they are represented in 8 bit codes)

 

Note-02:

 

MIME extends the limited capabilities of email.

 

As the name suggests,

  • Multipurpose Internet Email Extension (MIME) is an extension to the internet email protocol.
  • It extends the limited capabilities of email by enabling the users to send and receive graphics, audio files, video files etc in the message.
  • MIME was specially designed for SMTP.

 

Note-03:

 

SMTP is a stateless protocol.

 

This is because-

  • It does not maintain the state of its clients.
  • If an email is asked to be sent twice, then SMTP server resends it without saying that the email has already been sent.

 

Note-04:

 

We can not use SMTP at the receiver’s side.

 

This is because-

  • SMTP is a push protocol.
  • At receiver’s side, a pull protocol like POP3, IMAP is needed.
  • Receiver periodically checks if he has any mail from his mail server.

 

Note-05:

 

Sender and receiver can not run SMTP between their machines.

 

This is because-

  • Machines can not always be ON.
  • So, the functionality has been divided between the client and the mail server.
  • The mail server receives the mail on behalf of its client and manages the mail box of the client.

 

Note-06:

 

SMTP is not suitable for client authentication.

 

This is because-

  • SMTP does not require authentication.
  • It allows anyone on the Internet to send emails to anyone or even to a large group of people.
  • SMTP Auth short for SMTP Authentication has been provided for authentication.

 

To gain better understanding about SMTP Protocol,

Watch this Video Lecture

 

Next Article- Post Office Protocol | POP

 

Get more notes and other study material of Computer Networks.

Watch video lectures by visiting our YouTube channel LearnVidFun.