You are on page 1of 61

Technical Support Fundamentals (ITP 4107)

INTRODUCTION TO TCP/IP NETWORKING

Introduction to TCPIP Networking under Linux


Topic 02,p.1
©VTC 2012
Technical Support Fundamentals (ITP 4107)

LESSON INTENDED LEARNING OUTCOMES


On completion of the lesson, students are expecte
d to
 setup, configure, monitor and control appropriat
e TCP/IP network services for satisfying given r
equirements.

Introduction to TCPIP Networking under Linux


Topic 02,p.2
©VTC 2012
Technical Support Fundamentals (ITP 4107)

OVERVIEW OF TCP/IP
 TCP/IP and the Internet
 Data Communications Model

 TCP/IP Protocol Architecture

Introduction to TCPIP Networking under Linux


Topic 02,p.3
©VTC 2012
Technical Support Fundamentals (ITP 4107)

NETWORKING
 Most computers are used more for communication
than computation.
 At many sites— perhaps even the majority— we
b and email access are the primary uses of com
puters.
 As of 2010, internetworldstats.com estimates t
he Internet to have nearly 1.5 billion users,
or more than 21% of the world’s population.

Introduction to TCPIP Networking under Linux


Topic 02,p.4
©VTC 2012
Technical Support Fundamentals (ITP 4107)

IMPACT OF COMPUTER COMMUNICATIONS


 Increases with the number and types of compute
rs that participate in the network.
 WhatsApp
 Skype
 3G Phones/Tablets
 TCP/ IP does not depend on any particular har
dware or operating system, so devices that spe
ak TCP/ IP can all exchange data (“ interope
rate”) despite their many differences.
 TCP/ IP works on networks of any size or topo
logy, whether or not they are connected to the
outside world.
Introduction to TCPIP Networking under Linux
Topic 02,p.5
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP AND THE INTERNET


 The Internet and TCP/IP originate from a rese
arch network called ARPANET established in 19
69 by the U.S. Department of Defense.
 Advanced Research Projects Agency (ARPA) funded a
research and development project to create an exp
erimental packet-switching network.
 This network, called the ARPAnet, was built to st
udy techniques for providing a robust, reliable,
vendor-independent data communication network.
 The basic TCP/IP protocols were developed aft
er the ARPANET was operational in 1975.

Introduction to TCPIP Networking under Linux


Topic 02,p.6
©VTC 2012
Technical Support Fundamentals (ITP 4107)

UNIX AND TCP/IP


 The TCP/IP protocols were adopted as Military
Standards (MIL STD) in 1983, and all hosts con
nected to the ARPANET were required to conver
t to the protocols.
 To ease this conversion, DARPA (Defense Advan
ced Research Projects Agency) funded Bolt, Be
ranek, and Newman (BBN) to implement TCP/IP i
n Berkeley (BSD) Unix. This began the marriage
of Unix and TCP/IP.

Introduction to TCPIP Networking under Linux


Topic 02,p.7
©VTC 2012
Technical Support Fundamentals (ITP 4107)

INTERNET
 In 1983, the old ARPAnet was divided into MIL
NET, part of the Defense Data Network (DDN); a
nd a new, smaller ARPAnet.
 "Internet" was used to refer to the entire net
work: MILNET plus ARPAnet.

Introduction to TCPIP Networking under Linux


Topic 02,p.8
©VTC 2012
Technical Support Fundamentals (ITP 4107)

NSFNET
 In 1985, the National Science Foundation (NSF)
created NSFNet and connected it to the then-ex
isting Internet.
 NSF wanted to extend the network to every scie
ntist and engineer in the United States.
 To accomplish this, in 1987, NSF created a new
, faster backbone and a three-tiered network t
opology that included the backbone, regional n
etworks, and local networks.
 In 1990, the ARPAnet formally faded out of ex
istence, and in 1995, the NSFNet ceased its ro
le as a primary Internet backbone network.

Introduction to TCPIP Networking under Linux


Topic 02,p.9
©VTC 2012
Technical Support Fundamentals (ITP 4107)

THE INTERNET TODAY


 Today, Internet is larger than ever and encomp
asses hundreds of thousands of networks worldw
ide.
 It is no longer dependent on a core (or backbo
ne) network or on governmental support.
 Today's Internet is built by commercial provid
ers.
 National network providers, called tier-one provi
ders, and regional network providers create the i
nfrastructure.
 Internet Service Providers (ISPs) provide local a
ccess and user services.
 This network of networks is linked together in
many major interconnection points called Netwo
rk Access Points (NAPs).
Introduction to TCPIP Networking under Linux
Topic 02,p.10
©VTC 2012
Technical Support Fundamentals (ITP 4107)

INTRANETS
 Growth of the Internet spurred interest in TC
P/IP.
 The Internet protocols are often used for loca
l area networking even when the local network
is not connected to the Internet.
 TCP/IP is also widely used to build enterpris
e networks.
 TCP/IP-based enterprise networks that use Int
ernet techniques and web tools to disseminate
internal corporate information are called intr
anets.

Introduction to TCPIP Networking under Linux


Topic 02,p.11
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP FEATURES
1. Open protocol standards, freely availabl
e and developed independently from any s
pecific computer hardware or operating s
ystem.
2. Independent from specific physical netwo
rk hardware
 This allows TCP/IP to integrate many differen
t kinds of networks.
 TCP/IP can be run over an Ethernet, a DSL con
nection, a dial-up line, an optical network,
and virtually any other kind of physical tran
smission medium.
Introduction to TCPIP Networking under Linux
Topic 02,p.12
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP FEATURES
3. A common addressing scheme - allows any TCP/
IP device to uniquely address any other devi
ce in the entire network, even if the networ
k is as large as the worldwide Internet.
4. Standardized high-level protocols for consis
tent, widely available user services.

Introduction to TCPIP Networking under Linux


Topic 02,p.13
©VTC 2012
Technical Support Fundamentals (ITP 4107)

PROTOCOL
 Protocol is a set of formal rules of behavior.
 Diplomatic protocols aim to minimize misunderstan
dings.
 When computers communicate, it is necessary to de
fine a set of rules to govern their communication
s.
 In data communications, a set of rules for a spec
ific communication (e.g. email) is called a proto
col.
 TCP/IP is a protocol “suite,” a set of network
protocols designed to work smoothly together. It
includes several components, each defined by a st
andards-track RFC or series of RFCs.
Introduction to TCPIP Networking under Linux
Topic 02,p.14
©VTC 2012
Technical Support Fundamentals (ITP 4107)

REQUESTS FOR COMMENTS (RFCS)


 The open nature of TCP/IP protocols requires an open
standards development process, and publicly available
standards documents known as Requests for Comments or
RFCs.
 Protocol standards, proposed changes, and information
al bulletins all usually end up as RFCs. RFCs start t
heir lives as Internet Drafts, and after lots of emai
l wrangling and IETF (Internet Engineering Task Forc
e) meetings they either die or are promoted to the RF
C series.
 Anyone who has comments on a draft or proposed RFC is
encouraged to reply. In addition to standardizing the
Internet protocols, the RFC mechanism sometimes just
documents or explains aspects of existing practice.
Introduction to TCPIP Networking under Linux
Topic 02,p.15
©VTC 2012
Technical Support Fundamentals (ITP 4107)

REQUESTS FOR COMMENTS (RFCS)


 RFCs are numbered sequentially; once distributed,
the contents of an RFC are never changed.
 Updates are distributed as new RFCs with their ow
n reference numbers. Updates may either extend an
d clarify existing RFCs or supersede them entirel
y.
 RFCs may not be the gentlest way to learn about a
topic, but they are authoritative, concise, and f
ree.
 There are three basic types of RFCs: standards (S
TD), best current practices (BCP), and informatio
nal (FYI).
Introduction to TCPIP Networking under Linux
Topic 02,p.16
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP PROTOCOL STACK


 TCP/ IP is a protocol suite, including the followin
g components:
 IP, the Internet Protocol, which routes data packets fr
om one machine to another (RFC791)
 ICMP, the Internet Control Message Protocol, which prov
ides several kinds of low-level support for IP, includi
ng error messages, routing assistance, and debugging he
lp (RFC792)
 ARP, the Address Resolution Protocol, which translates
IP addresses to hardware addresses (RFC826)
 UDP, the User Datagram Protocol, which provides unverif
ied, one-way data delivery (RFC768)
 TCP , the Transmission Control Protocol, which implemen
ts reliable, full duplex, flow-controlled, error-correc
ted conversations (RFC793)
Introduction to TCPIP Networking under Linux
Topic 02,p.17
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP PROTOCOL STACK


 The protocols of the TCP/IP are arranged in a hierarchy
or “stack”, with the higher-level protocols making use
of the protocols beneath them. TCP/ IP is conventionally
described as a five-layer system. but the actual TCP/ IP
protocols inhabit only three of these layers.

Introduction to TCPIP Networking under Linux


Topic 02,p.18
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP& OSI MODELS

Introduction to TCPIP Networking under Linux


Topic 02,p.19
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP/IP PROTOCOL ARCHITECTURE

Consists of applications and


processes that use the network

Provides end-to-end data


delivery services

Defines the datagram and


handles the routing of data

Consists of routines for


accessing physical networks

Introduction to TCPIP Networking under Linux


Topic 02,p.20
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ENCAPSULATION
 Data is passed down the TCP/IP stack when it is
being sent to the network, and up the stack whe
n it is being received from the network.
 Each layer in the stack adds control informatio
n to ensure proper delivery.
 This control information is called a header bec
ause it is placed in front of the data to be tr
ansmitted.
 Each layer treats all the information it receiv
es from the layer above as data, and places its
own header in front of that information.
 The addition of delivery information at every l
ayer is called encapsulation.
Introduction to TCPIP Networking under Linux
Topic 02,p.21
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ENCAPSULATION

On the receiving machine, the encapsulation is reversed


as the packet travels back up the protocol stack.

Introduction to TCPIP Networking under Linux


Topic 02,p.22
©VTC 2012
Technical Support Fundamentals (ITP 4107)

DATA STRUCTURES OF TCP/IP


 The name of the primitive data unit depends on the layer
of the protocol. We use “packet” as a generic term th
at encompasses these various cases.

Introduction to TCPIP Networking under Linux


Topic 02,p.23
©VTC 2012
Technical Support Fundamentals (ITP 4107)

1. NETWORK ACCESS LAYER


 Lowest layer of the TCP/IP protocol hierarchy.
 Protocols in this layer provide the means for t
he system to deliver data to the other devices o
n a directly attached network.
 Defines how to use the network to transmit an I
P datagram.
 Protocols in this layer must know the details o
f the underlying network (its packet structure,
addressing, etc.) to correctly format the data b
eing transmitted to comply with the network cons
traints.
 Encompass the functions of all three lower layer
s of the OSI Reference Model (Network, Data Link
, and Physical).
Introduction to TCPIP Networking under Linux
Topic 02,p.24
©VTC 2012
Technical Support Fundamentals (ITP 4107)

NETWORK ACCESS LAYER FUNCTIONS


 Functions:
 Encapsulation of IP datagrams into frames to be
transmitted in the network, and
 Mapping of IP addresses to the physical address
es used by the network.
 One of the strengths of TCP/IP is its univ
ersal addressing scheme (IP addresses).
 An IP address must be converted into an ad
dress that is appropriate for the physical
network over which the datagram is transmi
tted.

Introduction to TCPIP Networking under Linux


Topic 02,p.25
©VTC 2012
Technical Support Fundamentals (ITP 4107)

2. INTERNET LAYER
 Internet Protocol (IP) is the most important protocol
in this layer.
 The release of IP used in the current Internet is IP
version 4 (IPv4), which is defined in RFC 791.
 More recent versions of IP
 IP version 5 is an experimental Stream Transport (ST)
protocol used for real-time data delivery.
 IPv5 never came into operational use.
 IPv6 is an IP standard that provides greatly expanded
addressing capacity.
 Because IPv6 uses a completely different address structur
e, it is not interoperable with IPv4.
 While IPv6 is a standard version of IP, it is not yet wid
ely used in operational, commercial networks.
 Since our focus is on practical, operational networks
, we only concentrate on IPv4.

Introduction to TCPIP Networking under Linux


Topic 02,p.26
©VTC 2012
Technical Support Fundamentals (ITP 4107)

INTERNET PROTOCOL (IP)


 The Internet Protocol is the heart of
TCP/IP. Its functions include:
1. Defining the datagram, the basic unit of t
ransmission in the Internet
2. Defining the Internet addressing scheme
3. Moving data between the Network Access Lay
er and the Transport Layer (at end hosts)
4. Routing datagrams to remote hosts
5. Performing fragmentation and re-assembly o
f datagrams (see later)

Introduction to TCPIP Networking under Linux


Topic 02,p.27
©VTC 2012
Technical Support Fundamentals (ITP 4107)

CHARACTERISTICS OF IP
 IP is a connectionless protocol.
 This means that it does not exchange control info
rmation (called a "handshake") to establish an en
d-to-end connection before transmitting data.
 In contrast, a connection-oriented protocol excha
nges control information with the remote system t
o verify that it is ready to receive data before
any data is sent. When the handshaking is success
ful, the systems are said to have established a c
onnection.
 Internet Protocol relies on protocols in oth
er layers above to establish the connection
if they require connection-oriented service.

Introduction to TCPIP Networking under Linux


Topic 02,p.28
©VTC 2012
Technical Support Fundamentals (ITP 4107)

CHARACTERISTICS OF IP
 IP also relies on protocols in the other layers
to provide error detection and error recovery.
 Internet Protocol is sometimes called an unreli
able protocol because it contains no error dete
ction and recovery code.
 This is not to say that the protocol cannot be relied
on; quite the contrary, IP can be relied upon to accu
rately deliver data to the connected network, but it
doesn't check whether that data was correctly receive
d at the remote host.
 Protocols in other layers of the TCP/IP archite
cture provide this checking when it is required
.

Introduction to TCPIP Networking under Linux


Topic 02,p.29
©VTC 2012
Technical Support Fundamentals (ITP 4107)

DATAGRAM
 The TCP/IP protocols were built to transmit data
over the ARPAnet, which was a packet-switching n
etwork.
 A packet is a block of data that carries with it
the control information necessary to deliver it,
similar to a postal letter, which has an address
written on its envelope.
 A packet-switching network uses the addressing i
nformation in the packets to switch packets from
one physical network to another, moving them tow
ard their final destination. Each packet travels
the network independently of any other packet.

Introduction to TCPIP Networking under Linux


Topic 02,p.30
©VTC 2012
Technical Support Fundamentals (ITP 4107)

IP DATAGRAM FORMAT
Header Length, this is the length of the IP header in multiples of 4 bytes.

Internet Protocol delivers the datagram by checking the


Destination Address in word 5 of the header

Introduction to TCPIP Networking under Linux


Topic 02,p.31
©VTC 2012
Technical Support Fundamentals (ITP 4107)

DELIVERY OF DATAGRAMS
 If the Destination Address is the address of a
host on the local network, the packet is delive
red directly to the destination.
 If the Destination Address is not on the local
network, the packet is passed to a gateway for
delivery.
 Gateways are devices that switch packets betwee
n different physical networks.
 Deciding which gateway to use is called routing
.
 IP makes the routing decision for each individu
al packet.

Introduction to TCPIP Networking under Linux


Topic 02,p.32
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ROUTERS VS GATEWAYS
 Internet gateways are commonly (and perhaps m
ore accurately) referred to as IP routers bec
ause they use Internet Protocol to route pack
ets between networks.
 Strictly speaking, a gateway moves data betwe
en different protocols, and a router moves da
ta between different networks.
 So a system that moves email between TCP/IP a
nd X.400 is a gateway, but a traditional IP g
ateway is a router.
 At one time X.400 was expected to be the predominant form of email, bu
t this role has been taken by the SMTP-based Internet e-mail . 
Introduction to TCPIP Networking under Linux
Topic 02,p.33
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ROUTING THROUGH GATEWAYS

The hosts (or end systems) process packets through all four protocol layers, while
the gateways (or intermediate systems) process the packets only up to the Internet
Layer where the routing decisions are made.

Introduction to TCPIP Networking under Linux


Topic 02,p.34
©VTC 2012
Technical Support Fundamentals (ITP 4107)

NETWORKS, GATEWAYS, AND HOSTS


Host A1 on the token ring
network routes the datagram
through gateway G1 to reach
host C1 on the Ethernet.

Gateway G1 forwards the


data through the X.25
network to gateway G2 for
delivery to host C1.

The datagram traverses three


physically different networks,
but eventually arrives intact
at host C1.

Introduction to TCPIP Networking under Linux


Topic 02,p.35
©VTC 2012
Technical Support Fundamentals (ITP 4107)

FRAGMENTATION OF DATAGRAMS
 As a datagram is routed through different networ
ks, it may be necessary to divide the datagram i
nto smaller pieces.
A datagram received from one network may be too lar
ge to be transmitted in a single packet on a differ
ent network.
 The size of packets on a network may be limited bot
h by hardware specifications and by protocol conven
tions.
 This condition occurs only when a gateway or rou
ter interconnects dissimilar physical networks o
r protocols
Introduction to TCPIP Networking under Linux
Topic 02,p.36
©VTC 2012
Technical Support Fundamentals (ITP 4107)

DATAGRAM FRAGMENT
has a "More Fragments" bit that tells tells which piece of
identifies
IP if it has assembled all of the the datagram is this
which
datagram fragments fragment
datagram
that this
fragment
belongs to

Introduction to TCPIP Networking under Linux


Topic 02,p.37
©VTC 2012
Technical Support Fundamentals (ITP 4107)

PASSING DATAGRAMS TO TRANSPORT LAYER


 When IP receives a datagram that is addressed t
o the local host, it must pass the data portion
of the datagram to the correct Transport Layer
protocol.
 This is done by using the protocol number from
word 3 of the datagram header.
 Each Transport Layer protocol has a unique prot
ocol number that identifies it to IP.

Introduction to TCPIP Networking under Linux


Topic 02,p.38
©VTC 2012
Technical Support Fundamentals (ITP 4107)

INTERNET CONTROL MESSAGE PROTOCOL


 An integral part of IP is the Internet Contro
l Message Protocol (ICMP) defined in RFC 792.
 This protocol is part of the Internet Layer an
d uses the IP datagram delivery facility to s
end its messages.
 ICMP sends messages that perform the control,
error reporting, and informational functions f
or TCP/IP as described in the next slide.

Introduction to TCPIP Networking under Linux


Topic 02,p.39
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ICMP FUNCTIONS (OVERVIEW)


1. Flow control
2. Detecting unreachable destinations
3. Redirecting routes
4. Checking remote hosts

Introduction to TCPIP Networking under Linux


Topic 02,p.40
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ICMP FUNCTIONS
1. Flow control
 When datagrams arrive too fast for processing,
the destination host or an intermediate gateway
sends an ICMP Source Quench Message back to the
sender. This tells the source to stop sending d
atagrams temporarily.

2. Detecting unreachable destinations


 When a destination is unreachable, the system d
etecting the problem sends a Destination Unreac
hable Message to the datagram's source. If the
unreachable destination is a network or host, t
he message is sent by an intermediate gateway.
But if the destination is an unreachable port,
the destination host sends the message.
Introduction to TCPIP Networking under Linux
Topic 02,p.41
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ICMP FUNCTIONS: REDIRECTING ROUTES


 A gateway sends the ICMP Redirect Message to tell a host t
o use another gateway, presumably because the other gatewa
y is a better choice. This message can be used only when t
he source host is on the same network as both gateways.

host
(1) IP datagram

(3) ICMP redirect

(2) IP datagram
R1 R2

Final
Introduction to TCPIP Networking under Linux
destination
Topic 02,p.42
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ICMP FUNCTIONS: CHECKING REMOTE HOSTS


 A host can send the ICMP Echo Message to see if a remote s
ystem's Internet Protocol is up and operational.
 When a system receives an echo message, it replies and sen
ds the header and the first few data bytes from the packet
(causing the ICMP message to be generated) back to the sou
rce host.
 The ping command uses this message.

“Echo messages"
type=8 : ICMP echo request
messages,
type=0 : ICMP echo reply
message

Note: ICMP header starts after


the IPv4 header.

Introduction to TCPIP Networking under Linux


Topic 02,p.43
©VTC 2012
Technical Support Fundamentals (ITP 4107)

HOW PING WORKS


 When a echo request message is received by the r
eceiving host, it sends back an echo reply messa
ge in which the identifier and sequence number f
ields are left unchanged.

Introduction to TCPIP Networking under Linux


Topic 02,p.44
©VTC 2012
Technical Support Fundamentals (ITP 4107)

3. TRANSPORT LAYER
 The two most important protocols in the Transport L
ayer are Transmission Control Protocol (TCP) and Us
er Datagram Protocol (UDP).
 TCP provides reliable data delivery service with en
d-to-end error detection and correction.
 UDP provides low-overhead, connectionless datagram
delivery service.
 Both protocols deliver data between the Application
Layer and the Internet Layer.
 Applications programmers can choose whichever servi
ce is more appropriate for their specific applicati
ons.
Introduction to TCPIP Networking under Linux
Topic 02,p.45
©VTC 2012
Technical Support Fundamentals (ITP 4107)

USER DATAGRAM PROTOCOL (UDP)


 UDP is an unreliable, connectionless datagram
protocol.

UDP uses 16-bit Source


Port and Destination Port
numbers in word 1 of the
message header to
deliver data to the correct
application process.

Length (in bytes) of the UDP


packet, including header.

Introduction to TCPIP Networking under Linux


Topic 02,p.46
©VTC 2012
Technical Support Fundamentals (ITP 4107)

WHY CHOOSE UDP AS A DATA TRANSPORT SERVI


CE?
 If the amount of data being transmitted is smal
l, the overhead of creating connections and ens
uring reliable delivery may be greater than the
work of re-transmitting the entire data set.
 In this case, UDP is the most efficient choice
for a Transport Layer protocol.
 Applications that fit a query-response model ar
e also excellent candidates for using UDP.
 Example: DHCP queries and responses

Introduction to TCPIP Networking under Linux


Topic 02,p.47
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TRANSMISSION CONTROL PROTOCOL


 TCP verifies that datagrams are delivered across
the network accurately and in the proper sequence
.
 TCP is a reliable, connection-oriented, byte-stre
am protocol.
 TCP provides reliability with a mechanism called
Positive Acknowledgment with Re-transmission (PA
R).
 The unit of data exchanged between cooperating TC
P modules is called a segment.

Introduction to TCPIP Networking under Linux


Topic 02,p.48
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP SEGMENT FORMAT

Indicate control
functions

 a checksum is used to verify that the data is undamaged.


 If the data segment is received undamaged, the receiver sends a
positive acknowledgment back to the sender.
 If the data segment is damaged, the receiver discards it.
 After an appropriate timeout period, the sending TCP module re-
transmits any segment for which no positive acknowledgment has
been received.
Introduction to TCPIP Networking under Linux
Topic 02,p.49
©VTC 2012
Technical Support Fundamentals (ITP 4107)

HANDSHAKE IN TCP
 TCP is connection-oriented. It establish
es a logical end-to-end connection betwe
en the two communicating hosts.
 Control information, called a handshake, is e
xchanged between the two endpoints to establi
sh a channel before data is transmitted.
 TCP indicates the control function of a
segment by setting the appropriate bit i
n the Flags field in word 4 of the segme
nt header.

Introduction to TCPIP Networking under Linux


Topic 02,p.50
©VTC 2012
Technical Support Fundamentals (ITP 4107)

THREE-WAY HANDSHAKE
 Host A begins the connection
by sending host B a segment w
ith the "Synchronize sequence
numbers" (SYN) bit set.
 This segment tells host B tha
t A wishes to set up a connec
tion, and it tells B what seq
uence number host A will use
as a starting number for its
segments. (Sequence numbers a
re used to keep data in the p
roper order.)
 Host B responds to A with a s
egment that has the "Acknowle
dgment" (ACK) and SYN bits se
t.
 B's segment acknowledges the
receipt of A's segment, and i
nforms A which sequence numbe
r host B will start with.
 Finally, host A sends a segme
nt that acknowledges receipt
of B's segment, and transfers
the first actual data.

Introduction to TCPIP Networking under Linux


Topic 02,p.51
©VTC 2012
Technical Support Fundamentals (ITP 4107)

 After this exchange, host A's TCP has positiv


e evidence that the remote TCP is alive and r
eady to receive data.
 As soon as the connection is established, data
can be transferred.
 When the cooperating modules have completed th
e data transfers, they will exchange a three-w
ay handshake with segments containing the "No
more data from sender" bit (called the FIN bi
t) to close the connection.

Introduction to TCPIP Networking under Linux


Topic 02,p.52
©VTC 2012
Technical Support Fundamentals (ITP 4107)

 TCP views the data it sends as a continuous s


tream of bytes, not as independent packets.
 Therefore, TCP takes care to maintain the seq
uence in which bytes are sent and received.
 The Sequence Number and Acknowledgment Number
fields in the TCP segment header keep track o
f the bytes.

Introduction to TCPIP Networking under Linux


Topic 02,p.53
©VTC 2012
Technical Support Fundamentals (ITP 4107)

INITIAL SEQUENCE NUMBER (ISN)


 To keep track of the data stream correctly, each
end of the connection must know the other end's i
nitial number.
 The two ends of the connection synchronize byte-n
umbering systems by exchanging SYN segments durin
g the handshake.
 The Sequence Number field in the SYN segment cont
ains the Initial Sequence Number (ISN), which is
the starting point for the byte-numbering system.
 For security reasons, the ISN should be a random
number.
 Each byte of data is numbered sequentially from t
he ISN.

Introduction to TCPIP Networking under Linux


Topic 02,p.54
©VTC 2012
Technical Support Fundamentals (ITP 4107)

ACKNOWLEDGMENT SEGMENT (ACK)


 Performs two functions:
 positive acknowledgment and
 flow control
 The acknowledgment tells the sender how
much data has been received and how much
more the receiver can accept.
 The Acknowledgment Number is the sequenc
e number of the next byte the receiver e
xpects to receive.

Introduction to TCPIP Networking under Linux


Topic 02,p.55
©VTC 2012
Technical Support Fundamentals (ITP 4107)

WINDOW IN TCP
 The Window field contains the window, or the num
ber of bytes the remote end is able to accept.
 If the receiver is capable of accepting 6000 mor
e bytes, the window would be 6000.
 The window indicates to the sender that it can c
ontinue sending segments as long as the total nu
mber of bytes that it sends is smaller than the
window of bytes that the receiver can accept.
 The receiver controls the flow of bytes from the
sender by changing the size of the window. A zer
o window tells the sender to cease transmission
until it receives a non-zero window value.

Introduction to TCPIP Networking under Linux


Topic 02,p.56
©VTC 2012
Technical Support Fundamentals (ITP 4107)

TCP DATA STREAM

The sender has received no acknowledgment for the bytes from 2001 on, but
continues sending data as long as it is within the window. If the sender fills the
window and receives no acknowledgment of the data previously sent, it will, after an
appropriate timeout, send the data again starting from the first unacknowledged byte.
That is, re-transmission would start from byte 2001 if no further acknowledgments
are received. This procedure ensures that data is reliably received at the far end of
the network.

Introduction to TCPIP Networking under Linux


Topic 02,p.57
©VTC 2012
Technical Support Fundamentals (ITP 4107)

PORT NUMBER
 TCP is also responsible for delivering data rec
eived from IP to the correct application.
 The application that the data is bound for is i
dentified by a 16-bit number called the port nu
mber.
 The Source Port and Destination Port are contai
ned in the first word of the segment header.
 Correctly passing data to and from the Applicat
ion Layer is an important part of what the Tran
sport Layer services do.

Introduction to TCPIP Networking under Linux


Topic 02,p.58
©VTC 2012
Technical Support Fundamentals (ITP 4107)

4. APPLICATION LAYER
The most widely known and implemented applications protoc
ols are:
 TELNET (23)
 The Network Terminal Protocol, which provides remote lo
gin over the network.
 FTP (20-data, 21-control)
 The File Transfer Protocol, which is used for interacti
ve file transfer.
 SMTP (25)
 The Simple Mail Transfer Protocol, which delivers elect
ronic mail.
 HTTP (80)
 The Hypertext Transfer Protocol, which delivers web pag
es over the network.
Introduction to TCPIP Networking under Linux
Topic 02,p.59
©VTC 2012
Technical Support Fundamentals (ITP 4107)

Some other commonly used TCP/IP applications:


 Domain Name System (DNS)
 Also called name service, this application maps I
P addresses to the names assigned to network devi
ces.
 Open Shortest Path First (OSPF)
 Routing is central to the way TCP/IP works. OSPF
is used by network devices to exchange routing in
formation. Refer to later notes for the topic of
routing.
 Network File System (NFS)
 This protocol allows files to be shared by variou
s hosts on the network.

Introduction to TCPIP Networking under Linux


Topic 02,p.60
©VTC 2012
Technical Support Fundamentals (ITP 4107)

SUMMARY
 In this overview, we discussed the struct
ure of TCP/IP, the protocol suite upon wh
ich the Internet is built.
 We have seen that TCP/IP is a hierarchy o
f four layers: Applications, Transport, I
nternet, and Network Access.
 We have examined the function of each of
these layers.

Introduction to TCPIP Networking under Linux


Topic 02,p.61
©VTC 2012

You might also like