1502691737IT CN Etext Mod2
1502691737IT CN Etext Mod2
Module 2
The TCP/IP Model and the Protocol Suit
Introduction
In this module, we will look at the TCP/IP model in little more detail. We will look at
protocols run at each of the layers and how actual communication process takes place
between communicating computers.
SMPT, FTP,
Application
HTTP, DNS,
Closely observe the figure 2.1. it describes the TCP/IP model as well as a protocol stack. The
stack describes the protocols runs at various layers starting from application to the network.
The word –Any‐ indicates that the TCP/IP standard does not have any specific protocols for
those layers and any protocol can work there. In the real world many protocols like Ethernet
for wired communication, 802.11 (Wi‐Fi), 802.16 (Wi‐Max), LTE (4G) etc. for wireless are
possible to be used at those two layers.
Though we have introduced the TCP/IP model and in a way, the protocol stack, we will
elaborate more about both of them in this module. We will start with the notion of
connection. Let me remind you that the TCP/IP communication is based on connection‐
oriented or connectionless service over connectionless delivery mechanism. For that, let us
understand the notion of physical and logical connection.
Logical connection
When a sender wants to communicate with the receiver, he sends a request. The receiver, if
willing, responds back positively. When this happens, a logical connection is said to be
established. When this does not happen, the logical connection is not established. When a
communication process happens after establishing a logical connection, it is said to be
connection‐oriented while otherwise is called connectionless.
In the case of a telephone connection, when the caller dials a number, the process initiates
a request which is sent to the other end. When the receiver receives a ring, it is said to
receive the request. The receiver may decide to pick up the phone or disconnect it
depending on his choice. When the receiver picks the phone up, the positive response to
the connection request is said to reach the caller. Both of them now can communicate. The
connection‐oriented connection is established exactly in that fashion. The sender sends a
connection request which the receiver may respond back positively or otherwise. If the
receiver accepts that request, the connection is established and communication (bi‐
directional) can proceed further. Any one of the communicating parties can initiate closure
of the connection which the other party honors and the connections gets closed.
Connectionless connection phrase seems ironic but it means the connection where the
process of establishing logical connection does not take place. In this case, the physical
connection exists and used for sending and receiving data but there is no connection
establishment or release.
However, a smart move by the TCP/IP protocol designers is to provide Connection oriented
service over connectionless delivery mechanism which we looked at in the previous module.
The TCP and SCTP protocols, running at the transport layer, provide connection‐oriented
service to the applications running on top of them. TCP, in turn, take services of IP, which
works at the network layer. IP is connectionless and thus provide autonomy to routers.
Virtual circuit
The sender and receiver may be connected in few different ways. In landline telephone
lines, they are connected by a dedicated line, which remains unutilized when the callers
pause or do not talk. In the case of SMS, the line is only utilized when it is being sent. The
first case is known as circuit switching where the complete circuit is occupied beforehand.
The SMS like communication is normally known as packet switching as it just sends packets
over the line. Only the portion of the line where the packet is being transmitted is occupied
and the rest is not used. The Internet, here also, provides a best‐of‐the‐breed kind of a
solution. For delivery, IP is connectionless so does not occupy the complete communication
line beforehand and thus saves on bandwidth and cost. (that is why VOIP calls are cheaper).
The TCP P provides a circuit‐likee connectioon to the appplications. For examplle, a browseer sends
URLs an nd receivess web pages, FTP clien nts uploads,, and down nload files, telnet clien
nt sends
commands and recceives respo onses as if connected
c t the serveer by a direect connectiion. This
to
feel is aachieved byy TCP. That is why it is said to pro ovide a virtu
ual circuit. The
T circuit is virtual
as it is not actuallly existing but
b the app plications are
a given th hat type of service. Th here are
many ro outers in beetween but TCP hides thatt information to thee applications on eitheer side.
The IP n
neither pro ng nor a virrtual circuit switching. It follows a packet
ovides a circcuit switchin
switchinng approach. In this ap
pproach, thee IP sends aand processses packets without thee notion
of the path. Eachh packet caan take an altogether different path than its predeceessor or
successsor.
Figure 2.2 indicatees the ideaa. The IP ru unning at tthe network layer, forr example, provide
service to protocoll running att the transport layer, TCP, UDP or SCTP.
which in turn take the same services from IP. Applications, like SMTP (for mailing) or FTP
(for file transfer), take reliable service from TCP, while some other applications like DNS
(Domain Name Service) use UDP.
Interconnecting networks
The idea behind designing TCP/IP was to provide interconnection between networks. When
the networks who are using TCP/IP are connected to each other, one would like to ask, at
which layer are they connected? A rough architecture of the Internet can be drawn as figure
2.3. Each user feels that the network is connected to the Internet which is a cloud‐like
system. Every other network is also connected with it and so it is possible to communicate.
This is an abstraction to the actual architecture depicted in figure 2.4. where each network
is connected to other networks by a chain of interconnected routers which provide
communication paths between networks. The packets sent from the network sender
belongs to, is reached to the network receiver belongs to by intermediary routers. The
packets are relayed by routers to other routers along the path based on a decision made by
network layer of those routers.
In other words, sender's network and the first router along the path (usually the router from
the ISP), is connected by their respective network layers and same is the case with all other
routers along the path.
Network 1 Network 2
The Internet
Network 3
Network 4
Network 1 Network 2
Network 3
Network 4
How the routers relay the traffic in the TCP/IP model? How the layers’ function in the
process of delivery of packets? Let us try to understand. Observe the figure 2.5. We take a
case where there is a sender as well as a receiver who are connected with two intermediary
routers. The sender’s application layer generates some traffic based on some application
and that traffic needs to be sent to the receiver via these two routers.
The application generates some data and informs the transport layer TCP that it wants to
connect to the receiver. Application layer encapsulates the application layer data in some
form (a URL or Uniform Resource Locator in case of HTTP, a command in case of telnet, a
chunk of a file in case of FTP etc.), and pass it on to TCP. TCP encapsulates that data in its
own form and adds its own headers, including many things but most notably, indicate the
application which generated the data and thus application which should receive data at the
other end1.
When that data is sent from TCP to IP, IP looks at the final destination value in the packet
itself and decides which is the nearest next router along the best path. It finds the router
based on its routing table value. The data link layer constructs the frame with the sender as
sending machine and receiver as the first router. The data link layer passes the frame to
physical layer then. The physical layer transmits that frame to first router. The physical layer
of first router, upon receipt, passes it up to its data link layer. When it reaches to the
1
How the transport layer decides the size of the segment? Usually it forgoes the layer independence in this
case, learn from the physical layer what is the size it can carry, for example, Ethernet can carry 1500 bytes, and
decide its own size based on it. For example, for Ethernet it decides it to be 1460 bytes so when TCP header of
20 bytes and IP header of 20 bytes are added to that, it fits exactly in the Ethernet frame.
So it do oes by constructing th he frame accordingly and passin ng it to its physical layyer. The
physicaal layer of first
f routerr then trannsmits it to physical laayer of seccond router. Same
processs happens at a the seco ond router and the paacket eventtually reach hes to the network
n
layer of second router. The second ro outer's netw work layer decides th hat the recceiver is
directlyy connected d and so instructs the data link layer to con nstruct the frame accordingly
with sender being the second d router and d receiver being
b the final router. Once that is done,
the phyysical layer of the seco ond router sends it to the physicaal layer of the t receiver. When
the recceiver's netw work layer receives th he packet, it looks at the destin nation addrress and
unlike the
t first and the second router, it understaands that th he packet is
i destined for this
machine only. The IP opens th he IP packeet, extracts the
t TCP seggment sent by the send der pass
it up thhe TCP run ning on th e receiver. TCP verifie
es that seg ment first to be with out any
errors. It also loo oks at the important information about th he applicatiion for which it is
destined (or even UDP, whattever the case c may be). The TCP P of the receiver then n passes
received data to the t respecttive application. The designers
d have purpossefully named data
units att different layers differrently. The application data, oncee transport layer's head ders are
added aat the transport layer,, becomes a segment.. The segment, when reach the network n
layer annd augmented with neetwork laye er headers, it becomes a packet. The packeet, when
encapsu ulated in daata link layeer header ass well as thee trailer, it is known as a frame.
We cann see the critical role off IP to intercconnect nettworks and TCP to helpp transmit the
t data
irrespecctive of thee type of network
n (th
he networkk under consideration n may be wired
w or
wirelesss and follow
w different protocols), irrespectivee of the datta link and physical
p layeers (one
may use fast Ethe ernet which h provides 1001 Mb, an nother mayy provide 10 0G Etherneet which
provides 10 Gigabits per second, and so on), irrespective of the way physical layer converts
bits into signals and vice versa, irrespective of the way data link layer frames the data and so
on. Let us reiterate what we claimed in module 1. The TCP/IP protocol is designed in a way
that it does not assume anything about the data link or physical layer and thus any network
beneath does not make any different to their functioning.
the receiver TCP layer says it cannot accept any more segments for the time being, the
sending TCP layer should stop sending for a while.
An application layer communication between peers may clarify above point. An FTP client
sends a few commands (as user types them) to server for example, get <a file name> or put
<a file name> and server responds back as per the command. Similarly, an SMTP client
sends information related to mail and the server responds back. A web client (browser)
sends a URL and the web server sends the page back. This application layer processing is
more obvious as it happens under our (the user’s) instruction.
Please note that such communication, in much more unreadable form, happens between all
peers. When peers communicate with each other, it is generally known as a protocol. Some
authors also call the communication, between layers above or below, a protocol while some
other authors call them interface. However, we will call communication between peers as
protocol. Thus TCP protocol is about communicating between two TCP peers. An Ethernet
protocol is about communication between two Ethernet cards and so on.
Please also take a note of a difference between a process and a protocol. A TCP process is
an OS process executing in the memory of the computer while a TCP protocol is a method of
communication between two TCP processes.
Protocol
A protocol is how peers communicate in an unambiguous way. When I ask a question, my
student may raise his hand if he knows the answer. When I select him, he may respond.
When you meet your friend in the morning, you say "Hi Buddy" or "Good Morning" and he
responds back accordingly. When we go to a movie theater, we render money and get
tickets, show them to the doorkeeper to have an entry and so on. These are protocols or the
rules that govern our behavior in a typical situation. The whole networking environment is
governed by such protocols. Here are basic features of a protocol.
1. There are multiple parties involved, usually two, we call the imitator of the
communication as sender and respondent as the receiver but once the introduction
gets over, either of the parties can send and receive.
2. The sender knows what to send and in which sequence. The receiver also expects
the message to come in a typical sequence. This synchronization is very crucial.
When the sender is sending a packet size for example, and the receiver understands
it to be the size of the image that follows, a chaotic situation arises. Both of the
communicating parties must have an unambiguous way of knowing what is being
sent and received.
Let us walk through an example of SMTP to understand the concept better. The SMTP
(Simple Mail Transfer Protocol) is used to send and receive emails.
The following snippet shows a communication between an SMTP client (denoted as C) and a
server (denoted as S). The comments written inside the braces are not a part of the
communication. They are inserted to help the reader know what is actually happening.
S:220 GLSICT.ORG ready (Server, i.e., GLSICT.ORG says, I am ready to accept emails.)
C: HELO GLSlCA.org (The client replies I am GLSICA.org and would like to send/ receive mail
from/to you, i.e., GLSICT.ORG)
S:250 OK (No objections. You can send/receive emails.)
C:MAIL FROM: bhushan@glsica.org
S:250 OK (Fine! This sender is not blacklisted! I can accept mails from him!) C: MAIL TO:
viral@glsict.org
S:250 OK (Fine! This user exists at this server! And can accept mails on his behalf!) C:MAIL
TO: kanu@glsict.org
S:550 No such user (I do not know this user, as there is no such mailbox.)
The SMTP uses some specific commands such as HELO, MAIL FROM, MAIL TO, etc. which are
known to both the client and the server. The sequence is also important. Only when the
client says MAIL TO, the server responds with either OK or NO SUCH USER.
Standardization bodies
It is important to have the protocols standardized by authorized governing bodies. The
Internet community has clear‐cut mechanisms to standardize protocols. The Internet
protocols are described by so‐called RFCs (Recommendation for Comments). The SMTP
example we have seen above is described according to RFC. IETF (Internet Engineering Task
Force) and IAB (Internet Advisory Board) are the two governing bodies which control
Internet standards.
The ISO or International Standards Organization is the main body for international
standardization. It includes ANSI (American National Standards Institute) which is a member
of ISO. All national standardization bodies come under the control of ISO. The OSI standard
was from ISO.
The IEEE (Institute of Electricals and Electronics Engineers) society is another organization
having its own standards which are widely recognized. It is the largest professional
organization of its kind. The 802 standards developed by IEEE define the protocols used in
different kinds of LANs including the Ethernet and 802.11 (Wi‐Fi). Apart from these, there
are other standardization bodies like Wi‐Fi and Wi‐Max for device manufacturers for
wireless networks and W3C or World Wide Web Consortium for WWW standards.
Summary
This module introduced the TCP/IP protocol suit, the protocols running at different layers of
this protocol suite and the need for each layer. The interaction between peers and how
protocols especially SMTP at application layer works is explained.