Nothing Special   »   [go: up one dir, main page]

CISCO CCNA1 Exploration - Network - Chapter - 4

Download as pdf or txt
Download as pdf or txt
You are on page 1of 45

OSI Transport Layer

Network Fundamentals – Chapter 4

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 1
Objectives
 Explain the role of Transport Layer protocols and
services in supporting communications across data
networks
 Analyze the application and operation of TCP
mechanisms that support reliability
 Analyze the application and operation of TCP
mechanisms that support reassembly and manage
data loss.
 Analyze the operation of UDP to support
communicate between two processes on end devices

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 2
Transport Layer Role and Services

Its primary responsibilities are:


 Tracking the individual communication between
applications on the source and destination hosts
 Segmenting data and managing each piece
 Reassembling the segments into streams of application
data
 Identifying different applications

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 3
Cont…

 Tracking Individual Conversations - maintain the multiple


communication streams between different applications
running on the host.
 Segmenting Data – dividing data into manageable pieces
 Reassembling Segments- reconstructing a complete data
stream
 Identifying the Applications – using port numbers

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 4
Transport Layer Role and Services

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 5
Separating Multiple Communications

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 6
Controlling the conversation
The primary functions specified by all Transport layer protocols include:
 Segmentation and Reassembly
 Conversation Multiplexing - There may be many applications or services
running on each host in the network. Each of these applications or services is
assigned an address known as a port so that the Transport layer can
determine with which application or service the data is identified.

 In addition to using the information contained in the


headers, for the basic functions of data segmentation and
reassembly, some protocols at the Transport layer
provide:
–Connection-oriented conversations
–Reliable delivery
–Ordered data reconstruction
–Flow control
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 7
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 8
Establishing a Session

 The Transport layer can provide this connection


orientation by creating a sessions between the
applications. These connections prepare the applications
to communicate with each other before any data is
transmitted. Within these sessions, the data for a
communication between the two applications can be
closely managed.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 9
Reliable Delivery

 For many reasons, it is possible for a piece of data to


become corrupted, or lost completely, as it is
transmitted over the network. The Transport layer can
ensure that all pieces reach their destination by having
the source device to retransmit any data that is lost.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 10
Same Order Delivery

 Because networks may provide multiple routes that can


have different transmission times, data can arrive in the
wrong order. By numbering and sequencing the
segments, the Transport layer can ensure that these
segments are reassembled into the proper order.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 11
Flow Control

 Network hosts have limited resources, such as memory


or bandwidth. When Transport layer is aware that these
resources are overtaxed, some protocols can request
that the sending application reduce the rate of data
flow. This is done at the Transport layer by regulating
the amount of data the source transmits as a group.
 Flow control can prevent the loss of segments on the
network and avoid the need for retransmission.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 12
Supporting Reliable communication

At the Transport layer the three basic operations of reliability are:

 tracking transmitted data


 acknowledging received data
 retransmitting any unacknowledged data

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 13
Transport Layer Role and Services
 Supporting Reliable Communication

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 14
TCP & UDP

 The two most common Transport layer protocols of


TCP/IP protocol suite are:
– Transmission Control Protocol (TCP) and
– User Datagram Protocol (UDP).

 Both protocols manage the communication of multiple


applications. The differences between the two are the
specific functions that each protocol implements.

 UDP is a simple, connectionless protocol


 TCP is a connection-oriented protocol.
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 15
Transport Layer Role and Services
 Each TCP segment has 20 bytes of overhead in the
header encapsulating the Application layer data,
whereas each UDP segment only has 8 bytes of
overhead.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 16
Transport Layer Role and Services
 Identify how a port number is represented and describe
the role port numbers play in the TCP and UDP
protocols.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 17
Types of ports

 Well Known Ports (Numbers 0 to 1023) - These


numbers are reserved for services and applications.
 Registered Ports (Numbers 1024 to 49151) - These
port numbers are assigned to user processes or
applications.
 Dynamic or Private Ports (Numbers 49152 to 65535) -
Also known as Ephemeral Ports, these are usually
assigned dynamically to client applications when
initiating a connection. It is not very common for a client
to connect to a service using a Dynamic or Private Port
(although some peer-to-peer file sharing programs do).

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 18
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 19
 Client sends TCP segment with:
–Destination Port: 23 (Well known port number)
–Source Port: 1028 (Dynamic Port assigned by client)
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 20
 Server responds with TCP segment with:
–Destination Port: 1028 (Dynamic Port assigned by client)
–Source Port: 23 (Well known port number)
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 21
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 22
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 23
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 24
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 25
Using NetStat

 Open a web browser.


 Open a command prompt window (Start->Run->cmd)
 Enter a URL of your choice.
 Type netstat –n in the command window.
 Questions:
–What is/are the source ports on your client?
–What is/are the destination ports on your client?
–What would be the source port(s) on the server?
–What would be the destination port(s) on the server?
–What application layer protocol is being used? How can you tell?
–What transport layer protocol is being used?
 Trying more at home:
–Use netstat to look at other networking applications such as FTP or Telnet.
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 26
Transport Layer Role and Services
 Describe the role of segments in the transport layer and
the two principle ways segments can be marked for
reassembly.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 27
Application and Operation of TCP Mechanisms
 Trace the steps that show how the TCP reliability
mechanism works as part of a session

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 28
Application and Operation of TCP Mechanisms

 An individual server cannot have two services assigned to the same port number
within the same Transport layer services. A host running a web server application
and a file transfer application cannot have both configured to use the same port (for
example, TCP port 8080).
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 29
TCP Connection Establishment and Termination

 In TCP connections, the host serving as a client initiates the session to the
server. The three steps in TCP connection establishment are:

 1. The initiating client sends a segment containing an initial sequence


value, which serves as a request to the server to begin a communications
session.
 2. The server responds with a segment containing an acknowledgement
value equal to the received sequence value plus 1, plus its own
synchronizing sequence value. The value is one greater than the
sequence number because the ACK is always the next expected Byte or
Octet. This acknowledgement value enables the client to tie the response
back to the original segment that it sent to the server.
 3. Initiating client responds with an acknowledgement value equal to the
sequence value it received plus one. This completes the process of
establishing the connection.
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 30
Three-way Handshake
 The sequence is as follows:
 The sending host (A) initiates a connection by sending a SYN packet to the
receiving host (B) indicating its INS = X: A - > B SYN, seq of A = X
 B receives the packet, records that the seq of A = X, replies with an ACK of X + 1,
and indicates that its INS = Y. The ACK of X + 1 means that host B has received all
octets up to and including X and is expecting X + 1 next: B - > A ACK, seq of A = X,
SYN seq of B = Y, ACK = X + 1
 A receives the packet from B, it knows that the seq of B = Y, and responds with an
ACK of Y + 1, which finalizes the connection process: A - > B ACK, seq of B = Y,
ACK = Y + 1

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 31
Application and Operation of TCP Mechanisms
 Trace the steps in the handshake in the termination of
TCP sessions

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 32
Managing TCP Sessions
 Describe how TCP sequence numbers are used to
reconstruct the data stream with segments placed in
the correct order

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 33
Managing TCP Sessions
 Describe the retransmission.remedy for lost data
employed by TCP (see 4.3.3)

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 34
Flow control
 As the transport layer sends data segments, it tries to ensure that
data is not lost. Data loss may occur if a host cannot process data
as quickly as it arrives. The host is then forced to discard the data.
Flow control ensures that a source host does not overflow the
buffers in a destination host. To provide flow control, TCP allows
the source and destination hosts to communicate. The two hosts
then establish a data-transfer rate that is agreeable to both.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 35
Managing TCP Sessions

 The amount of data that a source can transmit before


an acknowledgement must be received is called the
window size.
 Window Size is a field in the TCP header that enables
the management of lost data and flow control.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 36
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 37
Reducing Window size
 Describe the mechanisms in TCP that manage the
interrelationship between window size, data loss and
congestion during a session

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 38
UDP Protocol
 Describe the characteristics of the UDP protocol and
the types of communication for which it is best suited

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 39
UDP Datagram Reassembly

 Because UDP is connectionless, sessions are not


established before communication takes place as they
are with TCP. UDP is said to be transaction-based. In
other words, when an application has data to send, it
simply sends the data.
 Many applications that use UDP send small amounts of
data that can fit in one segment. However, some
applications will send larger amounts of data that must
be split into multiple segments. The UDP PDU is
referred to as a datagram, although the terms segment
and datagram are sometimes used interchangeably to
describe a Transport layer PDU.
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 40
Cont…

 When multiple datagrams are sent to a destination,


they may take different paths and arrive in the wrong
order. UDP does not keep track of sequence numbers
the way TCP does. UDP has no way to reorder the
datagrams into their transmission order.
 Therefore, UDP simply reassembles the data in the
order that it was received and forwards it to the
application. If the sequence of the data is important to
the application, the application will have to identify the
proper sequence of the data and determine how the
data should be processed.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 41
UDP Protocol
 Describe in detail the process specified by the UDP
protocol to reassemble PDUs at the destination device

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 42
UDP server process and requests
 Like TCP-based applications, UDP-based server applications are
assigned Well Known or Registered port numbers. When these
applications or processes are running, they will accept the data matched
with the assigned port number. When UDP receives a datagram destined
for one of these ports, it forwards the application data to the appropriate
application based on its port number.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 43
UDP Protocol
 The UDP client process randomly selects a port number from the dynamic
range of port numbers and uses this as the source port for the conversation.
The destination port will usually be the Well Known or Registered port
number assigned to the server process.

ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 44
ITE PC v4.0
Chapter 1 © 2007 Cisco Systems, Inc. All rights reserved. Cisco Public 45

You might also like