Sie sind auf Seite 1von 8

TCP/IP Protocol

Deepankar Agrawal
Electronics and Communication Engineering
IIT Roorkee, Uttrakhand 247667
September 29, 2015
Abstract
When two computers wish to exchange information over a network, there are several components
that must be in place before the data can actually be sent and received. Of course, the physical hardware
must exist, which is typically either an Ethernet link or a serial communications port for direct or
dial-up connections. Beyond this physical connection, however, computers also need to use a protocol
that defines the parameters and rules of the communication between them. In short, a protocol defines
the rules of the road that each computer must follow so that all of the systems in the network
can exchange data. One of the most popular protocols in use today is TCP/IP, which stands for
Transmission Control Protocol/Internet Protocol.

Introduction

Unlike a single local network, where every system is directly connected to each other, an internet is
a collection of networks, combined into a single, virtual network. The most widely used internet is
Internet. The Internet Protocol provides the means by which any system on any network can communicate
with another as easily as if they were on the same physical network. An Internet Protocol is just a
networking model which provides different sets of rules communication so that data can be transferred.
Each computer (known as a host) on the Internet has at least one IP (Internet Protocol) address that
uniquely identifies it from all other computers on the Internet. When you send or receive data (for
example, an e-mail or a Web page), the message gets divided into little chunks of data called packets.
Each of these packets contains both the senders IP address and the receivers address. Any packet is sent
first to a gateway computer that reads the destination address and forwards the packet to an adjacent
gateway that in turn reads the destination address and so forth across the Internet until one gateway
recognizes the packet as belonging to a computer within its immediate neighborhood or domain. That
gateway then forwards the packet directly to the computer whose address is specified.The most widely
used version of IP today is Internet Protocol Version 4 (IPv4). However, IP Version 6 (IPv6) is also
beginning to be supported. IPv6 provides for much longer addresses and therefore for the possibility of
many more Internet users. IPv6 includes the capabilities of IPv4 and any server that can support IPv6
packets can also support IPv4 packets.

Figure 1: Illustration of data transfer over Internet using TCP/IP.


A packet consists of a header followed by application-defined data. The header contains the addressing
information that is used to deliver the packet to its destination, much like an envelope is used to address
1

and contain postal mail. And like postal mail, there is no guarantee that a packet will actually arrive at
its destination. In fact, packets may be lost, duplicated or delivered out of order during their travels over
the network. Needless to say, this kind of unreliability can cause a lot of problems for software developers.
Whats really needed is a reliable, straightforward way to exchange data without having to worry about
lost packets or jumbled data.To fill this need, the Transmission Control Protocol (TCP) was developed.
Built on top of IP, TCP offers a reliable, full-duplex byte stream that may be read and written to in a
fashion similar to the use of a serial port. By convention, TCP/IP is used to refer to a suite of protocols,
all based on the Internet Protocol (IP). It provides end-to-end connectivity specifying how data should be
packetized, addressed, transmitted, routed and received at the destination. It is a hierarchical protocol
made up of different interactive modules, each of which provides different functionality. This functionality
is organized into four abstraction layers which are used to sort all related protocols according to the scope
of networking involved.

Protocol Layering

Whenever we talk about Internet we always hear one word protocol. It defines set of rules sender and
receiver may need to follow to be able to communicate effectively. When communication is simple we
may need only one simple protocol. But since our IP is connectionless and unreliable service so our
communication will be complex, we may need to divide our task between different layers, in which case
we need protocol at each layer, or protocol layering[4].
We can take example of simple talk between two person as a single layer protocol. Since the communication is simple we do not need multiple layers.

Figure 2: A single Layered protocol.


But suppose if they move away from each other and want to discuss something private that they
do not want others to know about. They agree to mail each other but they fear that their mail can
be intercepted before reaching them so they decided to encrypt the message using some key which they
discussed before moving away.Thus now our communication can be regarded as three layer process - first
getting the mail through delivery, then decrypting the cipher-text and then reading plain text illustrated
in Fig. 3.

Figure 3: A multi-layered protocol with three layers.


Thus, Protocol layering enables us to divide a complex task into several smaller and simpler tasks.
It have many advantages and rather implementing everything in one layer it breaks everything into
modules.Thus any application can use only the modules required by them. It does not need to go
through whole process. Thus we can say that, It allows us to separate services from implementation.

We know that TCP/IP protocol suite is a hierarchical model (which means that each upper level
protocol is supported by the services provided by one or more lower level protocols) that contain four
layers illustrated in Fig. 4.
Network Interface Layer
Internet or Network Layer
Transport Layer
Application Layer

Figure 4: Layers in TCP/IP protocol suite.


The layers must follow some specific rules for effective communication. These rules are summarized
in principles of protocol layering.

2.1

Principles of Protocol Layering

First Principle: If we need communication to be bidirectional, we need to make layer such that it can
perform both of opposite tasks[1] i.e. send or receive, encapsulate or decapsulate, etc. For example, in
above example first layer need to deliver in one direction and receive in another and similarly second
layer need to encrypt/decrypt the mails.
Second Principle: Also the objects in same layer on both sides should be identical i.e. third layer
has plain text and second layer has cipher-text.

2.2

Logical Connection

Logical connection can be described as layer to layer connection connection. It means application layer
of client is logically connected to application level of server or vice-versa. We can imagine a imaginary
connection between them.
Let us take a example that Computer A sends data to Computer B through two links (Link1 and
Link2) and a Router. We can see from fig. 5 that client and server computer need to use all five layers
where as links and routers only use as number of layers as they require. Thus breaking our communication
pattern into layers helps us to eliminate extra time required to transverse message through unused layers
in links and routers. Since Links are only used on physical level it have no need for interface design of
higher levels.

Figure 5: Communication through Internet using Layered Protocol.

Description Of Each Layer

Each Layer have its own properties and protocols which need to be understood to properly define TCP/IP
protocol.

3.1

Network Interface Layer

The Network Interface layer (also called as Network Access layer) is responsible for placing TCP/IP
packets on the network medium and receiving packets off the network medium. TCP/IP was designed
to be independent of the network access method, frame format, and medium. TCP/IP does not define
any specific protocol for the data-link layer. It supports all the standard and proprietary protocols. Any
protocol that can take the datagram and carry it through the link suffices for the network layer. The
data-link layer takes a datagram and encapsulates it in a packet called as frame. Frames are then carried
by physical layer in form of bits. We need to know that bits does not flow between cables or Ethernet
wires but it is ultimately the electrical or Optical Signals that carry our information.
In this way, TCP/IP can be used to connect different network types and mediums. Independence from
any specific network technology gives TCP/IP give the ability to be adapted to any new technologies
such as Asynchronous Transfer Mode (ATM). Some examples of Network Interface Protocols are :
LAN Media Access Control (MAC) scheme: This includes IEEE standards such as IEEE
802.3 (Ethernet), IEEE 802.4 (Token Bus), IEEE 802.5 (Token Ring), IEEE 802.11 (Wireless LAN,
or WLAN), IEEE 802.16 (WiMAX), and IEEE 802.17 (Resilient Packet Ring, or RPR). Many of
these technologies have now become old and are not used (or completely obsolete). Ethernet and
WLAN (or Wi-Fi) predominate over other technologies. Some carriers are still implementing RPR
within their own networks. WiMAX is also being deployed by some carriers as a wireless Internet
access alternative.
Point-to-Point Protocol (PPP): As the name suggests, PPP was primarily developed for use
over any serial point-to-point circuit. That includes switched access circuits such as ISDN and
POTS, as well as dedicated circuits (also known as leased lines or private lines).
Multilink Point-to-Point Protocol (MLPPP): It is also known as Multilink PPP (MLP, or
simply MP) is a version of PPP that supports inverse multiplexing (at the Data Link Layer) i.e.
two or more PPP connections into a single logical communications channel.
Frame relay: This is a fast packet service which was initially developed to replace the older X.25
services, supporting transmission rates from DS-0 through DS-3.
Asynchronous Transfer Mode (ATM): This cell relay technology is also considered as a fast
packet service, but it is capable of supporting data, voice, and video. ATM can operate at transmission rates from DS-1 to the higher SONET speeds. It is considered as one of the best technologies.

3.2

Internet Layer

The main aim of this layer is to send the data to its destination by using IP addressing, Routing tables,
etc. Some of the specific tasks performed by this layer is :
Logical Addressing: Every device that communicates over a network has a associated logical
address, which is sometimes also called as layer three address. For example, on the Internet, the
Internet Protocol (IP) is the network layer protocol and every machine has an IP address. That
addressing is also done at the data link layer as well, but those addresses refer to local physical
devices. In contrast, logical addresses used by this layer are independent of particular hardware and
must be unique across an entire inter-network. This address is known as IP address and is provided
by Operating System. This address is then used to find the destination host over Internet.
Routing: It is the job of the this layer protocol that functions at the network layer to handle
incoming packets from various sources, determine their final destination, and then figure out where
they need to be sent to make them reach their destination. To achieve this, Internet layer maintains
routing tables at each router and link.
Datagram Encapsulation: The network layer normally encapsulates the messages received from
higher layers by placing them into datagrams (also called packets) with a network layer header.
This header also contains the IP address of source and destination.
Fragmentation and Reassembly: The network layer send messages down to the data link layer
for transmission. Some data link layer protocols have limits on the length of any message that can
be sent. If the packet that the network layer wants to send is too large, the network layer must
split the packet up, send each piece to the data link layer, and then have the pieces reassembled
once they arrive at the network layer of the destination machine.
Error Handling: Special protocols are used at the network layer to allow devices that are logically
connected, or that are trying to route traffic, to exchange information about the status of hosts on
the network.
The network layer also has some supplementary protocols that help this layer in its delivery and
routing tasks. The Internet Control Message Protocol (ICMP) helps IP to report some problems when
routing a packet. The Internet Group Management Protocol (IGMP) is another protocol that helps IP
in multitasking. The Dynamic Host Configuration Protocol (DHCP) helps IP to get the network-layer
address for a host. The Address Resolution Protocol (ARP) is a protocol that helps IP to find the
link-layer address of a host or a router when its network-layer address is given[2].

3.3

Transport Layer

The logical connection at the transport layer is also end-to-end. The transport layer at the source host
gets the message from the application layer, encapsulates it in a this layers packet (called as segment or
a user datagram in different protocols) and sends it, through the logical (which is imaginary) connection,
to the transport layer of the destination host. In other words, the transport layer is responsible for
giving services to the application layer, i.e. to get a message from an application program running on
the source host and deliver it to the corresponding application program on the destination host. We also
need an end-to-end transport layer when we already have an end-to-end application layer because the
separation of tasks and duties and to make process modular. The transport layer should be independent
of the application layer. In addition, we will see that we have more than one protocol in the transport
layer, which means that each application program can use the protocol that best matches its requirement.
There are a few transport-layer protocols in the Internet, each designed for some specific task.
The main protocol, Transmission Control Protocol (TCP), is a connection-oriented protocol
that first makes a logical connection between the transport layers at two different hosts before data
transfer can occur. It creates a logical pipe between two TCPs for transferring a stream of bytes. TCP
also provides flow control (matching the sending data rate of the source host with the receiving data
rate of the destination host to prevent overwhelming of the destination), error control (to guarantee that
the segments arrive at the destination without error and resending the corrupted ones), and congestion
control to reduce the loss of segments due to congestion in the network. Main functions of error control
services at transport layer are:
Detecting and discarding corrupted packets.
5

Keeping track of lost and discarded packets and resending them.


Recognizing duplicate packets and discarding them.
Buffering out of order packets until missing packets arrive.
To recognize duplicate packets or to keep track of packets TCP number the packets called as sequence
numbers. Maximum numbers depend on number of bits used to number the packets. Also to check the
corruption of packets it add checksum to packet headers.
The other common protocol, User Datagram Protocol (UDP), is a connectionless protocol that
transmits user datagrams without first creating a logical connection. In UDP, each user datagram is
an independent entity without being related to the previous or the next one (the meaning of the term
connectionless). UDP is a simple protocol that does not provide flow, error, or congestion control. Its
simplicity, which means small overhead, is attractive to an application program that needs to send short
messages and cannot afford the retransmission of the packets involved in TCP, when a packet is corrupted
or lost. A new protocol, Stream Control Transmission Protocol (SCTP) is designed to respond to new
applications that are emerging in the multimedia.

3.4

Application Layer

The logical connection between the two application layers is also end to-end. The two application layers
exchange messages between each other as though there were a bridge between the two layers. However, we
should know that the communication is done through all the layers. Communication at the application
layer is between two processes (two programs running at this layer). To communicate, a process at
client sends a request to the other process running at server and receives a response. Process-to-process
communication is the main duty of the application layer.
This layer in the Internet includes many predefined protocols, but a user can also create a pair
of processes to be run at the two hosts. The Hypertext Transfer Protocol (HTTP) is a vehicle for
accessing the World Wide Web (WWW) which is just the name of this service. The Simple Mail Transfer
Protocol (SMTP) is the main protocol which is used in electronic mail (e-mail) transfer service. The
File Transfer Protocol (FTP) is used for transferring files from one source to another. The Terminal
Network (TELNET) and Secure Shell (SSH) are used for accessing a remote site or computer. The
Simple Network Management Protocol (SNMP) is used by an administrator to manage the Internet at
global and local levels. The Domain Name System (DNS) is also used by other protocols to find the
network-layer IP address of the computer. The Internet Group Management Protocol (IGMP) is used to
collect membership in a group.
HyperText Transfer Protocol (HTTP) The HyperText Transfer Protocol (HTTP) is a protocol that is used to define client can retrieve web documents from servers. A client sends a request to
server known as HTTP request which gets a response from server. The server uses default port number
80 and client uses any temporary port number. It uses the services of reliable transport layer protocol i.e
TCP. So before exchange of information connection establishment must take place. Connection can be of
two types, Persistent Connection in which multiple requests can be made in one connection whereas
in Nonpersistent Connection every time connection need to be made for each request as shown in
Fig. 6.
HTTP as of own does not provide any security, but we can run it over a Secure Socket Layer
(SSL). In that case HTTP is called is HTTPS. It provides authentication mechanisms in client server
model and data safety.
File Transfer Protocol (FTP) It is a standard protocol for copying file from one host to another.
Since our systems can run different operating systems so it can have different file naming conventions or
different ways to represent data. They can also have different directory structures. All of these problems
are taken care by FTP. Although we can transfer files from HTTP but FTP is better choice for transfer
of large files and also provides more file formats support.
The client have three components User Interface, client control process, and client data process. The
basically has last two components i.e. control process and data process as it does not need user interface.
The control connection is made between control process and data connection is made between data
processes. The two connections serves different purposes and have different lifelines. Whenever files need
to be transferred first a control connection is need to be made. It is established once in the whole process

Figure 6: Non-Persistent and Persistent Connection in HTTP.


while data connection is made for each file that need to be transferred. The control connection use well
known port 21 while data connection use port 20. Steps in opening data connection are :
The client issues a passive open since it is client that need files to be transferred not server.
The client sends its temporary port number to server using PORT command.
The server receives the port number and issues an active open using its port number 20 and clients
local port number.

Figure 7: Establishment of Control and Data Connection between client and Server.
FTP in general support three types of file type ASCII file, EBCDIC file or image file. It supports
three types of transmission mode stream mode, block mode and compressed mode. Stream mode is default
and data is transferred in continuous stream of bytes. In the block mode data travel in form of blocks
with each block having 3-byte header containing 1-byte block descriptor and next 2-bytes as block size.
Domain Name Space (DNS) To establish a connection from one host to another we need IP address,
which uniquely identifies the connection of a host to Internet. But to connect to websites we tend to
use names instead of IP address as they are easy to remember. But a system is needed which can map
these names to their corresponding IP addresses. But today Internet has grown so huge that a central
directory cannot all the information. If it would have been the case and then if it fails then whole system
will collapse. So better solution is to distribute this information among many computers in the world.
So any host which needs to map any address can communicate to their nearest computer holding that
information. This method is used by Domain Name System (DNS).
7

Figure 8: How DNS works.


A namespace that maps each address to a unique name can be organised in two ways flat or
hierarchical [3]. In flat name space each name is assigned to an address and name has no structure, it is
just a bunch of characters. The names do not have common section and if they do it has no meaning.
Its main disadvantage is that it cannot be used in such large systems such as Internet because it must be
controlled by some organization to prevent duplicates. In hierarchical namespace each name is made up
of several sections. The first section can define nature of organization (also called as domain), second
part define name of organization and so on. So now controlling departments can be decentralized.

Conclusion

We can see that TCP/IP protocol takes care of everything from sending and receiving data to how
data should be sent and what path should be taken. It is the best and most improved IP in computer
networking. Not only this model can be used on large system such as Internet but also can be used in
private internets or small networks. There are also many researches going on in improving the current
model to be more and reliable and user friendly. Presently we use IPv4 as our current IP but it will soon
be taken over by IPv6 as it have all features of v4 as well as some extra features. More important is that
IPv6 can be used with current Internet architecture.

References
[1] https://en.wikipedia.org/wiki/Transmission_Control_Protocol.
[2] http://www.ask.com/technology.
[3] http://www.hill2dot0.com/wiki/index.php?title=Network_Interface_Layer.
[4] Behrouz A Forouzan. Computer Networks, ATop Down Approach. 2012.

Das könnte Ihnen auch gefallen